/* RT-SEC-012 — Cyber Posture Self-Check. Scoped to .cps (and the print root);
   no global selectors. Colours resolve from the site tokens where one exists,
   so dark mode follows the site; the tool's own accents are redefined for dark
   under [data-theme="dark"] only. The OS-preference block was removed on
   22 Nov 2026: rt-tokens.css keeps its own commented out, so answering it here
   painted dark bars onto a light page for readers whose phone is in dark mode. */

.cps {
    --cps-ink: var(--rt-ink, #0D1B2A);
    --cps-soft: var(--rt-ink-soft, #2A3340);
    --cps-muted: var(--rt-ink-muted, #5C646F);
    --cps-surface: var(--rt-surface, #FFFFFF);
    --cps-surface-2: var(--rt-surface-2, #FAFAF7);
    --cps-line: var(--rt-hairline, #E6E1D4);
    --cps-brand: #0F4C5C;          /* deep teal: the tool's own accent */
    --cps-brand-ink: #FFFFFF;
    --cps-brand-soft: #E3F0F2;
    --cps-yes: #1F7A50;
    --cps-yes-bg: #E4F4EA;
    --cps-no: #A4400F;
    --cps-no-bg: #FCEBDD;
    --cps-unsure: #5B3FA0;
    --cps-unsure-bg: #EEE8FA;
    --cps-na: #4F5763;
    --cps-na-bg: #EEF0F2;
    --cps-track: #E9E6DD;
    --cps-radius: 14px;
    container-type: inline-size;
    container-name: cps;
    font-family: var(--rt-font-sans, system-ui, sans-serif);
    color: var(--cps-ink);
}

[data-theme="dark"] .cps {
    --cps-brand: #5FB3C4;
    --cps-brand-ink: #0D1B2A;
    --cps-brand-soft: #16343D;
    --cps-yes: #6FD3A0;
    --cps-yes-bg: #143326;
    --cps-no: #F3A774;
    --cps-no-bg: #3A2416;
    --cps-unsure: #C2B0F2;
    --cps-unsure-bg: #2A2240;
    --cps-na: #C3CAD3;
    --cps-na-bg: #283240;
    --cps-track: #2A3646;
}

/* ── notice ─────────────────────────────────────────────────────────────── */
.cps .cps-notice {
    border-left: 4px solid var(--cps-brand);
    background: var(--cps-brand-soft);
    border-radius: 0 10px 10px 0;
    padding: 12px 16px;
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--cps-soft);
}
.cps .cps-notice p { margin: 0 0 6px; }
.cps .cps-notice p:last-child { margin: 0; }
.cps .cps-notice cite { font-style: normal; font-weight: 600; color: var(--cps-ink); }

/* ── controls ───────────────────────────────────────────────────────────── */
.cps .cps-controls { margin-bottom: 18px; }
.cps fieldset { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.cps legend {
    float: left; width: 100%; margin-bottom: 6px;
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cps-muted);
}
.cps .cps-chip {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1.5px solid var(--cps-line); background: var(--cps-surface); color: var(--cps-ink);
    border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.cps .cps-chip-n { font-weight: 500; font-size: 12px; color: var(--cps-muted); }
.cps .cps-chip--fixed { background: var(--cps-brand); color: var(--cps-brand-ink); border-color: var(--cps-brand); cursor: default; }
.cps .cps-chip--fixed .cps-chip-n { color: var(--cps-brand-ink); opacity: .85; }
.cps button.cps-chip[aria-pressed="true"] { border-color: var(--cps-brand); background: var(--cps-brand-soft); }
.cps button.cps-chip[aria-pressed="true"]::before { content: "✓"; color: var(--cps-brand); }
.cps .cps-hint { font-size: 13px; line-height: 1.5; color: var(--cps-muted); margin: 0 0 14px; max-width: 72ch; }
.cps .cps-filter { gap: 0; }
.cps .cps-seg {
    border: 1.5px solid var(--cps-line); background: var(--cps-surface); color: var(--cps-soft);
    padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; margin: 0 -1.5px 0 0;
}
.cps .cps-seg:first-of-type { border-radius: 8px 0 0 8px; }
.cps .cps-seg:last-of-type { border-radius: 0 8px 8px 0; }
.cps .cps-seg[aria-pressed="true"] { background: var(--cps-ink); color: var(--cps-surface); border-color: var(--cps-ink); position: relative; }
.cps button:focus-visible { outline: 3px solid var(--cps-brand); outline-offset: 2px; }

/* ── layout ─────────────────────────────────────────────────────────────── */
.cps .cps-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@container cps (min-width: 760px) {
    .cps .cps-layout { grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
    .cps .cps-summary { position: sticky; top: 84px; }
}

/* ── summary ────────────────────────────────────────────────────────────── */
.cps .cps-summary {
    border: 1px solid var(--cps-line); border-radius: var(--cps-radius);
    background: var(--cps-surface-2); padding: 16px;
}
.cps .cps-sum-title { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cps-muted); }
.cps .cps-big { margin: 0 0 10px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cps .cps-big-n { font-family: var(--rt-font-serif, Georgia, serif); font-size: 48px; line-height: 1; font-weight: 600; color: var(--cps-brand); font-variant-numeric: tabular-nums; }
.cps .cps-big-of { font-size: 14px; color: var(--cps-soft); }
.cps .cps-stack { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--cps-track); }
.cps .cps-stack span { display: block; height: 100%; transition: width .2s ease; }
.cps .cps-stack-yes { background: var(--cps-yes); }
.cps .cps-stack-no { background: var(--cps-no); }
.cps .cps-stack-unsure { background: var(--cps-unsure); }
.cps .cps-legend { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: 13px; color: var(--cps-soft); }
.cps .cps-legend b { font-variant-numeric: tabular-nums; color: var(--cps-ink); }
.cps .cps-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--cps-track); margin-right: 6px; vertical-align: 1px; }
.cps .cps-dot--yes { background: var(--cps-yes); }
.cps .cps-dot--no { background: var(--cps-no); }
.cps .cps-dot--unsure { background: var(--cps-unsure); }
.cps .cps-progress { font-size: 13px; color: var(--cps-muted); margin: 10px 0 12px; }
.cps .cps-who { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.cps .cps-who > div { background: var(--cps-surface); border: 1px solid var(--cps-line); border-radius: 10px; padding: 8px 10px; }
.cps .cps-who-k { display: block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--cps-muted); }
.cps .cps-who-v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cps .cps-measures { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 7px; }
.cps .cps-m-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--cps-soft); }
.cps .cps-m-n { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--cps-ink); font-weight: 600; }
.cps .cps-m-bar { height: 5px; border-radius: 999px; background: var(--cps-track); overflow: hidden; margin-top: 3px; }
.cps .cps-m-bar span { display: block; height: 100%; background: var(--cps-yes); transition: width .2s ease; }
.cps .cps-layer-sum p, .cps .cps-rec { font-size: 12.5px; color: var(--cps-soft); margin: 0 0 6px; line-height: 1.45; }
.cps .cps-jump { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--rt-link, #2A6FDB); }

/* ── checklist ──────────────────────────────────────────────────────────── */
.cps .cps-loading, .cps .cps-error { font-size: 14px; color: var(--cps-muted); }
.cps .cps-error { color: var(--cps-no); font-weight: 600; }
.cps .cps-layer { margin-bottom: 26px; }
.cps .cps-layer-title { font-family: var(--rt-font-serif, Georgia, serif); font-size: 22px; margin: 0 0 4px; }
.cps .cps-layer-note { font-size: 13px; color: var(--cps-muted); margin: 0 0 8px; }
.cps .cps-layer--cloud .cps-layer-title::before, .cps .cps-layer--ai .cps-layer-title::before { content: "+ "; color: var(--cps-brand); }
.cps .cps-measure-title {
    display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
    margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--cps-line);
    font-size: 15px; font-weight: 700;
}
.cps .cps-measure-id { font-family: var(--rt-font-mono, ui-monospace, monospace); font-size: 12px; color: var(--cps-brand); font-weight: 600; }
.cps .cps-measure-cat { margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cps-muted); }

.cps .cps-item {
    position: relative; background: var(--cps-surface); border: 1px solid var(--cps-line);
    border-radius: var(--cps-radius); padding: 14px 16px 12px 18px; margin-bottom: 10px;
    border-left-width: 5px;
}
.cps .cps-item[data-state="yes"] { border-left-color: var(--cps-yes); }
.cps .cps-item[data-state="no"] { border-left-color: var(--cps-no); }
.cps .cps-item[data-state="unsure"] { border-left-color: var(--cps-unsure); }
.cps .cps-item[data-state="na"] { border-left-color: var(--cps-na); }
.cps .cps-item[data-state="partial"] { border-left-color: var(--cps-brand); }
.cps .cps-item-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.cps .cps-clauses { font-family: var(--rt-font-mono, ui-monospace, monospace); font-size: 12px; color: var(--cps-muted); white-space: nowrap; }
.cps .cps-item-head .cps-clauses { white-space: normal; margin-right: 4px; }
.cps .cps-badge { font-size: 11px; font-weight: 700; letter-spacing: .02em; border-radius: 999px; padding: 2px 9px; background: var(--cps-na-bg); color: var(--cps-na); white-space: nowrap; }
.cps .cps-badge--req { background: var(--cps-ink); color: var(--cps-surface); }
.cps .cps-badge--rec { background: var(--cps-na-bg); color: var(--cps-na); }
.cps .cps-badge--owner { background: var(--cps-yes-bg); color: var(--cps-yes); }
.cps .cps-badge--it { background: var(--cps-unsure-bg); color: var(--cps-unsure); }
.cps .cps-badge--mixed { background: var(--cps-brand-soft); color: var(--cps-brand); }
.cps .cps-badge--border { background: transparent; color: var(--cps-muted); border: 1px dashed var(--cps-muted); }
.cps .cps-item-title { margin: 0 0 10px; font-size: 15.5px; line-height: 1.45; font-weight: 600; color: var(--cps-ink); }

.cps .cps-answer { display: flex; flex-wrap: wrap; gap: 6px; }
.cps .cps-opt {
    border: 1.5px solid var(--cps-line); background: var(--cps-surface); color: var(--cps-soft);
    border-radius: 8px; padding: 7px 12px; min-height: 36px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.cps .cps-opt:hover { border-color: var(--cps-muted); }
.cps .cps-opt--yes[aria-pressed="true"] { background: var(--cps-yes-bg); border-color: var(--cps-yes); color: var(--cps-yes); }
.cps .cps-opt--no[aria-pressed="true"] { background: var(--cps-no-bg); border-color: var(--cps-no); color: var(--cps-no); }
.cps .cps-opt--unsure[aria-pressed="true"] { background: var(--cps-unsure-bg); border-color: var(--cps-unsure); color: var(--cps-unsure); }
.cps .cps-opt--na[aria-pressed="true"] { background: var(--cps-na-bg); border-color: var(--cps-na); color: var(--cps-na); }
.cps .cps-opt--partial[aria-pressed="true"] { background: var(--cps-brand-soft); border-color: var(--cps-brand); color: var(--cps-brand); }
.cps .cps-opt[aria-pressed="true"]::before { content: "● "; }

.cps .cps-parts { list-style: none; margin: 12px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--cps-brand-soft); display: grid; gap: 10px; }
.cps .cps-part-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cps .cps-part-text { margin: 4px 0 6px; font-size: 14px; line-height: 1.45; color: var(--cps-soft); }
.cps .cps-part .cps-opt { min-height: 32px; padding: 5px 10px; font-size: 13px; }

.cps .cps-more { margin-top: 10px; font-size: 14px; color: var(--cps-soft); }
.cps .cps-more summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--cps-brand); }
.cps .cps-more p { margin: 6px 0 0; line-height: 1.55; }
.cps .cps-more-parts { margin: 6px 0 0; padding-left: 18px; line-height: 1.5; }
.cps .cps-more-parts li { margin-bottom: 3px; }
.cps .cps-link a { color: var(--rt-link, #2A6FDB); font-weight: 600; }

/* ── lists ──────────────────────────────────────────────────────────────── */
.cps .cps-lists { margin-top: 26px; padding-top: 18px; border-top: 2px solid var(--cps-ink); }
.cps .cps-lists h3 { font-family: var(--rt-font-serif, Georgia, serif); font-size: 22px; margin: 0 0 4px; }
.cps .cps-lists-intro { font-size: 13.5px; color: var(--cps-muted); margin: 0 0 14px; max-width: 72ch; }
.cps .cps-lists-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .cps .cps-lists-grid { grid-template-columns: 1fr 1fr; } }
.cps .cps-listbox { border: 1px solid var(--cps-line); border-radius: var(--cps-radius); padding: 14px 16px; background: var(--cps-surface); }
.cps .cps-listbox h4 { margin: 0 0 8px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.cps .cps-count { font-size: 12px; background: var(--cps-ink); color: var(--cps-surface); border-radius: 999px; padding: 1px 9px; font-variant-numeric: tabular-nums; }
.cps .cps-listbox ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; list-style: decimal; }
.cps .cps-listbox li { list-style: decimal; }
.cps .cps-listbox li::marker { color: var(--cps-muted); font-weight: 700; font-size: 13px; }
.cps .cps-entry-main { margin: 0; font-size: 14px; line-height: 1.45; color: var(--cps-ink); }
.cps .cps-entry-meta { margin: 2px 0 0; font-size: 12px; line-height: 1.4; color: var(--cps-muted); }
.cps .cps-empty { font-size: 13px; color: var(--cps-muted); margin: 0; }
.cps .cps-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.cps .cps-btn {
    border: 1.5px solid var(--cps-ink); background: var(--cps-surface); color: var(--cps-ink);
    border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.cps .cps-btn--primary { background: var(--cps-brand); border-color: var(--cps-brand); color: var(--cps-brand-ink); }
.cps .cps-btn--quiet { border-color: var(--cps-line); color: var(--cps-soft); font-size: 13px; padding: 6px 12px; }
.cps .cps-status { font-size: 13px; color: var(--cps-muted); }

.cps .cps-save { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 22px 0 6px; padding: 12px 14px; border-radius: 10px; background: var(--cps-surface-2); border: 1px dashed var(--cps-line); }
.cps .cps-save-opt { font-size: 14px; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.cps .cps-save-note { flex-basis: 100%; margin: 0; font-size: 12.5px; color: var(--cps-muted); line-height: 1.45; }

/* ── reference table + notes in the content section (this page only) ─── */
.cps-ref-wrap { overflow-x: auto; margin: 16px 0 20px; }
.cps-ref { border-collapse: collapse; width: 100%; font-size: 14px; }
.cps-ref caption { caption-side: bottom; text-align: left; padding-top: 8px; font-size: 13px; color: var(--rt-ink-muted, #5C646F); }
.cps-ref th, .cps-ref td { padding: 7px 10px; border-bottom: 1px solid var(--rt-hairline, #E6E1D4); text-align: left; }
.cps-ref td:nth-child(3), .cps-ref td:nth-child(4) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cps-ref thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--rt-ink-muted, #5C646F); }
.cps-ogl { font-size: 13px; color: var(--rt-ink-muted, #5C646F); }

/* ── Studio layer (22 Nov 2026 refresh): ring gauge, segmented answers,
   lifted cards. Built on public/assets/css/tool-studio.css. ─────────────── */
.cps .cps-notice { border-left: 0; border-radius: 14px; border: 1px solid var(--cps-line); background: linear-gradient(135deg, var(--cps-brand-soft), transparent 75%), var(--cps-surface-2); padding: 14px 18px; }
.cps .cps-chip { transition: border-color .2s, background .2s, transform .15s; }
.cps button.cps-chip:hover { transform: translateY(-1px); border-color: var(--cps-brand); }
.cps .cps-filter { gap: 4px; padding: 4px; border-radius: 12px; background: var(--rt-bg-inset); width: fit-content; max-width: 100%; }
.cps .cps-seg, .cps .cps-seg:first-of-type, .cps .cps-seg:last-of-type { border: 0; margin: 0; border-radius: 9px; background: transparent; padding: 8px 12px; transition: background .2s, color .2s, box-shadow .2s; }
.cps .cps-seg[aria-pressed="true"] { background: var(--cps-surface); color: var(--cps-ink); box-shadow: 0 1px 2px rgba(13,27,42,.08), 0 4px 12px -6px rgba(13,27,42,.25); }

.cps .cps-summary { border-radius: 18px; background: var(--cps-surface); box-shadow: var(--st-shadow, none); padding: 18px; }
.cps .cps-gauge { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.cps .cps-ring {
    --cps-p-yes: 0; --cps-p-no: 0; --cps-p-unsure: 0;
    flex: 0 0 auto; width: 84px; height: 84px; border-radius: 50%; position: relative;
    background: conic-gradient(
        var(--cps-yes) 0 calc(var(--cps-p-yes) * 1%),
        var(--cps-no) 0 calc((var(--cps-p-yes) + var(--cps-p-no)) * 1%),
        var(--cps-unsure) 0 calc((var(--cps-p-yes) + var(--cps-p-no) + var(--cps-p-unsure)) * 1%),
        var(--cps-track) 0);
}
.cps .cps-ring-hole { position: absolute; inset: 11px; border-radius: 50%; background: var(--cps-surface); }
.cps .cps-gauge .cps-big { margin: 0; flex-direction: column; align-items: flex-start; gap: 2px; }
.cps .cps-gauge .cps-big-n { font-size: 40px; }
.cps .cps-measures { gap: 9px; }
.cps .cps-m-bar { height: 6px; }
.cps .cps-m-bar span { background: linear-gradient(90deg, var(--cps-yes), #3FA877); transition: width .4s var(--st-ease, ease); }

.cps .cps-item { border-left-width: 1px; padding: 16px 18px 14px 22px; border-radius: 16px; overflow: hidden; transition: box-shadow .25s, transform .25s, border-color .25s; }
.cps .cps-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--cps-track); transition: background .25s; }
.cps .cps-item[data-state="yes"]::before { background: var(--cps-yes); }
.cps .cps-item[data-state="no"]::before { background: var(--cps-no); }
.cps .cps-item[data-state="unsure"]::before { background: var(--cps-unsure); }
.cps .cps-item[data-state="na"]::before { background: var(--cps-na); }
.cps .cps-item[data-state="partial"]::before { background: var(--cps-brand); }
.cps .cps-item:hover { box-shadow: var(--st-shadow-lift, 0 10px 24px -16px rgba(13,27,42,.35)); }
.cps .cps-answer { gap: 0; padding: 3px; border-radius: 11px; background: var(--rt-bg-inset); width: fit-content; max-width: 100%; }
.cps .cps-opt { border: 0; border-radius: 8px; background: transparent; padding: 8px 14px; transition: background .18s, color .18s, box-shadow .18s; }
.cps .cps-opt:hover { background: var(--cps-surface); }
.cps .cps-opt[aria-pressed="true"]::before { content: none; }
.cps .cps-opt--yes[aria-pressed="true"], .cps .cps-opt--no[aria-pressed="true"], .cps .cps-opt--unsure[aria-pressed="true"],
.cps .cps-opt--na[aria-pressed="true"], .cps .cps-opt--partial[aria-pressed="true"] { box-shadow: 0 1px 2px rgba(13,27,42,.08), 0 4px 10px -6px rgba(13,27,42,.3); }
.cps .cps-lists { border-top: 0; padding: clamp(16px, 3cqi, 24px); border-radius: 18px; background: var(--rt-bg-inset); }
.cps .cps-listbox { border-radius: 16px; }
.cps .cps-btn { border-radius: 10px; transition: transform .15s, background .15s; }
.cps .cps-btn:hover { transform: translateY(-1px); }
.cps .cps-save { border-radius: 14px; border-style: solid; }

/* ── print: only the two lists ─────────────────────────────────────────── */
.cps-print-root { display: none; }
@media print {
    body.cps-printing > *:not(.cps-print-root) { display: none !important; }
    body.cps-printing .cps-print-root { display: block !important; color: #000; font-family: var(--rt-font-sans, sans-serif); font-size: 12pt; }
    body.cps-printing { background: #fff; margin: 0; padding: 0; }
    .cps-print-root h1 { font-size: 18pt; margin: 0 0 6pt; }
    .cps-print-root h2 { font-size: 14pt; margin: 14pt 0 6pt; }
    .cps-print-root li { margin-bottom: 6pt; break-inside: avoid; }
    .cps-print-root .cps-entry-main { margin: 0; }
    .cps-print-root .cps-entry-meta { margin: 0; font-size: 9.5pt; color: #333; }
}

@media (max-width: 560px) {
    .cps .cps-item { padding: 12px 12px 10px 14px; }
    .cps .cps-opt { padding: 7px 10px; }
    .cps .cps-big-n { font-size: 40px; }
    .cps .cps-measure-cat { margin-left: 0; flex-basis: 100%; }
}
