.icp-tool-page { width: min(1480px, 100%); }
.icp-back { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: 1rem; text-decoration: none; }
.icp-tool-head { margin-bottom: .75rem; }
.icp-eyebrow { margin: 0 0 .2rem !important; color: var(--gold) !important; font-size: .69rem !important; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.icp-trust-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .55rem; margin: .3rem 0 1rem; color: var(--muted); font-size: .73rem; }
.icp-trust-row > span { padding: .38rem .66rem; border: 1px solid var(--border); border-radius: 999px; background: rgba(15, 23, 42, .55); }
.icp-trust-row .icp-private { color: #6ee7b7; border-color: rgba(52, 211, 153, .3); background: rgba(16, 185, 129, .08); }
.icp-panel { padding: 1rem !important; }
.tool-page > .icp-panel:has(> #icp-controls:not(.hidden)) { display: block; }
.icp-preset-section { margin-bottom: 1rem; padding: .85rem; border: 1px solid var(--border); border-radius: .9rem; background: rgba(15, 23, 42, .34); }
.icp-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .72rem; }
.icp-section-heading h2 { margin: .12rem 0 0; color: var(--text); font-size: .96rem; }
.icp-section-heading small { max-width: 420px; color: var(--muted); font-size: .7rem; text-align: right; }
.icp-kicker { color: var(--gold); font-size: .63rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.icp-presets { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .45rem; }
.icp-presets button, .icp-view-tabs button, .icp-zoom-actions button { min-height: 38px; border: 1px solid var(--border); border-radius: .58rem; background: rgba(15, 23, 42, .58); color: var(--muted); font: 700 .7rem/1 Inter, sans-serif; cursor: pointer; transition: border-color .16s ease, color .16s ease, background .16s ease, transform .16s ease; }
.icp-presets button:hover, .icp-view-tabs button:hover, .icp-zoom-actions button:hover { border-color: rgba(251, 191, 36, .5); color: var(--text); }
.icp-presets button:active, .icp-view-tabs button:active, .icp-zoom-actions button:active { transform: translateY(1px); }
.icp-presets button.is-active, .icp-view-tabs button.is-active, .icp-zoom-actions button.is-active { border-color: rgba(251, 191, 36, .62); background: rgba(251, 191, 36, .13); color: var(--gold); }
.icp-drop-zone { min-height: 330px; border-style: dashed !important; border-color: rgba(251, 191, 36, .36) !important; background: radial-gradient(circle at 50% 0, rgba(251,191,36,.07), transparent 46%), rgba(8,13,27,.35); cursor: default; }
.icp-drop-zone.drag-over { border-color: var(--gold) !important; background: rgba(251, 191, 36, .1); }
.icp-controls { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 28vw, 390px); min-height: 650px; overflow: hidden; border: 1px solid var(--border); border-radius: 1rem; background: rgba(8, 13, 27, .55); }
.icp-controls.hidden { display: none !important; }
.icp-compare-shell { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: auto minmax(380px, 1fr) auto auto; margin: 0 !important; padding: 0 !important; gap: 0 !important; overflow: hidden; border: 0 !important; border-radius: 0 !important; background: rgba(15, 23, 42, .45); }
.icp-compare-shell > * { grid-column: 1; }
.icp-viewer-head { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: .7rem; padding: .55rem .7rem; border-bottom: 1px solid var(--border); }
.icp-view-tabs, .icp-zoom-actions { display: flex; align-items: center; gap: .3rem; }
.icp-view-tabs button, .icp-zoom-actions button { min-width: 43px; min-height: 34px; padding: .38rem .55rem; }
.icp-zoom-actions output { min-width: 40px; color: var(--muted); font-size: .66rem; text-align: center; }
.icp-compare-stage { position: relative; display: grid; min-width: 0; min-height: 380px; place-items: center; overflow: auto; isolation: isolate; background-color: #080d18; background-image: linear-gradient(45deg,#111827 25%,transparent 25%),linear-gradient(-45deg,#111827 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#111827 75%),linear-gradient(-45deg,transparent 75%,#111827 75%); background-position: 0 0,0 8px,8px -8px,-8px 0; background-size: 16px 16px; scrollbar-width: thin; }
.icp-image-plane { --icp-compare-position: 50%; position: relative; width: 100%; height: 100%; min-height: 380px; overflow: hidden; }
.icp-image-plane > img, .icp-result-clip img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; user-select: none; }
.icp-result-clip { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; overflow: hidden; clip-path: inset(0 calc(100% - var(--icp-compare-position)) 0 0); pointer-events: none; }
.icp-divider { position: absolute; z-index: 4; top: 0; bottom: 0; left: var(--icp-compare-position); width: 3px; padding: 0; border: 0; background: var(--gold); box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 0 18px rgba(251,191,36,.35); cursor: ew-resize; touch-action: none; transform: translateX(-50%); }
.icp-divider span { position: absolute; top: 50%; left: 50%; display: grid; width: 38px; height: 38px; place-items: center; transform: translate(-50%,-50%); border: 2px solid rgba(255,255,255,.9); border-radius: 50%; background: var(--gold); box-shadow: 0 8px 24px rgba(0,0,0,.3); color: #111827; font-size: 1rem; font-weight: 900; }
.icp-divider:focus-visible span { outline: 3px solid rgba(251,191,36,.36); outline-offset: 3px; }
.icp-stage-label { position: absolute; z-index: 5; top: .7rem; padding: .32rem .5rem; border-radius: .42rem; background: rgba(2,6,23,.78); color: #fff; font-size: .65rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; pointer-events: none; }
.icp-stage-original { right: .7rem; }.icp-stage-optimized { left: .7rem; }
.icp-stage-empty { position: absolute; z-index: 8; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: .55rem; background: rgba(8,13,24,.9); color: var(--text); }
.icp-stage-empty small { color: var(--muted); }.icp-stage-empty.hidden { display: none; }
.icp-compare-stage[data-view="original"] .icp-result-clip, .icp-compare-stage[data-view="original"] .icp-divider, .icp-compare-stage[data-view="original"] .icp-stage-optimized { display: none; }
.icp-compare-stage[data-view="optimized"] > .icp-image-plane > img, .icp-compare-stage[data-view="optimized"] .icp-divider, .icp-compare-stage[data-view="optimized"] .icp-stage-original { display: none; }
.icp-compare-stage[data-view="optimized"] .icp-result-clip { clip-path: none; }
.icp-result-summary { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); border-top: 1px solid var(--border); background: rgba(8,13,27,.76); }
.icp-result-summary > div { min-width: 0; padding: .7rem; border-right: 1px solid var(--border); }
.icp-result-summary > div:last-child { border-right: 0; }
.icp-result-summary span, .icp-current-file span { display: block; margin-bottom: .18rem; color: var(--muted); font-size: .6rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.icp-result-summary strong { display: block; overflow: hidden; color: var(--text); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.icp-saving-badge { padding: .62rem .8rem; border-top: 1px solid rgba(52,211,153,.2); background: rgba(16,185,129,.1); color: #6ee7b7; font-size: .76rem; font-weight: 800; text-align: center; }
.icp-saving-badge.is-warning { border-color: rgba(251,191,36,.24); background: rgba(251,191,36,.08); color: #fcd34d; }
.icp-settings { min-width: 0; padding: .82rem; overflow-y: auto; border-left: 1px solid var(--border); background: rgba(10,16,31,.91); scrollbar-width: thin; }
.icp-current-file { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .82rem; padding: .68rem; border: 1px solid var(--border); border-radius: .72rem; background: rgba(15,23,42,.5); }
.icp-current-file div { min-width: 0; }.icp-current-file strong { display: block; overflow: hidden; color: var(--text); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.icp-preset-section-rail { margin-bottom: .82rem; padding: .7rem; }
.icp-preset-section-rail .icp-section-heading { margin-bottom: .55rem; }
.icp-preset-section-rail .icp-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.icp-preset-section-rail > small { display: block; margin-top: .55rem; color: var(--muted); font-size: .61rem; line-height: 1.45; }
.icp-control-grid { display: grid; grid-template-columns: 1fr; gap: .15rem; }
.icp-settings .form-group { margin-bottom: .78rem; }.icp-settings .form-group small { display: block; margin-top: .32rem; color: var(--muted); font-size: .63rem; line-height: 1.45; }
.icp-inline-field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .45rem; margin-top: .4rem; }.icp-inline-field span { color: var(--muted); font-size: .68rem; }
.icp-range-label { display: flex; align-items: center; justify-content: space-between; }.icp-range-label output { min-width: 38px; padding: .2rem .35rem; border-radius: .35rem; background: rgba(251,191,36,.12); color: var(--gold); font-size: .7rem; font-weight: 800; text-align: center; }
.icp-candidates { display: grid; gap: .42rem; margin: .2rem 0 .82rem; }
.icp-candidate { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .55rem; width: 100%; min-height: 50px; padding: .52rem .62rem; border: 1px solid var(--border); border-radius: .65rem; background: rgba(15,23,42,.48); color: var(--text); font-family: inherit; text-align: left; cursor: pointer; }
.icp-candidate:hover, .icp-candidate.is-active { border-color: rgba(251,191,36,.5); background: rgba(251,191,36,.08); }
.icp-candidate-format { min-width: 43px; color: var(--gold); font-size: .72rem; font-weight: 900; }.icp-candidate-meta { display: flex; min-width: 0; flex-direction: column; gap: .12rem; }.icp-candidate-meta strong { font-size: .72rem; }.icp-candidate-meta small { color: var(--muted); font-size: .59rem; }.icp-candidate-check { color: #6ee7b7; font-size: .62rem; font-weight: 800; }
.icp-settings .btn-full + .btn-full { margin-top: .48rem; }
.icp-advanced { margin-top: .78rem; border: 1px solid var(--border); border-radius: .72rem; overflow: hidden; }
.icp-advanced summary { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: .6rem; padding: .65rem .72rem; color: var(--text); cursor: pointer; list-style: none; }.icp-advanced summary::-webkit-details-marker { display: none; }.icp-advanced summary span:first-child { display: flex; flex-direction: column; gap: .13rem; }.icp-advanced summary strong { font-size: .72rem; }.icp-advanced summary small { color: var(--muted); font-size: .59rem; }.icp-advanced-body { padding: .75rem; border-top: 1px solid var(--border); }
.icp-check { display: flex; align-items: flex-start; gap: .55rem; color: var(--text); cursor: pointer; }.icp-check input { margin-top: .18rem; accent-color: var(--gold); }.icp-check span { display: flex; flex-direction: column; gap: .18rem; }.icp-check strong { font-size: .7rem; }.icp-check small { color: var(--muted); font-size: .6rem; line-height: 1.45; }
.icp-toast { position: fixed; z-index: 9999; right: 1rem; bottom: 1rem; max-width: min(360px,calc(100vw - 2rem)); padding: .7rem .9rem; transform: translateY(18px); border: 1px solid rgba(52,211,153,.35); border-radius: .7rem; opacity: 0; background: #052e2b; color: #a7f3d0; font-size: .74rem; font-weight: 700; pointer-events: none; transition: opacity .2s ease,transform .2s ease; }.icp-toast.show { transform: translateY(0); opacity: 1; }.icp-toast.error { border-color: rgba(248,113,113,.35); background: #450a0a; color: #fecaca; }
.icp-panel > .image-batch { margin-top: 1rem; }
.image-batch-state { line-height: 1.35; }
.image-batch-settings.icp-controls { display: block !important; min-height: 0; overflow: visible; border: 0; background: transparent; }
.image-batch-settings .icp-settings { padding: 0; overflow: visible; border: 0; background: transparent; }

html.theme-light .icp-trust-row > span, html.theme-light .icp-preset-section { background: rgba(255,255,255,.72); }
html.theme-light .icp-trust-row .icp-private, html.theme-light .icp-saving-badge { color: #047857; }
html.theme-light .icp-controls { background: rgba(241,245,249,.86); }
html.theme-light .icp-compare-shell { background: #f1f5f9; }
html.theme-light .icp-settings { background: rgba(255,255,255,.95); }
html.theme-light .icp-current-file, html.theme-light .icp-candidate, html.theme-light .icp-presets button, html.theme-light .icp-view-tabs button, html.theme-light .icp-zoom-actions button { background: rgba(248,250,252,.92); }
html.theme-light .icp-candidate:hover, html.theme-light .icp-candidate.is-active { background: #fffbeb; }
html.theme-light .icp-saving-badge.is-warning { color: #a16207; }
html.theme-light .icp-toast { background: #ecfdf5; color: #065f46; }.theme-light .icp-toast.error { background: #fef2f2; color: #991b1b; }

@media (max-width: 1150px) { .icp-presets { grid-template-columns: repeat(4,minmax(0,1fr)); }.icp-result-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }.icp-result-summary > div:nth-child(3) { border-right: 0; }.icp-result-summary > div:nth-child(-n+3) { border-bottom: 1px solid var(--border); } }
@media (max-width: 900px) { .icp-controls { grid-template-columns: 1fr; }.icp-settings { max-height: none; border-top: 1px solid var(--border); border-left: 0; }.icp-compare-shell { min-height: 590px; }.icp-compare-stage { min-height: 420px; }.icp-image-plane { min-height: 420px; } }
@media (max-width: 640px) { .icp-panel { padding: .65rem !important; }.icp-section-heading { align-items: flex-start; flex-direction: column; }.icp-section-heading small { text-align: left; }.icp-presets { display: flex; padding-bottom: .25rem; overflow-x: auto; scroll-snap-type: x mandatory; }.icp-presets button { min-width: 105px; scroll-snap-align: start; }.icp-drop-zone { min-height: 285px; }.icp-viewer-head { align-items: stretch; flex-direction: column; }.icp-view-tabs, .icp-zoom-actions { justify-content: center; }.icp-view-tabs button { flex: 1; }.icp-zoom-actions button { min-width: 40px; }.icp-compare-shell { min-height: 530px; }.icp-compare-stage,.icp-image-plane { min-height: 340px; }.icp-result-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }.icp-result-summary > div { border-bottom: 1px solid var(--border); }.icp-result-summary > div:nth-child(2n) { border-right: 0; }.icp-result-summary > div:nth-last-child(-n+2) { border-bottom: 0; }.icp-trust-row { justify-content: flex-start; }.icp-trust-row .icp-private { width: 100%; text-align: center; } }
@media (prefers-reduced-motion: reduce) { .icp-presets button,.icp-view-tabs button,.icp-zoom-actions button,.icp-toast { transition: none; } }
