/* ============================================================
   ICO File Viewer - scoped under .icv / .icv-* (rebuilt 2026-10-10)
   Shared header, footer, FAQ and related pills come from custom_styles.css.
   Accent: blue #3399cc (viewers). Single colours, no gradients,
   no thick side borders. Light default, dark via [data-theme="dark"].
   ============================================================ */
.icv {
    --icv-accent: #3399cc;
    --icv-accent-strong: #237a9f;
    --icv-accent-soft: rgba(51, 153, 204, 0.09);
    --icv-accent-line: rgba(51, 153, 204, 0.45);
    --icv-go: #237a9f;
    --icv-go-hover: #1b6183;
    --icv-card: var(--bg-elevated, #fff);
    --icv-sunk: var(--card-tertiary, #f1f5f9);
    --icv-open: var(--card-secondary, #f8f9fa);
    --icv-line: var(--border-color, #e2e8f0);
    --icv-text-1: var(--text-primary, #1e293b);
    --icv-text-2: var(--text-secondary, #555);
    --icv-muted: var(--text-muted, #64748b);
    --icv-ok: #2f855a;
    --icv-ok-soft: rgba(51, 153, 102, 0.1);
    --icv-ok-line: rgba(51, 153, 102, 0.35);
    --icv-warn: #b45309;
    --icv-warn-soft: rgba(217, 119, 6, 0.08);
    --icv-warn-line: rgba(217, 119, 6, 0.35);
    --icv-red: #c23b3b;
    --icv-red-soft: rgba(230, 78, 78, 0.08);
    --icv-red-line: rgba(230, 78, 78, 0.35);
    --icv-checker: #e5e7eb;
    --icv-checker-bg: #fff;
    --icv-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    /* hex region colours */
    --icv-rh: rgba(51, 153, 204, 0.22); --icv-rd0: rgba(139, 92, 246, 0.16); --icv-rd1: rgba(139, 92, 246, 0.3);
    --icv-rp0: rgba(51, 153, 102, 0.13); --icv-rp1: rgba(217, 119, 6, 0.13); --icv-rm: #facc15;
}
[data-theme="dark"] .icv {
    --icv-accent: #60a5fa;
    --icv-accent-strong: #93c5fd;
    --icv-accent-soft: rgba(96, 165, 250, 0.12);
    --icv-accent-line: rgba(96, 165, 250, 0.45);
    --icv-go: #2563eb;
    --icv-go-hover: #1d4ed8;
    --icv-sunk: #172033;
    --icv-open: #1a2438;
    --icv-ok: #4ade80;
    --icv-ok-soft: rgba(74, 222, 128, 0.1);
    --icv-ok-line: rgba(74, 222, 128, 0.35);
    --icv-warn: #fbbf24;
    --icv-warn-soft: rgba(251, 191, 36, 0.08);
    --icv-warn-line: rgba(251, 191, 36, 0.35);
    --icv-red: #f87171;
    --icv-red-soft: rgba(248, 113, 113, 0.1);
    --icv-red-line: rgba(248, 113, 113, 0.4);
    --icv-checker: #334155;
    --icv-checker-bg: #1e293b;
    --icv-rh: rgba(96, 165, 250, 0.28); --icv-rd0: rgba(167, 139, 250, 0.2); --icv-rd1: rgba(167, 139, 250, 0.36);
    --icv-rp0: rgba(74, 222, 128, 0.14); --icv-rp1: rgba(251, 191, 36, 0.14); --icv-rm: #ca8a04;
}

.icv.tool-container { max-width: 1100px; margin: 0 auto; padding: 2rem; }
.icv-root [hidden], .icv [hidden] { display: none !important; }
.icv .icv-main { background: none; border: none; box-shadow: none; border-radius: 0; overflow: visible; padding: 0; }
.icv button { font: inherit; }
.icv code { font-family: var(--icv-mono); font-size: 0.86em; padding: 0.05rem 0.35rem; border-radius: 5px; background: var(--icv-sunk); }
.icv kbd {
    display: inline-block; padding: 0.05rem 0.4rem; border-radius: 5px; border: 1px solid var(--icv-line); border-bottom-width: 2px;
    background: var(--icv-card); font: 600 0.78em var(--icv-mono); color: var(--icv-text-1);
}
.icv .icv-muted { color: var(--icv-muted); }
.icv .icv-mono { font-family: var(--icv-mono); }
.icv .icv-small { font-size: 0.8rem; margin: 0.6rem 0 0; color: var(--icv-muted); }
.icv .icv-small a { color: var(--icv-accent-strong); }
[data-theme="dark"] .icv .icv-small a { color: var(--icv-accent); }
.icv :focus-visible { outline: 3px solid var(--icv-accent-line); outline-offset: 2px; }

/* backgrounds */
.icv .icv-bg-checker {
    background-color: var(--icv-checker-bg);
    background-image: linear-gradient(45deg, var(--icv-checker) 25%, transparent 25%), linear-gradient(-45deg, var(--icv-checker) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--icv-checker) 75%), linear-gradient(-45deg, transparent 75%, var(--icv-checker) 75%);
    background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.icv .icv-bg-white { background: #fff; }
.icv .icv-bg-dark { background: #111827; }

/* ---------- title ---------- */
.icv .tool-header { text-align: center; margin-bottom: 1.75rem; }
.icv .icv-title-row { display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin-bottom: 0.9rem; }
.icv .icv-title-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--icv-accent); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-theme="dark"] .icv .icv-title-icon { color: #0b1e33; }
.icv .icv-title-icon svg { width: 30px; height: 30px; display: block; }
.icv .tool-title { margin: 0; font-size: 2rem; font-weight: 700; color: var(--icv-accent); line-height: 1.2; }
.icv .tool-description { max-width: 800px; margin: 0 auto; font-size: 1.05rem; line-height: 1.65; color: var(--icv-text-2); }
.icv .tool-description a { color: var(--icv-accent-strong); font-weight: 500; }
[data-theme="dark"] .icv .tool-description a { color: var(--icv-accent); }

/* ---------- error ---------- */
.icv .icv-error { display: flex; align-items: flex-start; gap: 0.7rem; margin: 0 0 1rem; padding: 0.9rem 1rem; border-radius: 12px; border: 1px solid var(--icv-red-line); background: var(--icv-red-soft); color: var(--icv-text-1); }
.icv .icv-error > svg { width: 20px; height: 20px; color: #e64e4e; flex-shrink: 0; margin-top: 2px; }
.icv .icv-error > div { flex: 1; min-width: 0; }
.icv .icv-error p { margin: 0; font-size: 0.92rem; line-height: 1.55; overflow-wrap: anywhere; }
.icv .icv-error p + p { margin-top: 0.4rem; color: var(--icv-muted); font-size: 0.86rem; }
.icv .icv-error a { color: var(--icv-red); font-weight: 600; }
.icv .icv-x { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex-shrink: 0; border: none; border-radius: 8px; background: none; color: var(--icv-muted); cursor: pointer; padding: 0; }
.icv .icv-x:hover { background: rgba(100, 116, 139, 0.12); color: var(--icv-text-1); }
.icv .icv-x svg { width: 17px; height: 17px; }

/* ---------- cards / headings ---------- */
.icv .icv-card { background: var(--icv-card); border: 1px solid var(--icv-line); border-radius: 20px; padding: 1.25rem; box-shadow: var(--shadow-sm); margin-bottom: 1.25rem; min-width: 0; }
.icv .icv-h { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.75rem; font-size: 1rem; font-weight: 700; color: var(--icv-text-1); }
.icv .icv-h svg { width: 18px; height: 18px; color: var(--icv-accent); flex-shrink: 0; }
.icv .icv-caption { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0 0 0.45rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--icv-muted); }
.icv .icv-caption svg { width: 14px; height: 14px; }

/* ---------- buttons ---------- */
.icv .icv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; width: auto; min-height: 44px; padding: 0.6rem 1.1rem; margin: 0; border-radius: 12px; border: 1px solid transparent; font-size: 0.95rem; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.icv .icv-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.icv .icv-go { background: var(--icv-go); color: #fff; border-color: var(--icv-go); }
.icv .icv-go:hover:not(:disabled) { background: var(--icv-go-hover); color: #fff; }
.icv .icv-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.icv .icv-btn-lg { min-height: 50px; padding: 0.65rem 1.4rem; font-size: 1rem; }
.icv .icv-btn-sm { min-height: 36px; padding: 0.4rem 0.8rem; font-size: 0.85rem; border-radius: 10px; }
.icv .icv-btn-sm svg { width: 16px; height: 16px; }
.icv .icv-btn-ghost { background: var(--icv-sunk); color: var(--icv-text-2); border-color: var(--icv-line); }
.icv .icv-btn-ghost:hover:not(:disabled) { color: var(--icv-text-1); border-color: var(--icv-accent-line); }
.icv .icv-text-btn { display: inline-flex; align-items: center; gap: 0.35rem; width: auto; padding: 0.35rem 0.55rem; margin: 0; border: none; border-radius: 8px; background: none; color: var(--icv-accent-strong); font-size: 0.84rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
[data-theme="dark"] .icv .icv-text-btn { color: var(--icv-accent); }
.icv .icv-text-btn:hover { background: var(--icv-accent-soft); }
.icv .icv-text-btn svg { width: 15px; height: 15px; }
.icv .icv-seg-btn { display: inline-flex; align-items: center; gap: 0.4rem; width: auto; min-height: 36px; padding: 0.35rem 0.85rem; margin: 0; border-radius: 999px; border: 1px solid var(--icv-line); background: var(--icv-card); color: var(--icv-text-2); font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.icv .icv-seg-btn svg { width: 15px; height: 15px; color: var(--icv-accent); }
.icv .icv-seg-btn:hover { border-color: var(--icv-accent-line); color: var(--icv-text-1); }
.icv .icv-chip { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; width: auto; min-height: 34px; padding: 0.3rem 0.55rem; margin: 0; border-radius: 9px; border: 1px solid var(--icv-line); background: var(--icv-card); color: var(--icv-text-2); font-size: 0.8rem; font-weight: 700; cursor: pointer; min-width: 0; white-space: nowrap; box-sizing: border-box; }
.icv .icv-chip:hover { border-color: var(--icv-accent-line); }
.icv .icv-chip.is-active { border-color: var(--icv-accent); background: var(--icv-accent-soft); color: var(--icv-accent-strong); }
[data-theme="dark"] .icv .icv-chip.is-active { color: var(--icv-accent); }
.icv .icv-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; border: 1px solid var(--icv-line); background-size: 6px 6px; }
.icv .icv-chip-color input[type="color"] { width: 18px; height: 18px; padding: 0; margin: 0; border: 1px solid var(--icv-line); border-radius: 4px; background: none; cursor: pointer; }
.icv .icv-quick { display: grid; gap: 0.35rem; }
.icv .icv-quick > * { min-width: 0; }
.icv .icv-quick-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.icv .icv-quick-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.icv .icv-tag { display: inline-flex; align-items: center; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--icv-sunk); border: 1px solid var(--icv-line); font-size: 0.72rem; font-weight: 700; color: var(--icv-text-2); white-space: nowrap; }
.icv .icv-input { height: 36px; padding: 0 0.6rem; margin: 0; border-radius: 9px; border: 1px solid var(--icv-line); background: var(--input-bg, #fff); color: var(--icv-text-1); font: 0.85rem var(--icv-mono); box-sizing: border-box; min-width: 0; }
.icv .icv-input:focus { outline: none; border-color: var(--icv-accent); box-shadow: 0 0 0 3px var(--icv-accent-soft); }

/* ---------- upload ---------- */
.icv .icv-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; text-align: center; min-height: 190px; padding: 1.5rem 1.25rem; border-radius: 16px; border: 2px dashed var(--icv-accent-line); background: var(--icv-accent-soft); cursor: pointer; color: var(--icv-muted); font-size: 0.86rem; line-height: 1.5; transition: border-color 0.15s, background 0.15s; box-sizing: border-box; margin: 0; }
.icv .icv-drop:hover, .icv .icv-drop.is-drag { border-color: var(--icv-accent); background: rgba(51, 153, 204, 0.14); }
.icv .icv-drop:focus-within { outline: 3px solid var(--icv-accent-soft); }
.icv .icv-drop strong { font-size: 1.08rem; color: var(--icv-text-1); }
.icv .icv-drop-link { color: var(--icv-accent-strong); text-decoration: underline; text-underline-offset: 3px; }
[data-theme="dark"] .icv .icv-drop-link { color: var(--icv-accent); }
.icv .icv-drop-icon { width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 0.35rem; background: var(--icv-card); color: var(--icv-accent); border: 1px solid var(--icv-line); }
.icv .icv-drop-icon svg { width: 28px; height: 28px; }
.icv .icv-samples { margin-top: 1rem; }
.icv .icv-sample-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.icv .icv-under { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.6rem; margin-top: 1rem; }
.icv .icv-pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.22rem 0.65rem; border-radius: 999px; background: var(--icv-sunk); border: 1px solid var(--icv-line); font-size: 0.78rem; font-weight: 600; color: var(--icv-text-2); }
.icv .icv-pill svg { width: 14px; height: 14px; color: var(--icv-accent); }
.icv .icv-recent { margin-top: 1rem; padding-top: 0.85rem; border-top: 1px solid var(--icv-line); }
.icv .icv-recent-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.icv .icv-recent-head .icv-caption { margin: 0; }
.icv .icv-recent-list { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; }
.icv .icv-recent-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; width: 100%; padding: 0.5rem 0.7rem; margin: 0; border-radius: 10px; border: 1px solid var(--icv-line); background: var(--icv-sunk); cursor: pointer; text-align: left; min-width: 0; }
.icv .icv-recent-list button:hover { border-color: var(--icv-accent-line); }
.icv .icv-recent-name { font-size: 0.85rem; font-weight: 700; color: var(--icv-text-1); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icv .icv-recent-meta { font-size: 0.74rem; color: var(--icv-muted); }

/* drop overlay */
.icv .icv-dropover { position: fixed; inset: 0; z-index: 10004; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, 0.45); pointer-events: none; }
.icv .icv-dropover > div { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 2rem 2.5rem; border-radius: 20px; border: 2px dashed var(--icv-accent); background: var(--icv-card); color: var(--icv-muted); text-align: center; }
.icv .icv-dropover svg { width: 40px; height: 40px; color: var(--icv-accent); }
.icv .icv-dropover strong { font-size: 1.2rem; color: var(--icv-text-1); }

/* ---------- busy (logo loader) ---------- */
.icv .icv-prog { display: flex; align-items: center; gap: 0.9rem; padding: 1rem 1.1rem; }
.icv .icv-prog-text { font-size: 0.92rem; color: var(--icv-text-2); min-width: 0; overflow-wrap: anywhere; }
.icv .icv-loader { display: block; width: 40px; height: 40px; flex-shrink: 0; overflow: visible; --cico-outer: #f2534e; --cico-outer-soft: #f8d3d1; --cico-mid: #31ae77; --cico-mid-soft: #d0e7dd; --cico-inner: #2b9edb; }
[data-theme="dark"] .icv .icv-loader { --cico-outer-soft: rgba(242, 83, 78, 0.22); --cico-mid-soft: rgba(49, 174, 119, 0.22); }
.icv .icv-loader circle { fill: none; stroke-width: 72; transform-box: fill-box; transform-origin: center; }
.icv .icv-loader .bp { stroke: var(--cico-outer-soft); }
.icv .icv-loader .gp { stroke: var(--cico-mid-soft); }
.icv .icv-loader .b { stroke: var(--cico-outer); stroke-linecap: round; stroke-dasharray: 35.3 100; animation: icvSpinL 1.3s linear infinite; }
.icv .icv-loader .g { stroke: var(--cico-mid); stroke-linecap: round; stroke-dasharray: 75.8 100; animation: icvSpinR 2.1s linear infinite; }
.icv .icv-loader .r { stroke: var(--cico-inner); animation: icvBreathe 1.3s ease-in-out infinite; }
@keyframes icvSpinL { from { transform: rotate(117deg); } to { transform: rotate(-243deg); } }
@keyframes icvSpinR { from { transform: rotate(36deg); } to { transform: rotate(396deg); } }
@keyframes icvBreathe { 50% { transform: scale(0.9); } }
@media (prefers-reduced-motion: reduce) {
    .icv .icv-loader .b { animation-duration: 4s; }
    .icv .icv-loader .g { animation-duration: 6s; }
    .icv .icv-loader .r { animation: none; }
}

/* ---------- file strip ---------- */
.icv .icv-files { display: flex; align-items: stretch; gap: 0.45rem; flex-wrap: wrap; margin: 0 0 1rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--icv-line); }
.icv .icv-fcard { display: flex; align-items: center; min-width: 0; max-width: 260px; border-radius: 12px; border: 1px solid var(--icv-line); background: var(--icv-sunk); }
.icv .icv-fcard.is-active { border-color: var(--icv-accent); background: var(--icv-accent-soft); }
.icv .icv-fcard-main { display: flex; align-items: center; gap: 0.55rem; min-width: 0; width: auto; padding: 0.4rem 0.35rem 0.4rem 0.5rem; margin: 0; border: none; background: none; cursor: pointer; text-align: left; color: var(--icv-text-2); }
.icv .icv-fcard-thumb { width: 32px; height: 32px; flex-shrink: 0; }
.icv .icv-fcard-text { display: flex; flex-direction: column; min-width: 0; }
.icv .icv-fcard-text strong { font-size: 0.84rem; color: var(--icv-text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icv .icv-fcard-text span { font-size: 0.72rem; color: var(--icv-muted); white-space: nowrap; }
.icv .icv-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--icv-ok); }
.icv .icv-dot.is-warn { background: #d97706; }
.icv .icv-dot.is-fail { background: #e64e4e; }
.icv .icv-fcard-x { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; margin: 0 0.25rem 0 0; border: none; border-radius: 7px; background: none; color: var(--icv-muted); cursor: pointer; flex-shrink: 0; }
.icv .icv-fcard-x:hover { background: rgba(100, 116, 139, 0.14); color: var(--icv-text-1); }
.icv .icv-fcard-x svg { width: 15px; height: 15px; }
.icv .icv-fcard-add { display: inline-flex; align-items: center; gap: 0.3rem; width: auto; padding: 0.4rem 0.8rem; margin: 0; border-radius: 12px; border: 1px dashed var(--icv-line); background: none; color: var(--icv-accent-strong); font-size: 0.82rem; font-weight: 600; cursor: pointer; }
[data-theme="dark"] .icv .icv-fcard-add { color: var(--icv-accent); }
.icv .icv-fcard-add:hover { border-style: solid; border-color: var(--icv-accent); background: var(--icv-accent-soft); }
.icv .icv-fcard-add svg { width: 15px; height: 15px; }

/* ---------- file head ---------- */
.icv .icv-filehead { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; }
.icv .icv-thumb-wrap { width: 60px; height: 60px; border-radius: 14px; border: 1px solid var(--icv-line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.icv .icv-thumb-wrap canvas { width: 48px; height: 48px; display: block; }
.icv .icv-filetext { flex: 1; min-width: 0; }
.icv .icv-filetext strong { display: block; font-size: 1.05rem; color: var(--icv-text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icv .icv-filetext span { display: block; font-size: 0.82rem; color: var(--icv-muted); }
.icv .icv-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.icv .icv-badge { display: inline-flex; align-items: center; gap: 0.35rem; width: auto; padding: 0.28rem 0.7rem; margin: 0; border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; cursor: pointer; border: 1px solid transparent; }
.icv .icv-badge svg { width: 15px; height: 15px; }
.icv .icv-badge.is-pass { background: var(--icv-ok-soft); border-color: var(--icv-ok-line); color: var(--icv-ok); }
.icv .icv-badge.is-warn { background: var(--icv-warn-soft); border-color: var(--icv-warn-line); color: var(--icv-warn); }
.icv .icv-badge.is-fail { background: var(--icv-red-soft); border-color: var(--icv-red-line); color: var(--icv-red); }
.icv .icv-stats { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.8rem; }
.icv .icv-stat { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.22rem 0.6rem; border-radius: 999px; background: var(--icv-sunk); border: 1px solid var(--icv-line); font-size: 0.78rem; color: var(--icv-text-2); }
.icv .icv-stat svg { width: 14px; height: 14px; color: var(--icv-accent); }
.icv .icv-stat strong { color: var(--icv-text-1); font-variant-numeric: tabular-nums; }

/* ---------- toolbar / segs ---------- */
.icv .icv-toolbar { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.icv .icv-toolbar #icvOptsBtn { margin-left: auto; }
.icv .icv-segs { display: inline-flex; flex-wrap: wrap; padding: 0.2rem; gap: 0.2rem; border-radius: 10px; background: var(--icv-sunk); border: 1px solid var(--icv-line); max-width: 100%; box-sizing: border-box; }
.icv .icv-segs button { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; width: auto; min-height: 34px; padding: 0.2rem 0.7rem; margin: 0; border: none; border-radius: 8px; background: none; color: var(--icv-muted); font-size: 0.84rem; font-weight: 700; cursor: pointer; min-width: 0; }
.icv .icv-segs button svg { width: 16px; height: 16px; flex-shrink: 0; }
.icv .icv-segs button:hover { color: var(--icv-text-1); }
.icv .icv-segs button.is-active { background: var(--icv-card); color: var(--icv-accent-strong); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
[data-theme="dark"] .icv .icv-segs button.is-active { color: var(--icv-accent); background: #26334a; }
.icv .icv-segs-sm button { min-height: 30px; padding: 0.15rem 0.55rem; font-size: 0.8rem; }

/* ---------- options (collapsed rows) ---------- */
.icv .icv-adv { border: 1px solid var(--icv-line); border-radius: 12px; overflow: hidden; background: var(--icv-card); margin-top: 0.75rem; }
.icv .icv-adv-row + .icv-adv-row { border-top: 1px solid var(--icv-line); }
.icv .icv-adv-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; width: 100%; min-height: 52px; box-sizing: border-box; padding: 0.55rem 1rem; margin: 0; border: none; background: none; cursor: pointer; text-align: left; color: var(--icv-text-1); font-weight: 400; }
.icv .icv-adv-left { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.icv .icv-adv-left > svg { width: 18px; height: 18px; color: var(--icv-accent); flex-shrink: 0; }
.icv .icv-adv-text { display: flex; flex-direction: column; min-width: 0; }
.icv .icv-adv-title { font-size: 0.9rem; font-weight: 700; }
.icv .icv-adv-hint { font-size: 0.76rem; color: var(--icv-muted); line-height: 1.35; }
.icv .icv-adv-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.icv .icv-adv-value { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0.2rem 0.55rem; border-radius: 999px; background: var(--icv-accent-soft); color: var(--icv-accent-strong); font-size: 0.76rem; font-weight: 700; }
[data-theme="dark"] .icv .icv-adv-value { color: var(--icv-accent); }
.icv .icv-chevron { width: 17px; height: 17px; color: var(--icv-muted); transition: transform 0.2s; }
.icv .icv-adv-row.open .icv-chevron { transform: rotate(180deg); }
.icv .icv-adv-row.open .icv-adv-head, .icv .icv-adv-row.open .icv-adv-body { background: var(--icv-open); }
.icv .icv-adv-body { padding: 0.2rem 1rem 1rem; }
.icv .icv-switch-text { font-size: 0.74rem; font-weight: 800; color: var(--icv-muted); min-width: 26px; text-align: right; }
/* switch - beats the global .tool-container checkbox rules */
.tool-container.icv input[type="checkbox"].icv-switch {
    -webkit-appearance: none !important; appearance: none !important; position: relative; flex-shrink: 0;
    width: 40px !important; height: 22px !important; margin: 0 !important; padding: 0 !important;
    border: none !important; border-radius: 999px !important; background: #cbd5e1 !important; box-shadow: none !important; cursor: pointer; transition: background 0.2s;
}
[data-theme="dark"] .tool-container.icv input[type="checkbox"].icv-switch { background: #475569 !important; }
.tool-container.icv input[type="checkbox"].icv-switch::after, .tool-container.icv input[type="checkbox"].icv-switch:checked::after {
    content: '' !important; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; transform: none !important; transition: left 0.2s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); font-size: 0; line-height: 0; border: none;
}
.tool-container.icv input[type="checkbox"].icv-switch:checked { background: var(--icv-go) !important; }
.tool-container.icv input[type="checkbox"].icv-switch:checked::after { left: 21px; }
.tool-container.icv input[type="checkbox"].icv-switch:focus-visible { outline: 3px solid var(--icv-accent-line); outline-offset: 2px; }

/* ---------- panels ---------- */
.icv .icv-panels { position: relative; margin-top: 0.85rem; border: 1px solid var(--icv-line); border-radius: 14px; background: var(--icv-card); padding: 1rem; min-width: 0; }
.icv .icv-panels.is-full { position: fixed; inset: 10px; z-index: 10000; margin: 0; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
body.icv-noscroll { overflow: hidden; }
.icv .icv-full-btn { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; margin: 0; border-radius: 8px; border: 1px solid var(--icv-line); background: var(--icv-card); color: var(--icv-muted); cursor: pointer; z-index: 2; }
.icv .icv-full-btn:hover { color: var(--icv-text-1); border-color: var(--icv-accent-line); }
.icv .icv-full-btn svg { width: 16px; height: 16px; }
.icv .icv-pane { min-width: 0; }

/* layers */
.icv .icv-layers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 0.75rem; padding-top: 1.6rem; }
.icv .icv-frame-h { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.4rem; margin: 0.4rem 0 -0.2rem; font-size: 0.88rem; color: var(--icv-text-1); }
.icv .icv-frame-h svg { width: 16px; height: 16px; color: var(--icv-accent); }
.icv .icv-frame-h span { font-weight: 500; color: var(--icv-muted); }
.icv .icv-layer { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 0.8rem; padding: 0.7rem; border-radius: 14px; border: 1px solid var(--icv-line); background: var(--icv-open); min-width: 0; }
.icv .icv-layer.is-warn { border-color: var(--icv-warn-line); }
.icv .icv-layer.is-fail { border-color: var(--icv-red-line); }
.icv .icv-layer-view { position: relative; display: flex; align-items: center; justify-content: center; width: 132px; height: 132px; border-radius: 10px; border: 1px solid var(--icv-line); overflow: hidden; }
.icv .icv-layer-view canvas { display: block; max-width: 128px; max-height: 128px; }
.icv canvas.icv-pix { image-rendering: pixelated; image-rendering: crisp-edges; }
.icv .icv-zoomtag { position: absolute; right: 4px; bottom: 4px; padding: 0 0.3rem; border-radius: 5px; background: rgba(15, 23, 42, 0.65); color: #fff; font-size: 0.66rem; font-weight: 700; }
.icv .icv-layer-body { min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.icv .icv-layer-title { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.icv .icv-layer-title strong { font-size: 1.05rem; color: var(--icv-text-1); margin-right: 0.15rem; font-variant-numeric: tabular-nums; }
.icv .icv-meta { margin: 0; display: grid; gap: 0.1rem; font-size: 0.78rem; }
.icv .icv-meta > div { display: flex; gap: 0.4rem; min-width: 0; }
.icv .icv-meta dt { color: var(--icv-muted); min-width: 56px; flex-shrink: 0; }
.icv .icv-meta dd { margin: 0; color: var(--icv-text-1); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.icv .icv-flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.icv .icv-flags li { display: flex; align-items: center; gap: 0.3rem; font-size: 0.76rem; font-weight: 600; }
.icv .icv-flags li svg { width: 14px; height: 14px; flex-shrink: 0; }
.icv .icv-flags li.is-fail { color: var(--icv-red); }
.icv .icv-flags li.is-warn { color: var(--icv-warn); }
.icv .icv-layer-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: auto; padding-top: 0.2rem; }
.icv .icv-mini { display: inline-flex; align-items: center; gap: 0.25rem; width: auto; min-height: 30px; padding: 0.2rem 0.55rem; margin: 0; border-radius: 8px; border: 1px solid var(--icv-line); background: var(--icv-card); color: var(--icv-text-2); font-size: 0.76rem; font-weight: 700; cursor: pointer; }
.icv .icv-mini:hover { border-color: var(--icv-accent-line); color: var(--icv-text-1); }
.icv .icv-mini svg { width: 14px; height: 14px; color: var(--icv-accent); }
.icv .icv-mini-icon { padding: 0.2rem 0.45rem; }

/* inspect */
.icv .icv-ins-bar { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.6rem; padding-right: 2.4rem; }
.icv .icv-ins-bar + .icv-ins-bar { padding-right: 0; }
.icv .icv-ins-layers { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.icv .icv-zoomval { font: 700 0.8rem var(--icv-mono); color: var(--icv-muted); min-width: 2.6em; }
.icv .icv-bgdots { display: inline-flex; gap: 0.3rem; margin-left: auto; }
.icv .icv-bgdot { width: 28px; height: 28px; padding: 0; margin: 0; border-radius: 8px; border: 1px solid var(--icv-line); cursor: pointer; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; background-size: 8px 8px; }
.icv .icv-bgdot.is-active { box-shadow: 0 0 0 2px var(--icv-accent); }
.icv .icv-bgdot-custom { background: var(--icv-card); overflow: hidden; }
.icv .icv-bgdot-custom input[type="color"] { width: 22px; height: 22px; padding: 0; margin: 0; border: none; background: none; cursor: pointer; }
.icv .icv-ani { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.6rem; padding: 0.55rem 0.7rem; border-radius: 12px; background: var(--icv-sunk); border: 1px solid var(--icv-line); }
.icv .icv-range { flex: 1; min-width: 120px; accent-color: var(--icv-go); margin: 0; }
.icv .icv-ani-label { font-size: 0.8rem; color: var(--icv-text-2); font-variant-numeric: tabular-nums; }
.icv .icv-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 260px; max-height: 560px; overflow: auto; padding: 1rem; border-radius: 12px; border: 1px solid var(--icv-line); background: var(--icv-sunk); box-sizing: border-box; }
.icv .icv-panels.is-full .icv-stage { max-height: none; height: calc(100vh - 230px); }
.icv .icv-canvas-wrap { position: relative; display: inline-block; line-height: 0; margin: auto; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.icv .icv-canvas-wrap canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; cursor: crosshair; max-width: none; }
.icv .icv-px { position: absolute; box-sizing: border-box; border: 2px solid #facc15; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); pointer-events: none; }
.icv .icv-hot { position: absolute; box-sizing: border-box; border: 2px solid #e64e4e; border-radius: 50%; pointer-events: none; }
.icv .icv-hot::before, .icv .icv-hot::after { content: ''; position: absolute; background: #e64e4e; }
.icv .icv-hot::before { left: 50%; top: -10px; bottom: -10px; width: 2px; margin-left: -1px; }
.icv .icv-hot::after { top: 50%; left: -10px; right: -10px; height: 2px; margin-top: -1px; }
.icv .icv-ins-foot { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.6rem; min-height: 40px; }
.icv .icv-readout { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; flex: 1; min-width: 0; font-size: 0.84rem; color: var(--icv-text-1); }
.icv .icv-readout > span { display: inline-flex; flex-direction: column; }
.icv .icv-readout .icv-mono { font-size: 0.8rem; color: var(--icv-text-2); }
.icv .icv-hexval { font-weight: 700; color: var(--icv-text-1) !important; }
.icv .icv-swatch-big { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--icv-line); overflow: hidden; flex-shrink: 0; background-color: #fff; background-image: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%); background-size: 8px 8px; background-position: 0 0, 0 4px, 4px -4px, -4px 0; }
.icv .icv-swatch-big span { display: block; width: 100%; height: 100%; }
.icv .icv-ins-info { font-size: 0.78rem; color: var(--icv-muted); }
.icv .icv-hotrow { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.82rem; font-weight: 700; color: var(--icv-text-2); cursor: pointer; }

/* in use */
.icv .icv-context { display: grid; gap: 0.9rem; padding-top: 0.2rem; }
.icv .icv-ctx-card { border: 1px solid var(--icv-line); border-radius: 12px; padding: 0.9rem; background: var(--icv-open); min-width: 0; }
.icv .icv-ctx-note { margin: 0 0 0.7rem; font-size: 0.86rem; color: var(--icv-text-2); line-height: 1.5; padding-right: 2.2rem; }
.icv .icv-ctx-card + .icv-ctx-card .icv-ctx-note { padding-right: 0; }
.icv .icv-ctx-note a, .icv .icv-ctx-foot a { color: var(--icv-accent-strong); font-weight: 600; }
[data-theme="dark"] .icv .icv-ctx-note a, [data-theme="dark"] .icv .icv-ctx-foot a { color: var(--icv-accent); }
.icv .icv-ctx-foot { margin: 0.2rem 0 0; font-size: 0.82rem; color: var(--icv-muted); line-height: 1.5; }
.icv .icv-ctx-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.icv .icv-ctx-row .icv-ctx-note { margin: 0; padding: 0; flex: 1; min-width: 200px; }
.icv .icv-ctx-row .icv-quick { width: 280px; max-width: 100%; }
.icv .icv-pick { font-weight: 700; }
.icv .icv-pick.is-pass { color: var(--icv-ok); }
.icv .icv-pick.is-ok { color: var(--icv-text-1); }
.icv .icv-pick.is-warn { color: var(--icv-warn); }
.icv .icv-pick.is-fail { color: var(--icv-red); }
.icv .icv-tabs-mock { display: flex; align-items: flex-end; gap: 2px; padding: 6px 8px 0; border-radius: 10px 10px 0 0; margin-bottom: 0.5rem; overflow: hidden; }
.icv .icv-tabs-mock.is-light { background: #dfe3e8; }
.icv .icv-tabs-mock.is-dark { background: #1f2023; }
.icv .icv-tab-m { display: flex; align-items: center; gap: 8px; width: 210px; min-width: 0; height: 34px; padding: 0 10px; border-radius: 9px 9px 0 0; font: 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif; box-sizing: border-box; }
.icv .icv-tab-m svg { width: 13px; height: 13px; margin-left: auto; flex-shrink: 0; opacity: 0.6; }
.icv .is-light .icv-tab-m { color: #3c4043; }
.icv .is-light .icv-tab-m.is-on { background: #fff; color: #202124; }
.icv .is-dark .icv-tab-m { color: #bdc1c6; }
.icv .is-dark .icv-tab-m.is-on { background: #35363a; color: #e8eaed; }
.icv .icv-tab-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icv .icv-tab-fav { width: 16px; height: 16px; flex-shrink: 0; display: block; }
.icv .icv-tab-fav canvas { display: block; }
.icv .icv-tab-gen { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; opacity: 0.45; flex-shrink: 0; box-sizing: border-box; }
.icv .icv-serp { display: flex; align-items: center; gap: 10px; margin-top: 0.7rem; padding: 0.7rem 0.8rem; border-radius: 10px; background: #fff; border: 1px solid #e5e7eb; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; max-width: 360px; }
[data-theme="dark"] .icv .icv-serp { background: #202124; border-color: #3c4043; }
.icv .icv-serp-ico { width: 28px; height: 28px; border-radius: 50%; background: #f1f3f4; border: 1px solid #dadce0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-theme="dark"] .icv .icv-serp-ico { background: #303134; border-color: #5f6368; }
.icv .icv-serp-ico canvas { display: block; }
.icv .icv-serp-t { display: flex; flex-direction: column; min-width: 0; font-size: 13px; color: #202124; }
.icv .icv-serp-t span { font-size: 12px; color: #4d5156; }
[data-theme="dark"] .icv .icv-serp-t { color: #e8eaed; }
[data-theme="dark"] .icv .icv-serp-t span { color: #bdc1c6; }
.icv .icv-scenes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 0.6rem; margin-bottom: 0.8rem; }
.icv .icv-scene { border-radius: 10px; min-height: 120px; min-width: 0; overflow: hidden; position: relative; }
.icv .icv-scene-task { display: flex; align-items: flex-end; justify-content: center; gap: 6px; padding: 0 8px 8px; background: #6f8fb5; }
.icv .icv-scene-task::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 44px; background: rgba(32, 32, 36, 0.92); z-index: 0; }
.icv .icv-scene-task > span { position: relative; z-index: 1; }
.icv .icv-ph { display: block; width: 24px; height: 24px; border-radius: 6px; background: rgba(255, 255, 255, 0.28); margin-bottom: 2px; }
.icv .icv-ph.is-sq { border-radius: 3px; }
.icv .icv-ph.is-folder { width: 44px; height: 34px; border-radius: 4px; background: #e8b84a; margin: 0; }
.icv .icv-task-me { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 40px; height: 36px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); margin-bottom: 2px; }
.icv .icv-task-me canvas { display: block; }
.icv .icv-task-me::after { content: ''; width: 14px; height: 3px; border-radius: 2px; background: #60a5fa; margin-top: 2px; }
.icv .icv-scene-desk { display: flex; align-items: flex-start; gap: 10px; padding: 12px; background: #3f6f9f; }
.icv .icv-desk-me { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 74px; padding: 4px 2px; border-radius: 4px; }
.icv .icv-desk-me:first-child { background: rgba(255, 255, 255, 0.18); outline: 1px solid rgba(255, 255, 255, 0.35); }
.icv .icv-desk-ico { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.icv .icv-desk-ico canvas { display: block; }
.icv .icv-desk-lbl { font: 12px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); text-align: center; }
.icv .icv-scene-exp { background: #fff; border: 1px solid #e5e7eb; color: #1f2937; font: 12px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; }
[data-theme="dark"] .icv .icv-scene-exp { background: #202020; border-color: #3a3a3a; color: #e5e5e5; }
.icv .icv-exp-head { display: flex; gap: 6px; padding: 7px 9px; border-bottom: 1px solid rgba(127, 127, 127, 0.25); }
.icv .icv-exp-head span { width: 9px; height: 9px; border-radius: 50%; background: rgba(127, 127, 127, 0.4); }
.icv .icv-exp-grid { display: flex; align-items: flex-start; gap: 12px; padding: 10px; flex-wrap: wrap; }
.icv .icv-exp-me { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 104px; padding: 4px; border-radius: 4px; background: rgba(51, 153, 204, 0.16); }
.icv .icv-exp-ico canvas { display: block; }
.icv .icv-exp-row { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 140px; padding: 3px 6px; border-radius: 3px; }
.icv .icv-exp-row .icv-muted { margin-left: auto; }
.icv .icv-exp-sm canvas { display: block; }
.icv .icv-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 0.6rem; }
.icv .icv-tile { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.6rem; border-radius: 10px; border: 1px solid var(--icv-line); background: var(--icv-card); min-width: 0; }
.icv .icv-tile-view { display: flex; align-items: center; justify-content: center; height: 140px; border-radius: 8px; border: 1px solid var(--icv-line); overflow: hidden; }
.icv .icv-tile-view canvas { display: block; image-rendering: auto; }
.icv .icv-tile-info { display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.78rem; color: var(--icv-text-2); }
.icv .icv-tile-info strong { color: var(--icv-text-1); font-size: 0.86rem; }
.icv .icv-curtest { position: relative; height: 240px; border-radius: 12px; border: 1px dashed var(--icv-accent-line); background-color: var(--icv-card); background-image: radial-gradient(var(--icv-line) 1px, transparent 1px); background-size: 16px 16px; }
.icv .icv-target { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #e64e4e; box-shadow: 0 0 0 4px rgba(230, 78, 78, 0.25); }
.icv .icv-curpos { position: absolute; left: 10px; bottom: 8px; font: 700 0.78rem var(--icv-mono); color: var(--icv-muted); }

/* checks */
.icv .icv-checks-wrap { display: grid; gap: 0.9rem; }
.icv .icv-verdict { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.85rem 1rem; padding-right: 3rem; border-radius: 12px; border: 1px solid var(--icv-line); }
.icv .icv-verdict > svg { width: 26px; height: 26px; flex-shrink: 0; }
.icv .icv-verdict > div { flex: 1; min-width: 200px; }
.icv .icv-verdict strong { font-size: 1rem; color: var(--icv-text-1); }
.icv .icv-verdict p { margin: 0.15rem 0 0; font-size: 0.86rem; color: var(--icv-text-2); line-height: 1.5; }
.icv .icv-verdict.is-pass { background: var(--icv-ok-soft); border-color: var(--icv-ok-line); }
.icv .icv-verdict.is-pass > svg { color: var(--icv-ok); }
.icv .icv-verdict.is-warn { background: var(--icv-warn-soft); border-color: var(--icv-warn-line); }
.icv .icv-verdict.is-warn > svg { color: var(--icv-warn); }
.icv .icv-verdict.is-fail { background: var(--icv-red-soft); border-color: var(--icv-red-line); }
.icv .icv-verdict.is-fail > svg { color: var(--icv-red); }
.icv .icv-check-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.9rem; }
.icv .icv-check-card { border: 1px solid var(--icv-line); border-radius: 12px; padding: 0.9rem; background: var(--icv-open); min-width: 0; }
.icv .icv-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.icv .icv-check { display: flex; gap: 0.55rem; align-items: flex-start; padding: 0.5rem 0.2rem; border-top: 1px solid var(--icv-line); }
.icv .icv-check:first-child { border-top: none; }
.icv .icv-check > svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.icv .icv-check.is-pass > svg { color: var(--icv-ok); }
.icv .icv-check.is-warn > svg { color: var(--icv-warn); }
.icv .icv-check.is-fail > svg { color: var(--icv-red); }
.icv .icv-check.is-info > svg { color: var(--icv-accent); }
.icv .icv-check > div { min-width: 0; }
.icv .icv-check strong { font-size: 0.88rem; color: var(--icv-text-1); }
.icv .icv-check p { margin: 0.15rem 0 0; font-size: 0.82rem; line-height: 1.5; color: var(--icv-text-2); overflow-wrap: anywhere; }
.icv .icv-fixes { display: flex; flex-wrap: wrap; gap: 0.3rem 0.5rem; margin-top: 0.35rem; }
.icv .icv-fixlink { display: inline-flex; align-items: center; gap: 0.25rem; width: auto; padding: 0.15rem 0.5rem; margin: 0; border-radius: 999px; border: 1px solid var(--icv-accent-line); background: var(--icv-card); color: var(--icv-accent-strong); font-size: 0.76rem; font-weight: 700; text-decoration: none; cursor: pointer; }
[data-theme="dark"] .icv .icv-fixlink { color: var(--icv-accent); }
.icv .icv-fixlink:hover { background: var(--icv-accent-soft); }
.icv .icv-fixlink svg { width: 13px; height: 13px; }
.icv .icv-snip { margin-top: 0.8rem; }
.icv .icv-snip-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.icv .icv-snip-head .icv-caption { margin: 0; }
.icv .icv-code { margin: 0.35rem 0 0; padding: 0.6rem 0.75rem; border-radius: 8px; background: #1e293b; color: #e2e8f0; font: 0.78rem/1.55 var(--icv-mono); white-space: pre-wrap; overflow-wrap: anywhere; }

/* structure */
.icv .icv-struct { padding-top: 0.2rem; }
.icv .icv-struct .icv-h { margin-top: 1rem; }
.icv .icv-struct .icv-h:first-child { margin-top: 0; padding-right: 2.4rem; }
.icv .icv-table-wrap { overflow-x: auto; border: 1px solid var(--icv-line); border-radius: 10px; margin-top: 0.5rem; }
.icv .icv-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin: 0; }
.icv .icv-table th, .icv .icv-table td { padding: 0.5rem 0.7rem; text-align: left; border-bottom: 1px solid var(--icv-line); color: var(--icv-text-2); vertical-align: top; white-space: nowrap; }
.icv .icv-table th { background: var(--icv-sunk); color: var(--icv-text-1); font-weight: 700; font-size: 0.8rem; }
.icv .icv-table tr:last-child td, .icv .icv-table tr:last-child th { border-bottom: none; }
.icv .icv-kv th { width: 160px; }
.icv .icv-table td.icv-bad { background: var(--icv-red-soft); color: var(--icv-red); font-weight: 700; }
.icv .icv-entries td, .icv .icv-table td { font-variant-numeric: tabular-nums; }
.icv .icv-struct tr[data-off] { cursor: pointer; }
.icv .icv-struct tr[data-off]:hover td { background: var(--icv-accent-soft); }
.icv .icv-legend { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0; font-size: 0.74rem; color: var(--icv-text-2); }
.icv .icv-legend span { padding: 0.05rem 0.45rem; border-radius: 5px; }
.icv .icv-peek { margin: 0; padding: 0.7rem 0.8rem; border-radius: 10px; border: 1px solid var(--icv-line); background: var(--icv-card); font: 0.8rem/1.7 var(--icv-mono); color: var(--icv-text-1); overflow-x: auto; white-space: pre; }
.icv .icv-r-h { background: var(--icv-rh); }
.icv .icv-r-d0 { background: var(--icv-rd0); }
.icv .icv-r-d1 { background: var(--icv-rd1); }
.icv .icv-r-p0 { background: var(--icv-rp0); }
.icv .icv-r-p1 { background: var(--icv-rp1); }
.icv .icv-r-m { background: var(--icv-rm) !important; color: #111 !important; }

/* hex */
.icv .icv-hexbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding-right: 2.4rem; }
.icv .icv-search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 0.3rem; height: 38px; padding: 0 0.5rem 0 0.7rem; border-radius: 10px; border: 1px solid var(--icv-line); background: var(--input-bg, #fff); box-sizing: border-box; }
.icv .icv-search:focus-within { border-color: var(--icv-accent); box-shadow: 0 0 0 3px var(--icv-accent-soft); }
.icv .icv-search > svg { width: 16px; height: 16px; color: var(--icv-muted); flex-shrink: 0; }
.icv .icv-search input { flex: 1; min-width: 0; width: auto; height: 100%; border: none; background: none; outline: none; box-shadow: none; color: var(--icv-text-1); font-size: 0.86rem; padding: 0; margin: 0; }
.icv .icv-search-count { font-size: 0.74rem; color: var(--icv-muted); white-space: nowrap; }
.icv .icv-search-count.is-none { color: var(--icv-red); }
.icv .icv-jump { display: flex; gap: 0.3rem; }
.icv .icv-jump .icv-input { width: 100px; }
.icv .icv-hexmeta { font-size: 0.76rem; color: var(--icv-muted); }
.icv .icv-hex { height: 440px; overflow: auto; border-radius: 10px; border: 1px solid var(--icv-line); background: var(--icv-card); font: 0.8rem/20px var(--icv-mono); color: var(--icv-text-1); }
.icv .icv-panels.is-full .icv-hex { height: calc(100vh - 180px); }
.icv .icv-hex-space { position: relative; min-width: 640px; }
.icv .icv-hex-win { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.icv .icv-hrow { display: flex; gap: 1rem; height: 20px; padding: 0 0.7rem; white-space: pre; }
.icv .icv-hoff { color: var(--icv-muted); }
.icv .icv-hasc { color: var(--icv-text-2); }

/* next steps + action bar */
.icv .icv-next { margin-top: 1rem; }
.icv .icv-next-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.icv .icv-next-link { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.8rem; border-radius: 999px; border: 1px solid var(--icv-line); background: var(--icv-card); color: var(--icv-text-2); font-size: 0.82rem; font-weight: 600; text-decoration: none; }
.icv .icv-next-link svg { width: 14px; height: 14px; color: var(--icv-accent); }
.icv .icv-next-link:hover { border-color: var(--icv-accent-line); color: var(--icv-text-1); }
.icv .icv-actionbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--icv-line); }
.icv .icv-actionbar .icv-btn-ghost { min-height: 40px; padding: 0.4rem 0.7rem; font-size: 0.86rem; gap: 0.35rem; }
.icv .icv-actionbar .icv-btn-ghost svg { width: 16px; height: 16px; }
.icv .icv-actionbar #icvAllPng.icv-go, .icv .icv-actionbar #icvFix { margin-left: auto; }
.icv .icv-actionbar #icvAllPng.icv-go { min-height: 50px; padding: 0.65rem 1.4rem; font-size: 1rem; }
.icv .icv-actionbar #icvAllPng.icv-go + #icvFix { margin-left: 0; }

/* toast */
.icv .icv-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 10003; max-width: calc(100vw - 32px); box-sizing: border-box; padding: 0.55rem 1rem; border-radius: 10px; background: #1e293b; color: #fff; font-size: 0.86rem; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); transition: opacity 0.25s; text-align: center; }
[data-theme="dark"] .icv .icv-toast { background: #e2e8f0; color: #0f172a; }
.icv .icv-toast.is-out { opacity: 0; }

/* ---------- content ---------- */
.icv .icv-info { margin-top: 2rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
.icv .icv-info > * { min-width: 0; }
.icv .icv-info-card { background: var(--bg-elevated, #fff); border: 1px solid var(--icv-line); border-radius: var(--radius-md, 12px); padding: 1.4rem 1.5rem; }
.icv .icv-info-card h2 { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.9rem; font-size: 1.25rem; color: var(--icv-text-1); }
.icv .icv-info-card h2 svg { width: 22px; height: 22px; color: var(--icv-accent); flex-shrink: 0; }
.icv .icv-info-card h3 { margin: 1.2rem 0 0.5rem; font-size: 1.05rem; color: var(--icv-text-1); }
.icv .icv-info-card p, .icv .icv-info-card li { color: var(--icv-text-2); line-height: 1.65; font-size: 0.97rem; }
.icv .icv-info-card p { margin: 0.8rem 0 0; }
.icv .icv-info-card h2 + p { margin-top: 0; }
.icv .icv-info a { color: var(--icv-accent-strong); font-weight: 500; }
[data-theme="dark"] .icv .icv-info a { color: var(--icv-accent); }
.icv .icv-steps, .icv .icv-list { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.45rem; }
.icv .icv-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.icv .icv-feature { padding: 0.9rem 1rem; border-radius: 12px; border: 1px solid var(--icv-line); background: var(--icv-open); min-width: 0; }
.icv .icv-feature > svg { width: 20px; height: 20px; color: var(--icv-accent); }
.icv .icv-info-card .icv-feature h3 { margin: 0.35rem 0 0.2rem; font-size: 0.95rem; }
.icv .icv-info-card .icv-feature p { margin: 0; font-size: 0.88rem; line-height: 1.55; }
.icv .icv-info .icv-table td { white-space: normal; }
.icv .icv-info .icv-table td:first-child { font-weight: 700; color: var(--icv-text-1); white-space: nowrap; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
    .icv .icv-check-grid { grid-template-columns: minmax(0, 1fr); }
    .icv .icv-scenes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .icv .icv-scene-exp { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .icv.tool-container { padding: 1.1rem 16px; }
    .icv .tool-title { font-size: 1.55rem; }
    .icv .icv-title-icon { width: 46px; height: 46px; border-radius: 13px; }
    .icv .icv-title-icon svg { width: 25px; height: 25px; }
    .icv .tool-description { font-size: 0.98rem; }
    .icv .icv-card { padding: 1rem; border-radius: 16px; }
    .icv .icv-drop { min-height: 160px; }
    .icv #icvViews { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .icv #icvViews button { padding: 0.2rem 0.3rem; font-size: 0.8rem; }
    .icv .icv-toolbar #icvOptsBtn { margin-left: 0; flex: 1; }
    .icv .icv-panels { padding: 0.7rem; }
    .icv .icv-adv-head { padding: 0.55rem 0.75rem; }
    .icv .icv-adv-hint { display: none; }
    .icv .icv-quick-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .icv .icv-ctx-row .icv-quick-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .icv .icv-layer { grid-template-columns: 100px minmax(0, 1fr); gap: 0.6rem; }
    .icv .icv-layer-view { width: 100px; height: 100px; }
    .icv .icv-layer-view canvas { max-width: 96px; max-height: 96px; }
    .icv .icv-bgdots { margin-left: 0; }
    .icv .icv-stage { min-height: 220px; padding: 0.6rem; }
    .icv .icv-scenes { grid-template-columns: minmax(0, 1fr); }
    .icv .icv-tab-m { width: 170px; }
    .icv .icv-tabs-mock .icv-tab-m:not(.is-on) { width: 110px; }
    .icv .icv-hex { height: 380px; font-size: 0.72rem; }
    .icv .icv-hrow { gap: 0.6rem; padding: 0 0.4rem; }
    .icv .icv-hex-space { min-width: 540px; }
    .icv .icv-actionbar #icvFix, .icv .icv-actionbar #icvAllPng.icv-go { flex: 1 1 100%; margin-left: 0; order: -1; }
    .icv .icv-actionbar .icv-btn-ghost { flex: 1 1 calc(50% - 0.5rem); padding: 0.45rem 0.4rem; }
    .icv .icv-recent-list { grid-template-columns: minmax(0, 1fr); }
    .icv .icv-features { grid-template-columns: minmax(0, 1fr); }
    .icv .icv-info-card { padding: 1.1rem; }
    .icv .icv-panels.is-full { inset: 0; border-radius: 0; }
    .icv .icv-fcard { max-width: 100%; }
}
