:root {
  --bg: #f4f6fa;
  --logo-shield: #0b1f33;
  --logo-bar: #2dd4bf;
  --logo-word: #0b1f33;
  --logo-ai: #0e8f80;
  --surface: #ffffff;
  --text: #1b2330;
  --muted: #667085;
  --border: #e3e7ee;
  --primary: #3b5bdb;
  --primary-text: #ffffff;
  --low: #2f9e44;
  --medium: #f2b705;
  --high: #f76707;
  --critical: #e03131;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
  /* report chart series (validated categorical pair: slot 1 blue, slot 2 orange) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --cover-from: #1b2a6b;
  --cover-to: #3b5bdb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141c;
    --surface: #171e29;
    --text: #e6eaf0;
    --muted: #98a2b3;
    --border: #2a3342;
    --primary: #5c7cfa;
    --shadow: none;
    --series-1: #3987e5;
    --series-2: #d95926;
    --cover-from: #111a44;
    --cover-to: #2f4ab8;
    /* The navy shield would disappear on a dark background, so it turns light. */
    --logo-shield: #e6eaf0;
    --logo-bar: #0e8f80;
    --logo-word: #e6eaf0;
    --logo-ai: #2dd4bf;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
h4 { margin: 0.75rem 0 0.25rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.error-text { color: var(--critical); }

/* top bar */
.topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.75rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
/* Posture.ai logo: shield mark plus wordmark (brand colours in light mode). */
.logo-mark { width: 1.6em; height: 1.6em; flex: none; vertical-align: middle; }
.logo-shield { fill: var(--logo-shield); }
.logo-bar { fill: var(--logo-bar); }
.logo-word { font-weight: 700; letter-spacing: -0.02em; color: var(--logo-word); }
.logo-ai { color: var(--logo-ai); }
.brand-tag { font-size: 0.9rem; }
.tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.tab { border: none; background: transparent; padding: 0.45rem 0.8rem; border-radius: 8px; color: var(--muted); cursor: pointer; }
.tab.active { background: var(--bg); color: var(--text); font-weight: 600; }
#ai-status { margin-left: auto; }

main { max-width: 1200px; margin: 0 auto; padding: 1rem; }
.view { display: none; }
.view.active { display: block; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; box-shadow: var(--shadow); }
.card.narrow { max-width: 560px; }
/* The organisation's logo sits on a light chip so any logo reads in light and dark themes. */
.org-brand { display: flex; align-items: center; padding: 0.2rem 0.5rem; border-radius: 6px; background: #fff; border: 1px solid var(--border); }
.org-brand img { display: block; height: 26px; max-width: 140px; object-fit: contain; }
.dash-org { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.dash-org .org-logo-chip { display: flex; align-items: center; padding: 0.5rem 0.9rem; border-radius: 10px; background: #fff; border: 1px solid var(--border); }
.dash-org img { display: block; height: 48px; max-width: 240px; object-fit: contain; }
.dash-org h2 { margin: 0; font-size: 1.2rem; }
.logo-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.logo-preview { display: flex; align-items: center; justify-content: center; min-width: 220px; min-height: 90px; padding: 0.75rem; border-radius: 10px; background: #fff; border: 1px dashed var(--border); }
.logo-preview img { display: block; max-height: 80px; max-width: 280px; object-fit: contain; }
.logo-preview .muted { color: #6b7280; }
.logo-actions { display: flex; gap: 0.5rem; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 860px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

/* controls */
button, .button {
  font: inherit; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 0.45rem 0.85rem; border-radius: 8px; cursor: pointer; display: inline-block;
}
button:hover, .button:hover { border-color: var(--primary); }
button:disabled { opacity: 0.6; cursor: wait; }
button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
button.danger { color: var(--critical); }
button.small { padding: 0.2rem 0.55rem; font-size: 0.85em; }
button.link { border: none; background: none; padding: 0 0.2rem; }
input, select, textarea {
  font: inherit; width: 100%; padding: 0.45rem 0.6rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--text);
}
label { display: block; margin-bottom: 0.75rem; font-size: 0.9rem; color: var(--muted); }
label input, label select, label textarea { margin-top: 0.25rem; color: var(--text); }
label.inline { display: flex; gap: 0.5rem; align-items: center; }
label.inline input { width: auto; margin: 0; }
label.button { margin: 0; font-size: inherit; color: var(--text); }

.pill { padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.8rem; background: var(--bg); border: 1px solid var(--border); }
.pill.ok { color: var(--low); }
.pill.warn { color: var(--high); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0.9rem; box-shadow: var(--shadow); }
button.kpi { font: inherit; color: inherit; text-align: left; width: 100%; cursor: pointer; }
button.kpi:hover, button.kpi:focus-visible { border-color: var(--primary); }
.kpi-val { font-size: 1.8rem; font-weight: 700; }
.kpi-label { color: var(--muted); font-size: 0.85rem; }
.kpi.critical .kpi-val { color: var(--critical); }
.kpi.high .kpi-val { color: var(--high); }

/* heat map */
.heatmap-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 0.4rem; }
.axis-y { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; color: var(--muted); font-size: 0.8rem; }
.axis-x { grid-column: 2; text-align: center; color: var(--muted); font-size: 0.8rem; }
.heatmap { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.cell { aspect-ratio: 1.4; border: none; border-radius: 6px; color: #fff; font-weight: 700; font-size: 1.1rem; }
.cell.low { background: var(--low); }
.cell.medium { background: var(--medium); color: #3a2c00; }
.cell.high { background: var(--high); }
.cell.critical { background: var(--critical); }
.cell:hover { outline: 2px solid var(--text); }

.top-risks { padding-left: 1.2rem; margin: 0; }
.top-risks li { margin-bottom: 0.4rem; display: list-item; }
.top-risks a { color: var(--text); }
.bar-row { display: grid; grid-template-columns: minmax(0, 11rem) 1fr 2rem; gap: 0.5rem; align-items: center; font-size: 0.85rem; margin-bottom: 0.3rem; }
.bar { background: var(--bg); border-radius: 4px; height: 10px; }
.bar div { background: var(--primary); height: 100%; border-radius: 4px; }

/* badges */
.nowrap { white-space: nowrap; }
.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 6px; font-size: 0.8rem; font-weight: 600; color: #fff; white-space: nowrap; }
.badge.low { background: var(--low); }
.badge.medium { background: var(--medium); color: #3a2c00; }
.badge.high { background: var(--high); }
.badge.critical { background: var(--critical); }
.badge.very-low { background: var(--bg); color: var(--low); box-shadow: inset 0 0 0 1px var(--low); }
.tag { display: inline-block; font-size: 0.75rem; padding: 0 0.4rem; border-radius: 4px; background: var(--bg); border: 1px solid var(--border); }
.tag.p-high { color: var(--critical); }
.tag.p-medium { color: var(--high); }

/* register */
.toolbar { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.75rem; }
.toolbar input[type="search"] { max-width: 260px; }
.toolbar select { width: auto; }
.filter-bar { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.5rem 0.75rem; align-items: end; padding: 0.75rem; margin-bottom: 0.75rem; }
.filter-bar label { margin: 0; font-size: 0.8rem; }
.filter-bar select { margin-top: 0.2rem; padding: 0.3rem 0.4rem; font-size: 0.85rem; }
.filter-bar .link { justify-self: start; padding: 0.4rem 0; }
.risk-count { margin: 0 0 0.4rem; }
/* Half-width split view: two filters per row. */
body.risk-split .filter-bar, body.vendor-split .filter-bar, body.assessment-split .filter-bar, body.tra-split .filter-bar { grid-template-columns: repeat(2, 1fr); }
.table-card { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; cursor: pointer; user-select: none; }
#empty-register { padding: 1rem; }

/* dialog */
dialog { border: none; border-radius: 14px; padding: 0; width: min(760px, calc(100vw - 32px)); background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
#risk-form, #vendor-form, #assessment-form, #tra-form { padding: 1.25rem; max-height: 90vh; overflow-y: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.dialog-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.form-section { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 1.25rem 0 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.form-section-details { margin: 1rem 0 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.form-section-details > summary { cursor: pointer; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 0.5rem; }
.form-grid fieldset.checks { margin: 0 0 0.75rem; }
.risk-results { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.5rem; }
.risk-result { border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem 0.75rem; background: var(--bg); display: grid; gap: 0.25rem; }
@media (max-width: 600px) { .risk-results { grid-template-columns: 1fr; } }
.comment-log { list-style: none; padding: 0; margin: 0 0 0.5rem; max-height: 16rem; overflow-y: auto; }
.comment-log li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-add { display: flex; gap: 0.5rem; align-items: flex-start; }
.comment-add textarea { flex: 1; }
.dialog-head h2 { margin-top: 0; }
.close-x { font-size: 1.1rem; color: var(--muted); padding: 0.2rem 0.4rem; }
.vendor-name, .row-name { font: inherit; font-weight: 600; color: var(--primary); text-align: left; padding: 0; cursor: pointer; }
.vendor-name:hover, .row-name:hover { text-decoration: underline; }
:is(#vendor-table, #risk-table, #exception-table, #assessment-table, #tra-table) tr.selected td { background: var(--bg); }
/* NERC / CIP-013 tags stand in for their columns when the split view hides them. */
body:not(.vendor-split) #vendor-table .vendor-flag { display: none; }
:is(#vendor-table, #risk-table, #exception-table, #assessment-table, #tra-table) tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--primary); }

/* Desktop split view: the list on the left half, the open vendor or risk on the right. */
@media (min-width: 1100px) {
  :is(body.vendor-split, body.risk-split, body.assessment-split, body.tra-split) main { max-width: none; margin: 0 50vw 0 0; }
  body.vendor-split #vendor-dialog, body.risk-split #risk-dialog, body.assessment-split #assessment-dialog, body.tra-split #tra-dialog {
    position: fixed; inset: var(--topbar-h, 56px) 0 0 auto; width: 50vw; max-width: none; height: auto; max-height: none;
    margin: 0; border-radius: 0; border-left: 1px solid var(--border); box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08); z-index: 4;
  }
  body.vendor-split #vendor-form, body.risk-split #risk-form, body.assessment-split #assessment-form, body.tra-split #tra-form { max-height: none; height: 100%; }
  /* Half the width: keep asset, impact, gaps and Edit; hide the risk levels, status and date. */
  body.tra-split #tra-table :is(th, td):is(:nth-child(5), :nth-child(6), :nth-child(7), :nth-child(8)) { display: none; }
  /* Half the width: keep solution, outcome, tiers and Edit; hide risk owner, status and date. */
  body.assessment-split #assessment-table :is(th, td):is(:nth-child(3), :nth-child(7), :nth-child(8)) { display: none; }
  /* Half the width: keep risk, tiers and Edit; hide category, owner, status and due date. */
  body.risk-split #risk-table :is(th, td):is(:nth-child(3), :nth-child(4), :nth-child(7), :nth-child(8)) { display: none; }
  body.risk-split #exception-table :is(th, td):is(:nth-child(3), :nth-child(6), :nth-child(7)) { display: none; }
  /* Half the width: keep vendor, tiers and score; hide criticality, data, next review and status. */
  body.vendor-split #vendor-table :is(th, td):is(:nth-child(3), :nth-child(4), :nth-child(5), :nth-child(6), :nth-child(10), :nth-child(11)) { display: none; }
}
.ai-panel { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem; margin: 0.5rem 0; }
.ai-head { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.ai-panel ul { margin: 0.25rem 0; padding-left: 1.2rem; }

/* analyst */
.markdown { margin-top: 1rem; }
.markdown h2, .markdown h3, .markdown h4 { margin: 1rem 0 0.4rem; }
.markdown p { margin: 0.4rem 0; }
.chat-card { display: flex; flex-direction: column; min-height: 480px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem; max-height: 60vh; padding-right: 0.25rem; }
.msg { padding: 0.6rem 0.8rem; border-radius: 10px; max-width: 90%; }
.msg.user { align-self: flex-end; background: var(--primary); color: var(--primary-text); }
.msg.assistant { align-self: flex-start; background: var(--bg); border: 1px solid var(--border); }
.msg.markdown { margin-top: 0; }
.msg.markdown > :first-child { margin-top: 0; }
.chat-form { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 0.6rem 1rem; border-radius: 8px; z-index: 20; }
.toast.error { background: var(--critical); color: #fff; }
td:first-child, td:nth-child(8) { white-space: nowrap; }

/* vendors */
#vendor-form h3 { font-size: 1rem; margin: 1rem 0 0.25rem; }
.score-line { margin: 0.75rem 0; display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
td.overdue { color: var(--critical); font-weight: 600; }
td:nth-child(8) { white-space: nowrap; }
.bar div.critical { background: var(--critical); }
.bar div.high { background: var(--high); }
.bar div.medium { background: var(--medium); }
.bar div.low { background: var(--low); }

/* intake questionnaire */
.intake-main { max-width: 900px; }
.intake .intro h1 { font-size: 1.35rem; margin: 0 0 0.5rem; }
.intake .card { margin-bottom: 1rem; }
.intake .section-title { margin: 1.5rem 0 0.75rem; }
.progress-wrap { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.progress { width: 160px; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; border: 1px solid var(--border); }
#progress-bar { height: 100%; width: 0; background: var(--primary); transition: width 0.2s; }
fieldset.checks { border: none; padding: 0; margin: 0 0 0.75rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 0.25rem 1rem; }
fieldset.checks legend { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.4rem; padding: 0; }
fieldset.checks label { display: flex; gap: 0.4rem; align-items: center; margin: 0; color: var(--text); }
fieldset.checks input, .iq-answers input { width: auto; margin: 0; }
details.domain { padding: 0; }
details.domain summary { cursor: pointer; padding: 0.9rem 1rem; font-weight: 600; display: flex; justify-content: space-between; gap: 1rem; list-style: none; }
details.domain summary::-webkit-details-marker { display: none; }
details.domain summary::before { content: "▸"; margin-right: 0.5rem; color: var(--muted); }
details.domain[open] summary::before { content: "▾"; }
details.domain summary > span:first-child { flex: 1; }
.domain-count.done { color: var(--low); }
.iq { padding: 0.75rem 1rem; border-top: 1px solid var(--border); }
.iq-id { font-family: ui-monospace, monospace; font-size: 0.75rem; color: var(--muted); margin-right: 0.25rem; }
.iq-answers { display: flex; gap: 1.25rem; margin: 0.4rem 0; flex-wrap: wrap; }
.iq-answers label { display: flex; gap: 0.35rem; align-items: center; margin: 0; color: var(--text); font-size: 0.95rem; }
.iq textarea { font-size: 0.85rem; padding: 0.3rem 0.5rem; }
.iq.needs-comment textarea { border-color: var(--high); }
.iq.needs-comment textarea::placeholder { color: var(--high); }
.iq-child { margin-left: 1.5rem; border-left: 3px solid var(--border); }
.thread { margin-top: 0.5rem; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.thread-head { font-weight: 600; font-size: 0.85rem; margin-bottom: 0.3rem; display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.thread-msg { font-size: 0.875rem; padding: 0.35rem 0; border-top: 1px solid var(--border); white-space: pre-wrap; overflow-wrap: anywhere; }
.thread-msg.requester { color: var(--text); }
.thread-msg.vendor { padding-left: 0.6rem; border-left: 3px solid var(--primary); }
.thread-msg.system { font-style: italic; color: var(--muted); }
.thread textarea { margin-top: 0.4rem; }
.thread-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.4rem; }
.followup-banner { border-color: var(--high); }
.iq-evidence.warn { border-left-color: var(--high); color: var(--text); }
.ai-fill { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.contacts-head { display: flex; align-items: center; gap: 0.75rem; justify-content: space-between; }
.contacts-table { width: 100%; border-collapse: collapse; margin-bottom: 0.5rem; }
.contacts-table th { text-align: left; font-size: 0.8rem; font-weight: 500; color: var(--muted); padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); }
.contacts-table td { padding: 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.contacts-table tr.selected td { background: var(--bg); }
.contacts-table a { color: var(--primary); }
.contacts-table :is(th, td):last-child { width: 1%; text-align: center; }
.contact-editor { border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem 0.75rem; margin-bottom: 0.75rem; background: var(--bg); }
.contact-editor .row-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.intake-answers { margin: 0.75rem 0; border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem 0.9rem; }
.intake-answers > summary { cursor: pointer; font-weight: 600; }
.intake-answers h4 { margin: 0.9rem 0 0.3rem; font-size: 0.85rem; color: var(--muted); }
.ia-row { padding: 0.4rem 0; border-top: 1px solid var(--border); font-size: 0.875rem; }
.ia-inputs { display: flex; gap: 0.5rem; margin-top: 0.3rem; }
.ia-inputs select { width: auto; flex: 0 0 auto; padding: 0.2rem 0.4rem; }
.ia-inputs input { flex: 1; padding: 0.2rem 0.5rem; font-size: 0.85rem; }
.followup-banner a { font-family: ui-monospace, monospace; color: var(--primary); font-weight: 600; }
.intake-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; position: sticky; bottom: 0.5rem; }
@media print {
  .topbar, .intake-actions, #toast, .iq textarea:placeholder-shown { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .iq { break-inside: avoid; }
}

/* intake summary inside the vendor editor */
.intake-box { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem 0.9rem; margin: 0.75rem 0; font-size: 0.9rem; }
.intake-box ul { margin: 0.25rem 0; padding-left: 1.2rem; }
.intake-box summary { cursor: pointer; }
.intake-tools { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* intake attachments */
.attachments .drop { border: 2px dashed var(--border); border-radius: 10px; padding: 1rem; text-align: center; margin: 0.5rem 0; }
.attachments .drop.over { border-color: var(--primary); background: var(--bg); }
.attachments .drop input { width: auto; max-width: 100%; border: none; background: none; }
.doc-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.doc-list li { display: flex; gap: 0.5rem; align-items: center; padding: 0.3rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.doc-list li span:first-child { flex: 1; overflow-wrap: anywhere; }
.iq-evidence { font-size: 0.8rem; color: var(--muted); border-left: 3px solid var(--border); padding-left: 0.5rem; margin: 0.3rem 0; }

.ai-fill-line { margin-top: 0.4rem; }
.ai-review li { margin-bottom: 0.5rem; }
.ai-review select { width: auto; padding: 0.1rem 0.3rem; margin-left: 0.3rem; }
@media print { .attachments { display: none !important; } }

/* ---------- executive briefing ---------- */
.report-card { margin-bottom: 1rem; }
.report-toolbar { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.report-toolbar h2 { margin-bottom: 0.1rem; }
.report-toolbar p { margin: 0; }
#report-meta { margin-top: 0.3rem; color: var(--text); }
.analyst-chat { max-width: 760px; }
.rh-loading { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.rh-loading .spinner { width: 28px; height: 28px; }
.rh-doc { margin-top: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.rh-cover { background: linear-gradient(135deg, var(--cover-from), var(--cover-to)); color: #fff; border-radius: 14px; padding: 1.5rem; position: relative; overflow: hidden; }
.rh-cover::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,0.07); }
.rh-cover-top { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.85rem; opacity: 0.85; flex-wrap: wrap; }
.rh-logo { display: block; height: 30px; max-width: 170px; object-fit: contain; background: #fff; padding: 4px 8px; border-radius: 6px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rh-eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; display: inline-flex; align-items: center; gap: 0.4rem; }
.rh-cover .logo-mark { width: 1.4em; height: 1.4em; }
.rh-cover .logo-shield { fill: #fff; }
.rh-cover .logo-bar { fill: #0e8f80; }
.rh-cover h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 0.5rem 0 1rem; line-height: 1.15; }
.rh-posture { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.rh-posture-badge { display: flex; align-items: center; gap: 0.6rem; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); border-radius: 12px; padding: 0.5rem 0.9rem; }
.rh-posture-badge small { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.8; }
.rh-posture-badge strong { font-size: 1.3rem; }
.rh-posture-icon { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.25rem; font-weight: 800; background: #fff; }
.rh-posture-badge.low .rh-posture-icon { color: var(--low); }
.rh-posture-badge.medium .rh-posture-icon { color: #9a6b00; }
.rh-posture-badge.high .rh-posture-icon { color: var(--high); }
.rh-posture-badge.critical .rh-posture-icon { color: var(--critical); }
.rh-meter { display: flex; gap: 4px; }
.rh-meter span { width: 22px; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.22); }
.rh-meter span.on.low { background: var(--low); }
.rh-meter span.on.medium { background: var(--medium); }
.rh-meter span.on.high { background: var(--high); }
.rh-meter span.on.critical { background: var(--critical); }
.rh-headline { flex: 1 1 280px; margin: 0; font-size: 1.05rem; font-weight: 500; line-height: 1.4; position: relative; z-index: 1; }
.rh-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; }
.rh-kpi { border: 1px solid var(--border); border-radius: 12px; padding: 0.8rem 0.9rem; background: var(--surface); border-top: 4px solid var(--border); }
.rh-kpi.high { border-top-color: var(--high); }
.rh-kpi.critical { border-top-color: var(--critical); }
.rh-kpi-val { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rh-kpi-label { color: var(--muted); font-size: 0.82rem; }
.rh-kpi-sub { color: var(--low); font-size: 0.78rem; font-weight: 600; margin-top: 0.15rem; }
.rh-section { border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; background: var(--surface); }
.rh-section h3 { margin: 0 0 0.6rem; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.rh-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 860px) { .rh-two { grid-template-columns: minmax(0, 1fr); } }
.rh-lead { font-size: 1.05rem; line-height: 1.6; margin: 0; }
.rh-ai-note { color: var(--muted); font-style: italic; margin: 0; }
figure { margin: 0; }
figcaption { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.5rem; display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
/* heat maps */
.rh-heats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.rh-heat-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; gap: 0.3rem; }
.rh-axis-y { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 0.7rem; color: var(--muted); text-align: center; }
.rh-axis-x { grid-column: 2; font-size: 0.7rem; color: var(--muted); text-align: center; }
.rh-cells { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
.rh-cell { aspect-ratio: 1; border-radius: 4px; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; color: #fff; opacity: 0.35; }
.rh-cell.has { opacity: 1; }
.rh-cell.low { background: var(--low); }
.rh-cell.medium { background: var(--medium); color: #3a2c00; }
.rh-cell.high { background: var(--high); }
.rh-cell.critical { background: var(--critical); }
/* dumbbell */
.db-legend { font-weight: 400; font-size: 0.8rem; color: var(--muted); display: inline-flex; gap: 0.35rem; align-items: center; }
.db-key { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-left: 0.4rem; }
.db-key.inherent, .db-dot.inherent { background: var(--series-2); }
.db-key.residual, .db-dot.residual { background: var(--series-1); }
.db-row { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 0.6rem; align-items: center; padding: 0.35rem 0; }
.db-row:hover { background: var(--bg); border-radius: 6px; }
.db-label { font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-track { position: relative; height: 22px; background: linear-gradient(to right, var(--border) 1px, transparent 1px) 0 0 / 20% 100%; }
.db-link { position: absolute; top: 10px; height: 2px; background: var(--muted); opacity: 0.5; }
.db-dot { position: absolute; top: 5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }
.db-dot i { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 0.7rem; color: var(--text); font-weight: 600; }
.db-axis { display: flex; justify-content: space-between; margin-left: calc(11rem + 0.6rem); font-size: 0.7rem; color: var(--muted); }
/* bars */
.rb-row { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 1.5rem; gap: 0.5rem; align-items: center; font-size: 0.85rem; padding: 0.2rem 0; }
.rb-track { height: 12px; background: var(--bg); border-radius: 4px; }
.rb-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--series-1); }
.rb-fill.status.low { background: var(--low); }
.rb-fill.status.medium { background: var(--medium); }
.rb-fill.status.high { background: var(--high); }
.rb-fill.status.critical { background: var(--critical); }
.sev-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.4rem; }
.sev-dot.low { background: var(--low); } .sev-dot.medium { background: var(--medium); } .sev-dot.high { background: var(--high); } .sev-dot.critical { background: var(--critical); }
/* top risks */
.rh-risks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0.75rem; }
.rh-risk { border: 1px solid var(--border); border-left: 5px solid var(--border); border-radius: 10px; padding: 0.8rem 0.9rem; }
.rh-risk.critical { border-left-color: var(--critical); } .rh-risk.high { border-left-color: var(--high); } .rh-risk.medium { border-left-color: var(--medium); } .rh-risk.low { border-left-color: var(--low); }
.rh-risk header { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.rh-risk h4 { margin: 0; flex: 1; font-size: 0.98rem; }
.rh-risk-id { font-family: ui-monospace, monospace; font-size: 0.75rem; color: var(--muted); }
.rh-risk-meta { font-size: 0.78rem; color: var(--muted); margin: 0.25rem 0 0.4rem; }
.rh-risk p { margin: 0.35rem 0 0; font-size: 0.9rem; }
/* themes, vendors */
.rh-themes { display: flex; flex-direction: column; gap: 0.6rem; }
.rh-theme { display: flex; gap: 0.7rem; }
.rh-theme p { margin: 0.15rem 0 0; font-size: 0.9rem; }
.rh-theme-num, .rh-phase-num { flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; background: var(--primary); color: var(--primary-text); }
.rh-vendor { border-top: 1px solid var(--border); padding-top: 0.5rem; margin-top: 0.5rem; }
.rh-vendor p { margin: 0.25rem 0 0; font-size: 0.9rem; }
.rh-chip { display: inline-block; font-family: ui-monospace, monospace; font-size: 0.72rem; padding: 0 0.35rem; border-radius: 4px; border: 1px solid var(--border); background: var(--bg); margin-right: 0.2rem; }
/* roadmap */
.rh-roadmap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; position: relative; }
@media (max-width: 760px) { .rh-roadmap { grid-template-columns: minmax(0, 1fr); } }
.rh-phase { background: var(--bg); border-radius: 10px; padding: 0.75rem; }
.rh-phase-head { display: flex; gap: 0.5rem; align-items: center; font-weight: 700; margin-bottom: 0.5rem; }
.rh-action { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.55rem 0.65rem; margin-bottom: 0.5rem; font-size: 0.88rem; }
.rh-action-meta { color: var(--muted); font-size: 0.78rem; margin-top: 0.3rem; }
.rh-table { width: 100%; font-size: 0.88rem; }
.rh-table th { cursor: default; }
.rh-foot { color: var(--muted); font-size: 0.75rem; text-align: center; padding: 0 1rem 0.5rem; }
/* tooltip */
.tooltip { position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; max-width: 280px; background: var(--text); color: var(--bg); font-size: 0.8rem; padding: 0.35rem 0.55rem; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
/* print only the briefing */
@media print {
  body.printing-report > *:not(main), body.printing-report main > section:not(#view-analyst),
  body.printing-report .report-toolbar, body.printing-report .analyst-chat { display: none !important; }
  body.printing-report #view-analyst { display: block !important; }
  body.printing-report .report-card { border: none; box-shadow: none; padding: 0; }
  body.printing-report main { max-width: none; padding: 0; }
  body.printing-report { background: #fff; }
  .rh-cover, .rh-cell, .rb-fill, .db-dot, .rh-meter span, .badge, .rh-theme-num, .rh-phase-num { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rh-risk, .rh-phase, .rh-kpis, figure, .rh-theme, .rh-vendor { break-inside: avoid; }
  .rh-kpis { grid-template-columns: repeat(3, 1fr); }
  .rh-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rh-roadmap { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rh-heats { gap: 0.5rem; }
}
.rh-table-wrap { overflow-x: auto; }
.rh-table td { min-width: 4rem; }
@media (max-width: 600px) {
  .db-row { grid-template-columns: minmax(0, 5.5rem) minmax(0, 1fr); }
  .db-axis { margin-left: calc(5.5rem + 0.6rem); }
  .rb-row { grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr) 1.5rem; }
}

/* ---------- sign-in, workspace, roles ---------- */
.auth-screen { position: fixed; inset: 0; z-index: 50; background: linear-gradient(135deg, var(--cover-from), var(--cover-to)); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.auth-card { background: var(--surface); color: var(--text); width: min(420px, 100%); border-radius: 16px; padding: 1.75rem; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.auth-brand { font-size: 1.5rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.auth-card h1 { font-size: 1.35rem; margin: 0 0 0.75rem; }
.auth-card p { margin: 0 0 0.75rem; }
.auth-note { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.75rem; font-size: 0.9rem; }
.auth-links { margin-top: 1rem; font-size: 0.88rem; text-align: center; }
.auth-links a { color: var(--primary); }
button.wide { width: 100%; padding: 0.6rem; margin-top: 0.25rem; }
.qr { display: block; width: 180px; height: 180px; margin: 0.5rem auto; background: #fff; border-radius: 8px; padding: 6px; }
code.secret { display: block; word-break: break-all; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 0.4rem 0.5rem; margin: 0.4rem 0; font-size: 0.85rem; user-select: all; }
.org-list { display: flex; flex-direction: column; gap: 0.5rem; }
.org-choice { display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 0.75rem; }
.user-menu { display: flex; gap: 0.4rem; align-items: center; }
.ws-label { font-size: 0.85rem; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cloud #ai-status { margin-left: auto; }
.ws-card { margin-bottom: 1rem; max-width: 860px; }
.ws-card h3 { font-size: 0.95rem; margin: 1.25rem 0 0.5rem; display: flex; gap: 0.5rem; align-items: center; }
.profile-grid { margin-bottom: 0.5rem; }
.member-edit { margin: 0.75rem 0; padding: 0.75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.member-edit h4 { margin: 0 0 0.5rem; }
.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0; }
.inline-form input { flex: 1 1 220px; width: auto; }
.inline-form select { width: auto; }
.table-scroll { overflow-x: auto; }
.audit-scroll { max-height: 360px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
table.compact th, table.compact td { padding: 0.4rem 0.5rem; font-size: 0.88rem; }
table.compact th { cursor: default; }
table.compact select { width: auto; padding: 0.15rem 0.3rem; }
td.nowrap { white-space: nowrap; }
.usage-line { display: grid; gap: 0.3rem; max-width: 420px; }
.usage-line .bar div.high { background: var(--high); }
.usage-line .bar div.critical { background: var(--critical); }
body.read-only .edit-only, body.not-owner .owner-only { display: none !important; }
/* View-only roles: a note, locked fields, and no follow-up controls. */
.view-only-note { display: none; }
body.read-only .view-only-note { display: block; margin: -0.25rem 0 0.75rem; padding: 0.4rem 0.6rem; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; }
body.read-only [inert] :is(input, select, textarea) { background: transparent; }
body.read-only :is(.thread-actions, textarea[data-ask-text], [data-ask]) { display: none !important; }
#data-heading { margin-top: 2rem; }
.cloud #data-heading { margin-top: 0; }

/* Number of logged exceptions on the Exceptions tab. */
.tab-count:empty { display: none; }
.tab-count { display: inline-block; min-width: 1.3em; padding: 0 0.35em; margin-left: 0.2em; border-radius: 999px; background: var(--border); font-size: 0.75em; line-height: 1.5; text-align: center; }

/* People directory (Settings). */
.people-import { flex-wrap: wrap; align-items: center; }
.people-import label.checkbox { display: flex; gap: 0.4rem; align-items: center; margin: 0; }
.people-import label.checkbox input { width: auto; flex: none; margin: 0; }
.people-scroll { max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.people-tools { align-items: center; flex-wrap: wrap; }
.people-tools input[type="search"] { flex: 1 1 200px; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segmented button { border: 0; border-radius: 0; padding: 0.35rem 0.75rem; background: transparent; }
.segmented button.active { background: var(--primary); color: #fff; }
.org-chart { padding: 0.75rem; }
.org-chart ul { list-style: none; margin: 0; padding-left: 1.25rem; border-left: 1px solid var(--border); }
.org-chart > ul { padding-left: 0; border-left: 0; }
.org-chart li { margin: 0.35rem 0; }
.org-node { display: flex; flex-direction: column; padding: 0.3rem 0.5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); width: fit-content; max-width: 100%; }
.org-node .link { padding: 0; text-align: left; font-weight: 600; }
.people-import a.button { padding: 0.2rem 0.55rem; font-size: 0.85rem; text-decoration: none; }

/* Viewers: their own risks by default (removable), and no Vendors or AI analyst tabs. */
.viewer-only { display: none !important; }
body.viewer .viewer-only { display: flex !important; }
body.viewer .not-for-viewer { display: none !important; }
.mine-toggle { align-items: center; gap: 0.4rem; margin: 0; font-size: 0.9rem; white-space: nowrap; }
.mine-toggle input { width: auto; margin: 0; flex: none; }

/* Ad-hoc risk assessment editor. */
dialog.wide-dialog { width: min(1000px, calc(100vw - 32px)); }
.assess-section > summary { font-size: 0.85rem; font-weight: 600; }
.assess-rows { display: grid; gap: 0.6rem; margin-bottom: 0.5rem; }
.assess-row { border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem 0.75rem; background: var(--bg); }
.assess-row-head { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.4rem; }
.assess-row-head .danger { margin-left: auto; }
.assess-qs { display: grid; gap: 0.35rem; margin-bottom: 0.75rem; }
.assess-q { display: grid; grid-template-columns: minmax(0, 2fr) 7rem minmax(0, 2fr); gap: 0.5rem; align-items: center; font-size: 0.9rem; }
.assess-q select, .assess-q input { margin: 0; }
.assess-q.head { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
@media (max-width: 600px) { .assess-q { grid-template-columns: 1fr 6.5rem; } .assess-q input { grid-column: 1 / -1; } .assess-q.head span:last-child { display: none; } }
.ai-fill-bar { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.5rem; }

/* Threat risk assessment editor. */
.tra-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.35rem; margin-bottom: 1rem; }
.tra-step { display: flex; gap: 0.4rem; align-items: flex-start; text-align: left; padding: 0.4rem 0.5rem; font-size: 0.8rem; font-weight: 600; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.tra-step.active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.tra-step-num { flex: none; width: 1.25rem; height: 1.25rem; line-height: 1.25rem; text-align: center; border-radius: 50%; background: var(--border); font-size: 0.72rem; }
.tra-step.active .tra-step-num { background: var(--primary); color: var(--primary-text); }
.tra-step-note { display: block; min-height: 1em; font-weight: 400; font-size: 0.72rem; color: var(--muted); }
.tra-outside { padding: 0.5rem 0.75rem; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.tra-outside.hidden { display: none; }
.tra-outside p { margin: 0.2rem 0; }
.tra-link-row { display: flex; gap: 0.4rem; align-items: center; margin: 0.35rem 0; }
.tra-link-row input { margin: 0; flex: 1; min-width: 0; }
.tra-link-new { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.tra-share { display: inline-flex; gap: 0.3rem; align-items: center; margin: 0; }
.tra-share input { width: auto; margin: 0; }
.tra-review { margin-top: 0.5rem; }
.tra-review table { table-layout: fixed; }
.tra-review :is(th, td) { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.tra-review-actions { margin-top: 0.5rem !important; }
.tra-flag td { background: color-mix(in srgb, var(--high) 16%, transparent); font-weight: 600; }
.tra-form-section { margin-bottom: 1rem; }
.tra-form-status { min-height: 1.2em; }
.tra-h { font-size: 0.9rem; margin: 1rem 0 0.35rem; }
.tra-group { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0.75rem 0 0.25rem; }
.tra-impact-row { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 0.5rem; align-items: center; padding: 0.3rem 0; font-size: 0.88rem; border-bottom: 1px solid var(--border); }
.tra-impact-row select { margin: 0; min-width: 0; width: 100%; }
.tra-impact-row.head { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.tra-rating { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 1rem; }
.tra-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tra-yn { grid-template-columns: minmax(0, 1fr) 7rem; }
.tra-filter { margin-bottom: 0.5rem; }
.tra-filter select { width: auto; margin: 0 0 0 0.35rem; display: inline-block; }
.tra-control { padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.tra-control-head { display: grid; grid-template-columns: minmax(0, 1fr) 8.5rem; gap: 0.6rem; align-items: start; }
.tra-control-head select { margin: 0; }
.tra-control input { margin: 0.35rem 0 0; }
.tra-gap-text { margin: 0 0 0.5rem; }
.tra-score { display: flex; flex-direction: column; justify-content: center; gap: 0.2rem; }
.tra-two { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.tra-count { display: flex; justify-content: space-between; align-items: center; padding: 0.15rem 0; font-size: 0.88rem; }
.tra-summary-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.tra-summary-table :is(th, td) { text-align: left; padding: 0.3rem 0.4rem; border-bottom: 1px solid var(--border); }
.tra-todo { padding: 0.4rem 0.6rem; border-radius: 8px; background: var(--bg); border-left: 3px solid var(--high); }
.tra-notes { margin-top: 1rem; }
@media (max-width: 600px) {
  .tra-steps { grid-template-columns: repeat(5, minmax(4.5rem, 1fr)); overflow-x: auto; }
  .tra-step-num, .tra-step-note { display: none; }
  .tra-impact-row { grid-template-columns: 1fr; }
  .tra-impact-row.head { display: none; }
  .tra-rating, .tra-tiles, .tra-two { grid-template-columns: 1fr 1fr; }
  .tra-control-head { grid-template-columns: 1fr; }
}

/* ---------- ad-hoc assessment PDF report (printed on its own) ---------- */
#assessment-print { display: none; }
@media print {
  body.printing-assessment > *:not(#assessment-print) { display: none !important; }
  body.printing-assessment { background: #fff !important; margin: 0; padding: 0; }
  body.printing-assessment #assessment-print { display: block; }
  @page { size: letter; margin: 14mm 14mm 16mm; @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 8pt system-ui, sans-serif; color: #7a8295; } }
}
.pr-doc { --ink: #1a1f36; --soft: #5b6478; --line: #e1e5ee; --tint: #f5f7fb; --accent: #3b5bdb;
  color: var(--ink); font: 10pt/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.pr-doc * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pr-doc p { margin: 0 0 0.5em; }
.pr-doc ul { margin: 0.2em 0 0.5em; padding-left: 1.2em; }
.pr-doc li { margin-bottom: 0.25em; }
.pr-muted { color: var(--soft); }
.pr-label { font-size: 7.5pt; text-transform: uppercase; letter-spacing: 0.06em; color: var(--soft); font-weight: 600; margin-bottom: 0.15em; }

.pr-cover { background: linear-gradient(135deg, #1b2a6b, #3b5bdb); color: #fff; border-radius: 10px; padding: 18pt 20pt 16pt; margin-bottom: 14pt; position: relative; overflow: hidden; }
.pr-cover::after { content: ""; position: absolute; right: -50pt; top: -50pt; width: 170pt; height: 170pt; border-radius: 50%; background: rgba(255,255,255,0.07); }
.pr-cover-top { display: flex; justify-content: space-between; gap: 1em; font-size: 8.5pt; opacity: 0.9; }
.pr-brand { display: inline-flex; align-items: center; gap: 0.4em; font-weight: 600; }
.pr-brand .logo-mark { width: 14pt; height: 14pt; }
.pr-logo { display: block; height: 24pt; max-width: 140pt; object-fit: contain; background: #fff; padding: 3pt 6pt; border-radius: 4pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pr-brand .logo-shield { fill: #fff; }
.pr-brand .logo-bar { fill: #0e8f80; }
.pr-eyebrow { margin-top: 16pt; text-transform: uppercase; letter-spacing: 0.1em; font-size: 8pt; font-weight: 600; opacity: 0.85; }
.pr-cover h1 { font-size: 24pt; line-height: 1.15; margin: 3pt 0 4pt; font-weight: 750; }
.pr-cover-meta { font-size: 9pt; opacity: 0.85; }
.pr-verdict { display: flex; gap: 8pt; margin-top: 12pt; flex-wrap: wrap; }
.pr-verdict-item { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); border-radius: 8px; padding: 6pt 10pt; display: grid; gap: 3pt; }
.pr-verdict-item small { font-size: 7pt; text-transform: uppercase; letter-spacing: 0.07em; opacity: 0.85; }

.pr-badge { display: inline-block; padding: 1pt 7pt; border-radius: 999px; font-size: 8.5pt; font-weight: 650; color: #fff; background: #868e96; white-space: nowrap; }
.pr-badge.low { background: #2f9e44; } .pr-badge.medium { background: #f2b705; color: #3a2c00; }
.pr-badge.high { background: #f76707; } .pr-badge.critical { background: #e03131; } .pr-badge.neutral { background: #868e96; }
.pr-pill { display: inline-block; padding: 0 6pt; border-radius: 4px; font-size: 8.5pt; font-weight: 600; background: var(--tint); border: 1px solid var(--line); }
.pr-pill.yes { background: #e6f4ea; border-color: #b7dfc2; color: #1e6b31; }
.pr-pill.no { background: #f1f3f5; border-color: #dee2e6; color: #495057; }

.pr-section { margin: 0 0 12pt; }
.pr-section h2 { font-size: 12.5pt; margin: 0 0 6pt; padding-bottom: 4pt; border-bottom: 2px solid var(--accent); display: flex; align-items: center; gap: 6pt; break-after: avoid; }
.pr-num { display: inline-grid; place-items: center; min-width: 16pt; height: 16pt; border-radius: 50%; background: var(--accent); color: #fff; font-size: 8pt; }
.pr-section h3 { font-size: 9.5pt; margin: 6pt 0 3pt; color: var(--ink); break-after: avoid; }
.pr-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 8pt; break-inside: avoid; }
.pr-fact { padding: 5pt 8pt; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pr-fact:nth-child(3n) { border-right: none; }
.pr-callout { background: var(--tint); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 7pt 10pt; margin: 6pt 0 8pt; }
.pr-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12pt; }
.pr-notice { font-size: 8.5pt; color: var(--soft); font-style: italic; }
.pr-chips { display: flex; flex-wrap: wrap; gap: 5pt; }
.pr-chip { padding: 1pt 8pt; border-radius: 999px; border: 1px solid var(--line); color: var(--soft); font-size: 8.5pt; }
.pr-chip.on { background: #e7ecfd; border-color: #b9c6f7; color: #24398f; font-weight: 600; }

.pr-table { width: 100%; border-collapse: collapse; font-size: 8.8pt; margin: 4pt 0 8pt; }
.pr-table th { text-align: left; background: var(--tint); color: var(--soft); font-size: 7.5pt; text-transform: uppercase; letter-spacing: 0.05em; padding: 4pt 6pt; border-bottom: 1px solid var(--line); }
.pr-table td { padding: 4pt 6pt; border-bottom: 1px solid var(--line); vertical-align: top; }
.pr-table tr { break-inside: avoid; }
.pr-narrow { white-space: nowrap; width: 1%; }

.pr-finding { border: 1px solid var(--line); border-radius: 8px; padding: 7pt 10pt; margin-bottom: 7pt; break-inside: avoid; }
.pr-finding-head { display: flex; gap: 7pt; align-items: baseline; margin-bottom: 4pt; }
.pr-id { background: var(--ink); color: #fff; border-radius: 4px; padding: 0 5pt; font-size: 8pt; font-weight: 700; }
.pr-finding-scores { display: flex; flex-wrap: wrap; gap: 4pt 12pt; font-size: 8.5pt; color: var(--soft); padding: 4pt 0 6pt; border-bottom: 1px dashed var(--line); margin-bottom: 6pt; }
.pr-finding-scores b { color: var(--ink); font-weight: 600; }

.pr-final { break-inside: avoid-page; }
.pr-statement { margin: 8pt 0 0; padding: 9pt 12pt; border: 1px solid #b9c6f7; background: #f3f6ff; border-radius: 8px; font-size: 9.5pt; }
.pr-sign td { height: 26pt; }
.pr-sigline { border-bottom: 1px solid var(--ink) !important; min-width: 110pt; }
.pr-signoff { break-inside: avoid; }
.pr-foot { margin-top: 14pt; padding-top: 6pt; border-top: 1px solid var(--line); font-size: 7.5pt; color: var(--soft); text-align: center; }
