.image-tools-hero {
    position: relative;
    overflow: hidden;
    padding: 62px 0 70px;
    color: #fff;
    background:
        radial-gradient(circle at 82% 20%, rgba(255, 189, 85, .2), transparent 25%),
        linear-gradient(120deg, #102544 0%, #173a70 58%, #295fae 100%);
}

.image-tools-hero::after {
    position: absolute;
    right: -105px;
    bottom: -185px;
    width: 440px;
    height: 440px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 50%;
    box-shadow: 0 0 0 52px rgba(255, 255, 255, .025), 0 0 0 104px rgba(255, 255, 255, .018);
    content: "";
}

.image-tools-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(290px, .65fr);
    gap: 54px;
    align-items: center;
}

.image-tools-hero .eyebrow { color: #bcd2f2; }
.image-tools-hero h1 { max-width: 760px; margin: 7px 0 13px; color: #fff; font-family: "Hind", sans-serif; font-size: clamp(2.35rem, 4.8vw, 4rem); line-height: 1.06; letter-spacing: -.045em; }
.image-tools-hero p { max-width: 720px; margin: 0; color: #d6e2f3; font-family: "Hind", sans-serif; font-size: 1.06rem; line-height: 1.65; }
.image-tools-capabilities { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.image-tools-capabilities span { display: inline-flex; align-items: center; min-height: 31px; padding: 5px 10px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; color: #e7effa; background: rgba(255, 255, 255, .075); font-family: "Hind", sans-serif; font-size: .82rem; font-weight: 700; }

.image-tools-privacy-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; padding: 21px; border: 1px solid rgba(255, 255, 255, .17); border-radius: 18px; background: rgba(8, 29, 61, .4); box-shadow: 0 22px 48px rgba(3, 17, 39, .2); backdrop-filter: blur(10px); }
.image-tools-privacy-card strong { display: block; margin-bottom: 4px; color: #fff; font-family: "Hind", sans-serif; font-size: 1rem; }
.image-tools-privacy-card p { color: #c7d6eb; font-size: .86rem; line-height: 1.5; }
.image-tools-privacy-icon { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; color: #163a71; background: #ffcc79; }
.image-tools-privacy-icon::before { width: 19px; height: 16px; border: 2px solid currentColor; border-radius: 4px; content: ""; transform: translateY(3px); }
.image-tools-privacy-icon::after { position: absolute; top: 10px; width: 12px; height: 12px; border: 2px solid currentColor; border-bottom: 0; border-radius: 8px 8px 0 0; content: ""; }

.image-tools-page { min-height: 620px; padding: 50px 0 96px; background: linear-gradient(180deg, #f4f7fb 0%, #fff 35rem); }
.image-tools-upload-card { padding: 18px; border: 1px solid #dce5f0; border-radius: 20px; background: #fff; box-shadow: 0 16px 38px rgba(26, 49, 83, .08); }
.image-tools-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.image-tools-dropzone { display: grid; place-items: center; min-height: 235px; padding: 31px 20px; border: 2px dashed #b8c9df; border-radius: 15px; text-align: center; background: linear-gradient(135deg, #f7faff, #fbfdff); cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.image-tools-dropzone:hover, .image-tools-dropzone.is-dragging { border-color: #5f87cb; background: #f0f6ff; transform: translateY(-2px); }
.image-tools-file-input:focus-visible + .image-tools-dropzone { outline: 3px solid rgba(51, 106, 214, .18); outline-offset: 3px; }
.image-tools-dropzone strong { margin: 13px 0 4px; color: #1d365b; font-family: "Hind", sans-serif; font-size: 1.25rem; }
.image-tools-dropzone > span:not(.image-tools-upload-icon) { color: #70829b; font-family: "Hind", sans-serif; font-size: .9rem; }
.image-tools-dropzone b { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; margin-top: 18px; padding: 8px 16px; border-radius: 9px; color: #fff; background: var(--blue); font-family: "Hind", sans-serif; font-size: .88rem; }
.image-tools-upload-icon { position: relative; display: block; width: 57px; height: 57px; border-radius: 16px; color: #3569c7; background: #e8f1ff; }
.image-tools-upload-icon::before { position: absolute; top: 15px; left: 18px; width: 20px; height: 24px; border: 2px solid currentColor; border-radius: 4px; content: ""; }
.image-tools-upload-icon::after { position: absolute; top: 22px; left: 24px; width: 9px; height: 9px; border-top: 2px solid currentColor; border-left: 2px solid currentColor; content: ""; transform: rotate(45deg); }
.image-tools-status { min-height: 22px; margin: 12px 4px 0; color: #6b7e98; font-family: "Hind", sans-serif; font-size: .86rem; text-align: center; }
.image-tools-status.is-error { color: #a83c48; }

.image-tools-editor { margin-top: 22px; }
.image-tools-workspace-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, .75fr); gap: 20px; align-items: start; }
.image-tools-panel { border: 1px solid #dce5f0; border-radius: 18px; background: #fff; box-shadow: 0 13px 32px rgba(28, 50, 84, .065); }
.image-tools-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid #e8edf4; }
.image-tools-panel-head span, .image-tools-panel-head strong { display: block; font-family: "Hind", sans-serif; }
.image-tools-panel-head span { color: #8190a5; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.image-tools-panel-head strong { overflow: hidden; max-width: 520px; margin-top: 2px; color: #253d60; font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.image-tools-text-button { padding: 4px 2px; border: 0; color: #3566bd; background: transparent; font-family: "Hind", sans-serif; font-size: .84rem; font-weight: 700; cursor: pointer; }
.image-tools-text-button:hover { color: #1f4c9e; }

.image-tools-preview-frame { display: grid; place-items: center; min-height: 510px; padding: 23px; overflow: hidden; background-color: #e9eef5; background-image: linear-gradient(45deg, #dce3ec 25%, transparent 25%), linear-gradient(-45deg, #dce3ec 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #dce3ec 75%), linear-gradient(-45deg, transparent 75%, #dce3ec 75%); background-position: 0 0, 0 10px, 10px -10px, -10px 0; background-size: 20px 20px; }
.image-tools-stage { position: relative; overflow: hidden; max-width: 100%; max-height: 560px; line-height: 0; background: #fff; box-shadow: 0 12px 28px rgba(18, 35, 61, .2); touch-action: none; }
.image-tools-stage canvas { display: block; width: 100%; height: 100%; }
.image-tools-crop-selection { position: absolute; z-index: 2; border: 2px solid #fff; outline: 1px solid rgba(35, 89, 184, .95); box-shadow: 0 0 0 9999px rgba(8, 23, 44, .55), inset 0 0 0 1px rgba(36, 91, 189, .55); cursor: move; touch-action: none; }
.image-tools-crop-selection::before, .image-tools-crop-selection::after { position: absolute; background: rgba(255, 255, 255, .55); content: ""; pointer-events: none; }
.image-tools-crop-selection::before { top: 33.333%; right: 0; left: 0; height: 1px; box-shadow: 0 calc(100% + 33.333%) rgba(255, 255, 255, .55); }
.image-tools-crop-selection::after { top: 0; bottom: 0; left: 33.333%; width: 1px; box-shadow: calc(100% + 33.333%) 0 rgba(255, 255, 255, .55); }
.image-tools-crop-selection:focus-visible { outline: 3px solid #ffcc79; outline-offset: 2px; }
.image-tools-crop-selection [data-crop-handle] { position: absolute; z-index: 3; width: 22px; height: 22px; border: 3px solid #fff; border-radius: 50%; background: #336ad6; box-shadow: 0 3px 8px rgba(12, 37, 78, .3); }
.image-tools-crop-selection [data-crop-handle="nw"] { top: -12px; left: -12px; cursor: nwse-resize; }
.image-tools-crop-selection [data-crop-handle="ne"] { top: -12px; right: -12px; cursor: nesw-resize; }
.image-tools-crop-selection [data-crop-handle="sw"] { bottom: -12px; left: -12px; cursor: nesw-resize; }
.image-tools-crop-selection [data-crop-handle="se"] { right: -12px; bottom: -12px; cursor: nwse-resize; }

.image-tools-preview-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px 16px; border-top: 1px solid #e7edf4; border-bottom: 1px solid #e7edf4; }
.image-tools-preview-actions button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 7px 10px; border: 1px solid #dce4ef; border-radius: 8px; color: #506580; background: #fff; font-family: "Hind", sans-serif; font-size: .82rem; font-weight: 700; cursor: pointer; }
.image-tools-preview-actions button:hover { border-color: #abc1e5; color: #2d5baa; background: #f4f8ff; }
.image-tools-preview-actions button span { font-size: 1.12rem; line-height: 1; }
.image-tools-source-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 15px 17px; }
.image-tools-source-stats div { padding: 2px 12px; border-right: 1px solid #e7ecf3; }
.image-tools-source-stats div:first-child { padding-left: 0; }
.image-tools-source-stats div:last-child { padding-right: 0; border-right: 0; }
.image-tools-source-stats dt { color: #8997aa; font-family: "Hind", sans-serif; font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.image-tools-source-stats dd { margin: 4px 0 0; color: #2c4364; font-family: "Hind", sans-serif; font-size: .86rem; font-weight: 700; }

.image-tools-controls-panel { position: sticky; top: 92px; padding: 20px; }
.image-tools-control-section { margin: 0; padding: 0 0 20px; border: 0; }
.image-tools-control-section + .image-tools-control-section { padding-top: 20px; border-top: 1px solid #e7ecf3; }
.image-tools-control-section legend { display: flex; align-items: center; gap: 9px; width: 100%; margin-bottom: 13px; padding: 0; color: #263f62; font-family: "Hind", sans-serif; font-size: .96rem; font-weight: 700; }
.image-tools-control-section legend span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #3565ba; background: #eaf1ff; font-family: "DM Sans", sans-serif; font-size: .7rem; font-weight: 800; }
.image-tools-ratio-buttons, .image-tools-scale-buttons { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.image-tools-ratio-buttons button, .image-tools-scale-buttons button { min-height: 34px; padding: 6px 10px; border: 1px solid #dce4ee; border-radius: 8px; color: #63748b; background: #fff; font-family: "Hind", sans-serif; font-size: .78rem; font-weight: 700; cursor: pointer; }
.image-tools-ratio-buttons button:hover, .image-tools-ratio-buttons button.is-active, .image-tools-scale-buttons button:hover { border-color: #9db7e3; color: #2f5cad; background: #edf4ff; }
.image-tools-input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.image-tools-input-grid label, .image-tools-quality-control { display: block; color: #596c86; font-family: "Hind", sans-serif; font-size: .78rem; font-weight: 700; }
.image-tools-input-grid input, .image-tools-input-grid select { box-sizing: border-box; width: 100%; height: 42px; margin-top: 5px; padding: 0 10px; border: 1px solid #d9e2ee; border-radius: 8px; outline: 0; color: #263f61; background: #fbfdff; font: inherit; font-family: "DM Sans", sans-serif; font-size: .82rem; }
.image-tools-input-grid input:focus, .image-tools-input-grid select:focus { border-color: #7398d6; box-shadow: 0 0 0 3px rgba(51, 106, 214, .11); }
.image-tools-check { display: inline-flex; align-items: center; gap: 8px; margin: 11px 0; color: #5e718a; font-family: "Hind", sans-serif; font-size: .8rem; font-weight: 700; cursor: pointer; }
.image-tools-check input { width: 17px; height: 17px; accent-color: var(--blue); }
.image-tools-help { margin: 9px 0 0; color: #8795a8; font-family: "Hind", sans-serif; font-size: .75rem; line-height: 1.45; }
.image-tools-secondary-action { margin-top: 10px; padding: 4px 0; border: 0; color: #3564b8; background: transparent; font-family: "Hind", sans-serif; font-size: .78rem; font-weight: 700; cursor: pointer; }
.image-tools-quality-control { position: relative; margin-top: 14px; }
.image-tools-quality-control output { position: absolute; top: 0; right: 0; color: #335fab; }
.image-tools-quality-control input { width: 100%; margin-top: 9px; accent-color: var(--blue); cursor: pointer; }
.image-tools-quality-control.is-disabled { opacity: .48; }
.image-tools-form-status { margin: 0 0 12px; padding: 10px 12px; border: 1px solid #f0c9ce; border-radius: 9px; color: #9b3c48; background: #fff3f4; font-family: "Hind", sans-serif; font-size: .8rem; line-height: 1.45; }
.image-tools-primary-action { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 47px; padding: 10px 14px; border: 0; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #285cb8, var(--blue)); box-shadow: 0 8px 17px rgba(44, 91, 178, .23); font-family: "Hind", sans-serif; font-size: .9rem; font-weight: 700; cursor: pointer; }
.image-tools-primary-action:hover { filter: brightness(1.04); transform: translateY(-1px); }
.image-tools-primary-action:disabled { opacity: .62; cursor: wait; transform: none; }

.image-tools-result { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(0, 1.15fr); gap: 28px; align-items: center; margin-top: 22px; padding: 24px; border: 1px solid #cee5d9; border-radius: 18px; background: linear-gradient(135deg, #f2fbf6, #fff); box-shadow: 0 14px 34px rgba(31, 95, 67, .08); }
.image-tools-result-preview { display: grid; place-items: center; min-height: 250px; padding: 15px; overflow: hidden; border: 1px solid #dce7e1; border-radius: 13px; background: #edf3ef; }
.image-tools-result-preview img { display: block; max-width: 100%; max-height: 350px; object-fit: contain; box-shadow: 0 10px 25px rgba(24, 55, 42, .15); }
.image-tools-result-copy .eyebrow { color: #2d7a5d; }
.image-tools-result-copy h2 { margin: 5px 0 15px; color: #193c31; font-family: "Hind", sans-serif; font-size: clamp(1.55rem, 3vw, 2.25rem); letter-spacing: -.035em; }
.image-tools-result-copy dl { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 0 0 18px; }
.image-tools-result-copy dl div { padding: 10px 11px; border: 1px solid #dceae3; border-radius: 9px; background: rgba(255, 255, 255, .72); }
.image-tools-result-copy dt { color: #758d82; font-family: "Hind", sans-serif; font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.image-tools-result-copy dd { margin: 3px 0 0; color: #2a5645; font-family: "Hind", sans-serif; font-size: .86rem; font-weight: 700; }
.image-tools-download { display: inline-flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 45px; padding: 9px 14px; border-radius: 9px; color: #fff; background: #27815e; font-family: "Hind", sans-serif; font-size: .88rem; font-weight: 700; text-decoration: none; }
.image-tools-result-copy > .image-tools-text-button { display: block; margin-top: 10px; }

@media (max-width: 1040px) {
    .image-tools-hero-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; }
    .image-tools-workspace-grid { grid-template-columns: minmax(0, 1fr) 330px; }
    .image-tools-preview-frame { min-height: 440px; }
}

@media (max-width: 840px) {
    .image-tools-hero { padding: 48px 0 55px; }
    .image-tools-hero-grid, .image-tools-workspace-grid { grid-template-columns: 1fr; }
    .image-tools-privacy-card { max-width: 560px; }
    .image-tools-controls-panel { position: static; }
    .image-tools-preview-frame { min-height: 390px; }
    .image-tools-result { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .image-tools-page { padding: 32px 0 70px; }
    .image-tools-hero h1 { font-size: clamp(2.15rem, 11vw, 3rem); }
    .image-tools-privacy-card { grid-template-columns: 42px minmax(0, 1fr); padding: 16px; }
    .image-tools-privacy-icon { width: 42px; height: 42px; }
    .image-tools-upload-card { padding: 10px; border-radius: 15px; }
    .image-tools-dropzone { min-height: 205px; padding: 24px 14px; }
    .image-tools-panel { border-radius: 14px; }
    .image-tools-panel-head { padding: 14px; }
    .image-tools-panel-head strong { max-width: 210px; }
    .image-tools-preview-frame { min-height: 310px; padding: 15px; }
    .image-tools-crop-selection [data-crop-handle] { width: 26px; height: 26px; }
    .image-tools-crop-selection [data-crop-handle="nw"] { top: -14px; left: -14px; }
    .image-tools-crop-selection [data-crop-handle="ne"] { top: -14px; right: -14px; }
    .image-tools-crop-selection [data-crop-handle="sw"] { bottom: -14px; left: -14px; }
    .image-tools-crop-selection [data-crop-handle="se"] { right: -14px; bottom: -14px; }
    .image-tools-preview-actions { display: grid; grid-template-columns: 1fr 1fr; padding: 11px; }
    .image-tools-preview-actions button { justify-content: center; }
    .image-tools-source-stats { grid-template-columns: 1fr; gap: 8px; padding: 13px; }
    .image-tools-source-stats div, .image-tools-source-stats div:first-child, .image-tools-source-stats div:last-child { padding: 5px 0; border-right: 0; border-bottom: 1px solid #e7ecf3; }
    .image-tools-source-stats div:last-child { border-bottom: 0; }
    .image-tools-controls-panel { padding: 16px; }
    .image-tools-input-grid { grid-template-columns: 1fr 1fr; }
    .image-tools-result { padding: 16px; }
}

@media (max-width: 410px) {
    .image-tools-capabilities span { font-size: .76rem; }
    .image-tools-input-grid { grid-template-columns: 1fr; }
    .image-tools-result-copy dl { grid-template-columns: 1fr; }
    .image-tools-download { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
    .image-tools-dropzone, .image-tools-primary-action { transition: none; }
    .image-tools-dropzone:hover, .image-tools-dropzone.is-dragging, .image-tools-primary-action:hover { transform: none; }
}
