/* AuditShield UI. Self-contained (no web fonts, no CDN: air-gap safe and
   allowed by the strict CSP). Design tokens first; light and dark. */
:root {
  /* Brand (auditshield.dev): night, deep, ice, glacier, mist. */
  --night: #0b141c;
  --deep: #102230;
  --ice: #cfe8ee;
  --glacier: #7cc4cf;
  --mist: #8da1ad;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --bg: #eef3f5;
  --bg-image: none;
  --surface: #ffffff;
  --surface-2: #f4f8f9;
  --fg: #0b141c;
  --muted: #4b5d69;
  --line: #d9e3e7;
  --accent: #1d6b78;
  --accent-2: #3a8f9c;
  --accent-soft: #e2f0f2;
  --accent-fg: #ffffff;
  --on-status: #ffffff;
  --mark-line: #1d6b78;
  --mark-chev: #0b141c;
  --ok: #15803d;   --ok-soft: #e7f6ec;
  --warn: #b45309; --warn-soft: #fff4e0;
  --bad: #b91c1c;  --bad-soft: #fdecec;
  --danger: #b91c1c;
  --sidebar: #0b141c;
  --sidebar-2: #102230;
  --sidebar-fg: #b4c8cf;
  --sidebar-active: #e6f4f7;
  --shadow: 0 1px 2px rgba(11, 20, 28, .06), 0 4px 16px rgba(11, 20, 28, .05);
  --radius: 14px;
  color-scheme: light dark;
}
:root[data-theme="light"] { color-scheme: light; }
/* Dark is the default for everyone; "light" is a per-browser choice
   (theme toggle, stored in localStorage). */
:root:not([data-theme="light"]) {
  color-scheme: dark;
    --bg: var(--night); --bg-image: linear-gradient(170deg, var(--deep), var(--night) 70%);
    --surface: #12283a; --surface-2: #0e1d29; --fg: #dcedf1; --muted: var(--mist); --line: #1f3a4d;
    --accent: var(--glacier); --accent-2: #5aa9b8; --accent-soft: #15343f; --accent-fg: var(--night);
    --on-status: var(--night); --mark-line: var(--glacier); --mark-chev: var(--ice);
    --ok: #5fd68a; --ok-soft: #10291e; --warn: #f2b84b; --warn-soft: #2b2312; --bad: #ff7d7d; --bad-soft: #301a1d; --danger: #ff8a8a;
    --sidebar: #08111a; --sidebar-2: #0d1b27; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg-image) fixed, var(--bg); color: var(--fg);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--glacier) 35%, transparent); }
html { scrollbar-color: color-mix(in srgb, var(--mist) 45%, transparent) transparent; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.35rem; margin: 0 0 10px; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.small, td.small { font-size: .85rem; }
.mono { font-family: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, monospace; word-break: break-all; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- logo: line-drawn shield with a chevron (auditshield.dev) ---- */
.logo-mark { width: 26px; height: 31px; flex: none; }
.logo-mark path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.logo-mark .logo-shield { stroke: var(--mark-line); stroke-width: 3; fill: color-mix(in srgb, var(--glacier) 7%, transparent); }
.logo-chev { stroke: var(--mark-chev); stroke-width: 5; }
.logo-chev2 { stroke: var(--mark-line); stroke-width: 3.5; opacity: .7; }

/* ---- app shell ---- */
body.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px; color: var(--sidebar-fg);
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  border-right: 1px solid rgba(124, 196, 207, .10);
  --mark-line: var(--glacier); --mark-chev: var(--ice);
}
.sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 14px; color: var(--ice); font-family: var(--display); font-weight: 400; font-size: 1.22rem; letter-spacing: .05em; border-bottom: 1px solid rgba(124, 196, 207, .10); }
.sidebar .brand:hover { text-decoration: none; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--sidebar-fg); font-weight: 500; }
.sidebar nav a:hover { background: rgba(124, 196, 207, .07); color: var(--sidebar-active); text-decoration: none; }
.sidebar nav a[aria-current="page"] { background: rgba(124, 196, 207, .13); color: var(--sidebar-active); box-shadow: inset 3px 0 0 var(--glacier); }
.sidebar nav a[aria-current="page"] .icon { color: var(--glacier); }
.sidebar-foot { margin-top: auto; padding: 12px; border-radius: 10px; background: rgba(124, 196, 207, .05); border: 1px solid rgba(124, 196, 207, .08); display: flex; flex-direction: column; }
.muted-inv { color: var(--mist); }
.sidebar-foot .tenant { color: var(--ice); font-weight: 600; }

.frame { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 14px 28px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar .page-title { margin: 0 auto 0 0; font-family: var(--display); font-weight: 400; font-size: 1.4rem; letter-spacing: .02em; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.user-chip .avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-fg); font-weight: 700; }
.user-chip .role { font-size: .8rem; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.shell main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 28px 48px; }

/* ---- sign-in pages ---- */
body.auth {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px;
  background:
    radial-gradient(70vmax 60vmax at 50% 30%, rgba(124, 196, 207, .14), transparent 62%),
    repeating-radial-gradient(circle at 70% 120%, transparent 0 44px, rgba(124, 196, 207, .07) 44px 45px),
    var(--bg-image), var(--bg);
  background-attachment: fixed;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 22px; text-align: center; }
.auth-brand .logo-mark { width: 50px; height: 59px; margin-bottom: 10px; }
.auth-brand .logo-mark .logo-shield { stroke-width: 2; }
.auth-brand .logo-chev { stroke-width: 3.5; }
.auth-brand .logo-chev2 { stroke-width: 2.5; }
.auth-brand > span:not(.tenant) { font-family: var(--display); font-weight: 400; font-size: 2.1rem; letter-spacing: .05em; line-height: 1.1; color: var(--fg); }
:root:not([data-theme="light"]) .auth-brand > span:not(.tenant) {
  background: linear-gradient(180deg, #ffffff, var(--glacier) 140%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-brand .tenant { color: var(--muted); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; }
.auth main { width: 100%; max-width: 440px; }
.auth-foot { margin-top: 24px; color: var(--muted); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; text-align: center; max-width: 34em; }

/* ---- cards ---- */
section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow); }
section + section { margin-top: 14px; }
section > h1:first-child, section > h2:first-child { margin-top: 0; }

/* ---- explainers: a small "?" next to a heading opens the text below it ---- */
.titled { position: relative; display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.titled > h1, .titled > h2 { margin: 0; }
details.info { position: relative; margin: 0; flex: none; }
details.info > summary {
  list-style: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted); font-size: .75rem; font-weight: 700; line-height: 1; cursor: pointer; user-select: none;
}
details.info > summary::-webkit-details-marker { display: none; }
details.info > summary:hover, details.info[open] > summary { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
details.info > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Anchored at the "?" with its own width, so a narrow parent (a heading beside a
   button) cannot squeeze it; the script shifts it back inside the viewport. */
.info-body {
  position: absolute; z-index: 20; left: 0; top: calc(100% + 6px);
  width: max-content; min-width: min(280px, calc(100vw - 32px)); max-width: min(420px, calc(100vw - 32px));
  max-height: 80vh; overflow-y: auto; white-space: normal;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow);
  color: var(--muted); font-size: .9rem; font-weight: 400; letter-spacing: 0; text-align: left;
}
.info-body p:last-child { margin-bottom: 0; }
.info-body p { overflow-wrap: break-word; word-break: normal; }

/* ---- loading: top bar, spinner and skeleton rows ---- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .2s ease; }
.progress.active { opacity: 1; }
.progress::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent); animation: progress-slide 1.1s ease-in-out infinite;
}
.loading { display: grid; gap: 8px; padding: 4px 0; color: var(--muted); font-size: .85rem; }
.loading-head { display: flex; align-items: center; gap: 8px; }
.spinner { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.skeleton {
  display: block; height: 14px; border-radius: 6px; background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite;
  background-image: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 45%, var(--surface)) 50%, var(--line) 75%);
}
.skeleton:nth-child(3n) { width: 72%; }
.skeleton:nth-child(3n+1) { width: 88%; }
.tiles .loading, .home-tiles .loading { grid-column: 1 / -1; }
@keyframes progress-slide { to { left: 100%; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .progress::before { animation: none; left: 0; width: 100%; opacity: .7; }
  .spinner, .skeleton { animation: none; }
}

/* ---- filter bar above a table ---- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 12px; }
.filter-bar input[type="search"] {
  flex: 1 1 220px; max-width: 360px; padding: 8px 12px; font: inherit; font-weight: 400;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--fg);
}
.filter-bar input[type="search"]:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; border-color: var(--accent); }
.filter-bar .check { margin: 0; }
.hero { background: linear-gradient(125deg, #173b4a 0%, #102230 60%, #0b141c 100%); color: var(--ice); border: 1px solid rgba(124, 196, 207, .22); }
.hero .muted { color: #a9bec7; }
.hero a { color: var(--glacier); }
.hero h2 { font-size: 1.6rem; margin: 0; }
section.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; background: none; border: 0; box-shadow: none; padding: 0; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--fg); transition: transform .12s ease, box-shadow .12s ease; border-top: 4px solid var(--line); }
.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(11, 20, 28, .14); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.tile-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.tile-value { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.tile-detail { font-size: .85rem; color: var(--muted); }
.tile.tone-ok { border-top-color: var(--ok); }
.tile.tone-warn { border-top-color: var(--warn); }
.tile.tone-bad { border-top-color: var(--bad); }
.tile.tone-accent { border-top-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--surface)); }

/* ---- forms ---- */
label { display: block; margin: 0 0 14px; font-weight: 600; font-size: .92rem; }
label input, label textarea, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-weight: 400;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--fg);
}
/* Own chevron, inset from the edge (the native arrow hugs the border). */
select:not([multiple]):not([size]) {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 20px center, right 15px center; background-size: 5px 5px; background-repeat: no-repeat;
}
label input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; border-color: var(--accent); }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
label.check input { width: auto; margin: 0; }
label small { display: block; font-weight: 400; color: var(--muted); }
.checks { margin-top: 6px; display: grid; gap: 4px; font-weight: 400; }
form.inline, div.inline { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
form.inline label, div.inline label { flex: 1 1 160px; }
button {
  font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2)));
  color: var(--accent-fg); margin: 4px 8px 4px 0; box-shadow: 0 1px 2px rgba(11, 20, 28, .12);
}
button:hover { filter: brightness(1.06); }
button.secondary { background: var(--surface); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: none; }
button.ghost { background: transparent; color: var(--muted); border-color: var(--line); box-shadow: none; margin: 0; }
button.link { background: none; border: 0; padding: 0; margin: 0; color: var(--accent); box-shadow: none; font-weight: 500; text-align: left; }
button.link.danger { color: var(--danger); }
button:disabled { opacity: .55; cursor: not-allowed; }
.topbar button { margin: 0; }
.choices { display: flex; flex-wrap: wrap; margin-bottom: 16px; }
details { margin-top: 16px; }

/* ---- feedback ---- */
.error { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); border-radius: 10px; padding: 10px 14px; }
.banner { background: var(--warn-soft); color: var(--fg); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; }
dialog { max-width: 520px; width: 92%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--fg); padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(11, 20, 28, .6); backdrop-filter: blur(3px); }

/* ---- tables ---- */
table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 10px; font-size: .93rem; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
th:first-child { border-top-left-radius: 10px; }
th:last-child { border-top-right-radius: 10px; }
td { text-align: left; vertical-align: top; padding: 11px 10px; border-bottom: 1px solid var(--line); }
tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
tr.out td { color: var(--muted); }
td .muted { display: block; font-size: .83rem; margin-top: 3px; }

/* ---- status ---- */
td.light { font-weight: 700; white-space: nowrap; }
td.light::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); }
.light-red { color: var(--bad); }
.light-amber { color: var(--warn); }
.light-green { color: var(--ok); }
.gap-covered td:nth-child(2) { color: var(--ok); font-weight: 700; }
.gap-partial td:nth-child(2), .gap-needs_review td:nth-child(2) { color: var(--warn); font-weight: 700; }
.gap-missing td:nth-child(2) { color: var(--bad); font-weight: 700; }
tr.gap-missing td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
blockquote { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.draft-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 14px 0; background: var(--surface-2); }
.draft-card h2 { font-size: 1rem; }
pre.draft { white-space: pre-wrap; font-family: inherit; background: var(--surface); border: 1px solid var(--line); padding: 12px; border-radius: 10px; }

/* ---- activation ---- */
#recovery-list { columns: 2; padding-left: 24px; font-family: ui-monospace, Menlo, monospace; }
img#totp-qr { display: block; margin: 0 auto 12px; background: #fff; border-radius: 10px; padding: 6px; }

/* ---- assistant ---- */
.assistant { display: grid; grid-template-columns: 250px 1fr; gap: 22px; }
.assistant aside { border-right: 1px solid var(--line); padding-right: 16px; }
.assistant aside ul { list-style: none; padding: 0; margin: 12px 0 0; }
.assistant aside li { display: flex; justify-content: space-between; gap: 6px; padding: 7px 8px; border-radius: 8px; }
.assistant aside li.active { background: var(--accent-soft); }
.assistant aside li.active button.link:first-child { font-weight: 700; }
#messages { max-height: 62vh; overflow-y: auto; margin: 12px 0; padding-right: 4px; }
.msg { padding: 12px 14px; border-radius: 14px; margin: 10px 0; white-space: pre-wrap; border: 1px solid var(--line); }
.msg-user { background: var(--accent-soft); margin-left: 14%; border-color: transparent; border-bottom-right-radius: 4px; }
.msg-assistant { background: var(--surface-2); margin-right: 8%; border-bottom-left-radius: 4px; }
.msg-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.citations { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; background: color-mix(in srgb, var(--accent-2) 14%, var(--surface)); color: var(--accent-2); padding: 3px 10px; border-radius: 999px; cursor: help; font-weight: 600; }
#form-ask { display: flex; gap: 10px; align-items: flex-end; }
#form-ask textarea { margin: 0; }

/* ---- small screens ---- */
@media (max-width: 900px) {
  body.shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 8px; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar nav a span { display: none; }
  .sidebar-foot { display: none; }
  .topbar { padding: 12px 16px; }
  .shell main { padding: 16px; }
  .assistant { grid-template-columns: 1fr; }
  .assistant aside { border-right: 0; padding-right: 0; }
}
details.add { margin-top: 16px; border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 12px; padding: 0 16px; background: var(--surface-2); }
details.add[open] { padding-bottom: 12px; }
details.add > summary { cursor: pointer; padding: 12px 0; font-weight: 700; color: var(--accent); list-style: none; }
details.add > summary::before { content: "+ "; }
details.add[open] > summary::before { content: "− "; }
#form-evidence { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
#form-evidence > label:has(textarea), #form-evidence > div.inline, #form-evidence > button { grid-column: 1 / -1; justify-self: start; }
#skip-mfa { margin-top: 1rem; }
/* Finding severity (GAP report). */
.sev { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.sev-critical { background: var(--bad); color: var(--surface); }
.sev-high { background: var(--bad-soft); color: var(--bad); }
.sev-medium { background: var(--warn-soft); color: var(--warn); }
.sev-low { background: var(--ok-soft); color: var(--ok); }
.recommendation { margin: 6px 0 0; }
/* Onboarding and reset choices. */
.step { color: var(--accent); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; margin: 0; }
label.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; cursor: pointer; }
label.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
label.choice { font-weight: 400; }
label.choice input { margin-top: 4px; width: auto; flex: none; padding: 0; box-shadow: none; }
.big { font-size: 1.6rem; letter-spacing: .12em; }
a.button { display: inline-block; padding: 9px 16px; border-radius: 10px; background: var(--accent); color: var(--accent-fg); text-decoration: none; font-weight: 600; }
a.button.secondary { background: var(--surface); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
#reset-dialog { max-width: 560px; }

/* GAP run progress */
progress.run-progress { width: 100%; max-width: 32rem; height: 0.75rem; accent-color: var(--accent, #2563eb); }
.warning { color: var(--warn, #b45309); }
/* Build stamp and feedback changelog. */
.sidebar-foot .build { display: block; margin-top: 6px; font-variant-numeric: tabular-nums; opacity: .8; }
.changelog { margin-top: 14px; }
.changelog summary { cursor: pointer; font-weight: 600; }
.changelog ol { max-height: 260px; overflow: auto; padding-left: 18px; }
.changelog li { margin: 8px 0; }
.questions ol { max-height: 60vh; overflow: auto; padding-left: 18px; }
/* Developer-only feedback: wide enough for long review cases, clearly badged. */
dialog.dev-dialog { width: min(1100px, 94vw); max-width: none; max-height: 92vh; border-top: 3px solid var(--warn); }
.dev-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.dev-tabs button { background: none; color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 12px; font-weight: 600; }
.dev-tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.research-figure { margin: 8px 0 4px; }
.research-chart { width: 100%; max-width: 720px; height: auto; display: block; }
.rc-grid { stroke: var(--line); stroke-width: 1; }
.rc-axis { fill: var(--muted); font-size: 12px; }
.rc-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.rc-dot { stroke: var(--surface); stroke-width: 2; }
.rc-line.rc-gaps { stroke: var(--ok); } .rc-dot.rc-gaps, .rc-key.rc-gaps { fill: var(--ok); background: var(--ok); }
.rc-line.rc-acc { stroke: var(--accent); } .rc-dot.rc-acc, .rc-key.rc-acc { fill: var(--accent); background: var(--accent); }
.rc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); }
.rc-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.research-list { padding-left: 1.2em; }
.research-list li { margin: 0 0 10px; }
.research h3 { margin: 22px 0 8px; }
.dev-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: -4px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.dev-title { font-weight: 600; color: var(--muted); }
.dev-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .68rem; font-weight: 800; letter-spacing: .08em; line-height: 1.5; color: var(--warn); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
button.dev-open { display: inline-flex; align-items: center; gap: 8px; }
.dev-dialog textarea { width: 100%; }
.questions li.question { margin: 10px 0 16px; }
.question-body { white-space: pre-wrap; margin: 4px 0 6px; }
.question-choices { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 6px; }
.question-choices label.choice { display: inline-flex; gap: 4px; align-items: center; margin: 0; }

/* Theme toggle. */
.theme-toggle { font-size: 1.05rem; line-height: 1; padding: 8px 10px; }

/* ---- phones ---- */
td, p, li, blockquote, label, h1, h2, h3 { overflow-wrap: anywhere; }
/* Table cells break a word only when it cannot fit at all: "anywhere" also
   lowers a cell's minimum width, so tables squeezed columns to "recommen-ded"
   or "€10,000,00-0". Monospace ids still break anywhere (.mono). */
td { overflow-wrap: break-word; }
th { overflow-wrap: normal; hyphens: auto; }
/* Buttons never break inside their label: without this they inherit
   overflow-wrap: anywhere from a table cell and get squeezed to a letter or
   two per line. Text-link buttons (thread titles, links) still wrap. */
button, a.button { white-space: nowrap; overflow-wrap: normal; flex-shrink: 0; }
button.link { white-space: normal; overflow-wrap: anywhere; }
/* Action cells shrink to their buttons instead of squeezing them. */
td:has(> button:not(.link)), td:has(> a.button) { width: 1%; white-space: nowrap; }
/* Selects in a table show their whole value (e.g. the framework scope). */
td select { display: inline-block; width: auto; min-width: max-content; max-width: 100%; }
@media (max-width: 760px) {
  body { font-size: 14px; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .topbar .page-title { flex-basis: 100%; font-size: 1.05rem; }
  .topbar button { padding: 7px 10px; font-size: .85rem; }
  .user-chip span:not(.avatar) { display: none; }
  /* Evidence: connector tiles two by two instead of one tall column. */
  #auto-dashboard .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  #auto-dashboard .tile { padding: 12px; gap: 4px; }
  #auto-dashboard .tile:first-child { grid-column: 1 / -1; }
  #auto-dashboard .tile-label { font-size: .68rem; }
  #auto-dashboard .tile-value { font-size: 1rem; }
  .shell main { padding: 12px; }
  section { padding: 16px 14px; border-radius: 12px; }
  #form-evidence { grid-template-columns: 1fr; }
  /* Tables become stacked cards; each cell shows its column name. */
  table, thead, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; margin: 10px 0; background: var(--surface-2); }
  td { border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); padding: 8px 0; }
  tr td:last-child { border-bottom: 0; }
  td[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
  td:empty { display: none; }
  /* In the stacked cards, several buttons wrap onto new lines as whole buttons. */
  td:has(> button:not(.link)), td:has(> a.button) { width: 100%; white-space: normal; }
  td select { min-width: 0; width: 100%; }
  dialog { width: calc(100vw - 24px); max-width: none; }
}
/* Narrow phones: the top bar's buttons fit on one line under the title. */
@media (max-width: 420px) {
  .topbar { gap: 6px; }
  .topbar button { padding: 6px 8px; font-size: .8rem; }
}

/* Policy vault. */
.vault-title { display: flex; align-items: center; gap: 10px; }
.vault-title .lock { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-size: 1.1rem; }
.vault-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 16px; }
.badge { font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.upload-status { list-style: none; padding: 0; margin: 8px 0 0; font-size: .9rem; }
.upload-status li { padding: 4px 0; }
.upload-status li.ok::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.upload-status li.bad { color: var(--bad); }
.upload-status li.bad::before { content: "✗ "; font-weight: 700; }
.upload-status li.pending { color: var(--muted); }

/* Country lists in the company profile. */
.checks.countries { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 12px; max-height: 220px; overflow: auto; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }

/* Visual roadmap (Gantt). */
.gantt { margin: 12px 0 18px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 6px; background: var(--surface-2); overflow-x: auto; }
.g-row { display: grid; grid-template-columns: 120px minmax(560px, 1fr); align-items: center; min-height: 34px; border-bottom: 1px dashed color-mix(in srgb, var(--line) 70%, transparent); }
.g-row:last-of-type { border-bottom: 0; }
.g-head { min-height: 58px; border-bottom: 1px solid var(--line); }
.g-label { font-size: .82rem; font-weight: 600; color: var(--muted); padding-right: 8px; }
.g-track { position: relative; height: 26px; }
.g-head .g-track { height: 52px; }
.g-axis { position: absolute; inset: 0 0 26px 0; }
.g-tick { position: absolute; top: 2px; transform: translateX(-50%); font-size: .7rem; color: var(--muted); white-space: nowrap; }
.g-today { position: absolute; top: 0; font-size: .7rem; font-weight: 700; color: var(--accent); }
/* The timeline starts today: a line down the left edge of every track. */
.g-track { border-left: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.g-milestones { position: absolute; left: 0; right: 0; bottom: 0; height: 26px; }
.g-milestone { position: absolute; bottom: 2px; transform: translateX(-50%); background: none; border: 0; padding: 0; box-shadow: none; color: var(--warn); font-size: .7rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.g-milestone::before { content: "◆"; display: block; text-align: center; font-size: .95rem; }
.g-milestone.done { color: var(--ok); }
.g-bar { position: absolute; top: 3px; height: 20px; border-radius: 6px; border: 0; padding: 0 6px; margin: 0; box-shadow: none; overflow: hidden; font-size: .68rem; font-weight: 700; color: var(--on-status); text-align: left; white-space: nowrap; cursor: pointer; }
.g-bar.prio-high, .g-key.prio-high { background: var(--bad); }
.g-bar.prio-medium, .g-key.prio-medium { background: var(--warn); }
.g-bar.prio-low, .g-key.prio-low { background: var(--accent); }
.g-bar.done, .g-key.done { background: var(--ok); opacity: .75; }
.g-bar:hover { filter: brightness(1.15); }
.g-legend { margin: 8px 0 0; }
.g-key { display: inline-block; width: 12px; height: 10px; border-radius: 3px; vertical-align: middle; }
.g-list { padding-left: 18px; }
.g-list li { margin: 6px 0; }
.g-list li.done { opacity: .6; }
#gantt-dialog { max-width: 620px; }
details.milestones-detail > summary { cursor: pointer; font-weight: 700; color: var(--accent); margin: 8px 0; }
@media (max-width: 760px) {
  .g-row { grid-template-columns: 84px minmax(520px, 1fr); }
}

/* GAP analysis running: the show. One centred column, one type scale. */
.gap-show { --gs-grad: linear-gradient(90deg, var(--accent), var(--accent-2)); margin: 12px 0; padding: 26px 28px 20px; border-radius: 18px; text-align: center;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    radial-gradient(90% 120% at 100% 100%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%), var(--surface-2); }
.gs-flow { display: flex; align-items: flex-start; justify-content: center; list-style: none; margin: 0 auto 14px; padding: 0; max-width: 640px; }
.gs-step { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 0 0 auto; width: 92px; }
.gs-step small { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; transition: color .3s; }
.gs-node { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; font-size: 1.5rem; background: var(--surface);
  border: 2px solid var(--line); opacity: .55; filter: grayscale(.6); transition: opacity .4s, filter .4s, border-color .4s, box-shadow .4s, transform .4s; }
.gs-step.done .gs-node { opacity: 1; filter: none; border-color: color-mix(in srgb, var(--accent-2) 60%, var(--line)); }
.gs-step.done small { color: var(--accent-2); }
.gs-step.active .gs-node { opacity: 1; filter: none; border-color: var(--accent); transform: scale(1.08);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 16%, transparent), 0 0 28px color-mix(in srgb, var(--accent) 45%, transparent); animation: gs-pulse 2s ease-in-out infinite; }
.gs-step.active small { color: var(--accent); }
.gs-link { position: relative; flex: 1 1 40px; min-width: 18px; height: 4px; margin-top: 30px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 18%, var(--line)); overflow: hidden; }
.gs-link i { position: absolute; top: 50%; left: -10px; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--accent-2); opacity: 0;
  box-shadow: 0 0 8px var(--accent-2); }
.gs-link.flowing i { animation: gs-flow 1.8s linear infinite; }
.gs-link.flowing i:nth-child(2) { animation-delay: .6s; }
.gs-link.flowing i:nth-child(3) { animation-delay: 1.2s; }
.gs-step.done + .gs-link { background: var(--gs-grad); }
.gs-stage { margin: 4px 0 2px; font-size: 1.15rem; font-weight: 700; min-height: 1.5em; }
.gs-now { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; min-height: 1.9em; margin: 4px auto 14px; max-width: 720px; color: var(--muted); font-size: .95rem; }
.gs-now strong { color: var(--fg); font-variant-numeric: tabular-nums; }
.gs-now.swap { animation: gs-in .5s ease-out; }
.gs-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; color: var(--accent-fg); background: var(--gs-grad); white-space: nowrap; }
.gs-bar { position: relative; height: 14px; width: 100%; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--accent) 12%, var(--line));
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12); }
.gs-bar > span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--gs-grad); transition: width .9s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent-2) 60%, transparent); }
.gs-bar > span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .45) 50%, transparent 80%);
  background-size: 200% 100%; animation: gs-shine 2.2s linear infinite; }
.gs-bar.waiting > span { width: 30% !important; animation: gs-wait 1.6s ease-in-out infinite alternate; }
.gs-line { margin: 10px 0 0; font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.gs-notes p { margin: 6px auto 0; max-width: 680px; }
.gs-saved { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 20px 0 6px; }
.gs-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.gs-value { font-size: 2.4rem; line-height: 1.15; font-weight: 800; font-variant-numeric: tabular-nums; background: var(--gs-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gs-sub { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1.2em; }
.gs-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0 6px; }
.gs-stat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 16px 10px; border-radius: 14px; background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line)); box-shadow: var(--shadow); }
.gs-num { font-size: 2rem; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; background: var(--gs-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gs-trio { display: flex; justify-content: center; gap: 18px; }
.gs-trio > span { display: flex; flex-direction: column; align-items: center; }
.gs-trio b { font-size: 1.6rem; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; }
.gs-trio small { font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.gs-trio .v-ok b { color: var(--ok); }
.gs-trio .v-warn b { color: var(--warn); }
.gs-trio .v-bad b { color: var(--bad); }
.gs-ticker { list-style: none; margin: 12px auto 0; padding: 0; max-width: 720px; display: flex; flex-direction: column; gap: 6px; }
.gs-ticker:empty { display: none; }
.gs-ticker li { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; text-align: left; }
.gs-ticker li:nth-child(n+4) { opacity: .6; }
.gs-ticker li .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.gs-ticker li em { font-style: normal; font-weight: 700; font-size: .75rem; white-space: nowrap; }
.gs-ticker .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.gs-ticker .v-covered .dot { background: var(--ok); } .gs-ticker .v-covered em { color: var(--ok); }
.gs-ticker .v-partial .dot { background: var(--warn); } .gs-ticker .v-partial em { color: var(--warn); }
.gs-ticker .v-missing .dot { background: var(--bad); } .gs-ticker .v-missing em { color: var(--bad); }
.gs-ticker li.new { animation: gs-in .6s ease-out; }
.gs-tech { margin: 12px 0 0; font-size: .75rem; color: var(--muted); opacity: .8; min-height: 1em; }
.gs-actions { margin-top: 12px; }
.gs-actions:empty { display: none; }
.gs-coffee { margin: 10px 0 0; font-size: .85rem; color: var(--muted); }
@keyframes gs-pulse { 0%, 100% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 16%, transparent), 0 0 22px color-mix(in srgb, var(--accent) 35%, transparent); }
  50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 6%, transparent), 0 0 36px color-mix(in srgb, var(--accent) 55%, transparent); } }
@keyframes gs-flow { 0% { left: -10px; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes gs-shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes gs-wait { from { left: 0; } to { left: 70%; } }
@keyframes gs-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .gs-step.active .gs-node, .gs-link.flowing i, .gs-bar > span::after, .gs-bar.waiting > span, .gs-now.swap, .gs-ticker li.new { animation: none; }
  .gs-node, .gs-bar > span { transition: none; }
  .gs-link.flowing { background: var(--gs-grad); }
}
@media (max-width: 760px) {
  .gap-show { padding: 18px 14px 14px; }
  .gs-step { width: 64px; gap: 6px; }
  .gs-step small { font-size: .62rem; letter-spacing: .02em; }
  .gs-node { width: 46px; height: 46px; font-size: 1.1rem; }
  .gs-link { margin-top: 21px; }
  .gs-stage { font-size: 1rem; }
  .gs-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gs-stat { padding: 12px 6px; }
  .gs-num { font-size: 1.6rem; }
  .gs-value { font-size: 1.9rem; }
  .gs-trio { flex-direction: column; gap: 2px; }
  .gs-trio > span { flex-direction: row; align-items: baseline; gap: 6px; }
  .gs-trio b { font-size: 1.25rem; }
}

/* Assistant: chat layout. */
.assistant { transition: grid-template-columns .2s ease; }
.assistant.history-hidden { grid-template-columns: 0 minmax(0, 1fr); gap: 0; }
.assistant.history-hidden aside { overflow: hidden; padding: 0; border: 0; visibility: hidden; }
.chat { display: flex; flex-direction: column; min-height: 70vh; }
.chat-head { display: flex; align-items: center; gap: 8px; }
.chat-head h1 { margin: 0 auto 0 0; }
.chat-head .ghost { font-size: 1.1rem; padding: 6px 10px; }
#messages { flex: 1; overflow-y: auto; padding: 8px 2px; }
.msg-user { margin-left: auto; max-width: 80%; width: fit-content; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2))); color: var(--accent-fg); border-radius: 18px 18px 4px 18px; }
.msg-assistant { max-width: 88%; width: fit-content; border-radius: 18px 18px 18px 4px; }
.welcome p { margin: 0 0 10px; font-size: 1.05rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; font-size: .85rem; background: var(--surface); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: none; }
.typing { display: flex; gap: 5px; padding: 14px 16px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; padding: 8px 8px 8px 16px; border-radius: 24px; border: 1px solid var(--line); background: var(--surface-2); }
/* One line is exactly the send button's height and the button stays on the
   last line, so the text and caret sit centred on it at any height. */
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; box-shadow: none; margin: 0; padding: 10px 0; line-height: 22px; height: 42px; min-height: 42px; max-height: 180px; outline: none; }
.composer textarea:focus { outline: none; }
.composer button { border-radius: 50%; width: 42px; height: 42px; margin: 0; padding: 0; font-size: 1.05rem; line-height: 1; }
@media (max-width: 760px) {
  .assistant:not(.history-hidden) { grid-template-columns: 1fr; }
  .assistant:not(.history-hidden) .chat { display: none; }
  .chat { min-height: 75vh; }
}

/* AI policy drafts: health overview and the draft pop-up. */
.health { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 10px 0 14px; }
.health-col { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); border-top: 3px solid var(--line); }
.health-col.ok { border-top-color: var(--ok); }
.health-col.warn { border-top-color: var(--warn); }
.health-col.bad { border-top-color: var(--bad); }
.health-col h3 { margin: 0 0 8px; font-size: .95rem; }
.health-col ul { list-style: none; padding: 0; margin: 0; }
.health-col li { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.health-col li:last-child { border-bottom: 0; }
.health-col li button { flex: none; padding: 6px 10px; font-size: .82rem; }
.health-col .sev { margin-left: 6px; }
/* The text takes the room left of the button and wraps inside the column. */
.health-col { min-width: 0; }
.health-col li > div { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
/* Policies approved since the shown GAP analysis: re-check pending. */
.notice.recheck { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 10px 0; }
.notice.recheck p { flex: 1 1 20rem; min-width: 0; margin: 0; }
.badge-approved { margin-top: 2px; color: var(--ok); font-weight: 600; }
.create-policy { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.create-policy label { flex: 1; min-width: 240px; margin: 0; }
.draft-dialog { width: min(860px, calc(100vw - 24px)); max-width: none; }
.draft-dialog textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.dd-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dd-actions #dd-close { margin-left: auto; }
button.disabled-look { opacity: .45; filter: grayscale(1); }
.notice { margin-top: 10px; padding: 12px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); background: var(--warn-soft); }
@media (max-width: 900px) { .health { grid-template-columns: 1fr; } }

/* Markdown in assistant answers. */
.msg-text.md { white-space: normal; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 8px; }
.md h4, .md h5 { margin: 12px 0 6px; font-size: 1rem; }
.md h5 { font-size: .93rem; color: var(--muted); }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; padding: 1px 5px; border-radius: 5px; background: color-mix(in srgb, var(--fg) 8%, transparent); }
.md pre { overflow-x: auto; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--fg) 6%, transparent); }
.md pre code { padding: 0; background: none; }
.md .md-table { overflow-x: auto; margin: 6px 0 10px; }
.md table { margin: 0; font-size: .88rem; }
.md th, .md td { padding: 6px 8px; }
.cite { display: inline-block; margin: 0 1px; padding: 0 5px; border-radius: 6px; font-size: .68rem; font-weight: 700; line-height: 1.5; color: var(--accent); background: var(--accent-soft); cursor: help; vertical-align: super; }

/* Buttons and selects never break mid-word (narrow table cells squeezed
   "Draft policy" into one letter column); action cells keep their size. */
button, a.button, .chip { white-space: nowrap; overflow-wrap: normal; word-break: keep-all; flex-shrink: 0; }
td:has(> button), td:has(> select), td:has(> a.button) { width: 1%; white-space: nowrap; }
td select, td .chip { min-width: 9.5rem; }
td button + button { margin-left: 6px; }
@media (max-width: 760px) {
  td:has(> button), td:has(> select), td:has(> a.button) { width: 100%; }
  td select { width: 100%; }
}

/* Sub-pages. */
.tab-hidden { display: none !important; }
.sidebar .subnav { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 30px; padding-left: 10px; border-left: 1px solid rgba(124, 196, 207, .14); }
.sidebar .subnav a.sub { padding: 6px 10px; border-radius: 8px; font-size: .88rem; color: var(--sidebar-fg); opacity: .85; }
.sidebar .subnav a.sub:hover { background: rgba(124, 196, 207, .07); opacity: 1; text-decoration: none; }
.sidebar .subnav a.sub[aria-current="page"] { color: var(--sidebar-active); opacity: 1; font-weight: 600; background: rgba(124, 196, 207, .11); }
.subnav-top { display: none; }
@media (max-width: 900px) {
  .sidebar .subnav { display: none; }
  .subnav-top { display: block; width: 100%; margin: 0 0 12px; font-weight: 600; }
}

/* Framework chips on the overview. */
.fw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.fw-chip { padding: 3px 9px; border-radius: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .02em; color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }

/* GAP run history. */
.table-actions { display: flex; gap: 8px; margin: 0 0 8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; }
tr.cmp-better td { background: color-mix(in srgb, #1f9d55 9%, transparent); }
tr.cmp-worse td { background: color-mix(in srgb, #d64545 10%, transparent); }
#gap-compare h2, #gap-history-report h2 { margin-top: 24px; }
/* Policy documents: the formatted view and the editor. */
.doc-frame { max-height: min(62vh, 760px); overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.doc { padding: 28px 36px; line-height: 1.6; font-size: .97rem; color: var(--fg); counter-reset: h2; }
.doc > :first-child { margin-top: 0; }
.doc h1 { font-size: 1.55rem; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); }
.doc h2 { font-size: 1.2rem; margin: 22px 0 8px; }
.doc h3 { font-size: 1.04rem; margin: 18px 0 6px; }
.doc h4 { font-size: .97rem; margin: 14px 0 4px; color: var(--muted); }
.doc p { margin: 0 0 10px; }
.doc ul, .doc ol { margin: 4px 0 12px; padding-left: 26px; }
.doc li { margin: 3px 0; }
.doc li > ul, .doc li > ol { margin: 2px 0; }
.doc blockquote { margin: 10px 0; padding: 6px 14px; border-left: 3px solid var(--accent); color: var(--muted); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.doc table { width: 100%; margin: 8px 0 14px; border-collapse: collapse; font-size: .9rem; }
.doc th, .doc td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.doc th { background: var(--surface-2); font-weight: 600; }
.doc code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; padding: 1px 5px; border-radius: 5px; background: var(--surface-2); }
.doc pre { overflow-x: auto; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.doc a { color: var(--accent); text-decoration: underline; }
.doc-plain { white-space: pre-wrap; font-size: .92rem; }
.doc-edit { min-height: 320px; outline: none; }
.doc-edit:focus-visible { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.doc-edit td:empty::after, .doc-edit th:empty::after { content: "\200b"; }
.doc-editor { display: flex; flex-direction: column; }
.doc-toolbar { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 6px 8px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.doc-toolbar .tb { min-width: 30px; padding: 4px 8px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--fg); font-size: .82rem; font-weight: 600; cursor: pointer; box-shadow: none; }
.doc-toolbar .tb:hover { background: var(--surface); border-color: var(--line); }
.doc-toolbar .tb-bold { font-weight: 800; }
.doc-toolbar .tb-italic { font-style: italic; }
.doc-toolbar .tb-source { margin-left: auto; font-weight: 500; }
.doc-toolbar .tb-source[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.doc-toolbar.source-mode .tb:not(.tb-source) { opacity: .4; pointer-events: none; }
.doc-toolbar .tb-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }
.doc-source { width: 100%; min-height: 360px; border: 0; border-radius: 0; padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; background: var(--surface); color: var(--fg); resize: vertical; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 700px) {
  .doc { padding: 18px 16px; }
}
@media print {
  body.printing > *:not(dialog.print-target), body.printing dialog:not(.print-target) { display: none !important; }
  body.printing dialog.print-target { position: static; display: block; width: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; box-shadow: none; background: #fff; color: #000; }
  body.printing dialog.print-target::backdrop { display: none; }
  body.printing .print-target .dd-actions, body.printing .print-target .notice, body.printing .print-target .doc-toolbar { display: none !important; }
  body.printing .print-target .doc-frame { max-height: none; overflow: visible; border: 0; }
  body.printing .print-target .doc { padding: 0; color: #000; }
}
/* File inputs with our own (translated) button and status. */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Posture tile: one box per light with its count. */

/* Evidence page: title with the bundle button top right; dashboards. */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.page-head h1 { margin-bottom: 0; }
.bundle-quick { position: relative; }
.bundle-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(340px, 86vw); padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
div.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 8px; }
.evidence-upload { max-width: 640px; }

/* Audit calendar: one card per month. */
.audit-calendar { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cal-month { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.cal-month h3 { margin: 0 0 8px; font-size: .95rem; }
.cal-month ul { list-style: none; margin: 0; padding: 0; }
.cal-month li { display: flex; gap: 8px; margin: 6px 0; padding-left: 8px; border-left: 3px solid var(--line); font-size: .85rem; overflow-wrap: anywhere; }
.cal-date { font-weight: 700; min-width: 1.6rem; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; }
.cal-key { padding-left: 8px; border-left: 3px solid var(--line); }
.cal-renewal { border-left-color: var(--warn) !important; }
.cal-task { border-left-color: var(--accent) !important; }
.cal-deadline { border-left-color: var(--bad) !important; }
.cal-milestone { border-left-color: var(--ok) !important; }

/* Roadmap swimlanes and audit dates. */
.g-swimlane .g-label strong { display: block; color: var(--fg); }
.g-swimlane .g-label .small { font-weight: 500; }
.g-row.g-swimlane { grid-template-columns: 170px minmax(560px, 1fr); }
.g-row.g-head { grid-template-columns: 170px minmax(560px, 1fr); }
.g-event { position: absolute; width: 14px; height: 14px; margin: 3px 0 0 -7px; padding: 0; border: 0; border-radius: 50%; box-shadow: none; cursor: pointer; background: var(--accent); }
.g-event.cal-renewal { background: var(--warn); }
.g-event.cal-deadline { background: var(--bad); }
.g-event.cal-milestone { background: var(--ok); }
.g-event-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
@media (max-width: 720px) {
  .g-row.g-swimlane, .g-row.g-head { grid-template-columns: 110px minmax(520px, 1fr); }
}

/* Vendor marketplace. */
.svc-card, .rfq-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.svc-card.recommended { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.svc-head h3 { flex: 1 1 12em; min-width: 0; }
.svc-head h3 { margin: 0; font-size: 1rem; }
.svc-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: auto; }
.svc-card .chip { flex: none; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.svc-card .chip.warn { color: var(--warn); background: var(--warn-soft); }
#market-services details { margin-bottom: 18px; }
.svc-card > p, .rfq-card > p { margin: 0; }
.vendor-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rfq-card { margin-bottom: 14px; }
.rfq-card .chip { flex: none; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--surface-2); }
.rfq-card .chip.ok { color: var(--ok); background: var(--ok-soft); }
.rfq-card .chip.small { margin-left: 6px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; white-space: pre-wrap; }
table.bids td { vertical-align: top; }
.spinner { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 700px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: 6px; } }
/* Manual decisions on GAP findings */
.badge-manual { display: inline-block; margin-top: 2px; padding: 1px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
#ov-docs { display: grid; gap: 4px; max-height: 220px; overflow-y: auto; }
#ov-docs label.check { display: flex; gap: 8px; align-items: center; font-weight: normal; }
#ov-docs-field { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin: 8px 0; }

/* Suggested controls for uploaded evidence (#82). */
.ev-suggestions { margin: 14px 0 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.ev-suggestions h3 { margin: 0 0 6px; }
.ev-sugg-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; }
.ev-sugg { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ev-sugg-main { display: grid; gap: 4px; min-width: 0; }
.ev-sugg-main .badge { justify-self: start; }
.ev-sugg-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.badge.muted-badge { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
@media (max-width: 760px) { .ev-sugg { flex-direction: column; } }
/* Content not yet checked by a lawyer. */
.badge-legal { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 6px; font-size: .7rem; font-weight: 700; vertical-align: middle; color: var(--warn); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); cursor: help; }
/* Security functions: group tabs, then compact cards. */
.fn-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 8px; margin: 4px 0 18px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
button.fn-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; margin: 0; padding: 10px 14px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--fg); box-shadow: none; text-align: left; white-space: normal; flex-shrink: 1; }
button.fn-tab:hover { filter: none; background: var(--surface); }
button.fn-tab[aria-selected="true"] { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
button.fn-tab[aria-selected="true"] .fn-tab-name { color: var(--accent); }
.fn-tab-name { display: block; max-width: 100%; font-size: .92rem; font-weight: 650; }
.fn-tab-name > span:first-child { overflow-wrap: anywhere; }
.fn-count { display: inline-block; margin-left: 6px; min-width: 1.5em; padding: 0 7px; border-radius: 999px; font-size: .74rem; text-align: center; background: var(--accent-soft); color: var(--accent); }
.fn-tab-hint { max-width: 100%; font-size: .76rem; font-weight: 500; color: var(--muted); }
.fn-tab.done .fn-tab-hint { color: var(--ok); }
@media (max-width: 560px) {
  .fn-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; }
  button.fn-tab { padding: 8px 10px; }
}
.fn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; align-items: start; }
.fn-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; box-sizing: border-box; padding: 16px; border: 1px solid var(--line); border-top: 3px solid var(--warn); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.fn-card.ready { border-top-color: var(--ok); }
.fn-card *, .fn-card *::before, .fn-card *::after { box-sizing: border-box; }
.fn-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.fn-head h3 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
.fn-status { display: flex; flex-wrap: wrap; gap: 6px; }
.fn-card .chip { flex: none; padding: 2px 8px; border-radius: 999px; border: 0; font-size: .72rem; font-weight: 600; cursor: default; }
.fn-card .chip.warn { color: var(--warn); background: var(--warn-soft); }
.fn-card .chip.ok { color: var(--ok); background: var(--ok-soft); }
.fn-desc { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-label { flex: none; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fn-owner, .fn-upload-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fn-owner select, .fn-upload-row select { flex: 1 1 auto; width: auto; min-width: 0; max-width: 100%; margin: 0; padding: 6px 34px 6px 10px; font-size: .88rem; }
.fn-foot { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.fn-foot .fn-upload-toggle { margin-left: auto; }
.fn-docs-box { flex: 1 1 0; min-width: 0; margin: 0; padding: 0; border: 0; background: none; }
.fn-docs-none { padding: 5px 0; }
.fn-docs-box summary { padding: 5px 0; cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--accent); }
.fn-docs { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.fn-docs li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; min-width: 0; padding: 3px 0; font-size: .88rem; }
.fn-docs li button.link { min-width: 0; }
.fn-docs .doc-type { flex: none; padding: 1px 7px; border-radius: 6px; font-size: .72rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); }
.fn-upload { display: grid; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.fn-upload[hidden] { display: none; }
.fn-upload .file-field, .fn-upload .file-drop { min-width: 0; max-width: 100%; }
.fn-upload .file-drop.compact { flex-wrap: wrap; }
.fn-upload .file-drop-text { flex: 1 1 8rem; }
.fn-upload-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.fn-upload-actions [role="status"] { margin-right: auto; }
.fn-menu { position: relative; flex: none; }
button.fn-more { padding: 2px 10px; font-size: 1.1rem; line-height: 1.2; border-color: transparent; }
button.fn-more:hover, button.fn-more[aria-expanded="true"] { filter: none; background: var(--surface-2); border-color: var(--line); color: var(--fg); }
.fn-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; display: flex; flex-direction: column; min-width: 150px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.fn-menu-list[hidden] { display: none; }
.fn-menu-list button { margin: 0; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--fg); box-shadow: none; font-weight: 500; text-align: left; }
.fn-menu-list button:hover, .fn-menu-list button:focus-visible { filter: none; background: var(--surface-2); }
.fn-menu-list button.danger { color: var(--danger); }

/* Settings > Updates: one card per day. */
.update-day { padding: 12px 16px; margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.update-day h3 { margin: 0 0 6px; font-size: 1rem; }
.update-day ul { margin: 0; padding-left: 18px; }
.update-day li { margin: 6px 0; overflow-wrap: anywhere; }

/* Posture heatmap: tiles sized by controls, red to green by percent. */
.view-toggle { display: inline-flex; flex-wrap: wrap; gap: 0; margin: 4px 0 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.view-toggle button { border: 0; border-radius: 0; box-shadow: none; background: var(--surface); color: var(--fg); padding: 8px 14px; }
.view-toggle button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg, #fff); }
.view-toggle button:disabled { opacity: .5; cursor: not-allowed; }
.heatmap { display: flex; flex-wrap: wrap; gap: 6px; }
.heat-tile { display: flex; flex-direction: column; justify-content: space-between; min-height: 96px; padding: 10px 12px; border-radius: 10px; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / 35%); transition: background .4s ease; }
.heat-tile strong { font-size: .9rem; }
.heat-pct { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.heat-sub { font-size: .75rem; opacity: .9; }
.heat-legend { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.heat-scale { flex: 0 1 220px; height: 10px; border-radius: 5px; background: linear-gradient(90deg, hsl(0 68% 38%), hsl(30 68% 38%), hsl(60 68% 38%), hsl(90 68% 38%), hsl(120 68% 38%)); }

/* Roadmap projects: one bar per project, coloured by swimlane. */
.g-project { position: absolute; height: 38px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 2px 10px; border: 0; border-radius: 8px; box-shadow: none; overflow: hidden; color: #fff; text-align: left; white-space: nowrap; cursor: pointer; }
.g-project:hover { filter: brightness(1.12); }
.g-project-title { font-size: .74rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.g-project-sub { font-size: .66rem; opacity: .9; }
.lane-policy { background: #4c6aa8; }
.lane-controls { background: #0e7490; }
.lane-audit { background: #b45309; }
.g-project.done { background: var(--ok); opacity: .8; }
/* Short bars: the title beside the bar instead of "C…". */
.g-project.narrow, .g-step.narrow { overflow: visible; }
.g-side { position: absolute; top: 50%; left: calc(100% + 6px); transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-start; color: var(--fg); white-space: nowrap; pointer-events: none; }
.label-left .g-side { left: auto; right: calc(100% + 6px); align-items: flex-end; }
.g-step .g-side { font-size: .7rem; }
.g-key.lane-policy, .g-key.lane-controls, .g-key.lane-audit { display: inline-block; width: 12px; height: 10px; border-radius: 3px; vertical-align: middle; }
textarea.kickoff { width: 100%; font-family: inherit; }

/* Audit plan: one lane per framework, steps back from the audit date. */
.audit-plan .g-track { height: 34px; }
.audit-plan .g-label input[type="date"] { margin-top: 4px; padding: 3px 6px; font-size: .78rem; width: 100%; }
.audit-plan .g-label input.suggested { border-style: dashed; }
.g-step { position: absolute; top: 5px; height: 24px; padding: 0 6px; border: 0; border-radius: 6px; box-shadow: none; overflow: hidden; font-size: .66rem; font-weight: 700; color: #fff; white-space: nowrap; text-align: left; cursor: pointer; background: #64748b; }
.g-step.step-collectors { background: #0e7490; }
.g-step.step-owners { background: #4c6aa8; }
.g-step.step-evidence { background: #b45309; }
.g-step.step-review, .g-step.step-bundle { background: #475569; }
.g-step.step-send { background: #be185d; }
.g-step.step-followup { background: #334155; }
.g-step.done { background: var(--ok); opacity: .8; }
.g-audit { position: absolute; top: 4px; transform: translateX(-50%); color: var(--bad); font-size: 1.2rem; line-height: 1; }

/* GAP report summary: ring, status boxes, work saved, domain bars. */
.gap-summary { display: grid; grid-template-columns: auto 1fr; gap: 16px 22px; align-items: center; margin: 4px 0 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface)); }
.gap-ring { position: relative; width: 132px; height: 132px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gap-ring::before { content: ""; position: absolute; inset: 16px; border-radius: 50%; background: var(--surface); }
.gap-ring span, .gap-ring small { position: relative; }
.gap-ring span { font-size: 1.7rem; font-weight: 800; }
.gap-ring small { color: var(--muted); font-size: .75rem; }
.gap-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.gap-stat { min-width: 92px; padding: 10px 12px; border-radius: 10px; border: 1px solid currentColor; background: color-mix(in srgb, currentColor 10%, transparent); display: flex; flex-direction: column; }
.gap-stat strong { font-size: 1.5rem; line-height: 1.1; }
.gap-stat span { font-size: .78rem; font-weight: 600; }
.gap-stat.tone-ok { color: var(--ok); }
.gap-stat.tone-warn { color: var(--warn); }
.gap-stat.tone-bad { color: var(--bad); }
.gap-saved { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.gap-saved strong { font-size: 1.25rem; color: var(--accent); }
.gap-saved .info { padding: 0 8px; border-radius: 50%; }
.gap-how { flex-basis: 100%; margin: 6px 0 0; }
.gap-bars { grid-column: 1 / -1; display: grid; gap: 6px; }
.gap-bar-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 3.2rem; gap: 10px; align-items: center; font-size: .85rem; }
.gap-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line); }
.gap-bar .seg-covered { background: var(--ok); }
.gap-bar .seg-partial { background: var(--warn); }
.gap-bar .seg-open { background: var(--bad); }
.gap-bar-pct { text-align: right; font-weight: 700; }
@media (max-width: 640px) {
  .gap-summary { grid-template-columns: 1fr; justify-items: center; }
  .gap-bars, .gap-saved { width: 100%; }
}

/* ---- shared building blocks (ui polish) ---- */
.nowrap { white-space: nowrap; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.amount { font-variant-numeric: tabular-nums; }
.actions-cell { width: 1%; white-space: nowrap; vertical-align: middle; }
.actions-cell .row-actions { flex-wrap: nowrap; }
.row-actions button, .row-actions a.button { margin: 0; padding: 6px 12px; font-size: .85rem; }
th.actions-col { width: 1%; }
button.ghost.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
button.ghost.danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
button.small-btn { padding: 5px 12px; font-size: .82rem; margin: 0; }
.field { margin: 0 0 14px; }
.field-label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .92rem; }
.empty-state { padding: 22px; border: 1px dashed var(--line); border-radius: 14px; background: var(--surface-2); }
.empty-state.centered { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 36px 22px; }
.empty-state .empty-title { margin: 0; font-weight: 700; font-size: 1.02rem; }
.empty-state p { margin: 0; max-width: 46ch; }
.empty-state .button { margin-top: 10px; }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; font-size: 1.4rem; color: var(--accent); background: var(--accent-soft); }

/* Shared file picker: drop zone, our own button, chosen files. */
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }
.file-field { display: grid; gap: 8px; }
.file-drop { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1.5px dashed color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 12px; background: var(--surface-2); cursor: pointer; transition: border-color .12s ease, background .12s ease; }
.file-drop:hover, .file-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.file-drop.has-files { border-style: solid; }
.file-drop-icon { flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); position: relative; }
.file-drop-icon::before { content: ""; position: absolute; left: 50%; top: 11px; width: 2px; height: 16px; margin-left: -1px; background: var(--accent); border-radius: 1px; }
.file-drop-icon::after { content: ""; position: absolute; left: 50%; top: 11px; width: 9px; height: 9px; margin-left: -5.5px; border-left: 2px solid var(--accent); border-top: 2px solid var(--accent); transform: rotate(45deg); }
.file-drop-text { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: .92rem; }
.file-drop button { margin: 0; }
.file-drop.compact { padding: 10px 12px; gap: 10px; }
.file-drop.compact .file-drop-icon { width: 30px; height: 30px; }
.file-drop.compact .file-drop-icon::before { top: 8px; height: 14px; }
.file-drop.compact .file-drop-icon::after { top: 8px; }
.file-drop.compact button { padding: 6px 12px; font-size: .85rem; }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.file-list[hidden] { display: none; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: .88rem; }
.file-list .file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-kind { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .74rem; font-weight: 700; letter-spacing: .02em; color: var(--accent); background: var(--accent-soft); white-space: nowrap; }
.vault-upload { display: grid; gap: 4px; max-width: 720px; }
.vault-upload button[type=submit] { justify-self: start; }
.vault-table .doc-name { font-weight: 600; }
@media (max-width: 560px) { .file-drop { flex-wrap: wrap; } .file-drop button { width: 100%; } }

/* Overview: one box per light, equal widths. */
.light-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin-top: 2px; }
.light-count { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 4px 8px; border-radius: 10px; border: 1px solid color-mix(in srgb, currentColor 45%, transparent); background: color-mix(in srgb, currentColor 12%, transparent); }
.light-count strong { font-size: 1.6rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.light-count small { margin-top: 2px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.fw-chip.more { color: var(--muted); background: var(--surface-2); border-color: var(--line); cursor: help; }
.fine-table td { vertical-align: middle; }
.fine-table td:first-child { width: 28%; }
.fine-table tr.is-standard td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.fine-table tfoot td { border-bottom: 0; border-top: 2px solid var(--line); font-weight: 700; padding-top: 14px; }
.fine-table tfoot td:first-child { color: var(--muted); text-transform: uppercase; font-size: .78rem; letter-spacing: .05em; }
.meter { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.meter-track { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter-track > span { display: block; height: 100%; border-radius: 999px; background: currentColor; min-width: 2px; }
.meter-label { width: 3.2em; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .88rem; }
.meter-ok { color: var(--ok); }
.meter-warn { color: var(--warn); }
.meter-bad { color: var(--bad); }
.stake-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 12%, transparent); cursor: help; white-space: nowrap; }

/* Manual decisions: switch row. */
label.switch-row { display: flex; align-items: center; gap: 14px; margin: 12px 0 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-weight: 400; cursor: pointer; position: relative; }
label.switch-row[hidden] { display: none; }
label.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch { flex: none; position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--line); transition: background .15s ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s ease; }
label.switch-row input:checked + .switch { background: var(--accent); }
label.switch-row input:checked + .switch::after { transform: translateX(18px); }
label.switch-row input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-text { display: flex; flex-direction: column; gap: 2px; }

/* Marketplace (#110). */
.svc-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 8px; }
.market-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 14px 0; }
.market-summary > div { display: flex; flex-direction: column; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.market-summary strong { font-size: 1.6rem; line-height: 1.1; color: var(--accent); }
.market-summary .warn strong { color: var(--warn); }
.market-summary .ok strong { color: var(--ok); }
.market-summary span { color: var(--muted); font-size: .85rem; }
.market-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
button.filter-chip { margin: 0; padding: 6px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--surface); color: var(--fg); border: 1px solid var(--line); box-shadow: none; }
button.filter-chip .count { margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: .75rem; background: var(--surface-2); color: var(--muted); }
button.filter-chip.gaps { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
button.filter-chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button.filter-chip[aria-pressed="true"] .count { background: color-mix(in srgb, var(--accent-fg) 25%, transparent); color: inherit; }
/* GAP findings by framework: chip bar that stays in view over the long list. */
.fw-filter { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); box-shadow: var(--shadow); }
.fw-filter button.filter-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; transition: background .12s ease, border-color .12s ease, color .12s ease; }
.fw-filter button.filter-chip:hover:not([aria-pressed="true"]) { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.fw-filter button.filter-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fw-filter button.filter-chip .count { margin-left: 0; }
.fw-filter button.filter-chip .open { padding: 0 7px; border-radius: 999px; font-size: .72rem; font-weight: 700; color: var(--bad); background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.fw-filter button.filter-chip[aria-pressed="true"] .open { color: var(--accent); background: var(--accent-fg); border-color: transparent; }
.fw-filter-note { margin: 0 0 10px 4px; }
/* Wrapped chips can fill a phone screen: the bar scrolls away there. */
@media (max-width: 760px) { .fw-filter { position: static; } }
@media (prefers-reduced-motion: reduce) { .fw-filter button.filter-chip { transition: none; } }
/* A run button between the click and the run's start. */
button.busy, button.busy:disabled { display: inline-flex; align-items: center; gap: 8px; opacity: .9; cursor: progress; }
button.busy .spinner { margin: 0; border-color: currentColor; border-right-color: transparent; }
#run-start-error { margin: 6px 0 0; }
.svc-card { box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease; }
.svc-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.svc-card h3 { margin: 0; font-size: 1.02rem; }
.svc-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.svc-tag { padding: 2px 8px; border-radius: 6px; font-size: .72rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.svc-tag.weak { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: var(--warn-soft); }
.svc-tags .chip { margin-left: auto; }
.svc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.svc-cta { margin: 0; }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { margin-left: -6px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .muted { margin-left: 8px; }
.avatar { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; font-weight: 800; font-size: .95rem; letter-spacing: .02em; }
.avatar.sm { width: 28px; height: 28px; border-radius: 50%; font-size: .68rem; }
.vendor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 18px; }
.vendor-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.vendor-card > p { margin: 0; }
.vendor-head { display: flex; gap: 12px; align-items: center; }
.vendor-head h3 { margin: 0; font-size: 1rem; }
.vendor-head .chip { margin-left: 8px; padding: 1px 7px; font-size: .68rem; }
.flag { font-family: "Twemoji Mozilla", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.cred-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cred-chip { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .74rem; font-weight: 600; color: var(--ok); background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.vendor-offers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.vendor-offers > span { width: 100%; }
button.offer { margin: 0; max-width: 100%; white-space: normal; text-align: left; line-height: 1.3; padding: 4px 10px; font-size: .8rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); box-shadow: none; }
button.offer:disabled { cursor: default; opacity: 1; }

/* Quote request dialog. */
#rfq-vendors { border: 0; padding: 0; margin: 4px 0 14px; min-width: 0; }
#rfq-vendors legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: .92rem; }
#rfq-vendor-list { display: grid; gap: 8px; }
label.vendor-option { display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-weight: 400; cursor: pointer; }
label.vendor-option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
label.vendor-option input { width: auto; margin: 0; flex: none; accent-color: var(--accent); }
.vendor-option-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vendor-option-text .muted { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
label.rfq-start select { max-width: 18rem; }
details.rfq-preview { margin: 6px 0 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 0 14px; }
details.rfq-preview > summary { cursor: pointer; padding: 10px 0; font-weight: 700; }
details.rfq-preview[open] { padding-bottom: 10px; }
.facts { gap: 6px 16px; align-items: baseline; }
.facts dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.fact-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.fact-chip { padding: 1px 8px; border-radius: 6px; font-size: .78rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); }
.fact-chip.more { color: var(--muted); background: var(--surface); border: 1px solid var(--line); cursor: help; }


/* vCISO assistant: conversation list, bubbles, sources. */
.assistant { grid-template-columns: minmax(0, 250px) minmax(0, 1fr); }
.assistant aside, .assistant .chat { min-width: 0; }
.assistant aside li { align-items: center; gap: 4px; padding: 2px 4px 2px 8px; min-width: 0; }
.assistant aside li:hover { background: var(--surface-2); }
.assistant aside li.active, .assistant aside li.active:hover { background: var(--accent-soft); }
.assistant aside button.thread-title { flex: 1; min-width: 0; padding: 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.assistant aside li.active button.thread-title { color: var(--accent); }
button.thread-del { flex: none; width: 26px; height: 26px; margin: 0; padding: 0; border-radius: 7px; background: transparent; border: 1px solid transparent; box-shadow: none; color: var(--muted); font-size: 1.05rem; line-height: 1; opacity: 0; }
.assistant aside li:hover button.thread-del, .assistant aside li:focus-within button.thread-del, .assistant aside li.active button.thread-del { opacity: 1; }
button.thread-del:hover, button.thread-del:focus-visible { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); background: color-mix(in srgb, var(--danger) 10%, transparent); }
@media (hover: none) { button.thread-del { opacity: 1; } }
.msg-user .msg-meta { color: color-mix(in srgb, var(--accent-fg) 78%, transparent); }
.msg-user .msg-meta button.link { color: var(--accent-fg); text-decoration: underline; text-underline-offset: 2px; }
.msg-meta button.link { font-size: 12px; }
button.cite { display: inline-block; margin: 0 0 0 2px; padding: 0 5px; border: 0; border-radius: 6px; box-shadow: none; font: inherit; font-size: .66rem; font-weight: 700; line-height: 1.55; color: var(--accent); background: var(--accent-soft); vertical-align: super; cursor: pointer; white-space: nowrap; }
button.cite + button.cite { margin-left: 2px; }
button.cite:hover, button.cite[aria-expanded="true"] { background: var(--accent); color: var(--accent-fg); }
button.cite:focus-visible, button.source-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button.source-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin: 0; padding: 3px 10px 3px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); box-shadow: none; font-size: .8rem; font-weight: 500; cursor: pointer; }
button.source-chip .source-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22rem; }
button.source-chip:hover, button.source-chip[aria-expanded="true"] { border-color: var(--accent); }
.cite-n { flex: none; padding: 0 6px; border-radius: 999px; font-size: .7rem; font-weight: 800; color: var(--accent); background: var(--accent-soft); }
.cite-pop { position: fixed; z-index: 1000; width: min(380px, calc(100vw - 16px)); padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); box-shadow: 0 12px 40px rgba(0, 0, 0, .28); font-size: .88rem; white-space: normal; }
.cite-pop[hidden] { display: none; }
.cite-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.cite-head .cite-n { margin-top: 2px; }
.cite-title { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
button.cite-close { flex: none; width: 24px; height: 24px; margin: 0; padding: 0; border: 0; border-radius: 6px; background: transparent; box-shadow: none; color: var(--muted); font-size: 1.05rem; line-height: 1; }
button.cite-close:hover { background: var(--surface-2); color: var(--fg); }
.cite-text { margin: 0; line-height: 1.55; color: var(--muted); }
.cite-text mark { color: var(--fg); background: color-mix(in srgb, var(--warn) 22%, transparent); border-radius: 3px; padding: 0 2px; }
.cite-actions { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.cite-actions a, .cite-actions button.link { font-weight: 600; font-size: .85rem; }
#form-evidence .field { grid-column: 1 / -1; }
.file-drop-text strong { white-space: nowrap; }
@media (max-width: 760px) {
  td.actions-cell, td.num { width: 100%; text-align: left; white-space: normal; }
  .actions-cell .row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .vault-table td.num::before, .fine-table td.num::before { text-align: left; }
  .fine-table td:first-child { width: 100%; }
  .assistant { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Full-width pages and Home (vCISO + key figures) ---- */
.shell main { max-width: none; padding: 22px clamp(16px, 2.4vw, 40px) 40px; }
/* Long prose keeps a readable line length on wide screens. */
section > p.muted, section > p.lead, .info-body p { max-width: 120ch; }
.home { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 16px; align-items: start; }
.home-chat { min-width: 0; }
.home-chat .chat { height: calc(100vh - 150px); min-height: 520px; }
.home-chat #messages { flex: 1; max-height: none; min-height: 0; }
.home-chat .chat-head h1 { font-size: 1.2rem; }
.home-side { position: sticky; top: 16px; min-width: 0; }
/* Nothing in the key figures may widen the column past the viewport. */
.home-tiles > * { min-width: 0; }
.home-tiles .tile-label, .home-tiles .tile-value, .home-tiles .tile-detail { overflow-wrap: anywhere; }
.home-tiles { display: grid; grid-template-columns: 1fr; gap: 10px; }
.home-tiles > .loading { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.home-tiles .tile { padding: 12px 14px; gap: 4px; border-top-width: 3px; box-shadow: none; }
.home-tiles .tile-label { font-size: .7rem; }
.home-tiles .tile-value { font-size: 1.15rem; }
.home-tiles .tile-detail { font-size: .8rem; }
.home-tiles .light-count { padding: 6px 4px 5px; }
.home-tiles .light-count strong { font-size: 1.3rem; }
@media (min-width: 1700px) {
  .home { grid-template-columns: minmax(0, 1fr) minmax(560px, 640px); }
  .home-tiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .home-side { position: static; order: -1; }
  .home-tiles { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .home-chat .chat { height: auto; min-height: 70vh; }
}
@media (max-width: 760px) {
  .home-tiles { grid-template-columns: 1fr 1fr; }
  .home-tiles .tile-detail { display: none; }
  .home-tiles .tile:nth-child(-n+2 of .tile) { grid-column: 1 / -1; }
  .home-tiles .tile:nth-child(-n+2 of .tile) .tile-detail, .home-tiles .tile.capability .tile-detail { display: block; }
}
.welcome .chips .chip { white-space: normal; text-align: left; max-width: 100%; line-height: 1.35; }
.composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Home: posture at a glance and the security function radar. */
.glance-title { grid-column: 1 / -1; margin: 0 0 2px; font-size: 1rem; }
.tile.capability { align-items: stretch; }
/* The radar card spans the row so no column is left with an empty cell. */
.home-tiles .tile.capability { grid-column: 1 / -1; }
.radar { width: 100%; max-width: 300px; height: auto; margin: 4px auto; overflow: visible; }
.radar-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.radar-axis { stroke: var(--line); stroke-width: 1; }
.radar-area { fill: color-mix(in srgb, var(--accent) 30%, transparent); stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.radar-label { font-size: 10px; fill: var(--muted); }

/* Posture: overall score and the security function tiles. */
.posture-overall { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; padding: 10px 16px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.posture-overall .heat-pct { font-size: 2rem; }
.heat-group { margin: 16px 0 6px; font-size: 1rem; }
.fn-tile { flex: 1 1 150px; min-height: 84px; }
/* Audit plan: date and remove per lane. */
.plan-date { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.plan-date input[type="date"] { margin: 0; flex: 1; min-width: 0; }

/* A finished GAP analysis: the show's look, all stages done. */
.gap-done { display: block; margin-bottom: 16px; }
.gap-done .gs-step.done .gs-node { background: var(--ok); color: var(--on-status); border-color: var(--ok); }
.gap-done .gs-link i { animation: none; opacity: .7; background: var(--ok); }
.gap-done .done-check { color: var(--ok); font-weight: 800; }
.gap-done .gs-stage { font-size: 1.25rem; font-weight: 700; }
.gap-done .gap-how { margin-top: 6px; }
.gs-eyebrow { margin: 14px 0 0; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.gs-score { max-width: 560px; margin: 16px auto 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.gs-score-head { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.gs-score-num { font-size: 2.6rem; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.gs-score-bar { display: flex; height: 10px; margin: 12px 0; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.gs-score-bar .seg-covered { background: var(--ok); }
.gs-score-bar .seg-partial { background: var(--warn); }
.gs-score-bar .seg-open { background: var(--bad); }
.gs-score-bar .seg-review { background: var(--muted); }
.gs-verdicts4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gs-verdict { display: flex; flex-direction: column; align-items: center; }
.gs-verdict b { font-size: 1.5rem; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; }
.gs-verdict small { font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.gs-verdict.v-ok b { color: var(--ok); }
.gs-verdict.v-warn b { color: var(--warn); }
.gs-verdict.v-bad b { color: var(--bad); }
.gs-verdict.v-review b { color: var(--muted); }
.gap-empty .gs-stage { margin-top: 0; }
.gap-empty .gs-line { max-width: 560px; margin: 8px auto 0; font-weight: 400; color: var(--muted); }
@media (max-width: 520px) {
  .gs-verdicts4 { grid-template-columns: repeat(2, 1fr); }
  .gs-score-num { font-size: 2.1rem; }
}

/* Compliance: what applies, at a glance. */
.appl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 8px 0 6px; }
.appl-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.appl-card.kind-standard { border-top-color: var(--accent-2, var(--accent)); }
.appl-card p { margin: 0; }
.appl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.appl-badge { padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); }
.appl-facts { margin: 0; padding-left: 18px; font-size: .82rem; color: var(--muted); }
.appl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.appl-summary { margin: 4px 0 8px; }
.appl-stake { font-weight: 600; }
.appl-card.out { opacity: .7; border-top-color: var(--line); }
.appl-group { margin: 10px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.appl-group > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-weight: 600; }
.appl-group > .appl-grid { padding: 0 12px 12px; }
.appl-count { padding: 0 8px; border-radius: 999px; font-size: .75rem; color: var(--accent); background: var(--accent-soft); }
.appl-group-chips { display: flex; flex-wrap: wrap; gap: 4px; font-weight: 400; }
.appl-group[open] .appl-group-chips { display: none; }

/* ---- vCISO proposed changes (ADR 0029): one card per change, approved one by one ---- */
.msg .action-card {
  white-space: normal; margin: 12px 0 4px; padding: 14px 16px 12px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  border-left: 4px solid var(--accent); max-width: 560px;
}
.action-card.tone-ok { border-left-color: var(--ok); }
.action-card.tone-bad { border-left-color: var(--bad); }
.action-card.tone-muted { border-left-color: var(--line); opacity: .85; }
.action-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.action-icon {
  flex: none; width: 34px; height: 34px; border-radius: 10px; position: relative;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--accent-2)));
}
.action-icon::after {
  content: ""; position: absolute; left: 12px; top: 8px; width: 8px; height: 14px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.tone-muted .action-icon { background: var(--surface-2); border: 1px solid var(--line); }
.tone-muted .action-icon::after { border-color: var(--muted); }
.tone-bad .action-icon { background: var(--bad); }
.action-heading { display: flex; flex-direction: column; min-width: 0; flex: 1 1 150px; }
.action-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.action-heading h5 { margin: 1px 0 0; font-size: 1.02rem; font-weight: 650; color: var(--fg); }
.action-status { flex: none; margin-left: auto; font-size: .75rem; font-weight: 650; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.status-pending { color: var(--warn); background: var(--warn-soft); }
.status-ok { color: var(--ok); background: var(--ok-soft); }
.status-bad { color: var(--bad); background: var(--bad-soft); }
.status-muted { color: var(--muted); background: var(--surface-2); }
.action-summary { margin: 10px 0 8px; color: var(--fg); font-size: .92rem; }
.action-changes { margin: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.action-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr; gap: 12px; padding: 7px 12px; background: var(--surface-2); }
.action-row + .action-row { border-top: 1px solid var(--line); }
.action-row dt { color: var(--muted); font-size: .82rem; font-weight: 600; }
.action-row dd { margin: 0; font-size: .9rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; overflow-wrap: anywhere; }
.action-from { color: var(--muted); text-decoration: line-through; }
.action-arrow { color: var(--muted); }
.action-to { font-weight: 600; }
.action-result { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; font-size: .88rem; font-weight: 500; }
.action-result.status-muted { color: var(--fg); }
.action-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.action-note { font-size: .78rem; color: var(--muted); flex: 1 1 200px; }
.action-buttons { display: flex; gap: 8px; }
.action-buttons button { margin: 0; padding: 7px 16px; }
.action-reject { display: flex; gap: 8px; margin-top: 10px; }
.action-reject[hidden] { display: none; }
.action-reject input { flex: 1; min-width: 0; margin: 0; }
.action-reject button { margin: 0; }
button.secondary.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
@media (max-width: 600px) {
  .action-row { grid-template-columns: 1fr; gap: 2px; }
  .action-buttons { width: 100%; }
  .action-buttons button { flex: 1; }
}

/* Audit plan: one step per line, heads-up email button. */
.audit-plan .g-swimlane .g-track { height: auto; }
.audit-plan .g-label .small-btn { margin-top: 4px; padding: 3px 8px; font-size: .74rem; }
/* AI drafts: "In good shape" as coloured boxes per area. */
.dom-boxes { display: flex; flex-wrap: wrap; gap: 6px; }
.dom-box { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 6.5rem; padding: 8px 10px; border: 0; border-radius: 10px; box-shadow: none; color: #fff; text-align: left; text-shadow: 0 1px 2px rgb(0 0 0 / 30%); cursor: pointer; }
.dom-box strong { font-size: .82rem; }
.dom-box .dom-count { font-size: 1.1rem; font-weight: 800; }
.dom-box:hover { filter: brightness(1.1); }
.dom-list { margin: 8px 0 0; padding-left: 18px; font-size: .85rem; }
.dom-list li { display: list-item; padding: 3px 0; border: 0; }

/* Home: tighter key figures and the combined financial risk tile. */
.home-tiles { gap: 8px; align-items: start; align-content: start; }
.home-tiles .glance-title { margin: 0; }
.home-tiles .tile { padding: 10px 12px; }
.home-tiles .tile:hover { transform: none; }
.fin-row { display: flex; flex-direction: column; }
.fin-value { font-size: 1.15rem; font-weight: 700; }
.fin-label { font-size: .72rem; font-weight: 500; color: var(--muted); }
.fin-second { margin-top: 6px; }
.fin-second .fin-value { font-size: .95rem; }

/* Triage of GAP findings (done / please check / confirmed) and review notes. */
.triage { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.triage-done { background: var(--ok-soft); color: var(--ok); }
.triage-check { background: var(--warn-soft); color: var(--warn); }
.triage-confirmed { background: var(--accent-soft); color: var(--accent); }
.review-note { margin-top: 4px; padding: 4px 8px; border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 4px; }

/* Posture history (ADR 0030): trend chart, frameworks, domains, events. */
.history-cta { margin: 14px 0 0; }
.history-cta a { font-weight: 600; }
.report-only { display: none; }
section.posture-history { background: none; border: 0; box-shadow: none; padding: 0; }
.ph-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ph-controls .view-toggle { margin: 0; }
.posture-history .tiles { margin: 6px 0 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ph-kpi { font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.ph-card { margin: 0 0 16px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ph-card h2 { margin: 0 0 10px; font-size: 1.05rem; }
.ph-columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.ph-columns .ph-card { margin: 0 0 16px; }
@media (max-width: 1000px) { .ph-columns { grid-template-columns: 1fr; } }
.ph-chart-wrap { position: relative; }
.ph-svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.ph-zone { opacity: .09; }
.ph-zone-red { fill: var(--bad); }
.ph-zone-amber { fill: var(--warn); }
.ph-zone-green { fill: var(--ok); }
.ph-grid { stroke: var(--line); stroke-width: 1; }
.ph-tick { stroke: var(--muted); stroke-width: 1; }
.ph-axis { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.ph-fill-top { stop-color: var(--accent); stop-opacity: .35; }
.ph-fill-bottom { stop-color: var(--accent); stop-opacity: 0; }
.ph-area { fill: url(#ph-fill); }
.ph-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.ph-marker { fill: var(--surface); stroke: var(--accent-2, var(--accent)); stroke-width: 2.5; cursor: help; }
.ph-marker-milestone { stroke: var(--ok); }
.ph-end { fill: var(--surface); stroke: var(--accent); stroke-width: 3; }
.ph-now { fill: var(--accent); stroke: var(--surface); }
.ph-value { font-size: 20px; font-weight: 800; fill: var(--fg); font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.ph-value-start { font-size: 14px; font-weight: 700; fill: var(--muted); }
.ph-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.ph-hot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.ph-tip { position: absolute; transform: translate(-50%, calc(-100% - 14px)); padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .8rem; white-space: nowrap; pointer-events: none; z-index: 5; }
.ph-tip strong { display: block; }
.ph-frameworks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.ph-fw { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); border-left: 4px solid currentColor; background: var(--surface-2, var(--surface)); }
.ph-fw strong { color: var(--fg); }
.ph-fw-name { min-height: 2.6em; line-height: 1.3; }
.ph-fw-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ph-fw-pct { font-size: 1.6rem; font-weight: 800; color: var(--fg); font-variant-numeric: tabular-nums; }
.ph-spark { width: 100%; height: 42px; margin-top: auto; padding-top: 6px; overflow: visible; }
.ph-spark polyline { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ph-delta { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.ph-delta.up { color: var(--ok); }
.ph-delta.down { color: var(--bad); }
.ph-timeline { list-style: none; margin: 0; padding: 0; }
.ph-ev { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ph-ev:last-child { border-bottom: 0; }
.ph-ev-icon { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: .8rem; color: var(--accent); background: var(--accent-soft); }
.ph-ev-control .ph-ev-icon, .ph-ev-note .ph-ev-icon, .ph-ev-light .ph-ev-icon { color: var(--ok); background: var(--ok-soft); }
.ph-ev-milestone .ph-ev-icon { color: var(--warn); background: var(--warn-soft); }
.ph-ev.down .ph-ev-icon { color: var(--bad); background: var(--bad-soft); }
.ph-ev-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.ph-ev-date { font-size: .75rem; color: var(--muted); font-weight: 600; }
.ph-domain-table td.ph-delta { text-align: right; }
.ph-bar { position: relative; min-width: 120px; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.ph-bar span { position: absolute; top: 0; bottom: 0; }
.ph-bar-then { left: 0; background: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.ph-bar-now { background: var(--ok); }
.ph-bar-now.down { background: var(--bad); }
@media print {
  body.print-report { --bg: #fff; --surface: #fff; --surface-2: #fff; --fg: #0f172a; --muted: #4b5563; --line: #d6dbe4;
    --accent: #1d6b78; --accent-2: #3a8f9c; --accent-soft: #e2f0f2; --ok: #15803d; --ok-soft: #e7f6ec; --warn: #b45309; --warn-soft: #fff4e0;
    --bad: #b91c1c; --bad-soft: #fdecec; --shadow: none; --bg-image: none; background: #fff; color: #0f172a; }
  body.print-report .sidebar, body.print-report .topbar, body.print-report .subnav-top, body.print-report #error,
  body.print-report main > section:not(.posture-history), body.print-report .no-print, body.print-report dialog,
  body.print-report .posture-history .info { display: none !important; }
  body.print-report { display: block; }
  body.print-report .frame, body.print-report main { margin: 0; padding: 0; max-width: none; }
  body.print-report .report-only { display: flex; flex-direction: column; gap: 2px; margin: 0 0 12px; padding: 0 0 10px; border-bottom: 2px solid var(--accent); }
  body.print-report .report-kicker { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
  body.print-report #ph-company { font-size: 1.4rem; }
  body.print-report .ph-card, body.print-report .tile { break-inside: avoid; box-shadow: none; }
  body.print-report .ph-columns { grid-template-columns: 1fr; }
  body.print-report .tile:hover { transform: none; }
  body.print-report .ph-tip, body.print-report .ph-cross, body.print-report .ph-hot { display: none; }
  body.print-report * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* ---- Vault: archive filter, versions and diffs (ADR 0031) ---- */
.vault-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.vault-filter:empty { display: none; }
.vault-filter button[aria-pressed="true"], .diff-mode button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.version-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); vertical-align: 1px; }
.version-badge.archived { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.parse-badge { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 1px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; vertical-align: 1px; cursor: help; border: 1px solid transparent; white-space: nowrap; }
.parse-badge .parse-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.parse-medium { color: var(--warn); background: var(--warn-soft); }
.parse-low { color: var(--bad); background: var(--bad-soft); }
.parse-images { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
.parse-why { margin: 4px 0 6px 18px; padding: 0; }
.ver-table input[type="radio"] { margin: 0; width: auto; }
.ver-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 8px; }
.diff-mode { display: flex; gap: 6px; }
.diff-mode button { margin: 0; padding: 6px 12px; font-size: .85rem; }
.diff table { width: 100%; border-collapse: collapse; table-layout: fixed; font: .8rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.diff th { text-align: left; padding: 6px 8px; font: 600 .78rem/1.4 ui-sans-serif, system-ui, sans-serif; color: var(--muted); background: var(--surface-2); }
.diff td { padding: 1px 8px; vertical-align: top; border: 0; }
.diff td.code { white-space: pre-wrap; overflow-wrap: anywhere; }
.diff td.ln { width: 3.4em; color: var(--muted); text-align: right; user-select: none; }
.diff tr.add td, .diff td.add { background: var(--ok-soft); }
.diff tr.del td, .diff td.del { background: var(--bad-soft); }
.diff td.empty { background: var(--surface-2); }
.diff tr.gap td { text-align: center; color: var(--muted); background: var(--surface-2); cursor: pointer; font-family: ui-sans-serif, system-ui, sans-serif; }
.diff tr.gap td:hover, .diff tr.gap td:focus-visible { color: var(--accent); }
@media (max-width: 760px) {
  /* Diffs stay tables on a phone, not stacked cards. */
  .diff table { display: table; }
  .diff thead { display: table-header-group; }
  .diff tbody { display: table-row-group; }
  .diff tr { display: table-row; border: 0; border-radius: 0; padding: 0; margin: 0; background: none; }
  .diff td, .diff th { display: table-cell; width: auto; border-bottom: 0; padding: 1px 4px; }
  .diff td:empty { display: table-cell; }
  .diff td.ln { width: 2.4em; }
}

/* Audit plan on phones: cards instead of the chart. */
.audit-cards { display: none; }
@media (max-width: 760px) {
  .gantt.audit-plan { display: none; }
  .audit-cards { display: grid; gap: 10px; }
  .audit-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .audit-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: center; }
  .audit-card p { margin: 0; }
  .audit-steps { margin: 6px 0 0; padding-left: 18px; }
  .audit-steps li { margin: 6px 0; }
  .audit-steps li.done { opacity: .65; }
  #plan-audit { width: 100%; }
}
/* GAP show: the first step's label is longer ("Laws and frameworks"). */
.gs-step small { white-space: normal; text-align: center; line-height: 1.2; }
/* Home: the vCISO as one chat box, no conversation list (#201). */
.home-chat.assistant { grid-template-columns: minmax(0, 1fr); gap: 0; }
.home-chat.assistant > aside, .home-chat #toggle-history { display: none; }
.home-chat .chat { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; box-shadow: var(--shadow); }
.home-chat #messages { padding: 8px 4px; }
@media (max-width: 760px) {
  /* The list never takes the chat's place on Home. */
  .home-chat.assistant:not(.history-hidden) .chat { display: flex; }
  .home-chat .chat { min-height: 65vh; padding: 10px; }
  .home-chat .msg-user, .home-chat .msg-assistant { max-width: 92%; }
  .home-chat .composer { position: sticky; bottom: 0; background: var(--surface-2); }
}

/* Home: posture over time tile (#203). */
.home-tiles .posture-trend .ph-svg { width: 100%; height: auto; max-height: 150px; }
.home-tiles .posture-trend { grid-column: 1 / -1; }
/* Security functions: owner check, maturity bar, demo documents (#204). */
.fn-card.owned { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.chip.owner-ok { background: var(--ok); color: var(--on-status); border-color: var(--ok); }
.chip.owner-ok.pop { animation: owner-pop .6s ease; }
@keyframes owner-pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
.fn-maturity { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 6px 0; }
.fn-maturity progress { flex: 1 1 100%; height: 8px; }
.fn-maturity .small-btn { margin-left: auto; }
.fn-demo { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.fn-demo select { flex: 1; margin: 0; }
@media (prefers-reduced-motion: reduce) { .chip.owner-ok.pop { animation: none; } }

/* Company profile: amounts in EUR, grouped below the number field. */
.money-field { display: block; }
.money-hint { display: block; margin-top: 4px; min-height: 1.2em; }

/* Executive viewers: control titles without the ids (the id is the tooltip). */
.exec-view .ctl-id { display: none; }
.exec-view .ctl-title { font-weight: 700; color: var(--fg); }

.glance-head { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.glance-link { font-size: .85rem; font-weight: 600; white-space: nowrap; }
/* Board summary: one page, printable. */
.board-head { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 14px; padding: 0 0 10px; border-bottom: 2px solid var(--accent); }
.board-head .report-kicker { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.board-head strong { font-size: 1.3rem; }
.board-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.board-list { margin: 0; padding-left: 20px; }
.board-list li { margin: 8px 0; }
@media (max-width: 760px) { .board-columns { grid-template-columns: 1fr; } }
@media print {
  body.print-board { --bg: #fff; --surface: #fff; --surface-2: #fff; --fg: #0f172a; --muted: #4b5563; --line: #d6dbe4;
    --accent: #1d6b78; --accent-2: #3a8f9c; --accent-soft: #e2f0f2; --ok: #15803d; --ok-soft: #e7f6ec; --warn: #b45309; --warn-soft: #fff4e0;
    --bad: #b91c1c; --bad-soft: #fdecec; --shadow: none; --bg-image: none; display: block; background: #fff; color: #0f172a; }
  body.print-board .sidebar, body.print-board .topbar, body.print-board .subnav-top, body.print-board #error, body.print-board #progress,
  body.print-board main > section:not(.board), body.print-board .no-print, body.print-board dialog,
  body.print-board .board .info, body.print-board .board > .page-head { display: none !important; }
  body.print-board .frame, body.print-board main, body.print-board section.board { margin: 0; padding: 0; max-width: none; border: 0; box-shadow: none; }
  body.print-board .tiles { grid-template-columns: repeat(4, 1fr); }
  body.print-board .ph-card, body.print-board .tile { break-inside: avoid; box-shadow: none; }
  body.print-board .tile:hover { transform: none; }
  body.print-board * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Access rules and the sign-in log (Settings, ADR 0047). */
.access-form { display: grid; gap: 14px; max-width: 760px; }
.access-card { padding: 4px 16px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.access-card label.switch-row { margin: 12px -4px 14px; }
.access-card.off > :not(label.switch-row) { opacity: .55; transition: opacity .15s ease; }
.access-days { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; }
.access-days label.check { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.access-row { display: flex; flex-wrap: wrap; gap: 0 16px; }
.access-row label { flex: 1 1 160px; }
.access-actions { display: flex; align-items: center; gap: 14px; }

/* Settings, "Sign-in details": username and password side by side, stacked on phones. */
.signin-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; margin: 4px 0 8px; }
.signin-card { padding: 6px 18px 16px; }
.signin-card h3 { margin: 12px 0 4px; }
.signin-card > p.small { margin: 0 0 12px; }
.signin-card label small { margin-top: 6px; }
.signin-card [role=status] { flex: 1; }
.signin-card [role=status].error { color: var(--danger); font-weight: 600; }
/* Access-rule pickers: allowlist rows, day pills, country combobox. */
.access-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.access-buttons:empty { display: none; }
.access-buttons button.small { padding: 5px 12px; font-size: .85rem; }
.ip-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 36px; gap: 8px; margin: 0 0 4px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.ip-rows { display: grid; gap: 6px; }
.ip-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 36px; gap: 4px 8px; align-items: center; }
.ip-row input { display: block; width: 100%; margin: 0; padding: 9px 12px; font: inherit; font-weight: 400; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--fg); }
.ip-row input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }
.ip-row input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; border-color: var(--accent); }
.ip-row.invalid .ip-cidr { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.ip-row .ip-x { width: 36px; height: 36px; padding: 0; font-size: 1.2rem; line-height: 1; color: var(--muted); }
.ip-row .ip-x:hover:not(:disabled) { color: var(--bad); background: var(--bad-soft); }
.ip-hint { grid-column: 1 / -1; margin: 0 0 4px 2px; min-height: 0; }
.ip-hint:empty { display: none; }
.ip-hint.bad { color: var(--bad); font-weight: 500; }
.ip-you { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; color: var(--ok); background: var(--ok-soft); }
.ip-empty { margin: 4px 0; }
.ip-dup { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; color: var(--warn); background: var(--warn-soft); }
.access-warn { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); background: var(--warn-soft); font-size: .9rem; }
.access-warn[hidden] { display: none; }
.access-summary { margin: 6px 0 0; font-size: .9rem; color: var(--muted); }
.access-summary:empty { display: none; }
.access-days-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.access-presets { display: flex; gap: 14px; font-size: .88rem; }
.access-days { gap: 6px; }
label.day-pill { position: relative; margin: 0; cursor: pointer; }
label.day-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
label.day-pill span { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: .88rem; color: var(--muted); transition: background .12s ease, color .12s ease, border-color .12s ease; }
label.day-pill input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-fg, #fff); }
label.day-pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
label.day-pill input:disabled + span { cursor: default; opacity: .7; }
.access-row label.tz { flex: 2 1 260px; }
.cpick-field { margin: 12px 0 0; }
.cpick { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: text; }
.cpick:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.cpick-chips { display: contents; }
.cpick input { flex: 1 1 180px; min-width: 120px; margin: 0; padding: 6px 4px; border: 0; background: transparent; box-shadow: none; outline: none; }
.cchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); font-size: .88rem; font-weight: 500; }
.cflag { font-size: 1.05rem; line-height: 1; }
.ccode { padding: 1px 6px; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.cchip-x { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; box-shadow: none; color: var(--muted); font-size: 1rem; line-height: 1; }
.cchip-x:hover:not(:disabled) { background: var(--bad-soft); color: var(--bad); }
.cchip-x:disabled { display: none; }
.cpick-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; max-height: 300px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 28px rgba(0, 0, 0, .18); }
.cpick-list[hidden] { display: none; }
.cpick-list li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.cpick-list li[aria-selected="true"] { background: var(--accent-soft); }
.cpick-list li .cname { flex: 0 1 auto; }
.cpick-list li .cen { flex: 1 1 auto; font-size: .82rem; }
.cpick-list li .ccode { margin-left: auto; }
.cpick-list li.cpick-none { cursor: default; }
.access-alert { padding: 12px 16px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--bad) 45%, var(--line)); border-left: 4px solid var(--bad); background: var(--bad-soft); }
.access-alert[hidden] { display: none; }
.access-alert strong { color: var(--bad); }
.access-alert p { margin: 4px 0 0; }
@media (max-width: 560px) {
  .ip-head { display: none; }
  .ip-row { grid-template-columns: minmax(0, 1fr) 36px; }
  .ip-row .ip-note { grid-column: 1; grid-row: 2; }
  .ip-row .ip-x { grid-column: 2; grid-row: 1; }
}
.signin-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 6px 0 18px; }
.signin-tiles .tile:hover { transform: none; }
.signin-filter label { display: flex; align-items: center; gap: 6px; margin: 0; }
.signin-filter label input { margin: 0; }
.table-scroll { overflow-x: auto; }
.signin-table td { vertical-align: middle; }
.signin-table .action-status { margin-left: 0; }
.signin-table td .muted { display: block; }
/* Policy vault categories (#336). */
.vault-group { margin: 12px 0; }
.vault-group > summary { display: flex; align-items: center; gap: 8px; padding: 6px 2px; cursor: pointer; font-weight: 600; }
.vault-group .appl-count { padding: 0 8px; border-radius: 999px; font-size: .75rem; color: var(--accent); background: var(--accent-soft); }
/* Company at a glance and company documents (#332). */
.company-card { display: grid; gap: 8px; margin: 6px 0 16px; padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.company-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1.1rem; }
.company-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.company-facts dt { color: var(--muted); }
.company-facts dd { margin: 0; }
@media (max-width: 560px) { .company-facts { grid-template-columns: 1fr; } .company-facts dd { margin-bottom: 4px; } }

/* GAP findings as cards: problem, solution, evidence folded, decisions. */
.finding-legend { margin: 14px 0 4px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); color: var(--muted); line-height: 1.6; }
.finding-legend strong { color: var(--fg); }
.finding-legend strong:not(:first-child) { margin-left: 10px; }
.finding-list { display: grid; gap: 12px; margin-top: 12px; }
.finding { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 12px; padding: 14px 18px; background: var(--surface); }
.finding-missing { border-left-color: var(--bad); }
.finding-partial, .finding-needs_review { border-left-color: var(--warn); }
.finding-covered { border-left-color: var(--ok); }
.finding-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.finding-ctl { line-height: 1.4; }
.finding-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; flex: none; max-width: 45%; }
.finding-tags .triage, .finding-tags .badge-manual { margin-top: 0; }
.st { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.st-missing { background: var(--bad-soft); color: var(--bad); }
.st-partial, .st-needs_review { background: var(--warn-soft); color: var(--warn); }
.st-covered { background: var(--ok-soft); color: var(--ok); }
.finding-body { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.finding-body.single { grid-template-columns: 1fr; }
.finding-block { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.finding-block h4 { margin: 0 0 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.finding-block p { margin: 0; line-height: 1.5; }
.finding-block.solution { background: var(--accent-soft); }
.finding-block.solution h4 { color: var(--accent); }
.finding-note { margin: 8px 0 0; color: var(--muted); }
.finding-evidence { margin-top: 10px; }
.finding-evidence > summary { cursor: pointer; color: var(--accent); font-size: .85rem; font-weight: 600; }
.finding-evidence[open] > summary { margin-bottom: 6px; }
.finding-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.finding-actions button { margin: 0; }
@media (max-width: 760px) {
  .finding { padding: 12px 14px; }
  .finding-head { flex-direction: column; }
  .finding-tags { justify-content: flex-start; max-width: none; }
  .finding-body { grid-template-columns: 1fr; }
  .finding-actions { justify-content: stretch; }
  .finding-actions button { flex: 1 1 auto; }
}
@media print { .finding-actions, .finding-legend { display: none; } .finding { break-inside: avoid; } }
/* Full policy per framework (#337). */
.policy-exports { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 22px; }
.policy-exports .export-chip { text-decoration: none; cursor: pointer; }
.policy-exports .export-chip:hover { border-color: var(--accent); }
/* "In scope" chips in the company summary (#352). */
.company-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* The hidden attribute always hides, also where a rule sets display (#351). */
[hidden] { display: none !important; }
/* Quotes open their document (#364). */
.quote-link { cursor: pointer; transition: border-color .12s ease; }
.quote-link:hover, .quote-link:focus-visible { border-color: var(--accent); outline: none; }
.quote-hit { background: color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 4px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

/* Company profile auto-fill from public sources (ADR 0048). */
.autofill { margin: 8px 0 20px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.autofill h2 { margin-top: 0; }
.autofill-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px 14px; align-items: end; }
.autofill-form label { margin: 0; }
@media (max-width: 760px) { .autofill-form { grid-template-columns: 1fr; } }
.file-button { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.autofill-hosts { margin: 8px 0 12px; padding-left: 20px; }
.af-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 8px; flex-wrap: wrap; }
.af-toolbar h3 { margin: 0; }
.af-list { display: grid; gap: 10px; }
.af-row { display: grid; grid-template-columns: minmax(170px, 220px) 1fr auto; gap: 8px 16px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: var(--radius); background: var(--surface-2); }
.af-row.differs { border-left-color: var(--accent); }
.af-head { display: flex; align-items: flex-start; gap: 8px; margin: 0; }
.af-body { display: grid; gap: 6px; min-width: 0; }
.af-input { width: 100%; }
.af-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.af-quote { margin: 2px 0 0; padding: 4px 10px; border-left: 3px solid var(--line); color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.af-source a { overflow-wrap: anywhere; }
.af-differs { margin: 0; padding: 6px 10px; border-radius: 6px; background: var(--accent-soft); }
.af-actions { display: flex; gap: 6px; align-items: flex-start; }
.af-regs { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.af-confirmed { margin-top: 14px; }
.af-confirmed summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.af-log ul { margin: 6px 0 0; padding-left: 18px; }
.af-suggested { border-left-color: var(--warn); }
@media (max-width: 760px) { .af-row { grid-template-columns: 1fr; } }
