/* ADR-018: the portal's shell and page layouts. Tokens only, never hex. */
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

/* Shell: sidebar | main */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 20px; padding: 18px 14px;
  background: var(--surface-card); border-right: 1px solid var(--border-subtle); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; color: var(--text-strong); font-size: 15px;
  font-weight: 700; letter-spacing: -0.02em; }
.brand:hover { color: var(--text-strong); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand-600);
  color: var(--action-primary-fg); font-size: 14px; font-weight: 700; letter-spacing: 0; }
.workspace { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--border-subtle); background: var(--surface-sunken); }
.workspace-tile { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px;
  background: var(--brand-600); color: var(--action-primary-fg); font-size: 11px; font-weight: 700; }
.workspace-name { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text-strong); overflow-wrap: anywhere; }
.workspace-meta { font-size: 11.5px; color: var(--text-muted); }

.nav { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: 8px;
  color: var(--text-default); font-size: 13.5px; font-weight: 500; }
.nav-item:hover { background: var(--surface-hover); color: var(--text-default); text-decoration: none; }
.nav-item .label { flex: 1; min-width: 0; }
.nav-item.is-soon { color: var(--text-muted); }
.nav-item[aria-current="page"] { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.soon-tag { padding: 2px 7px; border: 1px solid var(--border-default); border-radius: var(--radius-pill);
  font: 11px/1 var(--font-mono); color: var(--text-subtle); }
.count-pill { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill);
  background: var(--danger-50); color: var(--danger-700); font-size: 11.5px; font-weight: 600; }
.nav-sub > summary { display: flex; align-items: center; gap: 8px; padding: 2px 10px 4px 36px; list-style: none; cursor: pointer;
  font-size: 12px; color: var(--text-muted); }
.nav-sub > summary::-webkit-details-marker { display: none; }
.sub-toggle::after { content: "Show ▾"; display: inline-flex; align-items: center; height: 20px; padding: 0 6px;
  border: 1px solid var(--border-default); border-radius: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-link); }
.nav-sub[open] .sub-toggle::after { content: "Hide ▴"; }
.nav-subitem { display: block; min-height: 30px; padding: 6px 10px 6px 36px; border-radius: 8px; font-size: 13px;
  line-height: 1.3; color: var(--text-muted); }
.nav-subitem:hover { background: var(--surface-hover); color: var(--text-default); text-decoration: none; }
.nav-subitem[aria-current="page"] { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }

.sidebar-foot { display: flex; flex-direction: column; gap: 10px; }
.theme-toggle { display: flex; align-items: center; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-muted); font: 500 13px var(--font-sans); cursor: pointer; }
.theme-toggle:hover { background: var(--surface-hover); }
.when-light, .when-dark { display: flex; align-items: center; gap: 10px; }
.when-dark, html[data-theme="dark"] .when-light { display: none; }
html[data-theme="dark"] .when-dark { display: flex; }
.account { position: relative; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.account > summary { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 8px; list-style: none; cursor: pointer; }
.account > summary::-webkit-details-marker { display: none; }
.account > summary:hover { background: var(--surface-hover); }
.avatar { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink-100); color: var(--text-strong); font-size: 12px; font-weight: 600; }
.who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--text-strong); }
.account .menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 10; display: flex; flex-direction: column;
  gap: 4px; padding: 8px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: 10px; box-shadow: var(--shadow-lg); }
.account .menu a { display: block; padding: 8px; border-radius: 6px; color: var(--text-default); }
.account .menu a:hover, .account .menu a[aria-current="page"] { background: var(--brand-50); color: var(--brand-700); text-decoration: none; }
.account .menu small { display: block; font-size: 12px; color: var(--text-muted); }
.account .menu form { margin: 0; }
.account .menu .btn { width: 100%; }

/* Top bar and page */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; height: 56px; padding: 0 32px;
  background: var(--surface-card); border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
.crumb { flex: 1; color: var(--text-muted); }
.crumb strong { color: var(--text-strong); font-weight: 600; }
.crumb .sep { margin: 0 8px; color: var(--text-subtle); }
.last-scan { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); white-space: nowrap; }
.last-scan .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success-600); }
.last-scan.none .dot { background: var(--border-strong); }
/* SPEC-021 change 0.4.0: the chosen date in words, under each date box */
.date-words { display: block; min-height: 1.2em; margin-top: 2px; }
.date-words.bad { color: var(--danger-700); font-weight: 600; }
input[type="date"][aria-invalid="true"] { border-color: var(--danger-600, #c0392b); }
/* SPEC-028 behaviour 5a: one row per security area, its choice beside its name */
.area-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 12px 0 4px; }
.area-filter a { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; text-decoration: none; }
.area-filter a[aria-current="true"] { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.state-dot { width: 8px; height: 8px; border-radius: 50%; }
.state-pass { background: var(--success-600); } .state-progress { background: var(--warning-500, #E0A800); } .state-fail { background: var(--danger-600, #D92D20); }
#areas-each .trust-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#areas-each select { width: auto; min-width: 190px; flex: none; }
#areas-each .trust-list li > span { flex: 1; min-width: 0; }
#areas-each > .btn, #areas-all { margin-top: 12px; }
@media (max-width: 720px) { #areas-each .trust-list li { flex-direction: column; align-items: stretch; } #areas-each select { width: 100%; } }
/* SPEC-023 change 0.5.0: files held back because they look like records */
.held-row { width: 100%; gap: 8px; }
.held-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.held-choice select, #move select { max-width: min(420px, 100%); }
.held-row p { margin: 0; }
/* SPEC-034: Feedback in the top bar and the request forms */
.feedback-menu > summary, details.confirm > summary.btn { list-style: none; }
.feedback-menu > summary::-webkit-details-marker, details.confirm > summary.btn::-webkit-details-marker { display: none; }
details.confirm > form textarea { width: 100%; }
form[data-feedback][hidden] { display: none; }  /* .stack would otherwise show it under the thanks */
details.confirm > .feedback-done { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: min(360px, 90vw); padding: 16px; background: var(--surface-card); border: 1px solid var(--border-default); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
#need > .feedback-done { left: 0; right: auto; }
.feedback-done p { margin: 0 0 10px; }
.feedback-error { margin: 0; padding: 8px 10px; width: 100%; border-radius: 6px; background: var(--danger-50); color: var(--danger-700); font-size: 13px; }
.feedback-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.full-text summary { cursor: pointer; }
.pre { white-space: pre-line; margin: 6px 0 0; }
.about { margin: 0 0 2px; }
#need > form { left: 0; right: auto; }  /* opens over the page, not the sidebar */
.page { width: 100%; max-width: 1240px; display: flex; flex-direction: column; gap: 28px; padding: 32px 32px 64px; }
.page h1 { margin: 0; font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; color: var(--text-strong); }
.page h2 { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--text-strong); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; }
.page-sub { margin: 4px 0 0; font-size: 14px; color: var(--text-muted); max-width: 760px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; font-size: 12.5px; color: var(--text-muted); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Signed-out pages */
.auth { display: grid; place-items: center; min-height: 100vh; padding: 32px 16px; }
.auth-card { display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 440px; }
.auth-card .brand { justify-content: center; }
.auth-card section { padding: 28px; }
.auth-card h1 { margin: 0 0 8px; font-size: 22px; color: var(--text-strong); }

@media print {
  .sidebar, .topbar, .no-print, form.notify { display: none !important; }
  .app { display: block; }
  body { background: none; }
  section, .card { box-shadow: none; }
}
/* SPEC-020 change 0.15.0: below 900px the sidebar is a panel that Menu slides in over a dimmed page. */
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.menu-button, .menu-close, .topbar-mark, .scrim { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: min(280px, 85vw); height: 100dvh;
    overflow-y: auto; transform: translateX(-100%); visibility: hidden; box-shadow: var(--shadow-lg);
    transition: transform var(--duration-base) var(--ease-standard), visibility 0s var(--duration-base); }
  .app.menu-open .sidebar { transform: none; visibility: visible; transition: transform var(--duration-base) var(--ease-standard); }
  .nav { flex: none; overflow: visible; }
  .scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 35; background: var(--surface-overlay); }
  body.menu-locked { overflow: hidden; }
  .menu-button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--border-default);
    border-radius: 8px; background: var(--surface-card); color: var(--text-strong); font: 600 13px var(--font-sans); cursor: pointer; }
  .menu-button:hover, .menu-close:hover { background: var(--surface-hover); }
  .menu-close { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px;
    background: transparent; color: var(--text-default); cursor: pointer; }
  .topbar-mark { display: grid; flex: none; }
  .topbar-mark:hover { text-decoration: none; }
  .topbar { position: static; flex-wrap: wrap; height: auto; min-height: 56px; gap: 4px 16px; padding: 10px 16px; }
  .page { padding: 24px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Coming soon pages and the roadmap */
.soon { width: 100%; max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; padding-top: 24px; }
.soon .soon-title { font-size: 34px; letter-spacing: -0.025em; }
.soon-desc { margin: 0; max-width: 660px; font-size: 16px; line-height: 1.6; color: var(--text-muted); }
.soon > p { margin: 0; }
.area { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px 32px; }
.area h2 { margin: 8px 0 4px; font-size: 22px; }
.area ul { margin: 8px 0 0; padding-left: 18px; }
.preview-head { display: flex; gap: 6px; align-items: baseline; padding: 10px 18px; background: var(--surface-sunken);
  border-bottom: 1px solid var(--border-subtle); font-size: 12.5px; }
.preview-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 220px 130px; gap: 12px; align-items: center;
  padding: 12px 18px; border-top: 1px solid var(--border-subtle); }
.preview-row:first-of-type { border-top: 0; }
.preview-row .status { justify-self: end; }
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 24px; }
.points > div { padding-top: 16px; border-top: 1px solid var(--border-default); }
.points h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--text-strong); }
.points p { margin: 0; font-size: 13px; }
.already { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 20px; border-radius: var(--radius-lg);
  background: var(--success-50); border: 1px solid var(--success-100); }
.already > .icon { color: var(--success-600); }
.already .eyebrow { color: var(--success-600); }
.already p { margin: 2px 0 0; }
.roadmap-card { display: flex; flex-direction: column; gap: 6px; color: var(--text-default); }
.roadmap-card:hover { text-decoration: none; border-color: var(--border-default); }
.roadmap-title { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; color: var(--text-strong); }
@media (max-width: 900px) { .preview-row { grid-template-columns: 1fr auto; } .preview-row > :nth-child(1), .preview-row > :nth-child(3) { display: none; } }

/* Integrations */
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; }
.card-head-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.card-head h2 { margin: 0; }
.card-head form { margin: 0; }
.table-head, .table-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) 130px 110px 120px;
  gap: 16px; align-items: center; padding: 14px 22px; }
.table-head { padding-block: 10px; background: var(--surface-sunken); border-top: 1px solid var(--border-subtle); }
.table-row { border-top: 1px solid var(--border-subtle); }
.table-row.is-error { background: var(--danger-50); }
.row-action { justify-self: end; }
.source-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.source-name { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.card-foot { padding: 12px 22px 16px; border-top: 1px solid var(--border-subtle); font-size: 13px; }
.card-foot ul { margin: 0 0 6px; padding-left: 18px; }
.card-foot p { margin: 0; }
.source-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.source-card p { margin: 0; flex: 1; }
.source-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panels { display: flex; flex-direction: column; gap: 16px; }
.panel-title { display: flex; align-items: center; gap: 10px; }
.panels section > p:last-child { margin-bottom: 0; }
.gcp-setup { margin: 8px 0 12px; }
.gcp-setup > summary, .disconnect > summary { cursor: pointer; font-size: 14px; }
.gcp-setup > summary { color: var(--text-link); }
.disconnect { margin-top: 12px; }
.disconnect > summary { color: var(--text-muted); }
.disconnect > summary:hover { color: var(--danger-700); }
.disconnect form { margin: 0; }
@media (max-width: 900px) {
  .table-head { display: none; }
  .table-row { grid-template-columns: 1fr; gap: 8px; }
  .row-action { justify-self: start; }
}

/* Frameworks */
.module { display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.module > p { margin: 0; }  /* the card's gap spaces its blocks; paragraphs add none of their own */
.module > p.small + p.small { margin-top: -8px; }  /* consecutive info lines read as one block */
.module-head { display: flex; align-items: center; gap: 8px; }
.module-head h2 { margin: 0; font-size: 18px; }
.score { margin: 0; font-size: 30px; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.score.big { font-size: 44px; line-height: 1; letter-spacing: -0.02em; }
.score .pct { font-size: 22px; color: var(--text-muted); }
.score small { margin-left: 10px; font-size: 13px; font-weight: 400; color: var(--text-muted); letter-spacing: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: -8px 0 0; font-size: 12.5px; color: var(--text-muted); }
.legend b { color: var(--text-strong); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding-top: 14px;
  border-top: 1px solid var(--border-subtle); }
.facts dd { margin: 4px 0 0; font-size: 13.5px; font-weight: 600; color: var(--text-default); }
.note { display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px; border-radius: var(--radius-lg);
  background: var(--brand-50); border: 1px solid var(--brand-100); }
.note .icon { color: var(--brand-700); margin-top: 2px; }
.note p { margin: 0; }
.module-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.module-card p { margin: 0; flex: 1; }
.module-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.fw-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; }
.fw-head h1 { margin: 0; }
.tag { margin-left: 8px; padding: 1px 8px; border: 1px solid var(--border-default); border-radius: var(--radius-pill);
  font: 500 12px var(--font-mono); color: var(--text-muted); vertical-align: middle; }
.coverage { padding: 10px 14px; border-radius: var(--radius-md); background: var(--brand-50); border: 1px solid var(--brand-100); }
.reqs { margin: 0; padding: 0; list-style: none; }
.reqs > li { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 10px 0;
  border-top: 1px solid var(--border-subtle); }
.reqs > li:first-child { border-top: 0; }
.ref { padding-top: 2px; font: 13px var(--font-mono); color: var(--text-muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
@media (max-width: 560px) { .reqs > li { grid-template-columns: minmax(0, 1fr) auto; } .chips .chip { white-space: normal; } .ref { grid-column: 1 / -1; } .facts { grid-template-columns: 1fr; } }

/* Scan progress */
.events { margin: 8px 0 0; padding-left: 20px; font-size: 13px; }
.events li { margin: 2px 0; }
/* SPEC-021: Controls page and control detail. */
.controls-grid { grid-template-columns: minmax(0, 2fr) 150px minmax(0, 1fr) 110px; }
.filters { justify-content: flex-start; align-items: end; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.stack label { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.attestation blockquote { margin: 0 0 8px; padding-left: 12px; border-left: 3px solid var(--border-subtle); }
.attestation .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; margin-top: 10px; }
section.card + section.card { margin-top: 16px; }
@media (max-width: 900px) { .controls-grid { grid-template-columns: 1fr; } }
/* SPEC-025: Settings people list. */
.people-grid { grid-template-columns: minmax(0, 2fr) 140px minmax(0, 1.5fr) 120px; }
@media (max-width: 900px) { .people-grid { grid-template-columns: 1fr; } }
/* SPEC-034: Your feedback, after .table-row so its columns win */
.requests-grid { grid-template-columns: 110px 110px minmax(0, 1fr) 90px; align-items: start; }
.requests-grid p { margin: 4px 0 0; }
@media (max-width: 900px) { .requests-grid { grid-template-columns: 1fr; } }
/* SPEC-023: policy register. */
.policies-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.3fr) 110px; }
.policy-doc { max-width: 72ch; font-size: 15px; line-height: 1.6; color: var(--text-strong); }
.policy-doc h1 { font-size: 24px; margin: 8px 0 12px; }
.policy-doc h2 { font-size: 17px; margin: 22px 0 6px; }
.policy-doc h3 { font-size: 15px; margin: 18px 0 4px; }
.policy-doc p, .policy-doc ul, .policy-doc ol { margin: 0 0 10px; }
.policy-doc ol, .policy-doc ul { padding-left: 22px; }
.policy-doc li { margin-bottom: 4px; }
.policy-doc table { border-collapse: collapse; margin: 0 0 12px; }
.policy-doc th, .policy-doc td { border: 1px solid var(--border-subtle); padding: 6px 10px; text-align: left; }
.policy-doc code { font-size: 13px; }
@media (max-width: 900px) { .policies-grid { grid-template-columns: 1fr; } }
/* SPEC-027: approval workflow. Added and removed lines are marked with "+" and "−" as well as colour. */
.decisions { list-style: none; padding: 0; margin: 0 0 12px; }
.decisions li { padding: 6px 0; border-bottom: 1px solid var(--border-subtle); }
.decisions blockquote { margin: 6px 0 0; padding-left: 10px; border-left: 3px solid var(--danger-600, #dc2626); }
.decide { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 12px 0; }
.check { flex-direction: row !important; align-items: center; gap: 8px; font-weight: 600; }
.diff { white-space: pre-wrap; font-size: 13px; max-height: 32rem; overflow: auto; padding: 12px; border: 1px solid var(--border-subtle); border-radius: 6px; }
.diff ins { display: block; text-decoration: none; background: var(--success-50, #ecfdf3); color: var(--success-700, #067647); }
.diff del { display: block; text-decoration: line-through; background: var(--danger-50, #fef3f2); color: var(--danger-700, #b42318); }
.comments { list-style: none; padding: 0; margin: 0 0 12px; }
.comments li { padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.comments p { margin: 4px 0 0; }
.record { max-width: 900px; }
.record-facts { display: grid; grid-template-columns: 180px 1fr; gap: 6px 16px; }
.record-facts div { display: contents; }
.record-facts dt { font-weight: 600; }
.record-facts dd { margin: 0; overflow-wrap: anywhere; }
.record-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.record-table th, .record-table td { border: 1px solid var(--border-subtle); padding: 6px 8px; text-align: left; vertical-align: top; }
@media (max-width: 900px) { .decide { grid-template-columns: 1fr; } .record-facts { grid-template-columns: 1fr; } }
@media print { .no-print { display: none !important; } }
/* SPEC-026 change 0.2.0: select policies to send together, the check-up and missing policies. */
.policies-grid.selectable { grid-template-columns: 28px minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.3fr) 110px; }
.checkup { list-style: none; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.missing { list-style: none; margin: 0; }
.missing li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.suggest-why { margin: 0 0 8px; }
.tip pre { font-size: 13px; padding: 8px 12px; border: 1px solid var(--border-subtle); border-radius: 6px; }
@media (max-width: 900px) { .policies-grid.selectable { grid-template-columns: 1fr; } }
.review-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr) auto; gap: 16px; align-items: center; }
@media (max-width: 900px) { .review-row { grid-template-columns: 1fr; } }
.read-sync { padding: 8px 0; border-bottom: 1px solid var(--border-subtle); overflow-wrap: anywhere; }
.read-sync p { margin: 0 0 4px; }
/* Radio buttons and checkboxes sit beside their words, not above them. */
.stack fieldset { border: 1px solid var(--border-subtle); border-radius: 6px; padding: 8px 12px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.stack fieldset label { flex-direction: row; align-items: center; gap: 8px; width: auto; }
.stack fieldset legend { padding: 0 4px; }
/* SPEC-028: Trust Center admin. */
.trust-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 16px 0; border-bottom: 1px solid var(--border-subtle); }
.trust-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; min-height: 40px; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid transparent; text-decoration: none; }
.trust-tabs a[aria-current="page"] { color: var(--brand-600); border-bottom-color: var(--brand-600); }
.trust-list { list-style: none; margin: 0 0 12px; padding: 0; }
.trust-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.area-form { margin-top: 0; flex-wrap: nowrap; }
.area-form select { width: auto; }
.trust-badge { display: inline-flex; align-items: center; gap: 10px; }
.trust-badge .mark { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); }
.trust-badge .mark.korelex { background: var(--brand-600); color: #fff; }
.swatch { display: inline-block; width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border-default); }
.trust-logo-thumb { width: 40px; height: 40px; object-fit: contain; border: 1px solid var(--border-subtle); border-radius: 8px; vertical-align: middle; margin-left: 8px; }
.trust-facts { display: grid; grid-template-columns: 140px 1fr; gap: 4px 16px; margin: 0 0 12px; }
.trust-facts div { display: contents; }
.trust-facts dt { color: var(--text-muted); }
.trust-facts dd { margin: 0; overflow-wrap: anywhere; }
.trust-request + .trust-request { border-top: 1px solid var(--border-subtle); }
.nda-preview { max-height: 260px; overflow: auto; white-space: pre-wrap; padding: 12px; border: 1px solid var(--border-subtle); border-radius: 6px; font-size: 13px; width: 100%; }
details.confirm { position: relative; }
details.confirm > form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: min(360px, 90vw); padding: 16px; background: var(--surface-card); border: 1px solid var(--border-default); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
@media (max-width: 720px) { .trust-facts { grid-template-columns: 1fr; } details.confirm > form, details.confirm > .feedback-done { position: static; } }
/* SPEC-020 behaviour 14: a framework's controls by what the client must do. */
.buckets { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; }
.buckets a { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(60px, 0.9fr) minmax(max-content, 1.4fr); gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border-subtle); color: inherit; text-decoration: none; }
.buckets a:hover .b-label { color: var(--text-link); }
.b-label { font-weight: 600; }
.b-meter { height: 6px; border-radius: 3px; background: var(--border-subtle); overflow: hidden; }
.b-meter span { display: block; height: 100%; background: var(--success-500, #2F9E5E); }
.b-count { text-align: right; color: var(--text-muted); white-space: nowrap; }
@media (max-width: 720px) { .buckets a { grid-template-columns: 1fr auto; } .b-meter { display: none; } }
/* SPEC-029: statement of applicability rows. */
.soa-row { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.soa-row .ref { min-width: 4.5em; }
.soa-row .grow { flex: 1 1 320px; }
.soa-change summary { cursor: pointer; color: var(--text-link); }
/* SPEC-020 behaviour 14: a control chip says what it still needs. Colour and words together. */
.chip.step-pass { background: var(--success-50, #ecfdf3); color: var(--success-700, #067647); border-color: transparent; }
.chip.step-todo { background: var(--surface-card); color: var(--text-link); border-color: var(--border-default); }
.chip.step-wait { background: var(--warning-50, #fffaeb); color: var(--warning-700, #b54708); border-color: transparent; }
.chip.step-accepted { background: var(--brand-50); color: var(--brand-700); border-color: transparent; }
.chip.step-fail { background: var(--danger-50, #fef3f2); color: var(--danger-700, #b42318); border-color: transparent; }
/* SPEC-031: evidence rows. */
.evidence-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) 80px minmax(0, 1.4fr); gap: 16px; align-items: center; }
@media (max-width: 900px) { .evidence-row { grid-template-columns: 1fr; gap: 4px; } }
.policy-pages { display: grid; gap: 12px; margin-top: 12px; }
.policy-pages img { width: 100%; height: auto; border: 1px solid var(--border-subtle); border-radius: 6px; background: #fff; }
.demo-banner { background: var(--brand-50, #e2eff0); color: var(--brand-700, #0b4850); text-align: center; font-size: 13px; font-weight: 600; padding: 6px 16px; border-bottom: 1px solid var(--border-subtle); }
.redteam-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 24px; margin: 0; }
.redteam-facts dt { font-size: 12px; color: var(--text-muted); }
.redteam-facts dd { margin: 0; }
.redteam-findings { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sev { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.sev-critical { background: #7f1d1d; color: #fff; }
.sev-high { background: #fde2e1; color: #9b1c1c; }
.sev-medhigh { background: #ffe8d1; color: #9a4a00; }
.sev-medium { background: #fef3c7; color: #7a5b00; }
.sev-low { background: #e5edf6; color: #2d4a6b; }
.redteam-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 2.4fr) 110px minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .redteam-grid { grid-template-columns: 1fr; gap: 4px; } }
.on-request { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
.badge-reports { display: block; margin-top: 2px; }

/* SPEC-035: failing items and their accepted risk on an automatic control */
.risk-items { list-style: none; margin: 0; padding: 0; }
.risk-item { display: flex; flex-direction: column; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--border-subtle); }
.risk-item p { margin: 0; }
.risk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.risk-head .mono { font-weight: 600; color: var(--text-strong); overflow-wrap: anywhere; }
.risk-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0; }
.risk-facts dt { color: var(--text-muted); }
.risk-facts dd { margin: 0; overflow-wrap: anywhere; }
.risk-back { color: var(--warning-700); }
.risk-accept > summary { list-style: none; }
.risk-accept > summary::-webkit-details-marker { display: none; }
.risk-accept[open] > summary { margin-bottom: 12px; }
.risk-accept form { max-width: 640px; }
.risk-until { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; }
.risk-until legend { padding: 0; margin-bottom: 6px; font-weight: 500; }
.risk-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-weight: 400; }
.risk-choice input[type="date"] { width: auto; }
.risk-history { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 0; padding-left: 18px; }
@media (max-width: 560px) { .risk-item { padding: 14px 16px; } .risk-facts { grid-template-columns: 1fr; } .risk-facts dd { margin-bottom: 6px; } }

/* SPEC-020 behaviour 14b: where to start, on a framework page */
.start { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.start-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 13rem; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.start-name { font-weight: 600; }
.start-item .chip { justify-self: end; }
.start-name .strength { font-weight: 400; color: var(--text-muted); font-size: 11px; margin-left: 8px; }
.start-more summary { cursor: pointer; color: var(--text-link); padding: 10px 0 0; font-size: 14px; }
@media (max-width: 640px) { .start-item { grid-template-columns: 1fr auto; } .start-count { grid-column: 1 / -1; grid-row: 2; } }

/* SPEC-020 behaviour 14c: how a framework is counted */
.counted-panel { display: flex; flex-direction: column; gap: 12px; }
.counted-tag { align-self: flex-start; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); background: var(--surface-sunken); border-radius: 4px; padding: 4px 8px; }
.counted-split > section.card, .counted-split > section.card + section.card { margin-top: 0; }
.counted-big { margin: 0; color: var(--text-muted); font-size: 15px; }
.counted-big b { font-size: 44px; line-height: 1; color: var(--text-strong); margin-right: 6px; font-weight: 600; }
.counted-dots { display: flex; flex-wrap: wrap; gap: 5px; }
.cd { display: inline-block; width: 14px; height: 14px; border-radius: 50%; }
.cd-pass { background: var(--success-500); } .cd-fail { background: var(--danger-500); } .cd-todo { background: var(--warning-500); }
.counted-kinds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.counted-kinds li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.counted-bar { grid-column: 1 / -1; display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--border-subtle); }
.counted-bar i { display: block; height: 100%; }
section.counted-rule { margin: 16px 0; display: flex; flex-direction: column; gap: 4px; background: var(--action-primary-bg); color: var(--action-primary-fg); border: 0; }
.counted-away { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 8px 0; }
.counted-away .card b { display: block; font-size: 28px; color: var(--text-strong); }
.counted-map { padding: 0; overflow: hidden; }
.counted-scroll { overflow-x: auto; }
#counted-map { display: block; width: 100%; min-width: 820px; }
#counted-map text { fill: var(--text-default); font-family: var(--font-sans); }
#counted-map .cm-head { font-size: 11px; letter-spacing: .08em; fill: var(--text-link); font-weight: 600; }
#counted-map .cm-ref { font-size: 11px; fill: var(--text-muted); font-family: ui-monospace, "SF Mono", Menlo, monospace; }
#counted-map .cm-label { font-size: 13px; }
#counted-map .cm-hit { fill: transparent; }
#counted-map .cm-node { cursor: pointer; outline: none; }
#counted-map .cm-node:hover .cm-hit { fill: var(--surface-hover); }
#counted-map .cm-node:focus-visible .cm-hit { stroke: var(--border-focus); stroke-width: 2; }
#counted-map .cm-pass { fill: var(--success-500); } #counted-map .cm-fail { fill: var(--danger-500); } #counted-map .cm-todo { fill: var(--warning-500); }
#counted-map path.link { fill: none; stroke: var(--border-default); stroke-width: 1.2; transition: opacity .15s; }
#counted-map.focus path.link { opacity: .15; }
#counted-map.focus path.link.on { opacity: 1; stroke-width: 2; }
#counted-map.focus path.link.on[data-tone="pass"] { stroke: var(--success-500); }
#counted-map.focus path.link.on[data-tone="fail"] { stroke: var(--danger-500); }
#counted-map.focus path.link.on[data-tone="todo"] { stroke: var(--warning-500); }
#counted-map.focus .cm-node.dim { opacity: .35; }
.counted-detail { border-top: 1px solid var(--border-subtle); padding: 16px 22px; display: flex; flex-direction: column; gap: 8px; }
.counted-detail p { margin: 0; }
.counted-detail-title { font-weight: 600; font-size: 16px; }
.counted-verdict { font-weight: 600; }
.cv-pass { color: var(--success-600); } .cv-fail { color: var(--danger-700); } .cv-todo { color: var(--warning-700); }
.counted-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.counted-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border-subtle); border-radius: 999px; font-size: 13px; }
.counted-chip .cd { width: 9px; height: 9px; }
.counted-chip small { color: var(--text-muted); }
.counted-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.counted-legend span { display: inline-flex; align-items: center; gap: 6px; }
.counted-legend .cd { width: 10px; height: 10px; }
@media (prefers-reduced-motion: reduce) { #counted-map path.link { transition: none; } }

/* SPEC-020 behaviour 14c: the call-out from a card or framework page to "How this is counted" */
.explain { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 12px 14px; border-radius: 10px; background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--text-default); text-decoration: none; transition: border-color .15s, background .15s; }
.explain:hover { border-color: var(--brand-500); }
.explain:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.explain-icon { display: flex; color: var(--brand-600); grid-row: span 2; padding-top: 1px; }
.explain-text { font-size: 12.5px; line-height: 1.45; color: var(--text-muted); }
.explain-text strong { display: block; font-size: 14px; color: var(--text-strong); margin-bottom: 1px; }
.explain-cta { grid-column: 2; justify-self: start; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-link); white-space: nowrap; }
.explain:hover .explain-cta .icon { transform: translateX(2px); }
.explain-cta .icon { transition: transform .15s; }
@media (prefers-reduced-motion: reduce) { .explain, .explain-cta .icon { transition: none; } }

/* SPEC-020 behaviour 14: bars and their key in the map's three colours */
.b-meter { display: flex; }
.b-meter span.m-done { background: var(--success-500); }
.b-meter span.m-fail { background: var(--danger-500); }
.b-meter span.m-todo { background: var(--warning-500); opacity: .45; }
.key { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; font-size: 12.5px; color: var(--text-muted); }
.key span { display: inline-flex; align-items: center; gap: 6px; }
.key i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.key .k-done { background: var(--success-500); } .key .k-fail { background: var(--danger-500); } .key .k-todo { background: var(--warning-500); opacity: .45; }
