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

.acg {
    --acg-accent: #339966;
    --acg-accent-strong: #237a52;
    --acg-accent-soft: rgba(51, 153, 102, 0.10);
    --acg-accent-line: rgba(51, 153, 102, 0.45);
    --acg-go: #237a52;
    --acg-go-hover: #1b6141;
    --acg-card: var(--bg-elevated, #fff);
    --acg-sunk: var(--card-tertiary, #f1f5f9);
    --acg-open: var(--card-secondary, #f8fafc);
    --acg-line: var(--border-color, #e2e8f0);
    --acg-text-1: var(--text-primary, #1e293b);
    --acg-text-2: var(--text-secondary, #555);
    --acg-muted: var(--text-muted, #64748b);
    --acg-warn: #b45309;
    --acg-red: #c23b3b;
    --acg-input: var(--input-bg, #fff);
    --acg-pass: #166534;
    --acg-pass-bg: #dcfce7;
    --acg-mid: #92400e;
    --acg-mid-bg: #fef3c7;
    --acg-fail: #991b1b;
    --acg-fail-bg: #fee2e2;
    --acg-cell: 84px;
}
[data-theme="dark"] .acg {
    --acg-accent: #5cc492;
    --acg-accent-strong: #7dd3a8;
    --acg-accent-soft: rgba(92, 196, 146, 0.13);
    --acg-accent-line: rgba(92, 196, 146, 0.5);
    --acg-go: #339966;
    --acg-go-hover: #5cc492;
    --acg-sunk: #172033;
    --acg-open: #1a2438;
    --acg-warn: #fbbf24;
    --acg-red: #f87171;
}

.acg.tool-container { max-width: 1240px; margin: 0 auto; padding: 2rem; }
.acg [hidden] { display: none !important; }
.acg button { font: inherit; width: auto; }
.acg .acg-ico { width: 16px; height: 16px; flex-shrink: 0; display: block; }

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

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

/* ---------- shared bits ---------- */
.acg .acg-card {
    background: var(--acg-card); border: 1px solid var(--acg-line);
    border-radius: 14px; padding: 1rem 1.1rem; min-width: 0;
}
.acg .acg-main > .acg-card + .acg-card,
.acg .acg-col-results > * + *,
.acg .acg-col-side > * + * { margin-top: 0.875rem; }
.acg .acg-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; min-width: 0; }
.acg .acg-h { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--acg-text-1); min-width: 0; }
.acg .acg-h svg { width: 17px; height: 17px; color: var(--acg-accent); flex-shrink: 0; }
.acg .acg-chip,
.acg .acg-adv-value {
    display: inline-flex; align-items: center; padding: 0.12rem 0.5rem; border-radius: 999px;
    background: var(--acg-accent-soft); color: var(--acg-accent-strong);
    font-size: 0.75rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.acg .acg-hint { margin: 0.55rem 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--acg-muted); }
.acg .acg-hint a { color: var(--acg-accent-strong); font-weight: 600; }
.acg .acg-hint-inline { margin: 0; }
.acg .acg-label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--acg-text-1); margin-bottom: 0.4rem; }
.acg .acg-caption {
    display: block; margin: 0.85rem 0 0.4rem;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--acg-muted);
}
.acg .acg-caption:first-child { margin-top: 0.2rem; }
.acg .acg-text-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.4rem 0.6rem; border: none; border-radius: 8px; background: none; text-decoration: none;
    color: var(--acg-accent-strong); font-size: 0.85rem; font-weight: 600; cursor: pointer; flex-shrink: 0;
}
.acg .acg-text-btn:hover { background: var(--acg-accent-soft); }
.acg .acg-text-btn svg { width: 15px; height: 15px; }
.acg .acg-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0; border-radius: 9px;
    border: 1px solid var(--acg-line); background: var(--acg-card); color: var(--acg-text-2);
    cursor: pointer; flex-shrink: 0; transition: border-color .15s, color .15s, background .15s;
}
.acg .acg-icon-btn svg { width: 16px; height: 16px; }
.acg .acg-icon-btn:hover:not(:disabled),
.acg .acg-icon-btn.active { border-color: var(--acg-accent-line); color: var(--acg-accent-strong); }
.acg .acg-icon-btn.active { background: var(--acg-accent-soft); }
.acg .acg-icon-btn:disabled { opacity: 0.4; cursor: not-allowed; background: var(--acg-card); }
.acg .acg-error-close { width: 28px; height: 28px; border: none; background: none; }
.acg .acg-mini-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
    border: none; border-radius: 7px; background: none; color: var(--acg-muted); cursor: pointer; flex-shrink: 0; text-decoration: none;
}
.acg .acg-mini-btn svg { width: 15px; height: 15px; }
.acg .acg-mini-btn:hover:not(:disabled) { background: var(--acg-accent-soft); color: var(--acg-accent-strong); }
.acg .acg-mini-btn.acg-del:hover:not(:disabled) { background: rgba(230, 78, 78, 0.12); color: var(--acg-red); }
.acg .acg-mini-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.acg .acg-input,
.acg .acg-textarea {
    width: 100%; min-width: 0; height: 34px; padding: 0 0.55rem; border-radius: 8px;
    border: 1px solid var(--acg-line); background: var(--acg-input); color: var(--acg-text-1);
    font: 600 0.85rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; box-sizing: border-box; margin: 0;
}
.acg .acg-textarea { height: auto; padding: 0.6rem 0.7rem; line-height: 1.5; font-weight: 500; resize: vertical; min-height: 92px; }
.acg .acg-input:focus,
.acg .acg-textarea:focus { outline: none; border-color: var(--acg-accent); box-shadow: 0 0 0 3px var(--acg-accent-soft); }
.acg .acg-input.is-bad { border-color: #e64e4e; box-shadow: 0 0 0 3px rgba(230, 78, 78, 0.15); }
.acg .acg-textarea::placeholder { color: var(--acg-muted); }

/* segmented */
.acg .acg-seg {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
    padding: 4px; border-radius: 12px; background: var(--acg-sunk); border: 1px solid var(--acg-line);
}
.acg .acg-seg-wrap3 { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.acg .acg-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(--acg-text-2); font-size: 0.85rem; font-weight: 600; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.acg .acg-seg button svg { width: 16px; height: 16px; flex-shrink: 0; }
.acg .acg-seg button:hover:not(.active) { color: var(--acg-text-1); }
.acg .acg-seg button.active {
    background: var(--acg-card); color: var(--acg-accent-strong); border-color: var(--acg-line);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* buttons */
.acg .acg-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;
}
.acg .acg-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.acg .acg-btn-sm { min-height: 32px; padding: 0.3rem 0.7rem; font-size: 0.82rem; border-radius: 9px; }
.acg .acg-btn-sm svg { width: 15px; height: 15px; }
.acg .acg-btn-primary,
.acg .acg-go { background: var(--acg-go); color: #fff; }
.acg .acg-btn-primary:hover,
.acg .acg-go:hover:not(:disabled) { background: var(--acg-go-hover); color: #fff; }
[data-theme="dark"] .acg .acg-btn-primary,
[data-theme="dark"] .acg .acg-go,
[data-theme="dark"] .acg .acg-go:hover:not(:disabled),
[data-theme="dark"] .acg .acg-btn-primary:hover { color: #0b1220; }
.acg .acg-go:disabled,
.acg .acg-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.acg .acg-btn-secondary { background: var(--acg-card); color: var(--acg-text-1); border-color: var(--acg-line); }
.acg .acg-btn-secondary:hover { border-color: var(--acg-accent-line); color: var(--acg-accent-strong); }
.acg .acg-btn-ghost { background: none; color: var(--acg-text-2); border-color: var(--acg-line); }
.acg .acg-btn-ghost:hover:not(:disabled) { color: var(--acg-accent-strong); border-color: var(--acg-accent-line); background: var(--acg-accent-soft); }

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

/* ---------- presets ---------- */
.acg .acg-presets { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.acg .acg-preset {
    display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; padding: 6px; border-radius: 11px;
    border: 1px solid var(--acg-line); background: var(--acg-card); cursor: pointer; text-align: left;
}
.acg .acg-preset:hover,
.acg .acg-preset:focus-visible { border-color: var(--acg-accent-line); outline: none; }
.acg .acg-preset-strip { display: flex; height: 26px; border-radius: 7px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08); }
.acg .acg-preset-strip > span { flex: 1; }
.acg .acg-preset-name { font-size: 0.78rem; font-weight: 700; color: var(--acg-text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- palette ---------- */
.acg .acg-mini-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }
.acg .acg-mini-actions .acg-icon-btn { width: 32px; height: 32px; }
.acg .acg-paste { margin-bottom: 0.85rem; padding: 0.85rem; border-radius: 12px; background: var(--acg-open); border: 1px solid var(--acg-line); }
.acg .acg-paste-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.55rem; flex-wrap: wrap; }
.acg .acg-paste-row .acg-hint { flex: 1 1 220px; min-width: 0; }
.acg .acg-paste-btns { display: flex; gap: 6px; }
.acg .acg-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 8px; }
.acg .acg-chip-card {
    display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: center;
    padding: 6px; border-radius: 12px; border: 1px solid var(--acg-line); background: var(--acg-card); min-width: 0;
}
.acg .acg-chip-card:focus-within { border-color: var(--acg-accent-line); }
.acg .acg-sw {
    position: relative; display: block; width: 44px; height: 62px; border-radius: 9px; overflow: hidden; cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.15);
}
.acg .acg-sw input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: none; padding: 0; }
.acg .acg-chip-fields { display: grid; gap: 4px; min-width: 0; }
.acg .acg-chip-fields .acg-input { height: 30px; font-size: 0.82rem; }
.acg .acg-name {
    width: 100%; min-width: 0; height: 26px; padding: 0 0.4rem; margin: 0; box-sizing: border-box;
    border: 1px solid transparent; border-radius: 7px; background: none; color: var(--acg-text-2);
    font: 600 0.8rem/1 inherit; text-overflow: ellipsis;
}
.acg .acg-name:hover { border-color: var(--acg-line); }
.acg .acg-name:focus { outline: none; border-color: var(--acg-accent); background: var(--acg-input); color: var(--acg-text-1); }
.acg .acg-chip-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 4px; align-self: stretch; }
.acg .acg-chip-acts { display: flex; gap: 0; }
.acg .acg-chip-score {
    padding: 0.1rem 0.4rem; border-radius: 999px; background: var(--acg-pass-bg); color: var(--acg-pass);
    font-size: 0.68rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.acg .acg-chip-score.is-zero { background: var(--acg-fail-bg); color: var(--acg-fail); }
.acg .acg-add-card {
    display: flex; font-family: inherit; align-items: center; justify-content: center; gap: 0.4rem; min-height: 76px; padding: 6px;
    border: 1.5px dashed var(--acg-line); border-radius: 12px; background: none; cursor: pointer;
    color: var(--acg-muted); font-size: 0.88rem; font-weight: 700;
}
.acg .acg-add-card:hover { border-color: var(--acg-accent); color: var(--acg-accent-strong); background: var(--acg-accent-soft); }

/* ---------- score ---------- */
.acg .acg-score-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.acg .acg-score-main { display: flex; flex-direction: column; min-width: 0; }
.acg .acg-score-big { font-size: 1.3rem; font-weight: 800; color: var(--acg-text-1); line-height: 1.25; font-variant-numeric: tabular-nums; }
.acg .acg-score-sub { font-size: 0.8rem; color: var(--acg-muted); margin-top: 0.15rem; }
.acg .acg-score-pct { font-size: 1.3rem; font-weight: 800; color: var(--acg-red); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.acg .acg-score-card.is-good .acg-score-pct { color: var(--acg-accent-strong); }
.acg .acg-meter { height: 8px; border-radius: 999px; background: var(--acg-sunk); margin-top: 0.7rem; overflow: hidden; }
.acg .acg-meter > span { display: block; height: 100%; width: 0; border-radius: 999px; background: #e64e4e; transition: width .3s; }
.acg .acg-score-card.is-good .acg-meter > span { background: var(--acg-accent); }
.acg .acg-score-stats { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-top: 0.7rem; }
.acg .acg-stat { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--acg-text-2); }
.acg .acg-stat b { color: var(--acg-text-1); font-variant-numeric: tabular-nums; }
.acg .acg-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.acg .acg-dot.lv-aaa { background: #15803d; }
.acg .acg-dot.lv-aa { background: #4ade80; }
.acg .acg-dot.lv-large,
.acg .acg-dot.lv-ui { background: #f59e0b; }
.acg .acg-dot.lv-fail { background: #ef4444; }
.acg .acg-cvd-note {
    display: flex; align-items: flex-start; gap: 0.45rem; margin: 0.7rem 0 0; padding: 0.55rem 0.7rem; border-radius: 10px;
    background: var(--acg-accent-soft); font-size: 0.8rem; line-height: 1.45; color: var(--acg-text-1);
}
.acg .acg-cvd-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--acg-accent-strong); }
.acg .acg-cvd-note.is-warn { background: rgba(245, 158, 11, 0.12); }
.acg .acg-cvd-note.is-warn svg { color: var(--acg-warn); }

.acg .acg-view-head { display: flex; }
.acg .acg-view { flex: 1; }
.acg .acg-view button { min-height: 40px; font-size: 0.9rem; }

/* ---------- grid ---------- */
.acg .acg-grid-card { padding: 0.6rem; }
.acg .acg-grid-scroll {
    overflow: auto; max-height: 72vh; border-radius: 10px; outline: none;
    overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
}
.acg .acg-grid { border-collapse: separate; border-spacing: 3px; margin: 0; width: 100%; table-layout: auto; }
.acg .acg-grid th,
.acg .acg-grid td { padding: 0; border: none; background: none; vertical-align: middle; }
.acg .acg-grid thead th {
    position: sticky; top: 0; z-index: 2; background: var(--acg-card); min-width: var(--acg-cell);
    padding: 2px 2px 6px; text-align: left; max-width: 140px;
}
.acg .acg-grid tbody th {
    position: sticky; left: 0; z-index: 2; background: var(--acg-card); width: 112px; min-width: 112px; max-width: 112px; padding-right: 6px;
    box-shadow: 0 -5px 0 var(--acg-card), 0 5px 0 var(--acg-card), 5px 0 0 var(--acg-card);
}
.acg .acg-grid .acg-corner { left: 0; z-index: 4; width: 112px; min-width: 112px; vertical-align: bottom; }
.acg .acg-corner span { display: block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--acg-muted); }
.acg .acg-corner span:first-child::after { content: ' \2193'; }
.acg .acg-corner span:last-child::after { content: ' \2192'; }
.acg .acg-colh,
.acg .acg-rowh { transition: background .12s; }
.acg .acg-colh { border-radius: 9px; }
.acg .acg-colh .acg-hsw { display: block; height: 18px; border-radius: 6px; margin-bottom: 5px; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.15); }
.acg .acg-rowh { display: table-cell; }
.acg .acg-rowh .acg-hsw { float: left; width: 16px; height: 40px; border-radius: 5px; margin-right: 7px; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.15); }
.acg .acg-htxt { display: flex; flex-direction: column; min-width: 0; }
.acg .acg-colh .acg-htxt b { max-width: 120px; }
.acg .acg-htxt b { font-size: 0.76rem; color: var(--acg-text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acg .acg-htxt small { font: 600 0.68rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--acg-muted); white-space: nowrap; }
.acg .acg-added { margin-left: 4px; font: 700 0.6rem/1 inherit; font-style: normal; color: var(--acg-accent-strong); text-transform: uppercase; }
.acg .acg-colh.is-col .acg-htxt b,
.acg .acg-rowh.is-row .acg-htxt b { color: var(--acg-accent-strong); }
.acg .acg-colh.is-col,
.acg .acg-rowh.is-row { background: linear-gradient(var(--acg-accent-soft), var(--acg-accent-soft)) var(--acg-card); }

.acg .acg-cell {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    width: 100%; min-width: var(--acg-cell); height: 70px; padding: 4px; border: none; border-radius: 9px; cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12); transition: opacity .15s, box-shadow .12s, transform .12s;
}
.acg .acg-aa { font-size: 1.3rem; font-weight: 800; line-height: 1; letter-spacing: -0.01em; }
.acg .acg-badge {
    display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px 2px 4px; border-radius: 999px;
    background: var(--acg-pass-bg); color: var(--acg-pass); font-size: 0.66rem; font-weight: 700; line-height: 1.2;
    font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.acg .acg-badge .acg-ico { width: 11px; height: 11px; stroke-width: 3; }
.acg .acg-badge b { font-weight: 800; }
.acg .lv-large .acg-badge,
.acg .lv-ui .acg-badge { background: var(--acg-mid-bg); color: var(--acg-mid); }
.acg .lv-fail .acg-badge { background: var(--acg-fail-bg); color: var(--acg-fail); }
.acg .acg-cell.is-dim { opacity: 0.28; }
.acg .acg-cell.is-dim:hover,
.acg .acg-cell.is-dim:focus-visible,
.acg .acg-cell.is-dim.is-sel { opacity: 0.8; }
.acg .acg-cell.is-hidden { background: var(--acg-sunk) !important; box-shadow: none; }
.acg .acg-cell.is-hidden > * { visibility: hidden; }
.acg .acg-cell:hover { transform: scale(1.04); z-index: 1; }
.acg .acg-cell:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--acg-accent); }
.acg .acg-cell.is-sel { box-shadow: 0 0 0 3px var(--acg-accent), 0 0 0 5px var(--acg-card); }
.acg td.is-row .acg-cell:not(.is-sel),
.acg td.is-col .acg-cell:not(.is-sel) { box-shadow: 0 0 0 2px var(--acg-accent-line); }
.acg .acg-diag span {
    display: block; width: 100%; min-width: var(--acg-cell); height: 70px; border-radius: 9px; opacity: 0.35;
    background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.55) 0 6px, transparent 6px 12px);
}
.acg .acg-grid-hint { display: flex; align-items: center; gap: 0.35rem; margin: 0.5rem 0.2rem 0.1rem; }
.acg .acg-grid-hint svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ---------- list ---------- */
.acg .acg-pairs { display: grid; gap: 6px; }
.acg .acg-li {
    display: grid; grid-template-columns: 150px minmax(0, 1fr) auto 28px; gap: 10px; align-items: center;
    padding: 5px 6px 5px 5px; border-radius: 12px; border: 1px solid var(--acg-line); min-width: 0;
}
.acg .acg-li.is-sel { border-color: var(--acg-accent); background: var(--acg-accent-soft); }
.acg .acg-li-prev {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px;
    height: 52px; padding: 0 0.65rem; border: none; border-radius: 8px; cursor: pointer; text-align: left; min-width: 0; overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}
.acg .acg-li-prev strong { font-size: 1.05rem; line-height: 1.1; color: inherit; }
.acg .acg-li-prev span,
.acg .acg-pair-prev > span { color: inherit; }
.acg .acg-li-prev span { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.acg .acg-li-info { display: flex; flex-direction: column; min-width: 0; }
.acg .acg-li-names { font-size: 0.85rem; font-weight: 700; color: var(--acg-text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acg .acg-li-names i { font-style: normal; font-weight: 500; color: var(--acg-muted); }
.acg .acg-li-info small { font: 600 0.7rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--acg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acg .acg-li-score { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.acg .acg-li-score strong { font-size: 0.95rem; color: var(--acg-text-1); font-variant-numeric: tabular-nums; white-space: nowrap; }
.acg .acg-lv {
    display: inline-flex; padding: 0.08rem 0.45rem; border-radius: 999px; font-size: 0.68rem; font-weight: 800;
    background: var(--acg-pass-bg); color: var(--acg-pass); white-space: nowrap;
}
.acg .acg-lv.lv-large,
.acg .acg-lv.lv-ui { background: var(--acg-mid-bg); color: var(--acg-mid); }
.acg .acg-lv.lv-fail { background: var(--acg-fail-bg); color: var(--acg-fail); }
.acg .acg-empty { margin: 0.3rem 0; font-size: 0.86rem; line-height: 1.55; color: var(--acg-text-2); }

/* ---------- pair details ---------- */
.acg .acg-pair-card .acg-h { overflow: hidden; }
.acg .acg-pair-card .acg-h-ico { width: 17px; height: 17px; color: var(--acg-accent); }
.acg .acg-pair { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem; align-items: stretch; }
.acg .acg-pair-prev {
    display: flex; flex-direction: column; justify-content: center; gap: 0.5rem; padding: 1rem 1.1rem; border-radius: 12px; min-width: 0;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}
.acg .acg-pair-big { font-size: 24px; font-weight: 700; line-height: 1.2; }
.acg .acg-pair-body { font-size: 16px; line-height: 1.5; }
.acg .acg-pair-ui { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.2rem; }
.acg .acg-pair-btn { padding: 0.3rem 0.8rem; border: 2px solid; border-radius: 8px; font-size: 0.85rem; font-weight: 700; }
.acg .acg-pair-icon { width: 22px; height: 22px; stroke-width: 2.5; }
.acg .acg-pair-ui small { font-size: 0.75rem; opacity: 0.85; }
.acg .acg-pair-side { min-width: 0; }
.acg .acg-pair-ratio { display: flex; align-items: center; gap: 0.6rem; }
.acg .acg-pair-ratio strong { font-size: 1.9rem; font-weight: 800; color: var(--acg-text-1); font-variant-numeric: tabular-nums; line-height: 1.1; }
.acg .acg-checks { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 3px; }
.acg .acg-checks li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 6px; align-items: center; font-size: 0.8rem; color: var(--acg-text-2); }
.acg .acg-checks li svg { width: 14px; height: 14px; stroke-width: 3; }
.acg .acg-checks li.ok svg,
.acg .acg-checks li.ok b { color: #16a34a; }
.acg .acg-checks li.no svg,
.acg .acg-checks li.no b { color: #dc2626; }
[data-theme="dark"] .acg .acg-checks li.ok svg,
[data-theme="dark"] .acg .acg-checks li.ok b { color: #4ade80; }
[data-theme="dark"] .acg .acg-checks li.no svg,
[data-theme="dark"] .acg .acg-checks li.no b { color: #f87171; }
.acg .acg-checks b { font-size: 0.72rem; font-weight: 800; }
.acg .acg-apca { margin: 0.6rem 0 0; font-size: 0.78rem; line-height: 1.45; color: var(--acg-muted); }
.acg .acg-apca b { color: var(--acg-text-1); }
.acg .acg-next { margin: 0.75rem 0 0; font-size: 0.82rem; line-height: 1.55; color: var(--acg-text-2); }
.acg .acg-next a,
.acg .acg-info a { color: var(--acg-accent-strong); font-weight: 600; }

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

.acg .acg-cvd-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin-top: 0.2rem; }
.acg .acg-cvd {
    display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; padding: 5px;
    border: 1px solid var(--acg-line); border-radius: 9px; background: var(--acg-card); cursor: pointer;
    font-size: 0.7rem; font-weight: 700; color: var(--acg-text-2); text-align: center;
}
.acg .acg-cvd span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acg .acg-cvd-sw { display: block; height: 18px; border-radius: 5px; }
.acg .acg-cvd:hover { border-color: var(--acg-accent-line); }
.acg .acg-cvd.active { border-color: var(--acg-accent); background: var(--acg-accent-soft); color: var(--acg-accent-strong); }

.acg .acg-fmt-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.acg .acg-fmt {
    padding: 0.32rem 0.65rem; border-radius: 999px; border: 1px solid var(--acg-line); background: var(--acg-card);
    color: var(--acg-text-2); font-size: 0.78rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.acg .acg-fmt:hover { border-color: var(--acg-accent-line); color: var(--acg-accent-strong); }
.acg .acg-fmt.active { border-color: var(--acg-accent); background: var(--acg-accent-soft); color: var(--acg-accent-strong); }
.acg .acg-pal-dl { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 0.85rem; flex-wrap: wrap; }
.acg .acg-pal-size { font-size: 0.78rem; color: var(--acg-muted); font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.acg .acg-pal-btns { display: flex; gap: 6px; }

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

/* ---------- fix palette ---------- */
.acg .acg-fix-intro { margin-top: -0.35rem; }
.acg .acg-fix-list { display: grid; gap: 8px; margin-top: 0.7rem; }
.acg .acg-fix { padding: 0.55rem 0.6rem; border-radius: 11px; border: 1px solid var(--acg-line); background: var(--acg-open); min-width: 0; }
.acg .acg-fix-name { display: block; font-size: 0.8rem; font-weight: 700; color: var(--acg-text-1); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acg .acg-fix-name small { font: 600 0.7rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--acg-muted); margin-left: 4px; }
.acg .acg-fix-opt { display: grid; grid-template-columns: 22px 14px 22px minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 3px 0; }
.acg .acg-fix-opt + .acg-fix-opt { border-top: 1px dashed var(--acg-line); }
.acg .acg-fix-sw { width: 22px; height: 22px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18); }
.acg .acg-fix-arrow { width: 14px; height: 14px; color: var(--acg-muted); }
.acg .acg-fix-txt { display: flex; flex-direction: column; min-width: 0; }
.acg .acg-fix-txt b { font: 700 0.78rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--acg-text-1); }
.acg .acg-fix-txt small { font-size: 0.72rem; color: var(--acg-accent-strong); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- action bar ---------- */
.acg .acg-actionbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--acg-line);
}
.acg .acg-summary { display: flex; flex-direction: column; min-width: 0; }
.acg .acg-summary strong { font-size: 0.95rem; color: var(--acg-text-1); font-variant-numeric: tabular-nums; }
.acg .acg-summary span { font-size: 0.8rem; color: var(--acg-muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.acg .acg-actionbar-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.acg .acg-go { min-width: 170px; }

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

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

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
    .acg .acg-presets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .acg .acg-layout { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
    .acg .acg-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .acg.tool-container { padding: 1rem 0.75rem; }
    .acg { --acg-cell: 78px; }
    .acg .tool-title { font-size: 1.55rem; }
    .acg .acg-title-icon { width: 46px; height: 46px; border-radius: 13px; }
    .acg .acg-title-icon svg { width: 24px; height: 24px; }
    .acg .acg-main { padding: 0.75rem; border-radius: 16px; }
    .acg .acg-card { padding: 0.85rem; }
    .acg .acg-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .acg .acg-chips { grid-template-columns: minmax(0, 1fr); }
    .acg .acg-card-head { flex-wrap: wrap; }
    .acg .acg-grid tbody th,
    .acg .acg-grid .acg-corner { width: 92px; min-width: 92px; max-width: 92px; }
    .acg .acg-rowh .acg-hsw { width: 10px; margin-right: 5px; }
    .acg .acg-corner span { font-size: 0.56rem; letter-spacing: 0.02em; }
    .acg .acg-cell { height: 62px; }
    .acg .acg-diag span { height: 62px; }
    .acg .acg-aa { font-size: 1.1rem; }
    .acg .acg-li { grid-template-columns: 64px minmax(0, 1fr) auto 28px; gap: 8px; }
    .acg .acg-li-prev span { display: none; }
    .acg .acg-score-big { font-size: 1.1rem; }
    .acg .acg-cvd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .acg .acg-actionbar { flex-direction: column; align-items: stretch; }
    .acg .acg-actionbar-btns { display: grid; grid-template-columns: 1fr 1fr; }
    .acg .acg-go { grid-column: 1 / -1; order: -1; }
    .acg .acg-info .info-card { padding: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
    .acg * { transition: none !important; }
}

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