/* ============================================================
   Color Palettes - gallery hub + palette pages (2026-10-05)
   Everything is scoped under .cpg / .cpg-*; 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"].
   ============================================================ */

.cpg {
    --cpg-accent: #3399cc;
    --cpg-accent-strong: #237a9f;
    --cpg-accent-soft: rgba(51, 153, 204, 0.10);
    --cpg-accent-line: rgba(51, 153, 204, 0.45);
    --cpg-go: #237a9f;
    --cpg-go-hover: #1b6183;
    --cpg-card: var(--bg-elevated, #fff);
    --cpg-sunk: var(--card-tertiary, #f1f5f9);
    --cpg-open: var(--card-secondary, #f8fafc);
    --cpg-line: var(--border-color, #e2e8f0);
    --cpg-text-1: var(--text-primary, #1e293b);
    --cpg-text-2: var(--text-secondary, #555);
    --cpg-muted: var(--text-muted, #64748b);
    --cpg-red: #c23b3b;
    --cpg-green: #23744d;
    --cpg-input: var(--input-bg, #fff);
    --cpg-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
[data-theme="dark"] .cpg {
    --cpg-accent: #5bb8e0;
    --cpg-accent-strong: #7cc8ea;
    --cpg-accent-soft: rgba(91, 184, 224, 0.13);
    --cpg-accent-line: rgba(91, 184, 224, 0.5);
    --cpg-go: #3399cc;
    --cpg-go-hover: #5bb8e0;
    --cpg-sunk: #172033;
    --cpg-open: #1a2438;
    --cpg-red: #f87171;
    --cpg-green: #4ade80;
}

.cpg.tool-container { max-width: 1160px; margin: 0 auto; padding: 2rem; }
.cpg [hidden] { display: none !important; }
.cpg button { font: inherit; width: auto; }
.cpg code { font-family: var(--cpg-mono); }

/* ---------- breadcrumb + title ---------- */
.cpg .cpg-crumbs { margin: 0 0 1rem; font-size: 0.82rem; }
.cpg .cpg-crumbs ol { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; margin: 0; padding: 0; justify-content: center; }
.cpg .cpg-crumbs li { color: var(--cpg-muted); }
.cpg .cpg-crumbs li + li::before { content: '/'; margin-right: 0.35rem; color: var(--cpg-line); }
.cpg .cpg-crumbs a { color: var(--cpg-accent-strong); text-decoration: none; }
.cpg .cpg-crumbs a:hover { text-decoration: underline; }
.cpg .tool-header { text-align: center; margin-bottom: 1.75rem; }
.cpg .tool-title-row { display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin-bottom: 0.9rem; }
.cpg .cpg-title-icon {
    width: 56px; height: 56px; border-radius: 16px; background: var(--cpg-accent); color: #fff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
[data-theme="dark"] .cpg-hub .cpg-title-icon { color: #0f172a; }
.cpg .cpg-title-icon svg { width: 30px; height: 30px; display: block; }
.cpg .tool-title { margin: 0; font-size: 2rem; font-weight: 700; color: var(--cpg-accent); line-height: 1.2; }
.cpg .tool-description { max-width: 800px; margin: 0 auto; font-size: 1.05rem; line-height: 1.65; color: var(--cpg-text-2); }
.cpg .tool-description a { color: var(--cpg-accent-strong); font-weight: 500; }

/* ---------- error ---------- */
.cpg .cpg-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(--cpg-text-1);
}
.cpg .cpg-error > svg { width: 20px; height: 20px; color: #e64e4e; flex-shrink: 0; margin-top: 2px; }
.cpg .cpg-error > div { flex: 1; min-width: 0; }
.cpg .cpg-error p { margin: 0; font-size: 0.9rem; line-height: 1.55; color: var(--cpg-text-1); }
.cpg .cpg-error p + p { margin-top: 0.3rem; color: var(--cpg-muted); }
.cpg .cpg-error a { color: var(--cpg-red); font-weight: 600; }

/* ---------- shared bits ---------- */
.cpg .cpg-main {
    background: var(--cpg-card); border: 1px solid var(--cpg-line); border-radius: 22px;
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08)); padding: 1.25rem;
}
.cpg .cpg-card { background: var(--cpg-card); border: 1px solid var(--cpg-line); border-radius: 14px; padding: 1rem 1.1rem; min-width: 0; }
.cpg .cpg-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; }
.cpg .cpg-h { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0 0 0.75rem; font-size: 0.95rem; font-weight: 700; color: var(--cpg-text-1); }
.cpg .cpg-card-head .cpg-h { margin: 0; }
.cpg .cpg-h svg { width: 17px; height: 17px; color: var(--cpg-accent); }
.cpg .cpg-chip,
.cpg .cpg-adv-value {
    display: inline-flex; align-items: center; padding: 0.12rem 0.5rem; border-radius: 999px;
    background: var(--cpg-accent-soft); color: var(--cpg-accent-strong);
    font-size: 0.75rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.cpg .cpg-hint { margin: 0.6rem 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--cpg-muted); }
.cpg .cpg-hint code { font-size: 0.74rem; color: var(--cpg-text-2); }
.cpg .cpg-next { margin: 0.6rem 0 0; font-size: 0.82rem; line-height: 1.55; color: var(--cpg-text-2); }
.cpg .cpg-next a, .cpg .cpg-info a, .cpg .cpg-empty a { color: var(--cpg-accent-strong); font-weight: 600; }
.cpg .cpg-caption { display: block; margin: 1.1rem 0 0.5rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cpg-muted); }
.cpg .cpg-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(--cpg-accent-strong); font-size: 0.85rem; font-weight: 600; cursor: pointer; flex-shrink: 0; text-decoration: none;
}
.cpg .cpg-text-btn:hover { background: var(--cpg-accent-soft); }
.cpg .cpg-text-btn svg { width: 15px; height: 15px; }
.cpg .cpg-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border-radius: 9px;
    border: 1px solid var(--cpg-line); background: var(--cpg-card); color: var(--cpg-text-2); cursor: pointer; flex-shrink: 0;
    transition: border-color .15s, color .15s, background .15s;
}
.cpg .cpg-icon-btn svg { width: 16px; height: 16px; }
.cpg .cpg-icon-btn:hover { border-color: var(--cpg-accent-line); color: var(--cpg-accent-strong); }
.cpg .cpg-error-close { width: 28px; height: 28px; border: none; background: none; }

.cpg .cpg-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;
}
.cpg .cpg-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.cpg .cpg-btn-sm { min-height: 34px; padding: 0.35rem 0.75rem; font-size: 0.84rem; border-radius: 9px; }
.cpg .cpg-btn-sm svg { width: 15px; height: 15px; }
.cpg .cpg-go { background: var(--cpg-go); color: #fff; }
.cpg .cpg-go:hover:not(:disabled) { background: var(--cpg-go-hover); color: #fff; }
[data-theme="dark"] .cpg .cpg-go, [data-theme="dark"] .cpg .cpg-go:hover:not(:disabled) { color: #0b1220; }
.cpg .cpg-go:disabled { opacity: 0.55; cursor: progress; }
.cpg .cpg-btn-secondary { background: var(--cpg-card); color: var(--cpg-text-1); border-color: var(--cpg-line); }
.cpg .cpg-btn-secondary:hover { border-color: var(--cpg-accent-line); color: var(--cpg-accent-strong); }
.cpg .cpg-btn-ghost { background: none; color: var(--cpg-text-2); border-color: var(--cpg-line); }
.cpg .cpg-btn-ghost:hover { color: var(--cpg-accent-strong); border-color: var(--cpg-accent-line); background: var(--cpg-accent-soft); }

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

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

/* switch - must beat .tool-container input[type="checkbox"] in custom_styles.css */
.cpg .cpg-switch-wrap { display: inline-flex; align-items: center; gap: 0.45rem; flex-shrink: 0; cursor: pointer; }
.cpg .cpg-switch-wrap em { font-style: normal; font-size: 0.72rem; font-weight: 800; color: var(--cpg-muted); min-width: 26px; letter-spacing: 0.04em; }
.cpg .cpg-switch-wrap input:checked + em { color: var(--cpg-accent-strong); }
input[type="checkbox"].cpg-switch,
.tool-container input[type="checkbox"].cpg-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"].cpg-switch,
[data-theme="dark"] .tool-container input[type="checkbox"].cpg-switch { background: #475569 !important; background-color: #475569 !important; }
input[type="checkbox"].cpg-switch::after,
.tool-container input[type="checkbox"].cpg-switch::after,
.tool-container input[type="checkbox"].cpg-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"].cpg-switch:checked,
.tool-container input[type="checkbox"].cpg-switch:checked { background: var(--cpg-go, #237a9f) !important; background-color: var(--cpg-go, #237a9f) !important; }
input[type="checkbox"].cpg-switch:checked::after,
.tool-container input[type="checkbox"].cpg-switch:checked::after { transform: translateX(18px) !important; }
input[type="checkbox"].cpg-switch:focus-visible,
.tool-container input[type="checkbox"].cpg-switch:focus-visible { outline: 2px solid var(--cpg-accent) !important; outline-offset: 2px !important; }

/* ---------- hub: filters ---------- */
.cpg .cpg-filter-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem; }
.cpg .cpg-search {
    display: flex; align-items: center; gap: 0.5rem; height: 44px; padding: 0 0.85rem; border-radius: 12px;
    border: 1px solid var(--cpg-line); background: var(--cpg-input); color: var(--cpg-muted); min-width: 0; box-sizing: border-box;
}
.cpg .cpg-search:focus-within { border-color: var(--cpg-accent); box-shadow: 0 0 0 3px var(--cpg-accent-soft); }
.cpg .cpg-search svg { width: 18px; height: 18px; flex-shrink: 0; }
.cpg .cpg-search input {
    flex: 1; min-width: 0; width: 100%; height: 100%; border: none; background: none; padding: 0; margin: 0; box-shadow: none;
    color: var(--cpg-text-1); font: 500 0.95rem/1 inherit;
}
.cpg .cpg-search input:focus { outline: none; }
.cpg .cpg-tagbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0.85rem 0; }
.cpg .cpg-tag {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.35rem 0.75rem; border-radius: 999px;
    border: 1px solid var(--cpg-line); background: var(--cpg-card); color: var(--cpg-text-2); font-size: 0.84rem; font-weight: 600; cursor: pointer;
}
.cpg .cpg-tag small { font-size: 0.7rem; color: var(--cpg-muted); font-weight: 700; }
.cpg .cpg-tag:hover { border-color: var(--cpg-accent-line); color: var(--cpg-accent-strong); }
.cpg .cpg-tag.active { background: var(--cpg-go); border-color: var(--cpg-go); color: #fff; }
.cpg .cpg-tag.active small { color: rgba(255, 255, 255, 0.8); }
[data-theme="dark"] .cpg .cpg-tag.active { color: #0b1220; }
[data-theme="dark"] .cpg .cpg-tag.active small { color: rgba(11, 18, 32, 0.7); }
.cpg .cpg-hues { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 0.2rem; }
.cpg .cpg-hue {
    display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.4rem 0.55rem; border-radius: 9px; min-width: 0;
    border: 1px solid var(--cpg-line); background: var(--cpg-card); color: var(--cpg-text-2); font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.cpg .cpg-hue:hover { border-color: var(--cpg-accent-line); }
.cpg .cpg-hue.active { border-color: var(--cpg-accent); background: var(--cpg-accent-soft); color: var(--cpg-accent-strong); }
.cpg .cpg-hue-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.15); }
.cpg .cpg-hue-any { background: conic-gradient(#e63946, #f9c74f, #43aa8b, #3a86ff, #7b2cbf, #ff6fa5, #e63946); }
.cpg .cpg-result-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 1rem 0 0.75rem; min-height: 34px; }
.cpg .cpg-count { margin: 0; font-size: 0.88rem; font-weight: 600; color: var(--cpg-text-2); }

/* ---------- hub: cards ---------- */
.cpg .cpg-grid { display: grid; gap: 0.9rem; }
.cpg .cpg-grid-hub { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cpg .cpg-hcard {
    display: flex; flex-direction: column; border: 1px solid var(--cpg-line); border-radius: 14px; overflow: hidden;
    background: var(--cpg-card); min-width: 0; transition: box-shadow .15s, transform .15s;
}
.cpg .cpg-hcard:hover { box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10); transform: translateY(-2px); }
.cpg .cpg-hstrip { display: flex; height: 92px; }
.cpg .cpg-hstrip button {
    flex: 1 1 0; min-width: 0; border: none; border-radius: 0; padding: 0 0 0.45rem; margin: 0; cursor: copy;
    display: flex; align-items: flex-end; justify-content: center; transition: flex-grow .2s;
}
.cpg .cpg-hstrip button span {
    font: 700 0.62rem/1 var(--cpg-mono); letter-spacing: 0.02em; opacity: 0; transition: opacity .15s;
    white-space: nowrap; overflow: hidden;
}
.cpg .cpg-hstrip:hover button:hover { flex-grow: 2.2; }
.cpg .cpg-hstrip button:hover span, .cpg .cpg-hstrip button:focus-visible span { opacity: 1; }
.cpg .cpg-hstrip button:focus-visible { outline: 2px solid var(--cpg-accent); outline-offset: -2px; }
.cpg .cpg-hcard-body { display: flex; flex-direction: column; flex: 1; padding: 0.75rem 0.85rem 0.7rem; min-width: 0; }
.cpg .cpg-hcard-body h3 { margin: 0; font-size: 0.98rem; line-height: 1.3; }
.cpg .cpg-hcard-body h3 a { color: var(--cpg-text-1); text-decoration: none; }
.cpg .cpg-hcard-body h3 a::after { content: ''; }
.cpg .cpg-hcard-body h3 a:hover { color: var(--cpg-accent-strong); }
.cpg .cpg-hcard-body p { margin: 0.3rem 0 0; font-size: 0.8rem; line-height: 1.45; color: var(--cpg-muted); flex: 1; }
.cpg .cpg-hcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.6rem; }
.cpg .cpg-hcard-tags { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.cpg .cpg-hcard-tags span {
    padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--cpg-sunk); color: var(--cpg-text-2);
    font-size: 0.68rem; font-weight: 700;
}
.cpg .cpg-hcopy { width: 32px; height: 32px; }
.cpg .cpg-hcard.is-variant .cpg-hcard-body h3 a { color: var(--cpg-text-2); }
.cpg .cpg-empty { display: flex; align-items: flex-start; gap: 0.7rem; padding: 1.5rem; border: 1px dashed var(--cpg-line); border-radius: 14px; color: var(--cpg-text-2); }
.cpg .cpg-empty svg { width: 22px; height: 22px; color: var(--cpg-accent); flex-shrink: 0; }
.cpg .cpg-empty p { margin: 0; line-height: 1.6; }

/* ---------- palette page: tabs + hero ---------- */
.cpg .cpg-vtabs { margin-bottom: 1rem; }
.cpg .cpg-vtabs button { flex-direction: column; align-items: stretch; gap: 0.35rem; padding: 0.45rem 0.55rem; min-height: 54px; }
.cpg .cpg-tab-strip { display: flex; height: 10px; border-radius: 999px; overflow: hidden; }
.cpg .cpg-tab-strip span { flex: 1; }
.cpg .cpg-tab-name { font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.cpg .cpg-tab-name b { color: var(--cpg-muted); margin-right: 0.15rem; }
.cpg .cpg-vtitle { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 0.75rem; font-size: 1.15rem; color: var(--cpg-text-1); }
.cpg .cpg-hero { display: grid; grid-template-columns: repeat(var(--cpg-n, 5), minmax(0, 1fr)); height: 260px; border-radius: 16px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08); }
.cpg .cpg-hero-sw {
    position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 0.2rem;
    min-width: 0; padding: 0.9rem 0.8rem; border: none; border-radius: 0; margin: 0; cursor: copy; text-align: left;
}
.cpg .cpg-hero-sw:focus-visible { outline: 3px solid var(--cpg-accent); outline-offset: -3px; }
.cpg .cpg-hero-name { font-size: 0.86rem; font-weight: 700; line-height: 1.25; max-width: 100%; overflow-wrap: anywhere; }
.cpg .cpg-hero-hex { font: 600 0.8rem/1 var(--cpg-mono); opacity: 0.85; }
.cpg .cpg-hero-copy { position: absolute; top: 0.7rem; right: 0.7rem; width: 16px; height: 16px; opacity: 0; transition: opacity .15s; }
.cpg .cpg-hero-sw:hover .cpg-hero-copy, .cpg .cpg-hero-sw:focus-visible .cpg-hero-copy { opacity: 0.9; }
.cpg .cpg-hero-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.8rem 0 1.1rem; }
.cpg .cpg-random { margin-left: auto; }

/* colour cards */
.cpg .cpg-cards { display: grid; grid-template-columns: repeat(var(--cpg-cols, 5), minmax(0, 1fr)); gap: 0.7rem; }
.cpg .cpg-ccard { border: 1px solid var(--cpg-line); border-radius: 13px; overflow: hidden; background: var(--cpg-card); min-width: 0; display: flex; flex-direction: column; }
.cpg .cpg-ccard-sw { height: 70px; display: flex; align-items: flex-end; padding: 0.55rem 0.7rem; }
.cpg .cpg-ccard-sw h3 { margin: 0; font-size: 0.88rem; font-weight: 700; color: inherit; line-height: 1.25; }
.cpg .cpg-codes { margin: 0; padding: 0.45rem 0.55rem 0.2rem; display: grid; gap: 1px; }
.cpg .cpg-codes > div { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 0.3rem; }
.cpg .cpg-codes dt { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.05em; color: var(--cpg-muted); }
.cpg .cpg-codes dd { display: flex; align-items: center; justify-content: space-between; gap: 0.2rem; margin: 0; min-width: 0; }
.cpg .cpg-codes code { font-size: 0.74rem; color: var(--cpg-text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; background: none; padding: 0; }
.cpg .cpg-copy {
    display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; flex-shrink: 0;
    border: none; border-radius: 7px; background: none; color: var(--cpg-muted); cursor: pointer;
}
.cpg .cpg-copy svg { width: 14px; height: 14px; }
.cpg .cpg-copy:hover { background: var(--cpg-accent-soft); color: var(--cpg-accent-strong); }
.cpg .cpg-ccard-links { margin: auto 0 0; padding: 0.35rem 0.7rem 0.6rem; font-size: 0.74rem; color: var(--cpg-muted); }
.cpg .cpg-ccard-links a { color: var(--cpg-accent-strong); font-weight: 600; text-decoration: none; }
.cpg .cpg-ccard-links a:hover { text-decoration: underline; }

/* mockups + contrast + gradient */
.cpg .cpg-duo { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0.9rem; margin-top: 1rem; align-items: start; }
.cpg .cpg-stack { display: grid; gap: 0.9rem; min-width: 0; }
.cpg .cpg-mock { display: grid; gap: 0.6rem; }
.cpg .cpg-mock-site, .cpg .cpg-mock-card, .cpg .cpg-mock-chart {
    background: var(--m-bg); color: var(--m-text); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--m-line); overflow: hidden;
}
.cpg .cpg-mock-nav { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--m-line); font-size: 0.7rem; font-weight: 600; }
.cpg .cpg-mock-logo { width: 18px; height: 18px; border-radius: 6px; background: var(--m-primary); margin-right: auto; }
.cpg .cpg-mock-link { color: var(--m-muted); }
.cpg .cpg-mock-pill { padding: 0.2rem 0.55rem; border-radius: 999px; background: var(--m-accent); color: var(--m-bg); font-size: 0.66rem; }
.cpg .cpg-mock-hero { display: flex; flex-direction: column; gap: 0.35rem; padding: 1rem 0.9rem 0.8rem; }
.cpg .cpg-mock-kicker { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--m-primary); }
.cpg .cpg-mock-h { font-size: 1.15rem; font-weight: 800; line-height: 1.2; color: var(--m-text); }
.cpg .cpg-mock-p { font-size: 0.74rem; line-height: 1.5; color: var(--m-muted); max-width: 34ch; }
.cpg .cpg-mock-btns { display: flex; gap: 0.4rem; margin-top: 0.25rem; }
.cpg .cpg-mock-btn { display: inline-block; padding: 0.35rem 0.75rem; border-radius: 8px; background: var(--m-primary); color: var(--m-on); font-size: 0.7rem; font-weight: 700; }
.cpg .cpg-mock-btn2 { display: inline-block; padding: 0.3rem 0.7rem; border-radius: 8px; border: 1.5px solid var(--m-text); color: var(--m-text); font-size: 0.7rem; font-weight: 700; }
.cpg .cpg-mock-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; padding: 0 0.9rem 0.9rem; }
.cpg .cpg-mock-tile { display: grid; gap: 4px; padding: 0.4rem; border-radius: 8px; background: var(--m-surface); box-shadow: inset 0 0 0 1px var(--m-line); }
.cpg .cpg-mock-tile span { height: 26px; border-radius: 5px; }
.cpg .cpg-mock-tile i { height: 4px; border-radius: 4px; background: var(--m-text); opacity: 0.55; }
.cpg .cpg-mock-tile i + i { width: 60%; opacity: 0.3; }
.cpg .cpg-mock-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 0.6rem; }
.cpg .cpg-mock-card { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding-bottom: 0.7rem; }
.cpg .cpg-mock-card-top { align-self: stretch; height: 38px; }
.cpg .cpg-mock-avatar { width: 34px; height: 34px; border-radius: 50%; margin-top: -17px; background: var(--m-accent); box-shadow: 0 0 0 3px var(--m-bg); }
.cpg .cpg-mock-card-h { font-size: 0.78rem; font-weight: 800; margin-top: 0.15rem; }
.cpg .cpg-mock-card-p { font-size: 0.66rem; color: var(--m-muted); margin-bottom: 0.25rem; }
.cpg .cpg-mock-chart { display: flex; align-items: flex-end; gap: 6px; padding: 0.7rem 0.7rem 0; height: 128px; box-sizing: border-box; border-bottom: 3px solid var(--m-surface); }
.cpg .cpg-mock-chart span { flex: 1; border-radius: 5px 5px 0 0; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.12); }

.cpg .cpg-pairs { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.cpg .cpg-pairs a {
    display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: 0.55rem; padding: 4px 6px 4px 4px;
    border-radius: 10px; text-decoration: none; color: var(--cpg-text-2); font-size: 0.8rem;
}
.cpg .cpg-pairs a:hover { background: var(--cpg-accent-soft); }
.cpg .cpg-pair-sample { display: flex; align-items: center; justify-content: center; height: 32px; border-radius: 8px; font-weight: 800; font-size: 0.9rem; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08); }
.cpg .cpg-pair-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpg .cpg-pair-text strong { color: var(--cpg-text-1); }
.cpg .cpg-pair-ratio { font: 700 0.76rem/1 var(--cpg-mono); color: var(--cpg-text-1); }
.cpg .cpg-badge { padding: 0.12rem 0.4rem; border-radius: 6px; font-size: 0.66rem; font-weight: 800; white-space: nowrap; }
.cpg .cpg-badge-aaa { background: rgba(51, 153, 102, 0.16); color: var(--cpg-green); }
.cpg .cpg-badge-aa { background: var(--cpg-accent-soft); color: var(--cpg-accent-strong); }
.cpg .cpg-badge-large { background: var(--cpg-sunk); color: var(--cpg-muted); }
.cpg .cpg-grad { height: 64px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08); }
.cpg .cpg-code {
    margin: 0.6rem 0 0; padding: 0.7rem 0.85rem; border-radius: 10px; background: #0f172a; color: #e2e8f0; border: 1px solid #1e293b;
    font: 0.74rem/1.55 var(--cpg-mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 120px; overflow: auto;
}
.cpg .cpg-code code { background: none; color: inherit; padding: 0; font: inherit; }

.cpg .cpg-openin { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 1rem; padding: 0.8rem 0.9rem; border-radius: 14px; background: var(--cpg-open); border: 1px solid var(--cpg-line); }
.cpg .cpg-openin-label { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; font-weight: 700; color: var(--cpg-text-1); margin-right: 0.3rem; }
.cpg .cpg-openin-label svg { width: 15px; height: 15px; color: var(--cpg-accent); }
.cpg .cpg-openin-link {
    display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.7rem; border-radius: 999px; border: 1px solid var(--cpg-line);
    background: var(--cpg-card); color: var(--cpg-text-2); font-size: 0.8rem; font-weight: 600; text-decoration: none;
}
.cpg .cpg-openin-link svg { width: 14px; height: 14px; color: var(--cpg-accent); }
.cpg .cpg-openin-link:hover { border-color: var(--cpg-accent-line); color: var(--cpg-accent-strong); }

/* export */
.cpg .cpg-export { margin-top: 1.2rem; }
.cpg .cpg-formats { display: grid; gap: 0.6rem; }
.cpg .cpg-fgroup-label { display: block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cpg-muted); margin-bottom: 0.35rem; }
.cpg .cpg-fgroup-btns { display: flex; flex-wrap: wrap; gap: 5px; }
.cpg .cpg-fchip {
    padding: 0.35rem 0.7rem; border-radius: 999px; border: 1px solid var(--cpg-line); background: var(--cpg-card);
    color: var(--cpg-text-2); font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.cpg .cpg-fchip:hover { border-color: var(--cpg-accent-line); color: var(--cpg-accent-strong); }
.cpg .cpg-fchip.active { border-color: var(--cpg-accent); background: var(--cpg-accent-soft); color: var(--cpg-accent-strong); }
.cpg .cpg-share { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.2rem; }
.cpg .cpg-share-link {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.85rem; border-radius: 10px; border: 1px solid var(--cpg-line);
    background: var(--cpg-card); color: var(--cpg-text-1); font-size: 0.84rem; font-weight: 600; text-decoration: none; cursor: pointer;
}
.cpg .cpg-share-link svg { width: 15px; height: 15px; color: var(--cpg-accent); }
.cpg .cpg-share-link:hover { border-color: var(--cpg-accent-line); color: var(--cpg-accent-strong); }
.cpg .cpg-actionbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--cpg-line); }
.cpg .cpg-summary { display: flex; flex-direction: column; min-width: 0; }
.cpg .cpg-summary strong { font-size: 0.95rem; color: var(--cpg-text-1); }
.cpg .cpg-summary span { font-size: 0.8rem; color: var(--cpg-muted); font-variant-numeric: tabular-nums; }
.cpg .cpg-actionbar-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cpg .cpg-actionbar .cpg-go { min-width: 170px; }

/* overview, related palettes */
.cpg .cpg-overview, .cpg .cpg-related-pal { margin-top: 2rem; }
.cpg .cpg-overview h2, .cpg .cpg-sec-head h2 { display: flex; align-items: center; gap: 0.5rem; font-size: 1.3rem; margin: 0 0 1rem; color: var(--cpg-text-1); }
.cpg .cpg-overview h2 svg, .cpg .cpg-sec-head h2 svg { width: 22px; height: 22px; color: var(--cpg-accent); }
.cpg .cpg-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cpg .cpg-sec-head h2 { margin: 0; }
.cpg .cpg-ov-list { display: grid; gap: 0.7rem; }
.cpg .cpg-ov { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1rem; align-items: center; padding: 0.7rem; border: 1px solid var(--cpg-line); border-radius: 14px; background: var(--cpg-card); }
.cpg .cpg-ov-strip { display: flex; height: 56px; border-radius: 10px; overflow: hidden; }
.cpg .cpg-ov-strip span { flex: 1; }
.cpg .cpg-ov-body { min-width: 0; }
.cpg .cpg-ov h3 { margin: 0; font-size: 0.98rem; color: var(--cpg-text-1); }
.cpg .cpg-ov-codes { margin: 0.25rem 0 0; font-size: 0.8rem; line-height: 1.6; color: var(--cpg-text-2); }
.cpg .cpg-ov-codes span { white-space: nowrap; }
.cpg .cpg-ov-codes code { font-size: 0.76rem; color: var(--cpg-muted); background: none; padding: 0; }
.cpg .cpg-grid-rel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cpg .cpg-pcard {
    display: flex; flex-direction: column; border: 1px solid var(--cpg-line); border-radius: 14px; overflow: hidden; background: var(--cpg-card);
    text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; min-width: 0;
}
.cpg .cpg-pcard:hover { box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10); transform: translateY(-2px); }
.cpg .cpg-strip { display: flex; height: 64px; }
.cpg .cpg-strip span { flex: 1; }
.cpg .cpg-pcard-body { display: flex; flex-direction: column; padding: 0.65rem 0.8rem; }
.cpg .cpg-pcard-body strong { font-size: 0.92rem; color: var(--cpg-text-1); }
.cpg .cpg-pcard-body small { font-size: 0.76rem; color: var(--cpg-muted); }

/* ---------- toast ---------- */
.cpg .cpg-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);
}
.cpg .cpg-toast.show { opacity: 1; transform: translate(-50%, 0); }
[data-theme="dark"] .cpg .cpg-toast { background: #f8fafc; color: #0f172a; }

/* ---------- content ---------- */
.cpg .related-tools { margin-top: 2rem; }
.cpg .cpg-info { display: grid; gap: 1.5rem; margin-top: 2rem; }
.cpg .cpg-info .info-card { background: var(--cpg-card); border: 1px solid var(--cpg-line); border-radius: 16px; padding: 1.6rem 1.75rem; box-shadow: none; }
.cpg .cpg-info .info-card h2 { font-size: 1.3rem; margin: 0 0 1rem; }
.cpg .cpg-info .info-card h2 svg { color: var(--cpg-accent); width: 22px; height: 22px; }
.cpg .cpg-info .info-card h3 { font-size: 1rem; margin: 1.1rem 0 0; color: var(--cpg-text-1); }
.cpg .cpg-info .info-card h2 + h3 { margin-top: 0; }
.cpg .cpg-info p { margin: 0.5rem 0 0; line-height: 1.7; color: var(--cpg-text-2); max-width: 800px; }
.cpg .cpg-list { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; line-height: 1.65; color: var(--cpg-text-2); }
.cpg .cpg-list strong { color: var(--cpg-text-1); }
.cpg .cpg-shade-links { display: flex; flex-wrap: wrap; gap: 6px; }
.cpg .cpg-shade-link {
    display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.75rem 0.35rem 0.4rem; border-radius: 999px;
    border: 1px solid var(--cpg-line); background: var(--cpg-card); color: var(--cpg-text-1) !important; font-size: 0.82rem; text-decoration: none;
}
.cpg .cpg-shade-link span { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18); }
.cpg .cpg-shade-link:hover { border-color: var(--cpg-accent-line); }
.cpg .cpg-theme-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.2rem 1.5rem; }
.cpg .cpg-theme-index h3 { margin-top: 0.8rem !important; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .cpg .cpg-duo { grid-template-columns: minmax(0, 1fr); }
    .cpg .cpg-grid-rel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cpg .cpg-hero { height: 220px; }
    .cpg .cpg-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .cpg.tool-container { padding: 1rem 0.75rem; }
    .cpg .tool-title { font-size: 1.55rem; }
    .cpg .cpg-title-icon { width: 46px; height: 46px; border-radius: 13px; }
    .cpg .cpg-title-icon svg { width: 24px; height: 24px; }
    .cpg .cpg-main { padding: 0.75rem; border-radius: 16px; }
    .cpg .cpg-card { padding: 0.85rem; }
    .cpg .cpg-adv-options { padding: 0; }
    .cpg .cpg-filter-top { grid-template-columns: minmax(0, 1fr); }
    .cpg .cpg-grid-hub { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
    .cpg .cpg-hstrip { height: 70px; }
    .cpg .cpg-hcard-body { padding: 0.6rem 0.65rem; }
    .cpg .cpg-hcard-body p { display: none; }
    .cpg .cpg-hcard-tags span:nth-child(n+2) { display: none; }
    .cpg .cpg-vtabs { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); }
    .cpg .cpg-hero { grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(54px, auto); height: auto; }
    .cpg .cpg-hero-sw { flex-direction: row; align-items: center; justify-content: space-between; padding: 0.7rem 2.6rem 0.7rem 0.9rem; }
    .cpg .cpg-hero-copy { top: 50%; margin-top: -8px; opacity: 0.7; }
    .cpg .cpg-random { margin-left: 0; }
    .cpg .cpg-cards { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
    .cpg .cpg-ccard { display: grid; grid-template-columns: 96px minmax(0, 1fr); }
    .cpg .cpg-ccard-sw { height: auto; grid-row: span 2; align-items: flex-end; padding: 0.55rem; }
    .cpg .cpg-ccard-sw h3 { font-size: 0.8rem; overflow-wrap: anywhere; }
    .cpg .cpg-ccard-links { padding-top: 0.2rem; }
    .cpg .cpg-codes > div { grid-template-columns: 34px minmax(0, 1fr); }
    .cpg .cpg-mock-row { grid-template-columns: minmax(0, 1fr); }
    .cpg .cpg-actionbar { flex-direction: column; align-items: stretch; }
    .cpg .cpg-actionbar-btns { display: grid; grid-template-columns: 1fr 1fr; }
    .cpg .cpg-actionbar .cpg-go { grid-column: 1 / -1; order: -1; min-width: 0; }
    .cpg .cpg-ov { grid-template-columns: minmax(0, 1fr); }
    .cpg .cpg-grid-rel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cpg .cpg-theme-index { grid-template-columns: minmax(0, 1fr); }
    .cpg .cpg-info .info-card { padding: 1.2rem; }
    .cpg .cpg-pairs a { grid-template-columns: 36px minmax(0, 1fr) auto; }
    .cpg .cpg-pairs .cpg-badge { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .cpg * { transition: none !important; }
}

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