/* [scaffold:fw=soc2-readiness] generated by scripts/scaffold-framework.js */
:root {
    --soc2-readiness-primary:   #c17a4a;
    --soc2-readiness-secondary: #9c5f37;
    --bg-1: #0b1220;
    --bg-2: #131b2e;
    --text-1: #e2e8f0;
    --text-2: #94a3b8;
    --border: rgba(255,255,255,.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-1);
    color: var(--text-1);
    line-height: 1.5;
}

.assessment-container { max-width: 900px; margin: 0 auto; padding: 24px 20px 80px; }

.assessment-container.has-sidebar {
    max-width: none;
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 40px);
    padding: 0;
    align-items: start;
}
.assessment-main { padding: 24px 20px 80px; }

.progress-tracker {
    position: sticky;
    top: 40px;
    height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.progress-overview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.progress-ring { width: 72px; height: 72px; }
.progress-ring-bg { fill: none; stroke: var(--border); stroke-width: 8; }
.progress-ring-fill {
    fill: none;
    stroke: var(--soc2-readiness-primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 213.6;
    stroke-dashoffset: 213.6;
    transform: rotate(-90deg);
    transform-origin: 40px 40px;
    transition: stroke-dashoffset .4s ease;
}
.progress-ring-label { font-size: 1.1rem; font-weight: 700; color: var(--soc2-readiness-primary); }
.progress-ring-sub { font-size: .72rem; color: var(--text-2); text-align: center; }
.progress-sections { display: flex; flex-direction: column; gap: 2px; }
.progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s;
    font-size: .83rem;
}
.progress-row:hover { background: rgba(255,255,255,.06); }
.progress-row-badge {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    flex-shrink: 0;
}
.progress-row-badge.complete { background: #22c55e; }
.progress-row-badge.partial  { background: #f59e0b; }
.progress-row-badge.started  { background: var(--soc2-readiness-secondary); }
.progress-row-name {
    flex: 1;
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.progress-row-count { font-size: .75rem; color: var(--text-2); white-space: nowrap; flex-shrink: 0; }

.evidence-note {
    width: 100%;
    margin-top: 10px;
    background: rgba(255,255,255,.03);
    border: 1px dashed var(--border);
    border-radius: 6px;
    color: var(--text-1);
    font-family: inherit;
    font-size: 13px;
    padding: 8px 10px;
    resize: vertical;
    line-height: 1.4;
}
.evidence-note::placeholder { color: var(--text-2); }
.evidence-note:focus { outline: none; border-color: var(--soc2-readiness-primary); }

.header {
    position: sticky; top: 40px; z-index: 10;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    display: flex; align-items: center; gap: 16px;
}
.header h1 { margin: 0; font-size: 20px; flex: 1; }
.header input[type="text"] {
    background: rgba(255,255,255,.06); border: 1px solid var(--border);
    color: var(--text-1); padding: 8px 12px; border-radius: 6px; width: 280px;
}
.save-notice { margin-top: 6px; font-size: .72rem; color: var(--text-2); transition: color .3s; }
.save-notice.just-saved { color: rgba(39,174,96,.95); }

.control-section {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 16px 0;
    overflow: hidden;
}
.control-header {
    padding: 14px 18px;
    background: rgba(255,255,255,.03);
    cursor: pointer;
    display: flex; align-items: center; gap: 16px;
    border-bottom: 1px solid var(--border);
}
.control-title { flex: 1; font-weight: 600; color: var(--soc2-readiness-primary); }
.control-progress { color: var(--text-2); font-size: 13px; }
.control-content { padding: 16px 18px; }

.question {
    padding: 14px 0;
    border-bottom: 1px dashed var(--border);
}
.question:last-child { border-bottom: none; }
.question-text { font-weight: 500; margin-bottom: 6px; }
.question-help { color: var(--text-2); font-size: 13px; margin-bottom: 10px; }

.options { display: grid; gap: 6px; }
.option {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}
.option:hover { background: rgba(255,255,255,.06); }
.option input[type="radio"]:checked + span { color: var(--soc2-readiness-primary); font-weight: 600; }

.save-bar {
    position: sticky; bottom: 0;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    display: flex; gap: 10px; justify-content: flex-end;
    margin-top: 24px;
}
.save-bar button {
    padding: 10px 18px;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--border);
    color: var(--text-1);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}
.save-bar .primary-btn {
    background: var(--soc2-readiness-primary);
    border-color: var(--soc2-readiness-primary);
    color: #0b1220;
}

/* Every modal on the page (welcome, scoping pickers, access denied) sits
   above the 40px nav bar (z-index 999) and the Ask Phronesis button (900),
   and is never taller than the space below the nav bar: the panel scrolls
   inside when its content is longer. Until October 2026 the overlay sat
   at z-index 100 and nothing scrolled, so on phones and small laptops a
   panel's top or its buttons could be off-screen or covered. */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.7);
    display: none; align-items: center; justify-content: center;
    z-index: 1000;
    padding: 56px 16px 16px;
    overflow-y: auto;
}
.modal-overlay[style*="flex"] { display: flex !important; }
.modal-panel {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    max-width: 540px;
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.modal-panel h2 { margin-top: 0; color: var(--soc2-readiness-primary); }
.modal-panel button {
    margin-top: 16px;
    padding: 10px 20px;
    background: var(--soc2-readiness-primary);
    color: #0b1220;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

/* Results overlay — fixed, full-viewport takeover below the 40px nav bar,
   matching every shipped framework's results panel. Do not turn this back
   into a plain in-flow block: assessment-core.js's renderResults() only
   toggles display:block/none on this element, so without position:fixed the
   analysis output renders in normal document flow instead of the expected
   overlay. Deliberately white/light — every shipped framework's results panel
   is light-on-white regardless of the rest of that page's theme (this template
   itself is dark-themed, --bg-1 above). The four variables below are redeclared
   for this subtree only: any var(--bg-1)/var(--text-1)/var(--text-2)/var(--border)
   used by a hand-added descendant rule picks up the light palette automatically
   via CSS custom-property cascading. If you add SVG (e.g. a radar chart) or any
   other hardcoded-colour content inside #results-content, colour it for a WHITE
   background, not this file's dark --bg-1/--text-1 defaults.
   The explicit color property below is NOT redundant with the --text-1
   redeclaration above it. Redeclaring a custom property only changes what
   var(--text-1) RESOLVES TO for a rule that explicitly references it — it does
   nothing for an element with no color rule of its own that is simply
   inheriting the color property from body (body's own color:var(--text-1) rule
   computes once, using the dark root value,
   and that already-resolved value is what's inherited — not re-evaluated per
   descendant). Plain, unclassed report text (list items built by onRenderResult
   for gaps/strengths/next-steps/warnings) is exactly this shape and will
   silently inherit body's near-white text straight onto this white panel
   without the line below. This was found and fixed on NIST CSF's own results
   panel by exactly this omission — do not drop it when copying this pattern. */
.results-panel {
    position: fixed;
    inset: 40px 0 0 0;
    background: #fff;
    z-index: 500;
    overflow-y: auto;
    padding: 28px 32px;
    --bg-1: #ffffff;
    --bg-2: #f4f6f8;
    --text-1: #1c2a38;
    --text-2: #5a6a7a;
    --border: #dde3ea;
    color: var(--text-1);
}
.results-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.results-header h2 { flex: 1; font-size: 1.4rem; color: var(--soc2-readiness-primary); margin: 0; }
.results-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.export-btn {
    background: var(--soc2-readiness-primary);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: .85rem;
    cursor: pointer;
    transition: background .15s;
}
.export-btn:hover { background: var(--soc2-readiness-secondary); }
.close-results-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-2);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: .85rem;
    cursor: pointer;
}
.close-results-btn:hover { color: var(--text-1); border-color: var(--text-2); }

/* ── RESULTS CONTENT — score summary, section grid, issue cards ──
   §3c: mandatory, zero exceptions — see FRAMEWORK_TEMPLATE.md. These
   classes are what onRenderResult's hand-written renderer actually
   creates (results-summary/results-score-row/overall-score/overall-label/
   results-grid/principle-card family/issue-item/issue-badge). Missing
   this block was found on CMMC (built before it existed here): the
   renderer worked and the elements existed, but rendered with bare
   browser-default spacing/colour because nothing here styled them. */
.results-summary {
    background: var(--bg-1);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.10);
}
.results-score-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.overall-score { font-size: 3rem; font-weight: 700; color: var(--soc2-readiness-primary); }
.overall-label { font-size: .85rem; color: var(--text-2); }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.principle-card {
    background: var(--bg-2);
    border-radius: 8px;
    padding: 12px 14px;
}
.principle-card-title { font-size: .8rem; font-weight: 600; color: var(--soc2-readiness-primary); margin-bottom: 6px; }
.principle-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.principle-bar-fill { height: 100%; border-radius: 3px; transition: width .6s ease; }
.principle-score-label { font-size: .75rem; color: var(--text-2); margin-top: 4px; }

.results-issues { background: var(--bg-1); border-radius: 10px; padding: 20px 24px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.10); }
.issue-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .87rem; }
.issue-item:last-child { border-bottom: none; }
.issue-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
    height: fit-content;
}
.badge-critical { background: #fde8e8; color: #c0392b; }
.badge-warning  { background: #fef3e2; color: #e07b00; }
.badge-good     { background: #e6f9f0; color: #27ae60; }

/* ── RADAR CHART ── assessment-core.js's buildRadarChart() wraps its SVG
   in a div classed "${cfg.key}-radar-wrapper" — one rule per framework key. */
.soc2-readiness-radar-wrapper {
    margin: 20px 0 24px;
    display: flex;
    justify-content: center;
}

.score-circle {
    width: 140px; height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--soc2-readiness-primary) 0%, var(--soc2-readiness-secondary) 100%);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    margin: 16px auto;
    color: #0b1220;
}
.score-num { font-size: 36px; font-weight: 800; }
.score-label { font-size: 13px; font-weight: 600; }

#radar-chart { display: block; max-width: 560px; margin: 0 auto; }

.section-bar { display: grid; grid-template-columns: 200px 1fr 60px; gap: 12px; align-items: center; margin: 8px 0; }
.bar-track { background: rgba(255,255,255,.06); border-radius: 4px; height: 8px; overflow: hidden; }
.bar-fill  { height: 100%; background: var(--soc2-readiness-primary); }
.bar-value { color: var(--text-2); font-size: 13px; text-align: right; }

.results-issues { margin-top: 24px; }
.results-issues h3 { color: var(--soc2-readiness-primary); margin-top: 20px; }

.size-hidden { display: none !important; }
.tsc-hidden  { display: none !important; }

/* §12 — every framework supplies its own .evidence-comment styling;
   evidence-upload.css deliberately doesn't (it only styles the upload
   widget it attaches alongside), so without this the textarea renders with
   bare browser defaults. */
.evidence-comment { margin-top: 8px; margin-bottom: 6px; }
.evidence-comment label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 3px;
}
.evidence-comment textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(255,255,255,.06);
    color: var(--text-1);
    font-size: .82rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color .15s;
}
.evidence-comment textarea:focus { outline: none; border-color: var(--soc2-readiness-primary); }
.evidence-comment textarea::placeholder { color: var(--text-2); opacity: .8; }
@media print { .evidence-comment textarea { border: 1px solid #ccc; background: #fff; color: #000; } }

/* ── EXECUTIVE SUMMARY (screen hidden, print visible) ──
   §3c: mandatory, zero exceptions. assessment-core.js's prepareAndPrint()
   builds this DOM generically for every core-based framework using the
   cfg.key prefix (here "soc2-readiness") — without the CSS below the elements
   exist but render unstyled/invisible: no PDF cover page, no colour, cards
   splitting across page boundaries, no confidentiality footer. */
.soc2-readiness-exec-summary { display: none; }

.soc2-readiness-exec-header {
    background: linear-gradient(135deg, var(--soc2-readiness-primary) 0%, var(--soc2-readiness-secondary) 100%);
    color: #0b1220;
    padding: 28px 32px;
    border-radius: 10px;
    margin-bottom: 24px;
}
.soc2-readiness-exec-header h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.soc2-readiness-exec-subtitle { font-size: 1.15rem; opacity: .85; margin-bottom: 2px; }
.soc2-readiness-exec-date { font-size: .82rem; opacity: .7; }

.soc2-readiness-exec-score-block {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 16px;
}
.soc2-readiness-exec-big-score { font-size: 3.2rem; font-weight: 700; }
.soc2-readiness-exec-rating { font-size: 1.1rem; font-weight: 600; }

.soc2-readiness-exec-pillars {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.soc2-readiness-exec-pillar-chip {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
    border: 1.5px solid;
}

.soc2-readiness-exec-gaps {
    background: var(--bg-1);
    border-radius: 10px;
    padding: 18px 22px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.10);
}
.soc2-readiness-exec-gaps h3 {
    font-size: .95rem;
    color: var(--soc2-readiness-primary);
    margin-bottom: 10px;
}
.soc2-readiness-exec-gap-item {
    padding: 6px 0 6px 16px;
    border-left: 3px solid #c0392b;
    font-size: .87rem;
    color: var(--text-1);
    margin-bottom: 6px;
}

/* Print footer (hidden on screen) */
.soc2-readiness-print-footer { display: none; }

/* Print pagination shell — a literal <table>/<tfoot> is required for Chrome
   to repeat this footer on every printed page (a CSS-only
   display:table-footer-group on a <div> only paints on the LAST page; a
   position:fixed footer doesn't reserve print-pagination space at all, so it
   paints OVER the last line(s) of content instead of pushing them to the
   next page — this is what clipped report text at the bottom of pages).
   Reset to block on screen so wrapping the results content in this shell at
   print time is invisible until @media print applies below. */
.print-shell-table,
.print-shell-table > tbody,
.print-shell-table > tfoot,
.print-shell-table > tbody > tr,
.print-shell-table > tfoot > tr,
.print-shell-table > tbody > tr > td,
.print-shell-table > tfoot > tr > td { display: block; margin: 0; padding: 0; border: none; }


/* ── MOBILE ── */
@media (max-width: 900px) {
    /* minmax(0, 1fr), not 1fr: a bare 1fr track is minmax(auto, 1fr), so this
       one column widened to fit the page's widest unshrinkable content (a
       fixed-width field, a no-wrap button) and pushed the progress tracker and
       questions past the edge of a phone screen. */
    .assessment-container.has-sidebar { grid-template-columns: minmax(0, 1fr); }
    .progress-tracker { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
    .results-panel { padding: 16px; }
}

@media (max-width: 600px) {
    /* Stack the title and the organisation-name field: side by side, the 280px
       field squeezed the title to a word or two per line and still ran past
       the edge of a phone screen. */
    .header { flex-wrap: wrap; }
    .header input[type="text"] { width: 100%; }
    /* The save bar's buttons don't fit on one row: secondary actions share the
       first row and the primary action gets a full-width row of its own,
       instead of the row spilling off the left edge (it is right-aligned). */
    .save-bar { flex-wrap: wrap; padding: 10px 12px; }
    .save-bar button { flex: 1 1 auto; padding: 10px 12px; }
    .save-bar .primary-btn { flex-basis: 100%; }
}

@media print {
    /* Printing is only ever triggered from inside the results panel via
       exportPDF() -> window.print() — hide the questionnaire and chrome,
       print only the results panel, matching every shipped framework. */
    #sch-nav-bar, .header, .save-bar, .save-notice, .progress-tracker, #assessment-form,
    .results-actions, .results-header, .tsc-bar, .soc2-target-bar { display: none !important; }
    body { background: #fff !important; color: #000 !important; padding: 0 !important; padding-top: 0 !important; margin: 0; }
    .results-panel {
        position: static !important;
        display: block !important;
        inset: auto;
        padding: 0 !important;
        background: #fff !important;
        overflow: visible !important;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    @page { size: A4; margin: 15mm 18mm; }

    .soc2-readiness-exec-summary {
        display: block !important;
        page-break-after: always;
    }
    /* Up to thirteen two-line category chips, the At a glance box and the
       radar only fit on page 1 with a little less room round the header and
       a 200px radar below the box (the core caps it at 240px). */
    .soc2-readiness-exec-header { padding: 20px 28px; margin-bottom: 14px; }
    .soc2-readiness-exec-header h1 { margin: 0 0 4px; }
    #soc2-readiness-exec-summary .soc2-glance ~ .ac-exec-radar.soc2-readiness-radar-wrapper svg { max-height: 200px !important; }

    .results-summary, .results-issues, .soc2-readiness-radar-wrapper, .principle-card,
    .soc2-readiness-exec-gaps { page-break-inside: avoid; }

    /* No "first section starts a new page" rule: it forced a break nothing
       needed (the cover already ends page 1). */
    .results-issues { page-break-before: auto; }

    /* Four a row: each category card holds two score bars with their labels,
       and the longest category words need the width. */
    .results-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 8px !important; }
    .principle-card { padding: 8px 10px !important; }
    .principle-card-title { font-size: .72rem !important; }
    .principle-score-label { font-size: .68rem !important; }

    .soc2-readiness-radar-wrapper svg { width: 100%; max-width: 480px; height: auto; }

    .print-shell-table {
      display: table !important;
      width: 100%;
      border-collapse: collapse;
    }
    .print-shell-table > tbody { display: table-row-group !important; }
    .print-shell-table > tfoot { display: table-footer-group !important; }
    .print-shell-table > tbody > tr, .print-shell-table > tfoot > tr { display: table-row !important; }
    .print-shell-table > tbody > tr > td, .print-shell-table > tfoot > tr > td { display: table-cell !important; padding: 0 !important; border: none !important; }

    .soc2-readiness-print-footer {
        display: flex !important;
        background: #ffffff;
        border-top: 2px solid var(--soc2-readiness-primary);
        padding: 5px 0;
        align-items: center;
    }
    .soc2-readiness-footer-col { flex: 1; font-size: 6.5pt; color: #5a6a7a; }
    .soc2-readiness-footer-left { text-align: left; font-weight: 700; color: #1c2a38; }
    .soc2-readiness-footer-right { text-align: right; }
}

/* ── Trust Service Category election modal + toggle bar ──────────────────────
   Mirrors nis2-assessment.css's .n2-scope-* pattern, adapted for a single
   checkbox screen rather than NIS2's two-step sector/size flow. */
.tsc-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 18px 0;
}
.tsc-option {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "check title" ". desc";
    column-gap: 10px;
    row-gap: 2px;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.tsc-option:hover { border-color: var(--soc2-readiness-primary); }
.tsc-option input[type="checkbox"] {
    grid-area: check;
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: var(--soc2-readiness-primary);
}
.tsc-option:has(input:checked) {
    border-color: var(--soc2-readiness-primary);
    background: color-mix(in srgb, var(--soc2-readiness-primary) 8%, transparent);
}
.tsc-option-title { grid-area: title; font-weight: 700; font-size: .92rem; color: var(--text-1); }
.tsc-option-desc  { grid-area: desc; font-size: .8rem; color: var(--text-2); line-height: 1.4; }

.tsc-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 14px;
    margin-bottom: 14px;
    background: color-mix(in srgb, var(--soc2-readiness-primary) 8%, transparent);
    border: 1px solid var(--soc2-readiness-primary);
    border-radius: 8px;
    font-size: .82rem;
}
.tsc-bar-label { font-weight: 600; color: var(--text-1); white-space: nowrap; }
.tsc-bar-value { color: var(--text-2); }
.tsc-bar-change {
    margin-left: auto;
    background: none;
    border: 1px solid var(--soc2-readiness-primary);
    color: var(--soc2-readiness-primary);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
}
.tsc-bar-change:hover { background: var(--soc2-readiness-primary); color: #fff; }

@media (max-width: 640px) {
    .tsc-bar { flex-direction: column; align-items: flex-start; }
    .tsc-bar-change { margin-left: 0; }
}

/* ─────────────────────────────────────────
   The report the organisation is aiming for (soc2-report.js;
   soc2-readiness-assessment.js renderSOC2READINESSResults()): the bar above
   the questions (on the dark page), and in the white results panel the
   summary card, the category grid, What an Auditor Would Raise, Getting Ready
   for <report>, the roadmap, and the "What an auditor looks for" notes under
   each question. Colours come from the tokens, which .results-panel
   redefines for its white background.
   ───────────────────────────────────────── */
.soc2-target-bar {
    display: flex;
    align-items: center;
    gap: 10px 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    margin-bottom: 14px;
    background: color-mix(in srgb, var(--soc2-readiness-primary) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--soc2-readiness-primary) 55%, transparent);
    border-radius: 8px;
    font-size: .82rem;
}
.soc2-target-label { font-weight: 600; color: var(--text-1); white-space: nowrap; }
.soc2-target-select {
    padding: 6px 10px;
    border: 1.5px solid color-mix(in srgb, var(--soc2-readiness-primary) 60%, transparent);
    border-radius: 8px;
    background: var(--bg-2);
    color: var(--text-1);
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    max-width: 100%;
    min-width: 0;
    color-scheme: dark;
}
.results-panel .soc2-target-select { background: #fff; color-scheme: light; }
.soc2-target-select:focus-visible { outline: 2px solid var(--soc2-readiness-primary); outline-offset: 2px; }
.soc2-target-hint { font-size: .8rem; color: var(--text-2); flex: 1 1 16rem; min-width: 0; }

/* Summary card: the stage, the two scores and the target. */
.soc2-score-block { min-width: 0; }
.overall-score.soc2-score-big { font-size: 1.55rem; line-height: 1.2; max-width: 20rem; }
.overall-score.soc2-score-num { font-size: 2.2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.soc2-score-side { margin-left: auto; text-align: right; max-width: 22rem; }
.soc2-target-line { font-size: .88rem; font-weight: 600; color: var(--soc2-readiness-secondary); }
.soc2-stage-means { font-size: .86rem; color: var(--text-2); margin: 0 0 12px; max-width: 80ch; }

.soc2-verdict {
    border: 1px solid var(--border);
    border-left: 4px solid #c0392b;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 0 0 14px;
    background: #fbfcfd;
}
.soc2-verdict.is-nearly { border-left-color: #b45309; }
.soc2-verdict.is-ready  { border-left-color: #008a5e; }
.soc2-verdict-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.soc2-verdict-pill {
    color: #fff;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .02em;
    padding: 2px 10px;
    border-radius: 12px;
    white-space: nowrap;
}
.soc2-verdict-text { font-weight: 700; color: var(--text-1); font-size: .95rem; }
.soc2-verdict-means { font-size: .85rem; color: var(--text-2); margin: 6px 0 10px; max-width: 80ch; line-height: 1.5; }
.soc2-tally { display: flex; flex-wrap: wrap; gap: 6px; }
.soc2-chip {
    font-size: .76rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    background: #eef1f5;
    color: #4b5563;
}
.soc2-chip.is-good  { background: #e6f4ea; color: #15803d; }
.soc2-chip.is-bad   { background: #fde8e8; color: #b91c1c; }
.soc2-chip.is-warn  { background: #fef3e2; color: #9a5b00; }
.soc2-chip.is-muted { background: #eef1f5; color: #4b5563; font-weight: 600; }
.soc2-summary-text, .soc2-timeline { font-size: .9rem; color: var(--text-1); margin: 0 0 14px; line-height: 1.6; max-width: 80ch; }
/* A block, not a centred flex box: the radar wrapper would then shrink to
   an SVG's default 300px. The SVG centres itself. */
.soc2-radar-slot { margin: 4px 0 14px; }

/* Category cards: a design bar and an operating evidence bar, each with the
   target's mark, and the category's exceptions for the target report. */
.soc2-section-card.has-likely   { box-shadow: inset 3px 0 0 #b91c1c; }
.soc2-section-card.has-possible { box-shadow: inset 3px 0 0 #c17a4a; }
.soc2-bar-row {
    display: grid;
    grid-template-columns: 4.6rem minmax(0, 1fr) 2.6rem;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}
.soc2-bar-label { font-size: .72rem; color: var(--text-2); }
.soc2-bar-value { font-size: .74rem; color: var(--text-1); text-align: right; font-variant-numeric: tabular-nums; }
.soc2-section-bar { position: relative; overflow: visible; }
.soc2-section-bar .principle-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; }
.soc2-target-marker {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    margin-left: -1px;
    background: var(--soc2-readiness-secondary);
    border-radius: 1px;
}
.soc2-section-rating { font-size: .74rem; font-weight: 600; margin-top: 8px; }
.soc2-section-rating.is-bad  { color: #b91c1c; }
.soc2-section-rating.is-warn { color: #9a5b00; }
.soc2-section-rating.is-good { color: #15803d; }
.soc2-section-rating.is-none { color: var(--text-2); font-weight: 500; }

/* What an Auditor Would Raise, and the controls lists in Getting Ready for. */
.soc2-lead { font-size: .87rem; color: var(--text-1); margin: 0 0 12px; line-height: 1.55; max-width: 80ch; }
.soc2-lead-sub, .soc2-muted { font-size: .82rem; color: var(--text-2); margin: 0 0 12px; max-width: 80ch; line-height: 1.5; }
.soc2-note {
    font-size: .82rem;
    color: #7a4f00;
    background: #fff8e6;
    border: 1px solid #f3d38a;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 0 0 12px;
}
.soc2-count { font-size: .9rem; font-weight: 600; border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; }
.soc2-count.is-open { background: #fef2f2; color: #991b1b; }
.soc2-count.is-met  { background: #ecfdf3; color: #166534; }
.soc2-exceptions h4, .soc2-target-step h4 { font-size: .95rem; color: var(--soc2-readiness-secondary); margin: 16px 0 8px; }

.soc2-item-list { margin: 0; padding-left: 22px; display: grid; gap: 12px; }
.soc2-item { font-size: .87rem; color: var(--text-1); }
.soc2-item-head { display: flex; align-items: baseline; gap: 6px 8px; flex-wrap: wrap; }
.soc2-item-name { font-weight: 700; color: var(--soc2-readiness-secondary); overflow-wrap: anywhere; }
.soc2-item-state {
    font-size: .72rem;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 10px;
}
.soc2-item-state.not  { background: #fde8e8; color: #b91c1c; }
.soc2-item-state.part { background: #fef3cd; color: #856404; }
.soc2-item-state.none { background: #eef1f5; color: #5a6275; }
.soc2-item-state.ok   { background: #e6f4ea; color: #15803d; }
.soc2-item-gain { font-size: .75rem; font-weight: 600; color: #15803d; white-space: nowrap; }
.soc2-crit {
    font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: .72rem;
    color: var(--text-2);
    background: #f1f4f8;
    border-radius: 4px;
    padding: 0 5px;
    white-space: nowrap;
}
.soc2-common { font-size: .7rem; font-weight: 700; color: #9a5b00; background: #fef3e2; border-radius: 8px; padding: 0 6px; white-space: nowrap; }
.soc2-item-why, .soc2-item-needs, .soc2-item-good, .soc2-item-evidence { margin: 4px 0 0; line-height: 1.5; max-width: 80ch; }
.soc2-item-why { color: #7a4f00; }
.soc2-item-needs strong { color: #b45309; font-weight: 600; }
.soc2-item-good strong, .soc2-item-evidence strong { color: var(--soc2-readiness-secondary); font-weight: 600; }
.soc2-item-evidence { color: var(--text-2); }

.soc2-more, .soc2-target-also { margin-top: 12px; font-size: .82rem; color: var(--text-2); }
.soc2-more summary, .soc2-target-also summary { cursor: pointer; font-weight: 600; color: var(--text-1); }
.soc2-more summary:focus-visible, .soc2-target-also summary:focus-visible { outline: 2px solid var(--soc2-readiness-primary); outline-offset: 2px; }
.soc2-more-lead { margin: 6px 0 0; max-width: 80ch; }
.soc2-more ul, .soc2-target-also ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 3px; }

/* Getting Ready for <report>. */
.soc2-target-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.soc2-target-head h3 { margin: 0; }
.soc2-target-picker { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: var(--text-2); max-width: 100%; }
/* The options are long; on a phone the select shrinks to fit rather than run off the screen. */
.soc2-target-picker .soc2-target-select { flex: 0 1 auto; }
.soc2-target-intro { font-size: .87rem; color: var(--text-1); line-height: 1.55; margin: 0 0 10px; max-width: 80ch; }
.soc2-target-summary {
    font-size: .9rem;
    font-weight: 600;
    color: var(--soc2-readiness-secondary);
    background: #faf5f0;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 0 0 14px;
    max-width: 80ch;
}
.soc2-meter { margin: 0 0 16px; max-width: 36rem; }
.soc2-meter-label { font-size: .78rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.soc2-meter-bar { position: relative; height: 10px; background: var(--border); border-radius: 5px; }
.soc2-meter-now, .soc2-meter-after { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.soc2-meter-after { background: repeating-linear-gradient(135deg, #d9b79a 0 4px, #efdccb 4px 8px); }
.soc2-meter-bar .soc2-target-marker { top: -4px; bottom: -4px; }
.soc2-meter-legend { font-size: .78rem; color: var(--text-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.soc2-target-step { border-top: 1px solid var(--border); padding-top: 4px; margin-top: 12px; }
.soc2-target-lead { font-size: .84rem; color: var(--text-2); margin: 0 0 8px; }
.soc2-target-next {
    margin-top: 12px;
    background: none;
    border: 1.5px solid var(--soc2-readiness-primary);
    color: var(--soc2-readiness-secondary);
    border-radius: 8px;
    padding: 7px 14px;
    font: inherit;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
}
.soc2-target-next:hover { background: color-mix(in srgb, var(--soc2-readiness-primary) 10%, transparent); }
.soc2-target-next:focus-visible { outline: 2px solid var(--soc2-readiness-primary); outline-offset: 2px; }

/* The roadmap. */
.soc2-phase { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-top: 10px; }
.soc2-phase-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.soc2-phase-name { font-weight: 700; color: var(--soc2-readiness-secondary); }
.soc2-phase-focus { font-size: .85rem; color: var(--text-2); }
.soc2-phase-closes, .soc2-phase-actions { margin: 4px 0 0; padding-left: 20px; font-size: .85rem; line-height: 1.5; }
.soc2-phase-closes { list-style: none; padding-left: 0; display: grid; gap: 3px; }
.soc2-phase-actions li { margin-top: 3px; }
.soc2-kind-tag {
    margin-left: 6px;
    font-size: .68rem;
    font-weight: 700;
    color: #7c4a26;
    background: #f6e8dc;
    border-radius: 8px;
    padding: 0 6px;
}
.soc2-kind-tag.is-operating { color: #1d4f7a; background: #e3eef8; }

/* Under each question (on the dark page): what an auditor looks for. */
.soc2-auditor-note { margin: 8px 0 4px; font-size: .8rem; color: var(--text-2); }
.soc2-auditor-note summary { cursor: pointer; font-weight: 600; color: var(--soc2-readiness-primary); width: fit-content; }
.soc2-auditor-note summary:focus-visible { outline: 2px solid var(--soc2-readiness-primary); outline-offset: 2px; }
.soc2-auditor-note p { margin: 6px 0 0; line-height: 1.5; max-width: 80ch; }
.soc2-auditor-note strong { color: var(--text-1); font-weight: 600; }
.soc2-auditor-kind { font-size: .74rem; font-weight: 600; }

/* The print cover's "At a glance" box (onPrintCover); printed only. */
.soc2-glance { display: none; }

@media (max-width: 600px) {
    .soc2-target-bar { flex-direction: column; align-items: stretch; }
    .soc2-target-label { white-space: normal; }
    .soc2-target-hint { flex: none; }
    .soc2-score-side { margin-left: 0; text-align: left; flex-basis: 100%; }
    .soc2-target-picker { flex-wrap: wrap; }
}

@media print {
    /* The cover's "At a glance" box: the report aimed for, the verdict, the
       exceptions and what it takes. */
    .soc2-glance {
        display: block;
        border: 1px solid #dde3ea;
        border-left: 4px solid var(--soc2-readiness-primary);
        border-radius: 6px;
        padding: 8px 12px;
        margin: 10px 0 6px;
        font-size: 9pt;
        page-break-inside: avoid;
    }
    .soc2-glance-title {
        font-size: 8pt;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--soc2-readiness-secondary);
        margin-bottom: 4px;
    }
    .soc2-glance-row { display: flex; gap: 10px; padding: 2px 0; border-top: 1px solid #eef1f5; }
    .soc2-glance-row:first-of-type { border-top: none; }
    .soc2-glance-row > span { flex: 0 0 40mm; color: #5a6a7a; }
    .soc2-glance-row > strong { flex: 1; color: #1c2a38; font-weight: 600; }

    /* The cover already carries the radar, with the same target ring. */
    .soc2-radar-slot { display: none !important; }

    /* The summary card, What an Auditor Would Raise, Getting Ready for and
       the roadmap run over pages: each control, phase and note stays whole
       instead, and a heading or lead-in never ends a page. */
    #soc2-summary-card, .results-issues.soc2-exceptions, .results-issues.soc2-target,
    .results-issues.soc2-roadmap { page-break-inside: auto; break-inside: auto; }
    #soc2-section-grid { break-inside: auto !important; page-break-inside: auto !important; }
    .soc2-verdict, .soc2-item, .soc2-phase, .soc2-meter, .soc2-target-summary, .soc2-note,
    .soc2-count, .issue-item, .soc2-more, .soc2-target-intro, .soc2-lead,
    .soc2-lead-sub { page-break-inside: avoid; break-inside: avoid; }
    .results-issues h3, .results-issues h4, .soc2-target-head, .soc2-target-intro, .soc2-lead,
    .soc2-lead-sub, .soc2-muted, .soc2-target-lead { break-after: avoid; page-break-after: avoid; }
    /* Controls and lists that do nothing on paper. The collapsed lists in
       What an Auditor Would Raise print: onPrintCover opens them. */
    .soc2-target-picker, .soc2-target-next, .soc2-target-also { display: none !important; }
    .soc2-more > summary { list-style: none; cursor: default; }
    .soc2-more > summary::-webkit-details-marker { display: none; }
    .overall-score.soc2-score-big { font-size: 1.3rem; }
    .overall-score.soc2-score-num { font-size: 1.8rem; }
    /* Four cards a row leave each about 140px inside: a narrower label and
       value column keep the bar itself about 50px wide. */
    .soc2-bar-row { grid-template-columns: 3.2rem minmax(0, 1fr) 1.8rem; gap: 4px; margin-top: 4px; }
    .soc2-bar-label, .soc2-bar-value { font-size: .64rem; }
    .soc2-section-rating { font-size: .64rem; }
}
