/* ============================================================
   Image Color Picker - stylesheet (rebuilt 2026-10-05)
   Everything is scoped under .icp / .icp-*; the shared header, footer,
   FAQ and related-tools pills come from styles/custom_styles.css,
   which loads first. Blue accent, single colours for titles and icons,
   no thick side borders. Dark mode via [data-theme="dark"], light default.
   ============================================================ */

.icp {
    --icp-accent: #3399cc;
    --icp-accent-strong: #237a9f;
    --icp-accent-soft: rgba(51, 153, 204, 0.10);
    --icp-accent-line: rgba(51, 153, 204, 0.45);
    --icp-go: #237a9f;
    --icp-go-hover: #1b6183;
    --icp-card: var(--bg-elevated, #fff);
    --icp-sunk: var(--card-tertiary, #f1f5f9);
    --icp-open: var(--card-secondary, #f8fafc);
    --icp-line: var(--border-color, #e2e8f0);
    --icp-text-1: var(--text-primary, #1e293b);
    --icp-text-2: var(--text-secondary, #555);
    --icp-muted: var(--text-muted, #64748b);
    --icp-checker: #e5e7eb;
    --icp-checker-bg: #fff;
    --icp-view-bg: #eef2f6;
    --icp-red: #c23b3b;
    --icp-input: var(--input-bg, #fff);
}
[data-theme="dark"] .icp {
    --icp-accent: #5bb8e0;
    --icp-accent-strong: #7cc8ea;
    --icp-accent-soft: rgba(91, 184, 224, 0.13);
    --icp-accent-line: rgba(91, 184, 224, 0.5);
    --icp-go: #3399cc;
    --icp-go-hover: #5bb8e0;
    --icp-sunk: #172033;
    --icp-open: #1a2438;
    --icp-checker: #334155;
    --icp-checker-bg: #1e293b;
    --icp-view-bg: #111a2b;
    --icp-red: #f87171;
}

.icp.tool-container { max-width: 1160px; margin: 0 auto; padding: 2rem; }
.icp [hidden] { display: none !important; }
.icp button { font: inherit; width: auto; }

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

/* ---------- error ---------- */
.icp .icp-error {
    display: flex; align-items: flex-start; gap: 0.7rem;
    margin: 0 0 1rem; padding: 0.9rem 1rem; border-radius: 12px;
    border: 1px solid rgba(230, 78, 78, 0.35); background: rgba(230, 78, 78, 0.08);
    color: var(--icp-text-1);
}
.icp .icp-error > svg { width: 20px; height: 20px; color: #e64e4e; flex-shrink: 0; margin-top: 2px; }
.icp .icp-error > div { flex: 1; min-width: 0; }
.icp .icp-error p { margin: 0; font-size: 0.9rem; line-height: 1.55; color: var(--icp-text-1); }
.icp .icp-error p + p { margin-top: 0.3rem; color: var(--icp-muted); }
.icp .icp-error a { color: var(--icp-red); font-weight: 600; }

/* ---------- shared bits ---------- */
.icp .icp-checker {
    background-color: var(--icp-checker-bg);
    background-image:
        linear-gradient(45deg, var(--icp-checker) 25%, transparent 25%),
        linear-gradient(-45deg, var(--icp-checker) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--icp-checker) 75%),
        linear-gradient(-45deg, transparent 75%, var(--icp-checker) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.icp .icp-card {
    background: var(--icp-card); border: 1px solid var(--icp-line);
    border-radius: 14px; padding: 1rem 1.1rem; min-width: 0;
}
.icp .icp-col-view > * + *,
.icp .icp-col-side > * + * { margin-top: 0.875rem; }
.icp .icp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; min-width: 0; }
.icp .icp-h { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--icp-text-1); min-width: 0; }
.icp .icp-h svg { width: 17px; height: 17px; color: var(--icp-accent); flex-shrink: 0; }
.icp .icp-chip,
.icp .icp-adv-value {
    display: inline-flex; align-items: center; padding: 0.12rem 0.5rem; border-radius: 999px;
    background: var(--icp-accent-soft); color: var(--icp-accent-strong);
    font-size: 0.75rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.icp .icp-hint { margin: 0.55rem 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--icp-muted); }
.icp .icp-text-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.4rem 0.6rem; border: none; border-radius: 8px; background: none;
    color: var(--icp-accent-strong); font-size: 0.85rem; font-weight: 600; cursor: pointer; flex-shrink: 0; white-space: nowrap;
}
.icp .icp-text-btn:hover { background: var(--icp-accent-soft); }
.icp .icp-text-btn svg { width: 15px; height: 15px; }
.icp .icp-link-btn {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.55rem; border-radius: 8px;
    border: 1px solid var(--icp-line); background: var(--icp-card); color: var(--icp-text-2);
    font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.icp .icp-link-btn:hover { border-color: var(--icp-accent-line); color: var(--icp-accent-strong); }
.icp .icp-link-btn svg { width: 14px; height: 14px; }
.icp .icp-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0; border-radius: 9px;
    border: 1px solid var(--icp-line); background: var(--icp-card); color: var(--icp-text-2);
    cursor: pointer; flex-shrink: 0; transition: border-color .15s, color .15s, background .15s;
}
.icp .icp-icon-btn svg { width: 16px; height: 16px; }
.icp .icp-icon-btn:hover:not(:disabled) { border-color: var(--icp-accent-line); color: var(--icp-accent-strong); }
.icp .icp-icon-btn:disabled { opacity: 0.4; cursor: not-allowed; background: var(--icp-card); }
.icp .icp-error-close { width: 28px; height: 28px; border: none; background: none; }
.icp .icp-mini-actions { display: flex; gap: 0.3rem; }
.icp .icp-mini-actions .icp-icon-btn { width: 32px; height: 32px; }

/* segmented */
.icp .icp-seg {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
    padding: 4px; border-radius: 12px; background: var(--icp-sunk); border: 1px solid var(--icp-line);
}
.icp .icp-seg button {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
    min-height: 36px; padding: 0.35rem 0.5rem; border: 1px solid transparent; border-radius: 9px;
    background: none; color: var(--icp-text-2); font-size: 0.85rem; font-weight: 600; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.icp .icp-seg button:hover:not(.active) { color: var(--icp-text-1); }
.icp .icp-seg button.active {
    background: var(--icp-card); color: var(--icp-accent-strong); border-color: var(--icp-line);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* buttons */
.icp .icp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    min-height: 42px; padding: 0.55rem 1rem; border-radius: 11px; border: 1px solid transparent;
    font-size: 0.92rem; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
}
.icp .icp-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.icp .icp-go { background: var(--icp-go); color: #fff; }
.icp .icp-go:hover:not(:disabled) { background: var(--icp-go-hover); color: #fff; }
[data-theme="dark"] .icp .icp-go,
[data-theme="dark"] .icp .icp-go:hover:not(:disabled) { color: #0b1220; }
.icp .icp-go:disabled { opacity: 0.5; cursor: not-allowed; background: var(--icp-go); }
.icp .icp-btn-ghost { background: none; color: var(--icp-text-2); border-color: var(--icp-line); }
.icp .icp-btn-ghost:hover:not(:disabled) { color: var(--icp-accent-strong); border-color: var(--icp-accent-line); background: var(--icp-accent-soft); }
.icp .icp-btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; background: none; }

/* ---------- main layout ---------- */
.icp .icp-main {
    background: var(--icp-card); border: 1px solid var(--icp-line); border-radius: 22px;
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08)); padding: 1.25rem;
}
.icp .icp-layout {
    display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 1.25rem; align-items: start;
}
.icp .icp-col-view,
.icp .icp-col-side { min-width: 0; }

/* ---------- image card ---------- */
.icp .icp-view-card { padding: 0.75rem; }
.icp .icp-filebar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0 0 0.6rem; min-width: 0; }
.icp .icp-file { display: inline-flex; align-items: center; gap: 0.45rem; min-width: 0; font-size: 0.86rem; font-weight: 600; color: var(--icp-text-1); }
.icp .icp-file svg { width: 16px; height: 16px; color: var(--icp-accent); flex-shrink: 0; }
.icp .icp-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.icp .icp-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.45rem;
    min-height: 340px; padding: 2rem 1.25rem; border-radius: 12px; text-align: center; cursor: pointer;
    border: 2px dashed var(--icp-accent-line); background: var(--icp-accent-soft); color: var(--icp-text-2);
    transition: background .15s, border-color .15s; outline: none; box-sizing: border-box;
}
.icp .icp-drop:hover,
.icp .icp-drop.is-drag,
.icp .icp-drop:focus-visible { border-color: var(--icp-accent); background: rgba(51, 153, 204, 0.16); }
.icp .icp-drop.is-busy { cursor: progress; opacity: 0.75; }
.icp .icp-drop-icon {
    width: 60px; height: 60px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
    background: var(--icp-accent); color: #fff; margin-bottom: 0.35rem;
}
[data-theme="dark"] .icp .icp-drop-icon { color: #0f172a; }
.icp .icp-drop-icon svg { width: 28px; height: 28px; }
.icp .icp-drop-title { font-size: 1.15rem; font-weight: 700; color: var(--icp-text-1); }
.icp .icp-drop-sub { font-size: 0.88rem; color: var(--icp-muted); }
.icp .icp-drop-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 0.5rem; }
.icp .icp-drop-chips span {
    padding: 0.12rem 0.45rem; border-radius: 6px; background: var(--icp-card); border: 1px solid var(--icp-line);
    font-size: 0.7rem; font-weight: 700; color: var(--icp-muted); letter-spacing: 0.03em;
}
.icp .icp-samples { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.7rem; }
.icp .icp-samples-label { font-size: 0.8rem; font-weight: 700; color: var(--icp-muted); margin-right: 0.15rem; }

.icp .icp-view {
    position: relative; overflow: hidden; border-radius: 12px; outline: none;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.icp .icp-view:focus-visible { box-shadow: 0 0 0 3px var(--icp-accent-line); }
.icp .icp-view.is-drag { box-shadow: 0 0 0 3px var(--icp-accent); }
.icp .icp-view-canvas { display: block; cursor: crosshair; touch-action: none; }
.icp .icp-view.is-pannable .icp-view-canvas { cursor: crosshair; }
.icp .icp-view.is-panning .icp-view-canvas { cursor: grabbing; }
.icp .icp-loupe {
    position: absolute; left: 0; top: 0; pointer-events: none; border-radius: 10px; z-index: 3;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(15, 23, 42, 0.25), 0 10px 28px rgba(0, 0, 0, 0.3);
    will-change: transform;
}
.icp .icp-hover {
    position: absolute; left: 10px; bottom: 10px; z-index: 2; pointer-events: none;
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.55rem; border-radius: 9px;
    background: rgba(15, 23, 42, 0.78); color: #fff;
    font: 700 0.8rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.icp .icp-hover small { font-weight: 600; color: #94a3b8; font-size: 0.72rem; }
.icp .icp-sw { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45); flex-shrink: 0; }
.icp .icp-busy {
    position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    background: rgba(15, 23, 42, 0.45); color: #fff; font-size: 0.95rem;
}
.icp .icp-spinner {
    width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
    animation: icp-spin .8s linear infinite;
}
@keyframes icp-spin { to { transform: rotate(360deg); } }

.icp .icp-view-tools { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.6rem; min-width: 0; }
.icp .icp-view-hint { display: flex; align-items: center; gap: 0.35rem; margin: 0; min-width: 0; }
.icp .icp-view-hint svg { width: 14px; height: 14px; flex-shrink: 0; }
.icp .icp-zoom {
    display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; flex-shrink: 0;
    background: var(--icp-sunk); border: 1px solid var(--icp-line);
}
.icp .icp-zoom button {
    display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
    border: none; border-radius: 7px; background: none; color: var(--icp-text-2); cursor: pointer;
}
.icp .icp-zoom button:hover { background: var(--icp-card); color: var(--icp-accent-strong); }
.icp .icp-zoom button svg { width: 16px; height: 16px; }
.icp .icp-zoom .icp-zoom-txt { width: 34px; font-size: 0.74rem; font-weight: 800; }
.icp .icp-zoom strong { min-width: 50px; text-align: center; font-size: 0.78rem; color: var(--icp-text-1); font-variant-numeric: tabular-nums; }

/* ---------- main colors ---------- */
.icp .icp-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.icp .icp-pal {
    display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; min-width: 0;
    border: 1px solid var(--icp-line); border-radius: 10px; overflow: hidden; background: var(--icp-card); cursor: pointer;
    transition: border-color .15s, transform .15s;
}
.icp .icp-pal:hover { border-color: var(--icp-accent-line); transform: translateY(-1px); }
.icp .icp-pal:focus-visible { outline: none; border-color: var(--icp-accent); box-shadow: 0 0 0 3px var(--icp-accent-soft); }
.icp .icp-pal-sw { display: block; height: 46px; }
.icp .icp-pal-hex { padding: 0.35rem 0.4rem 0; font: 700 0.74rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--icp-text-1); text-align: left; }
.icp .icp-pal-pct { padding: 0.05rem 0.4rem 0.35rem; font-size: 0.68rem; font-weight: 600; color: var(--icp-muted); text-align: left; font-variant-numeric: tabular-nums; }

/* ---------- selected color ---------- */
.icp .icp-cur-top { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0.8rem; align-items: center; }
.icp .icp-cur-sw {
    position: relative; display: block; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; cursor: copy;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.15); background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}
.icp .icp-cur-sw > span { position: absolute; inset: 0; }
.icp .icp-cur-sw.flash { animation: icp-pop .35s ease; }
@keyframes icp-pop { 50% { transform: scale(1.08); } }
.icp .icp-cur-meta { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.icp .icp-cur-meta strong { font-size: 0.95rem; color: var(--icp-text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icp .icp-cur-meta span { font-size: 0.78rem; color: var(--icp-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.4; }
.icp .icp-codes { display: grid; gap: 5px; margin-top: 0.85rem; }
.icp .icp-code-row {
    display: grid; grid-template-columns: 52px minmax(0, 1fr) 30px; align-items: center; gap: 6px;
    padding: 3px 3px 3px 9px; border-radius: 9px; background: var(--icp-sunk); border: 1px solid var(--icp-line);
}
.icp .icp-code-row > span { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.05em; color: var(--icp-muted); }
.icp .icp-code-row code {
    font: 600 0.84rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--icp-text-1);
    background: none; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
    user-select: all;
}
.icp .icp-copy {
    display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 28px; padding: 0;
    border: none; border-radius: 7px; background: none; color: var(--icp-muted); cursor: pointer;
}
.icp .icp-copy svg { width: 15px; height: 15px; }
.icp .icp-copy:hover:not(:disabled) { background: var(--icp-card); color: var(--icp-accent-strong); }
.icp .icp-copy:disabled { opacity: 0.35; cursor: default; }
.icp .icp-next { margin: 0.75rem 0 0; font-size: 0.82rem; line-height: 1.6; color: var(--icp-text-2); }
.icp .icp-next a,
.icp .icp-info a { color: var(--icp-accent-strong); font-weight: 600; }

/* ---------- your colors ---------- */
.icp .icp-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 300px; overflow-y: auto; }
.icp .icp-item {
    display: grid; grid-template-columns: minmax(0, 1fr) 28px 28px; align-items: center; gap: 2px;
    padding: 3px; border-radius: 10px; border: 1px solid var(--icp-line); background: var(--icp-card); min-width: 0;
}
.icp .icp-item.is-sel { border-color: var(--icp-accent); background: var(--icp-accent-soft); }
.icp .icp-item-pick {
    display: flex; align-items: center; gap: 0.45rem; min-width: 0; padding: 0; border: none; background: none; cursor: pointer;
    color: var(--icp-text-1); text-align: left;
}
.icp .icp-item-sw { position: relative; width: 28px; height: 28px; border-radius: 7px; overflow: hidden; flex-shrink: 0; background-size: 8px 8px; background-position: 0 0, 0 4px, 4px -4px, -4px 0; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.15); }
.icp .icp-item-sw > span { position: absolute; inset: 0; }
.icp .icp-item-hex { font: 700 0.78rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icp .icp-item-copy,
.icp .icp-item-del {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
    border: none; border-radius: 7px; background: none; color: var(--icp-muted); cursor: pointer;
}
.icp .icp-item svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icp .icp-item-copy:hover { color: var(--icp-accent-strong); background: var(--icp-card); }
.icp .icp-item-del:hover { color: var(--icp-red); background: rgba(230, 78, 78, 0.1); }
.icp .icp-empty { margin: 0; font-size: 0.84rem; line-height: 1.55; color: var(--icp-muted); }

/* ---------- collapsed option rows ---------- */
.icp .icp-adv-options { padding: 0; overflow: hidden; }
.icp .icp-adv-row + .icp-adv-row { border-top: 1px solid var(--icp-line); }
.icp .icp-adv-head {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    width: 100%; min-height: 52px; padding: 0.55rem 1rem; border: none; background: none;
    cursor: pointer; text-align: left; color: var(--icp-text-1); box-sizing: border-box;
}
.icp .icp-adv-head-static { cursor: default; }
.icp .icp-adv-head:hover:not(.icp-adv-head-static) { background: var(--icp-open); }
.icp .icp-adv-left { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.icp .icp-adv-left > svg { width: 18px; height: 18px; color: var(--icp-accent); flex-shrink: 0; }
.icp .icp-adv-text { display: flex; flex-direction: column; min-width: 0; }
.icp .icp-adv-title { font-size: 0.9rem; font-weight: 700; color: var(--icp-text-1); }
.icp .icp-adv-hint { font-size: 0.76rem; color: var(--icp-muted); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; }
.icp .icp-adv-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.icp .icp-chevron { width: 17px; height: 17px; color: var(--icp-muted); transition: transform .2s; }
.icp .icp-adv-row.open .icp-chevron { transform: rotate(180deg); }
.icp .icp-adv-row.open .icp-adv-head,
.icp .icp-adv-row.open .icp-adv-body { background: var(--icp-open); }
.icp .icp-adv-body { padding: 0.2rem 1rem 1rem; }

/* switch - must beat .tool-container input[type="checkbox"] in custom_styles.css */
.icp .icp-switch-wrap { display: inline-flex; align-items: center; gap: 0.45rem; flex-shrink: 0; cursor: pointer; }
.icp .icp-switch-wrap em { font-style: normal; font-size: 0.72rem; font-weight: 800; color: var(--icp-muted); min-width: 26px; letter-spacing: 0.04em; }
.icp .icp-switch-wrap input:checked + em { color: var(--icp-accent-strong); }
input[type="checkbox"].icp-switch,
.tool-container input[type="checkbox"].icp-switch {
    -webkit-appearance: none !important; appearance: none !important;
    position: relative !important; display: inline-block !important;
    width: 40px !important; min-width: 40px !important; max-width: 40px !important; height: 22px !important;
    margin: 0 !important; padding: 0 !important; border: none !important; border-radius: 999px !important;
    background: #cbd5e1 !important; background-color: #cbd5e1 !important; box-shadow: none !important;
    cursor: pointer !important; transition: background-color .2s !important; flex-shrink: 0; vertical-align: middle;
}
[data-theme="dark"] input[type="checkbox"].icp-switch,
[data-theme="dark"] .tool-container input[type="checkbox"].icp-switch { background: #475569 !important; background-color: #475569 !important; }
input[type="checkbox"].icp-switch::after,
.tool-container input[type="checkbox"].icp-switch::after,
.tool-container input[type="checkbox"].icp-switch:checked::after {
    content: '' !important; font-size: 0 !important; position: absolute !important;
    top: 3px !important; left: 3px !important; right: auto !important; bottom: auto !important;
    width: 16px !important; height: 16px !important; border-radius: 50% !important;
    background: #fff !important; box-shadow: 0 1px 2px rgba(0,0,0,.3) !important;
    transform: none !important; transition: transform .2s !important; display: block !important;
}
input[type="checkbox"].icp-switch:checked,
.tool-container input[type="checkbox"].icp-switch:checked { background: var(--icp-go, #237a9f) !important; background-color: var(--icp-go, #237a9f) !important; }
input[type="checkbox"].icp-switch:checked::after,
.tool-container input[type="checkbox"].icp-switch:checked::after { transform: translateX(18px) !important; }
input[type="checkbox"].icp-switch:focus-visible,
.tool-container input[type="checkbox"].icp-switch:focus-visible { outline: 2px solid var(--icp-accent) !important; outline-offset: 2px !important; }

/* ---------- export ---------- */
.icp .icp-export { margin-top: 1.1rem; }
.icp .icp-export-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.icp .icp-src { min-width: 260px; }
.icp .icp-tabs {
    display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; margin-bottom: 0.6rem;
    background: var(--icp-sunk); border: 1px solid var(--icp-line); width: fit-content; max-width: 100%; box-sizing: border-box;
}
.icp .icp-tabs button {
    padding: 0.3rem 0.75rem; border: 1px solid transparent; border-radius: 7px; background: none; cursor: pointer;
    color: var(--icp-text-2); font-size: 0.82rem; font-weight: 700; white-space: nowrap;
}
.icp .icp-tabs button.active { background: var(--icp-card); color: var(--icp-accent-strong); border-color: var(--icp-line); }
.icp .icp-code {
    margin: 0; padding: 0.85rem 1rem; border-radius: 11px; max-height: 260px; overflow: auto;
    background: #0f172a; color: #e2e8f0; border: 1px solid #1e293b;
    font: 0.82rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap; word-break: break-word;
}
.icp .icp-code code { font: inherit; color: inherit; background: none; padding: 0; }
.icp .icp-png {
    display: flex; justify-content: center; padding: 0.75rem; border-radius: 11px; max-height: 320px; overflow: auto;
    background: var(--icp-sunk); border: 1px solid var(--icp-line);
}
.icp .icp-png img { display: block; max-width: 100%; height: auto; border-radius: 6px; box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12); }
.icp .icp-export-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 0.85rem; }
.icp .icp-summary { display: flex; flex-direction: column; min-width: 0; }
.icp .icp-summary strong { font-size: 0.95rem; color: var(--icp-text-1); font-variant-numeric: tabular-nums; }
.icp .icp-summary span { font-size: 0.8rem; color: var(--icp-muted); font-variant-numeric: tabular-nums; }
.icp .icp-export-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.icp .icp-go { min-width: 170px; }

/* ---------- toast ---------- */
.icp .icp-toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 9500; transform: translate(-50%, 16px);
    padding: 0.7rem 1.1rem; border-radius: 12px; background: #0f172a; color: #f8fafc;
    font-size: 0.88rem; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 32px);
}
.icp .icp-toast.show { opacity: 1; transform: translate(-50%, 0); }
[data-theme="dark"] .icp .icp-toast { background: #f8fafc; color: #0f172a; }

/* ---------- content ---------- */
.icp .related-tools { margin-top: 2rem; }
.icp .icp-info { display: grid; gap: 1.5rem; margin-top: 2rem; }
.icp .icp-info > * { min-width: 0; }
.icp .icp-info .info-card {
    background: var(--icp-card); border: 1px solid var(--icp-line); border-radius: 16px;
    padding: 1.6rem 1.75rem; box-shadow: none;
}
.icp .icp-info .info-card h2 { font-size: 1.3rem; margin: 0 0 1rem; }
.icp .icp-info .info-card h2 svg { color: var(--icp-accent); width: 22px; height: 22px; }
.icp .icp-info p { margin: 0.75rem 0 0; line-height: 1.7; color: var(--icp-text-2); }
.icp .icp-list-info strong { color: var(--icp-text-1); }
.icp .icp-list-info { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; line-height: 1.65; color: var(--icp-text-2); }
.icp .icp-table-wrap { overflow-x: auto; border: 1px solid var(--icp-line); border-radius: 12px; margin-top: 0.9rem; }
.icp .icp-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.icp .icp-table th,
.icp .icp-table td { padding: 0.6rem 0.85rem; text-align: left; border-bottom: 1px solid var(--icp-line); color: var(--icp-text-2); }
.icp .icp-table th { background: var(--icp-open); color: var(--icp-text-1); font-weight: 700; }
.icp .icp-table tr:last-child td { border-bottom: none; }
.icp .icp-table code { font-size: 0.85em; padding: 0.05rem 0.3rem; border-radius: 4px; background: var(--icp-sunk); white-space: nowrap; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    /* one column: image, then the picked color right under it, then the rest */
    .icp .icp-layout { display: flex; flex-direction: column; align-items: stretch; gap: 0.875rem; }
    .icp .icp-col-view,
    .icp .icp-col-side { display: contents; }
    .icp .icp-col-view > * + *,
    .icp .icp-col-side > * + * { margin-top: 0; }
    .icp .icp-view-card { order: 1; }
    .icp .icp-current { order: 2; }
    .icp .icp-list-card { order: 3; }
    .icp .icp-palette-card { order: 4; }
    .icp .icp-adv-options { order: 5; }
}
@media (max-width: 600px) {
    .icp.tool-container { padding: 1rem 0.75rem; }
    .icp .tool-title { font-size: 1.6rem; }
    .icp .icp-title-icon { width: 46px; height: 46px; border-radius: 13px; }
    .icp .icp-title-icon svg { width: 24px; height: 24px; }
    .icp .icp-main { padding: 0.75rem; border-radius: 16px; }
    .icp .icp-card { padding: 0.85rem; }
    .icp .icp-view-card { padding: 0.5rem; }
    .icp .icp-drop { min-height: 240px; }
    .icp .icp-view-tools { flex-direction: column; align-items: stretch; }
    .icp .icp-zoom { justify-content: space-between; }
    .icp .icp-src { min-width: 0; width: 100%; }
    .icp .icp-export-bar { flex-direction: column; align-items: stretch; }
    .icp .icp-export-btns { display: grid; grid-template-columns: 1fr 1fr; }
    .icp .icp-go { min-width: 0; }
    .icp .icp-info .info-card { padding: 1.2rem; }
    .icp .icp-palette { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
    .icp .icp-table th,
    .icp .icp-table td { padding: 0.5rem 0.55rem; }
    .icp .icp-table code { white-space: normal; word-break: break-word; }
}
@media (max-width: 480px) {
    .icp .icp-list { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .icp * { transition: none !important; animation: none !important; }
}

/* ---------- Swatch export panel (shared CIColorExport formats) ---------- */
.icp .icp-xp { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.icp .icp-xp-groups { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.icp .icp-xp-group { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 8px; align-items: start; min-width: 0; }
.icp .icp-xp-glabel { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--icp-muted); padding-top: 7px; line-height: 1.2; }
.icp .icp-xp-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.icp .icp-xp-chip {
    font: inherit; width: auto; margin: 0; font-size: 0.8rem; font-weight: 600; line-height: 1.3;
    padding: 5px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap;
    border: 1px solid var(--icp-line); background: var(--icp-card); color: var(--icp-text-2);
    transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.icp .icp-xp-chip:hover { border-color: var(--icp-accent-line); color: var(--icp-text-1); }
.icp .icp-xp-chip.active { background: var(--icp-accent-soft); border-color: var(--icp-accent); color: var(--icp-accent-strong); }
.icp .icp-xp-chip:focus-visible { outline: 2px solid var(--icp-accent); outline-offset: 2px; }
.icp .icp-xp-hint { margin: 0; }
@media (max-width: 520px) {
    .icp .icp-xp-group { grid-template-columns: minmax(0, 1fr); gap: 5px; }
    .icp .icp-xp-glabel { padding-top: 0; }
}
.icp .icp-xp-bin { border: 1px dashed var(--icp-line); border-radius: 11px; padding: 0.75rem; background: var(--icp-open); display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.icp .icp-xp-dots { display: flex; flex-wrap: wrap; gap: 4px; }
.icp .icp-xp-dots i { width: 18px; height: 18px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12); }
.icp .icp-xp-bin .icp-hint { margin: 0; }
.icp .icp-xp-next { margin: 0.6rem 0 0; }

/* Shared steps list + FAQ (main CSS) follow the tool accent (2026-10-11) */
.icp.tool-container { --tool-accent: var(--icp-accent, #3399cc); }
