/* Layout: three columns — a dark green year rail, a section navigator, and the working page.
   Sign-offs are drawn as working-paper stamps (initials + date), the way reviewers tick audit files. */
:root {
  --bg: #f4f6f2;
  --surface: #ffffff;
  --surface-2: #eef2ec;
  --ink: #18241d;
  --muted: #5a6a61;
  --faint: #8a988f;
  --line: #dde3dc;
  --line-strong: #c6d0c7;
  --brand: #22513b;
  --brand-hover: #1a4130;
  --brand-ink: #ffffff;
  --brand-soft: #e3eee7;
  --rail: #173a2b;
  --rail-ink: #d6e6dc;
  --rail-active: #f4f6f2;
  --stamp: #22513b;
  --ok: #2b7a4b;
  --ok-soft: #e1f1e7;
  --warn: #9a6512;
  --warn-soft: #fbf0db;
  --bad: #b3261e;
  --bad-soft: #fbe5e3;
  --info-soft: #e8eef6;
  --shadow: 0 1px 2px rgba(24, 36, 29, .06), 0 8px 24px rgba(24, 36, 29, .06);
  --f-display: "Libre Caslon Text", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111713; --surface: #18201b; --surface-2: #1e2822; --ink: #e3ebe5; --muted: #9eada4; --faint: #75847b;
    --line: #2a352e; --line-strong: #39463e; --brand: #3f8a63; --brand-hover: #4a9a70; --brand-ink: #ffffff; --brand-soft: #1f3328;
    --rail: #0b130e; --rail-ink: #b9cec1; --rail-active: #18201b; --stamp: #7cc39b;
    --ok: #6cc28e; --ok-soft: #1c3326; --warn: #e2b05a; --warn-soft: #34291a; --bad: #f08a80; --bad-soft: #3a1f1c; --info-soft: #1e2833;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111713; --surface: #18201b; --surface-2: #1e2822; --ink: #e3ebe5; --muted: #9eada4; --faint: #75847b;
  --line: #2a352e; --line-strong: #39463e; --brand: #3f8a63; --brand-hover: #4a9a70; --brand-ink: #ffffff; --brand-soft: #1f3328;
  --rail: #0b130e; --rail-ink: #b9cec1; --rail-active: #18201b; --stamp: #7cc39b;
  --ok: #6cc28e; --ok-soft: #1c3326; --warn: #e2b05a; --warn-soft: #34291a; --bad: #f08a80; --bad-soft: #3a1f1c; --info-soft: #1e2833;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ───── shell ───── */
.shell { display: grid; grid-template-columns: 76px 268px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100%; overflow: hidden; }
.rail { background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; align-items: center; padding: 14px 0 12px; gap: 10px; overflow-y: auto; }
.rail-logo { width: 48px; height: 48px; border-radius: 10px; background: #f4f6f2; display: grid; place-items: center; overflow: hidden; }
.rail-logo img { width: 46px; }
.rail-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; margin-top: 8px; }
.year-tile { width: 56px; border: 0; border-radius: 10px; background: transparent; color: var(--rail-ink); padding: 8px 0 7px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: var(--f-mono); font-size: 15px; font-weight: 600; }
.year-tile:hover { background: rgba(255, 255, 255, .08); }
.year-tile[aria-current="true"] { background: var(--rail-active); color: var(--ink); }
.year-tile .yt-state { font-family: var(--f-body); font-size: 9.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; opacity: .75; display: flex; align-items: center; gap: 3px; }
.year-tile svg { width: 10px; height: 10px; }
.year-add { width: 40px; height: 40px; border-radius: 10px; border: 1px dashed rgba(214, 230, 220, .45); background: transparent; color: var(--rail-ink); cursor: pointer; font-size: 20px; line-height: 1; }
.year-add:hover { background: rgba(255, 255, 255, .08); }
.rail-spacer { flex: 1; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 13px; border: 0; cursor: pointer; flex: none; }
.rail .avatar { background: rgba(255, 255, 255, .12); color: #fff; }

.nav { background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; padding: 18px 12px 24px; display: flex; flex-direction: column; gap: 4px; }
.nav-head { padding: 0 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.nav-head .eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.nav-head h2 { font-family: var(--f-display); font-size: 21px; font-weight: 700; margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.nav-group { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding: 14px 8px 4px; }
.nav a, .nav button.nav-link { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 13.5px; border: 0; background: none; width: 100%; text-align: left; cursor: pointer; }
.nav a:hover, .nav button.nav-link:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav .ref { font-family: var(--f-mono); font-size: 12px; color: var(--muted); min-width: 26px; }
.nav a[aria-current="page"] .ref { color: var(--brand); }
.nav .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav details { border-radius: 6px; }
.nav summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13.5px; font-weight: 500; }
.nav summary::-webkit-details-marker { display: none; }
.nav summary:hover { background: var(--surface-2); }
.nav summary .chev { width: 12px; height: 12px; transition: transform .15s; color: var(--faint); flex: none; }
.nav details[open] summary .chev { transform: rotate(90deg); }
.nav details > div { padding-left: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; border: 1.5px solid var(--line-strong); }
.dot.half { background: linear-gradient(90deg, var(--warn) 50%, transparent 50%); border-color: var(--warn); }
.dot.full { background: var(--ok); border-color: var(--ok); }
.sec-meter { font-family: var(--f-mono); font-size: 11px; color: var(--faint); }
.task-badge { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); }
.task-badge.done { background: var(--ok-soft); color: var(--ok); }

.main { overflow-y: auto; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 10px 28px; min-height: 52px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.topbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.btn.menu-btn { display: none; }
.page { padding: 26px 28px 60px; max-width: 1180px; }
.page.narrow { max-width: 860px; }

/* ───── type ───── */
.page-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .titles { flex: 1; min-width: 260px; }
.eyebrow { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
h1.title { font-family: var(--f-display); font-size: 30px; line-height: 1.15; font-weight: 700; margin-top: 4px; }
h1.title .refno { font-family: var(--f-mono); font-size: 18px; font-weight: 500; color: var(--brand); margin-right: 10px; vertical-align: 3px; }
.lede { color: var(--muted); max-width: 68ch; margin-top: 8px; }
h2.sec { font-family: var(--f-display); font-size: 19px; font-weight: 700; margin: 28px 0 12px; }
h3.sub { font-size: 14px; font-weight: 600; margin: 0 0 8px; }

/* ───── controls ───── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 7px; padding: 7px 13px; font-weight: 500; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 6px; }
.btn.lg { padding: 11px 18px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.icon { width: 16px; height: 16px; flex: none; }

label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); padding: 8px 10px; font-size: 14px; }
textarea.input { min-height: 74px; resize: vertical; line-height: 1.5; }
.input:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
.input.cell { padding: 5px 7px; font-size: 13px; border-radius: 5px; min-height: 0; }
textarea.input.cell { min-height: 58px; }
.check { display: inline-flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; flex: none; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; background: var(--surface); flex: none; }
.seg button { border: 0; background: transparent; padding: 6px 14px; cursor: pointer; font-weight: 500; font-size: 13px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"].yes { background: var(--warn-soft); color: var(--warn); }
.seg button[aria-pressed="true"].no { background: var(--ok-soft); color: var(--ok); }
.seg button[aria-pressed="true"].na, .seg button[aria-pressed="true"].neutral { background: var(--surface-2); color: var(--ink); }
.seg button[aria-pressed="true"].done { background: var(--ok-soft); color: var(--ok); }
.seg.sm button { padding: 3px 9px; font-size: 12px; }

/* ───── chips & status ───── */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.chip.outline { background: transparent; border: 1px dashed var(--line-strong); }
.chip svg { width: 12px; height: 12px; }

/* ───── cards / panels ───── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.panel-pad { padding: 18px 20px; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h3 { font-size: 14.5px; font-weight: 600; }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { padding: 16px 18px; }
.kpi .label { font-size: 12.5px; color: var(--muted); }
.kpi .value { font-family: var(--f-display); font-size: 30px; font-weight: 700; line-height: 1.1; margin-top: 4px; font-variant-numeric: lining-nums tabular-nums; }
.kpi .value small { font-family: var(--f-body); font-size: 14px; color: var(--muted); font-weight: 400; }
.kpi .bar { margin-top: 10px; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.bar.ok > span { background: var(--ok); }
.bar.warn > span { background: var(--warn); }

/* ───── tables ───── */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t .group td { background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 12.5px; letter-spacing: .02em; padding: 7px 12px; }
table.t.dense td { padding: 7px 10px; }
table.t.edit td { padding: 6px 6px; }
.cell-pre { white-space: pre-wrap; }

/* ───── prose (policy statements) ───── */
.prose { max-width: 74ch; font-size: 15px; line-height: 1.68; }
.prose p { margin: 0 0 12px; }
.prose h3 { font-family: var(--f-display); font-size: 17px; font-weight: 700; margin: 24px 0 8px; }
.prose h3:first-child { margin-top: 0; }
.prose ul { margin: 0 0 14px; padding-left: 20px; }
.prose li { margin-bottom: 5px; }
.prose .note { background: var(--info-soft); border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }
a.xref { font-family: var(--f-mono); font-size: .86em; text-decoration: none; background: var(--brand-soft); color: var(--brand); padding: 0 5px; border-radius: 4px; white-space: nowrap; }
a.xref:hover { text-decoration: underline; }

/* ───── sign-off stamps ───── */
.signoffs { display: flex; gap: 10px; flex-wrap: wrap; }
.stamp { min-width: 132px; border: 1.5px solid var(--stamp); color: var(--stamp); border-radius: 6px; padding: 6px 10px 6px; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; background: color-mix(in srgb, var(--stamp) 5%, var(--surface)); position: relative; }
.stamp .lbl { grid-column: 1 / -1; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; opacity: .85; }
.stamp .ini { font-family: var(--f-display); font-size: 22px; font-weight: 700; line-height: 1.1; }
.stamp .when { font-family: var(--f-mono); font-size: 11.5px; line-height: 1.3; }
.stamp .when span { display: block; color: var(--muted); font-family: var(--f-body); font-size: 11px; }
.stamp .x { position: absolute; top: 3px; right: 4px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 2px; display: none; }
.stamp:hover .x { display: block; }
.stamp.empty { border-style: dashed; border-color: var(--line-strong); color: var(--muted); background: transparent; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.stamp.empty .btn { margin-top: 2px; }

/* ───── forms ───── */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid > .full { grid-column: 1 / -1; }
.f-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.f-value { font-size: 14.5px; white-space: pre-wrap; min-height: 22px; }
.f-value.empty { color: var(--faint); }
.form-h { grid-column: 1 / -1; font-family: var(--f-display); font-size: 16px; font-weight: 700; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 4px; }
.info-box { grid-column: 1 / -1; background: var(--surface-2); border-radius: 8px; padding: 12px 14px; font-size: 13.5px; white-space: pre-wrap; }
.intro { background: var(--info-soft); border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; font-size: 13.5px; max-width: 90ch; }
.cl-item .note { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.rating td.r { text-align: center; width: 44px; }
.rating td.r button { width: 30px; height: 26px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); }
.rating td.r button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.rating td.r .mark { font-weight: 700; color: var(--brand); }
.score-card { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 14px; }
.score { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.score .n { font-family: var(--f-mono); font-size: 18px; font-weight: 600; }
.score.weak { border-color: var(--warn); background: var(--warn-soft); }

/* ───── independence ───── */
.iq-list { display: flex; flex-direction: column; gap: 10px; }
.iq { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; }
.iq .n { font-family: var(--f-mono); color: var(--faint); font-size: 13px; padding-top: 3px; }
.iq .q { font-size: 14.5px; }
.iq .newtag { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); font-weight: 600; margin-left: 6px; }
.iq .detail { grid-column: 2 / -1; margin-top: 8px; }
.iq.answered-yes { border-color: var(--warn); }
.iq.missing { border-color: var(--bad); }
.declare { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-top: 18px; }
.declare p { margin: 0 0 12px; max-width: 75ch; }
.sign-line { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.sign-line .input { max-width: 340px; font-family: var(--f-display); font-size: 18px; }
.certificate { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 26px 28px; position: relative; overflow: hidden; }
.certificate::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; border: 18px solid var(--brand-soft); }
.certificate h2 { font-family: var(--f-display); font-size: 24px; font-weight: 700; }
.progress-strip { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.progress-strip .bar { flex: 1; max-width: 320px; }

/* ───── task cards (staff home) ───── */
.task-card { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.task-card h3 { font-family: var(--f-display); font-size: 20px; font-weight: 700; }
.task-card .state { display: flex; align-items: center; gap: 10px; }
.ring { width: 64px; height: 64px; flex: none; }
.ring circle { fill: none; stroke-width: 7; }
.ring .bg { stroke: var(--surface-2); }
.ring .fg { stroke: var(--brand); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring text { font-family: var(--f-mono); font-size: 15px; font-weight: 600; fill: var(--ink); }

/* ───── org chart ───── */
.org { display: flex; flex-direction: column; align-items: center; gap: 0; }
.org-node { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 12px; text-align: center; min-width: 170px; box-shadow: var(--shadow); }
.org-node .nm { font-weight: 600; font-size: 13.5px; }
.org-node .ps { font-size: 12px; color: var(--muted); }
.org-node.top { border-color: var(--brand); border-width: 1.5px; }
.org-v { width: 1.5px; height: 22px; background: var(--line-strong); }
.org-offices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; width: 100%; border-top: 1.5px solid var(--line-strong); padding-top: 22px; position: relative; }
.org-office { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.org-office h4 { text-align: center; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.org-office .org-node { min-width: 0; box-shadow: none; }

/* ───── misc ───── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state h3 { color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.banner { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); margin-bottom: 18px; font-size: 13.5px; flex-wrap: wrap; }
.banner > span { flex: 1; min-width: 0; }
.banner.info { background: var(--info-soft); color: var(--ink); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.demo-bar { background: #2b2a1f; color: #f3e9c6; font-size: 12.5px; padding: 6px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.demo-bar button { background: rgba(255, 255, 255, .12); color: inherit; border: 0; border-radius: 5px; padding: 2px 9px; cursor: pointer; font-size: 12px; }
.demo-bar button[aria-pressed="true"] { background: #f3e9c6; color: #2b2a1f; }
.app-wrap { display: flex; flex-direction: column; height: 100%; }
.app-wrap > .shell { flex: 1; min-height: 0; }
.kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.activity li:last-child { border-bottom: 0; }
.sep { height: 1px; background: var(--line); margin: 18px 0; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: auto; }
.copy-box { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.copy-box input { flex: 1; font-family: var(--f-mono); font-size: 12px; }

/* toast & modal */
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; font-size: 13.5px; box-shadow: var(--shadow); max-width: 380px; animation: tin .2s ease-out; }
.toast.err { background: var(--bad); color: #fff; }
@keyframes tin { from { transform: translateY(6px); opacity: 0; } }
.modal-back { position: fixed; inset: 0; background: rgba(10, 18, 13, .45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; width: min(620px, 100%); max-height: calc(100% - 32px); overflow-y: auto; box-shadow: var(--shadow); }
.modal.wide { width: min(860px, 100%); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-head h3 { font-family: var(--f-display); font-size: 18px; font-weight: 700; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.attendees { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }

/* auth */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 600px at 10% -10%, var(--brand-soft), transparent 60%), var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 30px 30px 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.auth-card .logo { width: 150px; border-radius: 6px; background: #fff; padding: 6px 8px; align-self: flex-start; }
.auth-card h1 { font-family: var(--f-display); font-size: 24px; font-weight: 700; }
.auth-card .sub { color: var(--muted); margin-top: -8px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-foot { font-size: 12.5px; color: var(--muted); text-align: center; }
.err-msg { color: var(--bad); font-size: 13px; background: var(--bad-soft); padding: 8px 10px; border-radius: 6px; }
.demo-logins { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.demo-logins .btn { justify-content: flex-start; }

/* print */
.print-doc { max-width: 820px; margin: 0 auto; padding: 30px 28px; background: var(--surface); }
.print-doc .cover { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; gap: 16px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.print-doc .cover img { width: 220px; }
.print-doc .cover h1 { font-family: var(--f-display); font-size: 36px; }
.print-doc section.ps { break-before: page; padding-top: 10px; }
.print-doc h2.pt { font-family: var(--f-display); font-size: 22px; border-bottom: 2px solid var(--brand); padding-bottom: 6px; margin-bottom: 14px; }
.print-doc h3.pst { font-size: 16px; margin: 22px 0 10px; }
.print-bar { position: sticky; top: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 10px; align-items: center; z-index: 5; }
@media print {
  .print-bar, .demo-bar { display: none !important; }
  body, .print-doc { background: #fff; color: #000; }
  .print-doc { padding: 0; max-width: none; }
  .stamp { break-inside: avoid; }
  table.t th { background: #eee; }
  a.xref { background: none; padding: 0; color: #000; }
}

/* ───── responsive ───── */
@media (max-width: 1100px) {
  .grid.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail, .nav { position: fixed; top: 0; bottom: 0; z-index: 40; transform: translateX(-110%); transition: transform .2s; }
  .nav { transform: translateX(calc(-100% - 90px)); }
  .rail { left: 0; width: 72px; }
  .nav { left: 72px; width: min(300px, calc(100% - 72px)); box-shadow: var(--shadow); }
  .shell.open .rail, .shell.open .nav { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 30; }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 8px 16px; }
  .page { padding: 18px 16px 50px; }
  .grid.k3, .grid.k2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .org-offices { grid-template-columns: 1fr; }
  .attendees { grid-template-columns: 1fr; }
  h1.title { font-size: 25px; }
  .iq { grid-template-columns: 26px minmax(0, 1fr); }
  .iq .seg { grid-column: 2; justify-self: start; margin-top: 6px; }
  .kv { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .grid.k4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .value { font-size: 24px; }
}
.input:disabled, select.input:disabled, textarea.input:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.edit-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 16px; border: 1px dashed var(--brand); border-radius: 8px; background: var(--brand-soft); font-size: 13.5px; }
.edit-bar > span:nth-child(2) { flex: 1; min-width: 220px; }
.edit-bar .icon { color: var(--brand); }
.diff-old { background: var(--bad-soft); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 50%, transparent); padding: 2px 4px; border-radius: 4px; white-space: pre-wrap; }
.diff-new { background: var(--ok-soft); padding: 2px 4px; border-radius: 4px; white-space: pre-wrap; }
.drop { border: 2px dashed var(--line-strong); border-radius: 10px; padding: 26px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
table.t tr.flash td { background: var(--ok-soft); transition: background 2s; }

/* culture assessment cards on the overview */
.culture-card { box-shadow: none; }
.culture-card.click { cursor: pointer; }
.culture-card.click:hover { border-color: var(--brand); }
.culture-card .state { margin-top: 8px; }
