/* Latra — design system.
   One stylesheet for the shell and shared components, light and dark, no build
   step. learning.css and documents.css build on these tokens. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #e9ecf1;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --text-2: #344054;
  --muted: #667085;

  --accent: #3e63dd;
  --accent-hover: #3358d4;
  --accent-text: #ffffff;
  --accent-soft: #edf2fe;
  --ok: #12805c;   --ok-soft: #e6f6ee;
  --warn: #b54708; --warn-soft: #fef4e6;
  --bad: #d92d20;  --bad-soft: #fef1f0;
  --info: #3e63dd; --info-soft: #edf2fe;

  --radius: 12px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px -12px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .06);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);

  /* The sidebar is dark in both themes. */
  --side-bg: #0a0f1d;
  --side-bg-2: #0e1528;
  --side-text: #c6cede;
  --side-muted: #7581a0;
  --side-line: rgba(255, 255, 255, .07);
  --side-hover: rgba(255, 255, 255, .055);
  --side-active: rgba(110, 140, 255, .16);

  color-scheme: light;
}
/* Dark follows the device unless someone chose light in the app (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f18;
    --surface: #121827;
    --surface-2: #171f31;
    --surface-3: #1d2740;
    --border: #232c41;
    --border-strong: #2e3a55;
    --text: #e9edf5;
    --text-2: #c4cbd9;
    --muted: #8b95aa;
    --accent: #7d9bff;
    --accent-hover: #93acff;
    --accent-text: #0a1020;
    --accent-soft: #1a2447;
    --ok: #4cd391;   --ok-soft: #12301f;
    --warn: #f5b04f; --warn-soft: #33260f;
    --bad: #ff8577;  --bad-soft: #3a1a18;
    --info: #7d9bff; --info-soft: #1a2447;
    --shadow-xs: none;
    --shadow: 0 1px 0 rgba(255, 255, 255, .02);
    --shadow-lg: 0 16px 40px -14px rgba(0, 0, 0, .7);
    --side-bg: #070b15;
    --side-bg-2: #0a1020;
    color-scheme: dark;
  }
}
/* Chosen in the app: the same tokens whatever the device says. */
:root[data-theme="dark"] {
  --bg: #0b0f18;
  --surface: #121827;
  --surface-2: #171f31;
  --surface-3: #1d2740;
  --border: #232c41;
  --border-strong: #2e3a55;
  --text: #e9edf5;
  --text-2: #c4cbd9;
  --muted: #8b95aa;
  --accent: #7d9bff;
  --accent-hover: #93acff;
  --accent-text: #0a1020;
  --accent-soft: #1a2447;
  --ok: #4cd391;   --ok-soft: #12301f;
  --warn: #f5b04f; --warn-soft: #33260f;
  --bad: #ff8577;  --bad-soft: #3a1a18;
  --info: #7d9bff; --info-soft: #1a2447;
  --shadow-xs: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, .02);
  --shadow-lg: 0 16px 40px -14px rgba(0, 0, 0, .7);
  --side-bg: #070b15;
  --side-bg-2: #0a1020;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14.5px; line-height: 1.55;
  font-feature-settings: "cv11", "ss01", "ss03"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { color: var(--text); letter-spacing: -.015em; }
h1 { font-size: 1.65rem; font-weight: 680; margin: 0; letter-spacing: -.025em; }
h2 { font-size: 1.04rem; font-weight: 650; margin: 0 0 .8rem; }
h3 { font-size: .98rem; font-weight: 650; margin: 1.2rem 0 .5rem; }
p { margin: .5rem 0; }
code, .mono { font-family: var(--mono); font-size: .86em; }
kbd { font-family: var(--font); font-size: .72rem; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); background: var(--surface); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ── shell ──────────────────────────────────────────────────────────────── */
body.app { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--side-bg-2) 0%, var(--side-bg) 100%); color: var(--side-text);
  border-right: 1px solid #000; padding: 16px 12px 12px; scrollbar-width: thin; scrollbar-color: #1c2640 transparent;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 14px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: #fff; font-weight: 500; font-size: .98rem; letter-spacing: -.01em; text-decoration: none !important; }
.brand b { font-weight: 750; }
.brand { color: #e2e8f0; }
.brand .brand-mark { width: 28px; height: 28px; flex: none; }
.brand-word { height: 17px; width: auto; flex: none; }
.sidebar-menu { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.nav-toggle-btn { display: none; cursor: pointer; padding: 6px; border-radius: 8px; color: #fff; margin: 0; }

.org-switch {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin-bottom: 10px; border-radius: 12px;
  background: rgba(255, 255, 255, .035); border: 1px solid var(--side-line); color: #fff; text-decoration: none !important; transition: background .15s;
}
.org-switch:hover { background: rgba(255, 255, 255, .07); }
.org-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 750; font-size: .8rem; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg, #5b7cfa, #8b5cf6); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.org-mark-platform { background: #111a2e; color: #e2e8f0; padding: 5px; } .org-mark-platform .brand-mark { width: 100%; height: 100%; }
.org-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; flex: 1; }
.org-name { font-weight: 650; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-sub { font-size: .74rem; color: var(--side-muted); }
.org-chev { color: var(--side-muted); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-heading { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--side-muted); padding: 16px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 7.5px 10px; border-radius: 8px; color: var(--side-text);
  font-size: .89rem; font-weight: 500; text-decoration: none !important; position: relative; transition: background .12s, color .12s;
}
.nav-item .ic { width: 17px; height: 17px; opacity: .72; }
.nav-item:hover { background: var(--side-hover); color: #fff; }
.nav-item.active { background: var(--side-active); color: #fff; font-weight: 600; }
.nav-item.active .ic { opacity: 1; color: #9db3ff; }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #7d9bff; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; font-size: .7rem; font-weight: 700; background: rgba(255,255,255,.1); color: #fff; }
.nav-count.bad { background: #e5484d; }

.sidebar-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 6px 2px; border-top: 1px solid var(--side-line); }
.user-card { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; padding: 6px; border-radius: 10px; color: #fff; text-decoration: none !important; }
.user-card:hover { background: var(--side-hover); }
.user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-name { font-size: .86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mail { font-size: .72rem; color: var(--side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .avatar { background: linear-gradient(135deg, #334366, #46598a); color: #fff; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--side-muted); cursor: pointer; font-size: 17px; }
.icon-btn:hover { background: var(--side-hover); color: #fff; }

.shell { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 58px; padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--muted); min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.crumb-sep { width: 14px; height: 14px; opacity: .55; }
.crumb-current { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.search { display: flex; align-items: center; gap: 8px; width: min(360px, 34vw); height: 36px; padding: 0 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs); color: var(--muted); }
.search:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.search input { border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: .88rem; flex: 1; min-width: 0; padding: 0; height: 100%; box-shadow: none !important; }
.admin-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); font-size: .76rem; font-weight: 650; white-space: nowrap; }

.main { padding: 28px 32px 72px; width: 100%; max-width: 1240px; }
.main.wide { max-width: 1480px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-sub { margin: 6px 0 0; color: var(--muted); font-size: .95rem; max-width: 70ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 900px) {
  body.app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 30; height: auto; padding: 10px 14px; }
  .sidebar-top { padding: 0; }
  .nav-toggle-btn { display: inline-flex; }
  .sidebar-menu { display: none; padding-top: 12px; }
  .nav-toggle:checked ~ .sidebar-menu { display: flex; }
  .topbar { position: static; padding: 0 16px; height: auto; min-height: 52px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .search { width: 100%; }
  .main { padding: 18px 16px 56px; }
}

/* ── surfaces ───────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card > h2:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }

/* stats */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; }
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 550; display: flex; align-items: center; gap: 7px; }
.stat-value { font-size: 1.75rem; font-weight: 720; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 4px; line-height: 1.15; }
.stat-sub { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.stat-ok .stat-value { color: var(--ok); }
.stat-bad .stat-value { color: var(--bad); }
.stat-warn .stat-value { color: var(--warn); }
.score { display: flex; align-items: center; gap: 18px; }
.score-num { font-size: 2.6rem; font-weight: 780; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.meter { height: 7px; background: var(--surface-3); border-radius: 99px; overflow: hidden; min-width: 80px; margin-top: 6px; }
.meter span { display: block; height: 100%; border-radius: 99px; }
.meter-ok span { background: linear-gradient(90deg, #17a673, var(--ok)); }
.meter-warn span { background: linear-gradient(90deg, #f0a03a, var(--warn)); }
.meter-bad span { background: linear-gradient(90deg, #f0605a, var(--bad)); }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .75rem; letter-spacing: .02em; border-bottom: 1px solid var(--border); padding: 9px 12px; white-space: nowrap; }
td { border-bottom: 1px solid var(--border); padding: 12px; vertical-align: middle; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* pills — status with a dot */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 99px; font-size: .74rem; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-info { background: var(--info-soft); color: var(--info); }
.pill-muted { background: var(--surface-2); color: var(--muted); }

/* avatars */
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700; flex-shrink: 0;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); }
.avatar-lg { width: 34px; height: 34px; font-size: .78rem; }
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.person-text a, .person-text strong { font-weight: 600; color: var(--text); }
.person-sub { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* forms */
form.inline { display: inline; }
label { display: block; font-weight: 600; font-size: .85rem; margin: 14px 0 6px; color: var(--text-2); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 450; color: var(--text); }
label.check input { margin-top: 3px; accent-color: var(--accent); }
.hint { color: var(--muted); font-size: .8rem; font-weight: 450; margin-top: 3px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=number], input[type=url], input[type=file], select, textarea {
  width: 100%; padding: 8px 11px; min-height: 38px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; font-size: .92rem;
  box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
textarea.code { font-family: var(--mono); font-size: .84rem; min-height: 260px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
select[multiple] { background-image: none; padding-right: 11px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.form-actions { margin-top: 20px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: .87rem; font-weight: 600;
  cursor: pointer; text-decoration: none !important; box-shadow: var(--shadow-xs); transition: background .12s, border-color .12s, box-shadow .12s, transform .05s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary, button.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff) 0%, var(--accent) 100%); color: var(--accent-text); border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .1), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.btn-sm { height: 30px; padding: 0 11px; font-size: .8rem; border-radius: 8px; }
button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }
button.link { background: none; border: 0; color: var(--accent); padding: 0; font: inherit; cursor: pointer; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px 16px; margin: 16px 0; }
legend { font-weight: 650; padding: 0 6px; font-size: .9rem; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 4px 18px; }

/* feedback */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 550; font-size: .9rem; border: 1px solid transparent; }
.flash-ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 20%, transparent); }
.flash-err { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 20%, transparent); }
.callout { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin: 10px 0; font-size: .9rem; }
.callout-warn { background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 80%, var(--text)); }
.empty { text-align: center; color: var(--muted); padding: 36px 12px; }
.empty p { margin: 0 0 14px; }

/* content */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.4em; }
.prose blockquote { border-left: 3px solid var(--accent); margin: 1em 0; padding: .2em 1em; background: var(--surface-2); border-radius: 0 8px 8px 0; }
.prose img { max-width: 100%; }
.video { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; background: #000; margin: 12px 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.quiz-q { border-top: 1px solid var(--border); padding: 14px 0; }
.result-right { color: var(--ok); }
.result-wrong { color: var(--bad); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.timeline li:last-child { border-bottom: 0; }
.suggest { background: var(--info-soft); border-radius: 9px; padding: 9px 11px; font-size: .84rem; margin-top: 8px; }
.suggest.weak { background: var(--warn-soft); }
.suggest.none { background: var(--surface-2); color: var(--muted); }
.ins-q { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; padding: 16px 0; border-top: 1px solid var(--border); }
.ins-q:first-of-type { border-top: 0; }
@media (max-width: 900px) { .ins-q { grid-template-columns: 1fr; } }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-row label { display: flex; gap: 6px; align-items: center; font-weight: 450; margin: 0; color: var(--text); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 22px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 550; font-size: .9rem; }
.tabs a.active { color: var(--text); border-color: var(--accent); font-weight: 650; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.secret { font-family: var(--mono); letter-spacing: .1em; background: var(--surface-2); padding: 10px 12px; border-radius: 9px; word-break: break-all; }
.qr { background: #fff; padding: 10px; border-radius: 12px; display: inline-block; border: 1px solid var(--border); }
.qr img { display: block; width: 200px; height: 200px; }

/* ── auth (sign-in, invite, reset, MFA) ─────────────────────────────────── */
body.bare { min-height: 100vh; }
body.bare > .main { max-width: none; padding: 0; }
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); min-height: 100vh; }
.auth-brand {
  position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at 110% -10%, rgba(125, 155, 255, .35), transparent 60%), radial-gradient(800px 500px at -10% 110%, rgba(139, 92, 246, .35), transparent 60%), linear-gradient(160deg, #0a0f1d, #111a33 60%, #0c1226);
}
.auth-brand::before { content: ""; position: absolute; inset: 0; opacity: .12; background-image: radial-gradient(circle at 1px 1px, #fff 1px, transparent 1.4px); background-size: 22px 22px; mask-image: radial-gradient(ellipse at 70% 40%, #000, transparent 70%); }
.auth-brand > * { position: relative; }
.auth-logo { display: inline-flex; gap: 10px; align-items: center; font-size: 1.1rem; font-weight: 500; }
.auth-logo b { font-weight: 750; }
.auth-logo { color: #e2e8f0; }
.auth-logo .brand-mark { width: 36px; height: 36px; }
.auth-logo .brand-word { height: 22px; width: auto; }
.auth-pitch h2 { font-size: 2.3rem; line-height: 1.12; letter-spacing: -.035em; color: #fff; margin: 0 0 14px; font-weight: 720; max-width: 18ch; }
.auth-pitch p { color: rgba(255, 255, 255, .72); font-size: 1.02rem; max-width: 46ch; margin: 0 0 26px; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 12px; align-items: center; color: rgba(255, 255, 255, .85); font-size: .94rem; }
.auth-points .ic { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); color: #a9bcff; }
.auth-mock { margin-top: 34px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 560px; }
.auth-mock div { border-radius: 14px; padding: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(8px); }
.auth-mock span { display: block; font-size: .72rem; color: rgba(255, 255, 255, .6); }
.auth-mock strong { display: block; font-size: 1.5rem; letter-spacing: -.03em; margin-top: 2px; }
.auth-mock i { display: block; height: 5px; border-radius: 99px; margin-top: 8px; background: linear-gradient(90deg, #6ee7b7 var(--w), rgba(255, 255, 255, .12) var(--w)); }
.auth-foot { font-size: .8rem; color: rgba(255, 255, 255, .5); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 48px 32px; background: var(--surface); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin: 0 0 22px; }
.auth-card .btn-primary { width: 100%; height: 42px; font-size: .95rem; }
.auth-card .form-actions { flex-direction: column; align-items: stretch; }
.auth-alt { text-align: center; font-size: .86rem; color: var(--muted); margin-top: 18px; }
.auth-secure { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 28px; font-size: .78rem; color: var(--muted); }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-brand { padding: 28px 24px; } .auth-pitch h2 { font-size: 1.7rem; } .auth-mock, .auth-points { display: none; } }

/* print */
@media print {
  body.app { display: block; background: #fff; color: #000; }
  .sidebar, .topbar, .page-actions, .no-print, .flash { display: none !important; }
  .main { padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; padding: 0; }
  a { color: #000; }
  .ins-q { break-inside: avoid; }
}

/* search */
.search-big { display: flex; align-items: center; gap: 12px; padding: 6px 16px; }
.search-big .ic { color: var(--muted); width: 20px; height: 20px; }
.search-big input { border: 0; box-shadow: none; font-size: 1.05rem; padding: 12px 0; }
.search-big input:focus { box-shadow: none; }
.with-icon { display: flex; align-items: center; gap: 8px; }
.with-icon .ic { color: var(--accent); }
.hit-list { list-style: none; margin: 0; padding: 0; }
.hit-list a { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 9px; color: var(--text); text-decoration: none; }
.hit-list a:hover { background: var(--surface-2); }
.hit-list span { font-size: .82rem; color: var(--muted); }
.topbar .search input { border: 0; background: transparent; min-height: 0; padding: 0; box-shadow: none; border-radius: 0; }

/* ── dashboard ──────────────────────────────────────────────────────────── */
.dash-hello { display: flex; justify-content: space-between; align-items: flex-end; margin: -4px 0 20px; }
.dash-hello h1 { font-size: 1.8rem; }
.dash-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
@media (max-width: 1150px) { .dash-top { grid-template-columns: 1fr; } }
.eyebrow-sm { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.score-card { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: center; margin: 0; padding: 24px 28px;
  background: radial-gradient(500px 240px at 0% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%), var(--surface); }
@media (max-width: 700px) { .score-card { grid-template-columns: 1fr; } }
.score-left { text-align: center; }
.score-note { font-size: .84rem; color: var(--muted); margin: 0; }
.gauge { position: relative; width: 210px; margin: 6px auto 4px; }
.gauge svg { width: 100%; display: block; }
.gauge .g-track { fill: none; stroke: var(--surface-3); stroke-width: 14; stroke-linecap: round; }
.gauge .g-fill { fill: none; stroke: url(#gg); stroke-width: 14; stroke-linecap: round; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--accent) 30%, transparent)); }
.gauge-ok .gs1 { stop-color: #34d399; } .gauge-ok .gs2 { stop-color: #059669; }
.gauge-info .gs1 { stop-color: #93b4ff; } .gauge-info .gs2 { stop-color: #3e63dd; }
.gauge-warn .gs1 { stop-color: #fcd34d; } .gauge-warn .gs2 { stop-color: #e8890c; }
.gauge-bad .gs1 { stop-color: #fda29b; } .gauge-bad .gs2 { stop-color: #d92d20; }
.gauge-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 8px; }
.gauge-label strong { font-size: 3.2rem; font-weight: 780; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge-label span { font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.gauge-ok .gauge-label span { color: var(--ok); } .gauge-info .gauge-label span { color: var(--accent); } .gauge-warn .gauge-label span { color: var(--warn); } .gauge-bad .gauge-label span { color: var(--bad); }
.score-right { display: grid; gap: 14px; }
.pillar { display: block; color: var(--text); text-decoration: none !important; padding: 10px 12px; border-radius: 10px; margin: -10px -12px; transition: background .12s; }
.pillar:hover { background: var(--surface-2); }
.pillar-top { display: flex; justify-content: space-between; font-size: .88rem; font-weight: 550; }
.pillar-top strong { font-variant-numeric: tabular-nums; }
.pillar .meter { height: 8px; }
.pillar-w { font-size: .72rem; color: var(--muted); margin-top: 4px; }

.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpi { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.kpi:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.kpi-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.kpi-ok .kpi-ic { background: var(--ok-soft); color: var(--ok); }
.kpi-warn .kpi-ic { background: var(--warn-soft); color: var(--warn); }
.kpi-bad .kpi-ic { background: var(--bad-soft); color: var(--bad); }
.kpi-info .kpi-ic { background: var(--accent-soft); color: var(--accent); }
.kpi-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-label { font-size: .78rem; color: var(--muted); font-weight: 550; }
.kpi-value { font-size: 1.45rem; font-weight: 740; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-sub { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.e8 .card-head { align-items: flex-start; }
.e8-count { font-size: .9rem; color: var(--muted); white-space: nowrap; }
.e8-count strong { font-size: 1.6rem; color: var(--text); letter-spacing: -.03em; }
.e8-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1000px) { .e8-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.e8-tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 10px; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); }
.e8-ic { grid-row: span 2; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; }
.e8-name { font-weight: 650; font-size: .86rem; }
.e8-detail { font-size: .74rem; color: var(--muted); line-height: 1.35; }
.e8-evidenced { border-color: color-mix(in srgb, var(--ok) 30%, var(--border)); background: color-mix(in srgb, var(--ok-soft) 55%, var(--surface)); }
.e8-evidenced .e8-ic { background: var(--ok); color: #fff; }
.e8-documented .e8-ic { background: var(--warn-soft); color: var(--warn); }
.e8-gap .e8-ic { background: var(--bad-soft); color: var(--bad); }
.e8-legend { display: flex; gap: 16px; margin-top: 14px; font-size: .78rem; color: var(--muted); align-items: center; flex-wrap: wrap; }
.e8-legend span { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; }
.e8-legend span::before { content: ""; width: 9px; height: 9px; border-radius: 3px; }
.e8-legend .e8-evidenced::before { background: var(--ok); } .e8-legend .e8-documented::before { background: var(--warn); } .e8-legend .e8-gap::before { background: var(--bad); }

.dash-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.dash-cols .card { margin: 0; }
.agenda, .feed, .people-list { list-style: none; margin: 0; padding: 0; }
.agenda li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.agenda li:last-child, .feed li:last-child, .people-list li:last-child { border-bottom: 0; }
.agenda-date { width: 42px; text-align: center; line-height: 1.1; flex-shrink: 0; }
.agenda-date strong { display: block; font-size: 1.15rem; font-weight: 740; letter-spacing: -.02em; }
.agenda-date span { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.agenda li.overdue .agenda-date strong { color: var(--bad); }
.agenda-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; flex-shrink: 0; background: var(--accent-soft); color: var(--accent); }
.agenda-check { background: var(--ok-soft); color: var(--ok); } .agenda-review { background: var(--warn-soft); color: var(--warn); } .agenda-insurance { background: #f3e8ff; color: #7c3aed; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .agenda-insurance { background: #2a1c47; color: #c4a6ff; } }
:root[data-theme="dark"] .agenda-insurance { background: #2a1c47; color: #c4a6ff; }
.agenda-body { display: flex; flex-direction: column; min-width: 0; color: var(--text); text-decoration: none !important; }
.agenda-body strong { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-body span { font-size: .78rem; color: var(--muted); }
.agenda-body:hover strong { color: var(--accent); }
.feed li { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.feed-body { display: flex; flex-direction: column; font-size: .86rem; min-width: 0; }
.feed-time { font-size: .74rem; color: var(--muted); }
.people-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.tags { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.tone-bad { color: var(--bad); }

/* ── my tasks inbox ─────────────────────────────────────────────────────── */
.inbox-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.inbox-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.ichip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: .82rem; color: var(--muted); box-shadow: var(--shadow-xs); }
.ichip strong { color: var(--text); font-size: .92rem; }
.ichip .ic { color: var(--accent); }
.ichip.zero { opacity: .55; }
.inbox { padding: 6px; }
.task { display: grid; grid-template-columns: 40px minmax(0, 1fr) 150px auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 10px; color: var(--text); text-decoration: none !important; transition: background .12s; position: relative; }
.task + .task::before { content: ""; position: absolute; left: 68px; right: 14px; top: 0; border-top: 1px solid var(--border); }
.task:hover { background: var(--surface-2); }
.task-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; background: var(--accent-soft); color: var(--accent); }
.task-signoff .task-ic, .task-verify .task-ic { background: #f3e8ff; color: #7c3aed; }
.task-check .task-ic { background: var(--ok-soft); color: var(--ok); }
.task-incident .task-ic { background: var(--bad-soft); color: var(--bad); }
.task-ack .task-ic { background: var(--warn-soft); color: var(--warn); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .task-signoff .task-ic, :root:not([data-theme="light"]) .task-verify .task-ic { background: #2a1c47; color: #c4a6ff; } }
:root[data-theme="dark"] .task-signoff .task-ic, :root[data-theme="dark"] .task-verify .task-ic { background: #2a1c47; color: #c4a6ff; }
.task.is-overdue .task-ic { background: var(--bad-soft); color: var(--bad); }
.task-main { display: flex; flex-direction: column; min-width: 0; }
.task-main strong { font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-main span { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-due { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: .84rem; }
@media (max-width: 800px) { .task { grid-template-columns: 40px minmax(0, 1fr); } .task-due, .task > .btn { grid-column: 2; } }
.all-clear { text-align: center; padding: 48px 20px; }
.all-clear > .ic { width: 52px; height: 52px; padding: 12px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); margin-bottom: 8px; }
.done-list { list-style: none; margin: 0; padding: 0; }
.done-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.done-list li:last-child { border-bottom: 0; }
.done-list a { flex: 1; color: var(--text); font-weight: 550; }
.done-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); font-size: 12px; }

/* people and roles */
.tags-left { justify-content: flex-start; }
.role-chip { display: inline-block; padding: 2px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: .76rem; font-weight: 600; color: var(--text-2); }
.role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 18px; }
.role-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
a.role-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: var(--shadow-lg); }
.role-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.role-card p { margin: 0; font-size: .82rem; color: var(--muted); flex: 1; }
.role-card-foot { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); padding-top: 8px; border-top: 1px solid var(--border); }
.perm-matrix th.pm-role { text-align: center; min-width: 96px; }
.perm-matrix .pm-group td { background: var(--surface-2); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 12px; }
.pm-label { font-weight: 600; font-size: .88rem; }
.pm-desc { font-size: .76rem; color: var(--muted); }
.pm-desc code { font-size: .72rem; }
.pm-cell { text-align: center; }
.pm-yes { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 13px; }
.pm-no { display: inline-block; width: 8px; height: 2px; border-radius: 2px; background: var(--border-strong); }

/* platform portfolio */
.kpi-grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 22px; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.client-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; transition: transform .15s, box-shadow .15s, border-color .15s; }
.client-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.client-top { display: flex; gap: 11px; align-items: center; }
.client-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.client-name strong { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-name span { font-size: .78rem; color: var(--muted); }
.client-score { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; }
.client-num { font-size: 2rem; font-weight: 780; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.client-bar .meter { margin: 0; }
.tone-ok { color: var(--ok); } .tone-info { color: var(--accent); } .tone-warn { color: var(--warn); }
.client-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding-top: 12px; border-top: 1px solid var(--border); }
.client-stats div { display: flex; flex-direction: column; }
.client-stats dt { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.client-stats dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.client-stats dt { font-size: .66rem; letter-spacing: .04em; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 22px; }
.trend { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; margin: 4px 0 10px; font-size: .76rem; }
.trend svg { width: 100%; height: 40px; display: block; }
.trend .t-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.trend .t-area { fill: color-mix(in srgb, var(--accent) 12%, transparent); }
.trend-delta { font-weight: 700; }
.trend-delta.up { color: var(--ok); } .trend-delta.down { color: var(--bad); }
.trend-empty { color: var(--muted); font-size: .74rem; }
.auth-card form + form { margin-top: 12px; text-align: center; }
.doc-search-box input { border: 0; box-shadow: none; min-height: 0; background: transparent; }

/* requirements actions and menus */
.req-actions { white-space: nowrap; text-align: right; width: 1%; }
.req-actions > * { vertical-align: middle; }
details.menu { display: inline-block; position: relative; margin-left: 6px; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; width: 280px; padding: 14px; text-align: left; white-space: normal;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); display: grid; gap: 12px; }
.menu-panel label { margin: 0 0 4px; }

/* phone polish */
@media (max-width: 700px) {
  .dash-hello { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dash-hello h1, .inbox-head h1 { font-size: 1.45rem; }
  .kpi-grid { grid-template-columns: 1fr; }
}

.cert-brand .brand-mark, .cert-issuer .brand-mark { width: 18px; height: 18px; color: #1e293b; vertical-align: -3px; }

/* Two-step verification: choosing a method, signing in, the account list. */
.btn-block { width: 100%; justify-content: center; }
.mfa-choices { display: grid; gap: 10px; margin: 18px 0; }
.mfa-choice { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; color: inherit; text-decoration: none; transition: border-color .15s, background .15s; }
.mfa-choice:hover { border-color: var(--accent); background: var(--surface-2); }
.mfa-choice strong { display: flex; align-items: center; gap: 8px; }
.mfa-choice span:not(.pill) { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.mfa-choice.disabled { opacity: .55; pointer-events: none; }
.mfa-passkey { margin: 8px 0 14px; }
.mfa-passkey .small { margin-top: 8px; min-height: 1.2em; }
.mfa-code { margin: 12px 0; }
.mfa-code summary { cursor: pointer; color: var(--muted); }
.mfa-methods { display: grid; gap: 4px; }
.mfa-method { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.mfa-method:first-child { border-top: 0; }
.mfa-method ul.plain { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; }
.mfa-method ul.plain li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.plain-list li:first-child { border-top: 0; }

/* Configuration register */
.cfg-state-label { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cfg-state-value { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 14px; }
.cfg-evidence { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 8px; }
.cfg-file { margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.cfg-thumb { display: block; aspect-ratio: 16 / 10; background: var(--surface-2); border-bottom: 1px solid var(--border); overflow: hidden; }
.cfg-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
.cfg-doc { display: grid; place-items: center; text-decoration: none; }
.cfg-doc span { font-weight: 800; letter-spacing: .08em; color: var(--muted); font-size: .9rem; }
.cfg-file figcaption { padding: 10px 12px; display: grid; gap: 3px; font-size: .86rem; }
.cfg-name { font-weight: 600; word-break: break-all; }
.cfg-upload { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.cfg-retired { margin-top: 12px; }
.cfg-retired summary { cursor: pointer; }
.cfg-outcomes { flex-direction: column; gap: 8px; }

/* Light / dark toggle in the top bar. The icon shows what you'd switch to. */
.theme-toggle { margin: 0 0 0 4px; display: flex; }
.theme-toggle button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; padding: 0; }
.theme-toggle button:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle .ic { width: 17px; height: 17px; }
.theme-toggle .ic-sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .ic-sun { display: block; } :root:not([data-theme="light"]) .theme-toggle .ic-moon { display: none; } }
:root[data-theme="dark"] .theme-toggle .ic-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ic-moon { display: none; }
.cfg-table { table-layout: fixed; width: 100%; }
.cfg-table td { overflow-wrap: anywhere; }

/* Company logo as the sidebar mark: a white tile so any logo reads on the dark sidebar. */
.org-mark-logo { background: #fff; padding: 4px 6px; box-shadow: none; width: auto; min-width: 34px; max-width: 96px; }
/* A fixed height, not 100%: a tall logo in a grid cell would otherwise keep its own size and spill over the menu. */
.org-mark-logo img { height: 26px; max-height: 26px; width: auto; max-width: 84px; object-fit: contain; display: block; }
.org-mark-logo { overflow: hidden; }

/* Settings → Branding */
.brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
@media (max-width: 1000px) { .brand-grid { grid-template-columns: 1fr; } }
.brand-current { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; }
.brand-current img.on-plate { max-height: 44px; max-width: 180px; object-fit: contain; display: block; }
.brand-current .logo-plate { border-radius: 8px; padding: 6px 10px; }
.brand-current img:not(.on-plate) { max-height: 44px; max-width: 180px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.brand-colour { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand-colour input[type=color] { width: 56px; height: 38px; padding: 2px; border-radius: 9px; cursor: pointer; }
.brand-colour .check { margin: 0; }
.doc-reader.brand-preview { display: block; }
.brand-preview .doc-paper { padding: 28px 30px 18px; box-shadow: var(--shadow); }
.brand-preview .doc-title { font-size: 1.5rem; margin: 12px 0 0; }
.brand-preview .doc-head { padding-bottom: 14px; margin-bottom: 14px; }
.brand-preview .doc-body h2 { margin-top: .4em; font-size: 1.05rem; }
.brand-preview .doc-foot { margin-top: 18px; }
.brand-remove { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ── incident register ──────────────────────────────────────────────────── */
.pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 1em; }
.inc-kinds { flex-wrap: wrap; }
.inc-help p { font-size: .92rem; }
.inc-inline { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.inc-inline .form-actions { margin-top: 8px; }
.inc-obligations { list-style: none; padding: 0; margin: 0; }
.inc-ob { padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--border); border-left: 4px solid var(--info); border-radius: 10px; background: var(--surface); }
.inc-ob.is-late { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad-soft) 55%, var(--surface)); }
.inc-ob.is-done { border-left-color: var(--ok); opacity: .85; }
.inc-ob-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.inc-ob-head strong { margin-right: auto; }
.inc-ob-more { margin-top: 6px; }
.inc-ob-more summary { cursor: pointer; color: var(--accent); }
.inc-ob-more .inc-inline { border-top: 0; padding-top: 0; margin-top: 8px; }
.inc-ob-more input[name="note"] { margin-top: 6px; }
.inc-disclaimer { margin: 6px 0 0; }
.inc-timeline .inc-ev-obligation .pre, .inc-timeline .inc-ev-status .pre { color: var(--muted); }
.inc-timeline .inc-ev-closed .pre, .inc-timeline .inc-ev-reported .pre { font-weight: 650; }
.inc-timeline .pre { margin: 2px 0 0; }

/* A light logo on its dark plate (core/branding.ts logoHtml). Prints with its background. */
.logo-plate { display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.logo-plate img { display: block; }

/* ── registers ──────────────────────────────────────────────────────────── */
.reg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.reg-card { display: flex; gap: 14px; align-items: flex-start; color: inherit; text-decoration: none !important; transition: border-color .15s, transform .15s; margin: 0; }
.reg-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-1px); }
.reg-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--info-soft); color: var(--info); flex-shrink: 0; }
.reg-ic .ic { width: 20px; height: 20px; }
.reg-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.reg-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .8rem; color: var(--muted); margin-top: 4px; align-items: center; }
.reg-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 16px; }
.reg-field.wide { grid-column: 1 / -1; }
.reg-rating { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; font-size: .85rem; color: var(--muted); }
.reg-kv dd.pre { white-space: pre-wrap; }

/* ── frameworks (modules) ───────────────────────────────────────────────── */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 8px; }
.mod-card { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none !important; margin: 0; transition: border-color .15s, transform .15s; }
.mod-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-1px); }
.mod-cat { font-size: .7rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.mod-progress { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding-top: 8px; }
.mod-summary { display: flex; gap: 22px; align-items: center; }
.mod-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mod-group .card-head { margin-bottom: 4px; }
.mod-req { padding: 12px 0; border-top: 1px solid var(--border); }
.mod-req:first-of-type { border-top: 0; }
.mod-req-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mod-req-head strong { flex: 1; min-width: 220px; }
.mod-code { font-size: .8rem; color: var(--muted); min-width: 64px; }
.mod-guidance { margin: 4px 0 0 74px; }
.mod-guidance summary { cursor: pointer; color: var(--accent); }
.mod-guidance p { margin: 6px 0; color: var(--text); }
.mod-actions { margin: 6px 0 0 74px; }
.mod-not_applicable .mod-req-head strong { color: var(--muted); }
.ev-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0 74px; }
.ev-chip { display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%; padding: 4px 10px; border-radius: 8px; font-size: .78rem; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none !important; border-left-width: 3px; }
.ev-chip.ev-ok { border-left-color: var(--ok); }
.ev-chip.ev-warn { border-left-color: var(--warn); }
.ev-chip.ev-bad { border-left-color: var(--bad); }
.ev-chip.ev-muted { border-left-color: var(--border); color: var(--muted); }
a.ev-chip:hover { background: var(--surface-2); }
.ev-kind { font-weight: 700; text-transform: uppercase; font-size: .66rem; letter-spacing: .06em; color: var(--muted); }
.ev-label { font-weight: 600; }
.ev-detail { color: var(--muted); }
@media (max-width: 700px) { .mod-guidance, .mod-actions, .ev-chips { margin-left: 0; } }

/* Evidence pack: a document, printed on white. */
.pack-sheet { background: #fff; color: #111827; border: 1px solid var(--border); border-radius: 14px; padding: 40px 48px; max-width: 1100px; margin: 0 auto; }
.pack-head { border-bottom: 3px solid var(--brand, #3e63dd); padding-bottom: 18px; margin-bottom: 24px; }
.pack-logo { max-height: 56px; max-width: 240px; }
.pack-org { font-weight: 750; font-size: 1.1rem; }
.pack-kicker { margin-top: 18px; text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; font-weight: 750; color: var(--brand-ink, #3e63dd); }
.pack-sheet h1 { margin: 4px 0 6px; font-size: 1.7rem; color: #111827; }
.pack-meta { color: #4b5563; margin: 0 0 8px; }
.pack-summary { font-size: 1rem; }
.pack-group h2 { font-size: 1.05rem; margin: 26px 0 8px; color: var(--brand-ink, #111827); }
.pack-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.pack-table th, .pack-table td { border-bottom: 1px solid #e5e7eb; padding: 7px 8px; text-align: left; vertical-align: top; color: #111827; }
.pack-table th { background: #f3f4f6; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.pack-ev { margin: 0; padding-left: 16px; }
.pack-foot { margin-top: 30px; padding-top: 12px; border-top: 1px solid #e5e7eb; font-size: .75rem; color: #6b7280; }
@media print {
  .pack-sheet { border: 0; padding: 0; max-width: none; }
  .pack-table tr, .pack-group h2 { break-inside: avoid; }
  .pack-sheet .pill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
