/* =====================================================================================================
   LPS GRC design system. Every colour, size, radius, shadow and duration comes from the tokens below.
   Themes: dark (default) and light, set on <html data-theme> by /static/theme.js before first paint.
   See UI-NOTES.md for how to use the tokens and components.
   ===================================================================================================== */

/* ---------------------------------------------------------------- 1. tokens */
:root {
  /* type */
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-title: 28px; --lh-title: 32px; --fs-section: 20px; --lh-section: 28px;
  --fs-body: 14px; --lh-body: 22px; --fs-caption: 12px; --lh-caption: 16px;
  /* spacing (8px grid) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  /* shape */
  --r-card: 12px; --r-ctl: 8px; --r-pill: 999px;
  /* motion */
  --t-fast: 150ms; --t-med: 200ms; --ease: cubic-bezier(.2, .7, .2, 1);
  /* layout */
  --side-w: 256px; --side-w-collapsed: 68px; --content-max: 1360px; --top-h: 60px;
  /* brand */
  --grad-primary: linear-gradient(135deg, #3B82F6 0%, #6366F1 100%);
  --cyan: #22D3EE;
  --iar: #A855F7; --ir: #22D3EE;
}

/* dark (default) */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1220; --surface: #111A2E; --elevated: #16213A; --sunken: #0E1628;
  --line: rgba(148, 163, 184, .12); --line-strong: rgba(148, 163, 184, .22);
  --fg: #E6EDF7; --muted: #94A3B8; --faint: #64748B;
  --accent: #60A5FA; --accent-strong: #3B82F6; --accent-soft: rgba(59, 130, 246, .14); --accent-ring: rgba(99, 102, 241, .45);
  --on-accent: #FFFFFF;
  --ok: #34D399; --ok-bg: rgba(16, 185, 129, .14); --ok-solid: #10B981;
  --warn: #FBBF24; --warn-bg: rgba(245, 158, 11, .14); --warn-solid: #F59E0B;
  --bad: #F87171; --bad-bg: rgba(239, 68, 68, .15); --bad-solid: #EF4444;
  --crit: #FB7185; --crit-bg: rgba(225, 29, 72, .22); --crit-solid: #E11D48;
  --info: #7DD3FC; --info-bg: rgba(56, 189, 248, .14); --info-solid: #38BDF8;
  --na: #94A3B8; --na-bg: rgba(148, 163, 184, .14); --na-solid: #64748B;
  --heat-ok: rgba(16, 185, 129, .22); --heat-warn: rgba(245, 158, 11, .26); --heat-bad: rgba(239, 68, 68, .30); --heat-crit: rgba(225, 29, 72, .50);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 8px 24px rgba(2, 6, 23, .45); --shadow-3: 0 24px 64px rgba(2, 6, 23, .6);
  --glow: 0 0 0 1px rgba(99, 102, 241, .5), 0 6px 20px rgba(59, 130, 246, .35);
  --glass: rgba(11, 18, 32, .72);
  --grid-dot: rgba(148, 163, 184, .10);
  --side-bg: #0A1020; --side-fg: #A9B6CA; --side-active: rgba(59, 130, 246, .14);
  --code-bg: #0E1628;
}
/* light */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F5F7FB; --surface: #FFFFFF; --elevated: #FFFFFF; --sunken: #EEF2F8;
  --line: rgba(15, 23, 42, .10); --line-strong: rgba(15, 23, 42, .18);
  --fg: #0F172A; --muted: #475569; --faint: #64748B;
  --accent: #2563EB; --accent-strong: #2563EB; --accent-soft: rgba(37, 99, 235, .09); --accent-ring: rgba(79, 70, 229, .35);
  --on-accent: #FFFFFF;
  --ok: #047857; --ok-bg: #D1FAE5; --ok-solid: #10B981;
  --warn: #B45309; --warn-bg: #FEF3C7; --warn-solid: #F59E0B;
  --bad: #B91C1C; --bad-bg: #FEE2E2; --bad-solid: #EF4444;
  --crit: #9F1239; --crit-bg: #FFE4E6; --crit-solid: #E11D48;
  --info: #0369A1; --info-bg: #E0F2FE; --info-solid: #0EA5E9;
  --na: #475569; --na-bg: #E2E8F0; --na-solid: #94A3B8;
  --heat-ok: #C7F0DD; --heat-warn: #FDE7B0; --heat-bad: #FBC4C4; --heat-crit: #F79AAC;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .06); --shadow-2: 0 8px 24px rgba(15, 23, 42, .08); --shadow-3: 0 24px 64px rgba(15, 23, 42, .18);
  --glow: 0 0 0 1px rgba(79, 70, 229, .35), 0 6px 18px rgba(37, 99, 235, .25);
  --glass: rgba(255, 255, 255, .78);
  --grid-dot: rgba(15, 23, 42, .07);
  --side-bg: #0B1220; --side-fg: #A9B6CA; --side-active: rgba(59, 130, 246, .18);
  --code-bg: #F1F5F9;
}

/* ---------------------------------------------------------------- 2. base */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-ui); font-size: var(--fs-body); line-height: var(--lh-body);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-ring); }
h1 { margin: 0; font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
h2 { margin: 0 0 var(--s3); font-size: var(--fs-section); line-height: var(--lh-section); font-weight: 650; letter-spacing: -.01em; }
h3 { margin: 0 0 var(--s2); font-size: var(--fs-caption); line-height: var(--lh-caption); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.eyebrow { font-size: var(--fs-caption); line-height: var(--lh-caption); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.eyebrow a { color: inherit; }
.sub, .muted { color: var(--muted); font-size: 12.5px; line-height: 18px; }
.sub { display: block; margin-top: 2px; }
.mono, code { font-family: var(--font-mono); font-size: 12.5px; font-variant-ligatures: none; }
.nowrap { white-space: nowrap; }
.num, .kpi .v, .count, td.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ic { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ic.sm { width: 14px; height: 14px; vertical-align: -2px; }
.ic.lg { width: 22px; height: 22px; }
.ic.xl { width: 32px; height: 32px; stroke-width: 1.5; }

/* ---------------------------------------------------------------- 3. app shell */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; transition: grid-template-columns var(--t-med) var(--ease); }
.side-collapsed .shell { grid-template-columns: var(--side-w-collapsed) minmax(0, 1fr); }
.side { background: var(--side-bg); color: var(--side-fg); position: sticky; top: 0; height: 100dvh; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; padding: var(--s3) var(--s2); gap: var(--s3); border-right: 1px solid rgba(148, 163, 184, .10); scrollbar-width: thin; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px; color: #fff; text-decoration: none; min-height: 44px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--grad-primary); display: grid; place-items: center; flex: 0 0 auto; box-shadow: var(--glow); }
.brand-mark .ic { color: #fff; width: 18px; height: 18px; }
.brand b { font-size: 15px; letter-spacing: .01em; display: block; line-height: 18px; }
.brand small { display: block; font-size: 11px; color: #7C8BA3; font-weight: 500; line-height: 14px; }
.side nav { display: grid; gap: 1px; }
.side .navh { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #64748B; padding: 14px 10px 4px; font-weight: 650; white-space: nowrap; }
.side .navh.fwh { color: #CBD5E1; display: flex; align-items: center; gap: 8px; }
.side .navh.fwh::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.side nav a { position: relative; color: var(--side-fg); text-decoration: none; padding: 7px 10px; border-radius: var(--r-ctl); display: flex; gap: 10px;
  align-items: center; font-weight: 500; font-size: 13.5px; line-height: 20px; white-space: nowrap; transition: background var(--t-fast) var(--ease), color var(--t-fast); }
.side nav a .lbl { overflow: hidden; text-overflow: ellipsis; }
.side nav a:hover { background: rgba(148, 163, 184, .08); color: #fff; }
.side nav a[aria-current="page"] { background: var(--side-active); color: #fff; }
.side nav a[aria-current="page"]::before { content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad-primary); box-shadow: 0 0 10px rgba(99, 102, 241, .8); }
.side nav a .ic { opacity: .85; }
.side nav a[aria-current="page"] .ic { color: #93C5FD; opacity: 1; }
.side details.navgroup > summary { list-style: none; cursor: pointer; color: #64748B; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em;
  padding: 14px 10px 4px; font-weight: 650; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.side details.navgroup > summary::-webkit-details-marker { display: none; }
.side details.navgroup > summary::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform var(--t-fast); }
.side details.navgroup[open] > summary::after { transform: rotate(45deg); }
.side details.navgroup > a { font-size: 13px; }
.side .foot { margin-top: auto; font-size: 11.5px; color: #64748B; padding: 8px 10px; display: grid; gap: 6px; }
.side .foot .trust { display: flex; align-items: center; gap: 6px; color: #7C8BA3; white-space: nowrap; }
.side-toggle { appearance: none; border: 1px solid rgba(148, 163, 184, .16); background: transparent; color: #7C8BA3; border-radius: var(--r-ctl);
  height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 10px; cursor: pointer; font: inherit; font-size: 12px; white-space: nowrap; }
.side-toggle:hover { color: #fff; border-color: rgba(148, 163, 184, .3); }
.side-collapsed .side .lbl, .side-collapsed .side .navh, .side-collapsed .brand span, .side-collapsed .side .foot .txt,
.side-collapsed .side details.navgroup > summary span { display: none; }
.side-collapsed .side details.navgroup > summary { justify-content: center; padding: 10px 0 2px; }
.side-collapsed .side details.navgroup > summary::after { margin: 0; }
.side-collapsed .side nav a { justify-content: center; padding: 9px 0; }
.side-collapsed .side-toggle .ic { transform: rotate(180deg); }
.side-collapsed .side-toggle { justify-content: center; padding: 0; }
.side-collapsed .brand { justify-content: center; padding: 6px 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s6); height: var(--top-h); border-bottom: 1px solid var(--line);
  background: var(--glass); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); position: sticky; top: 0; z-index: 20; }
.top form.search { flex: 1 1 auto; max-width: 520px; display: flex; position: relative; }
.top form.search input { width: 100%; padding-left: 36px; padding-right: 64px; background: var(--surface); }
.top form.search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.kbd { font-family: var(--font-mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; line-height: 18px; background: var(--sunken); }
.top form.search .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.top .who { margin-left: auto; display: flex; align-items: center; gap: var(--s2); font-size: 13px; color: var(--muted); white-space: nowrap; }
.secure { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); padding: 3px 10px; border-radius: var(--r-pill); background: var(--ok-bg); font-weight: 600; }
.recording { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.recording::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bad-solid); box-shadow: 0 0 0 3px var(--bad-bg); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.rolebadge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); color: var(--fg); }
.rolebadge.admin { border-color: rgba(99, 102, 241, .5); color: #A5B4FC; background: rgba(99, 102, 241, .12); }
:root[data-theme="light"] .rolebadge.admin { color: #4338CA; }
.rolebadge.auditor { border-color: rgba(34, 211, 238, .5); color: var(--cyan); background: rgba(34, 211, 238, .10); }
:root[data-theme="light"] .rolebadge.auditor { color: #0E7490; }
.rolebadge.editor { border-color: rgba(16, 185, 129, .45); color: var(--ok); background: var(--ok-bg); }
.iconbtn { appearance: none; width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); cursor: pointer; transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast); text-decoration: none; }
.iconbtn:hover { color: var(--fg); border-color: var(--line-strong); }
.theme-toggle .moon { display: none; } :root[data-theme="light"] .theme-toggle .sun { display: none; } :root[data-theme="light"] .theme-toggle .moon { display: inline; }
.usermenu { position: relative; }
.usermenu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 3px 6px 3px 3px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); }
.usermenu > summary::-webkit-details-marker { display: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--grad-primary); flex: 0 0 auto; letter-spacing: .02em; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; border-radius: 12px; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--elevated); border: 1px solid var(--line-strong); border-radius: var(--r-card); box-shadow: var(--shadow-3);
  padding: 6px; display: grid; min-width: 220px; z-index: 40; backdrop-filter: blur(12px); }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-ctl); text-decoration: none; color: var(--fg); font: inherit; font-size: 13.5px;
  background: none; border: 0; cursor: pointer; text-align: left; width: 100%; }
.menu a:hover, .menu button:hover, .menu a[aria-current] { background: var(--accent-soft); }
.menu .menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; gap: 4px; }
.menu form { margin: 0; }
.fw-switch { position: relative; }
.fw-switch > summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 0 12px; height: 36px; display: flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--fg); background: var(--surface); }
.fw-switch > summary::-webkit-details-marker { display: none; }
.fw-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--elevated); border: 1px solid var(--line-strong); border-radius: var(--r-card); box-shadow: var(--shadow-3); padding: 6px; display: grid; min-width: 200px; z-index: 40; }
.fw-menu a { padding: 8px 10px; border-radius: var(--r-ctl); text-decoration: none; color: var(--fg); display: flex; gap: 8px; align-items: center; }
.fw-menu a:hover, .fw-menu a[aria-current] { background: var(--accent-soft); }
.btn.menu-btn { display: none; }
.content { padding: var(--s6); display: grid; gap: var(--s6); max-width: var(--content-max); width: 100%; margin: 0 auto; animation: enter var(--t-med) var(--ease); align-content: start; }
@keyframes enter { from { transform: translateY(4px); } to { transform: none; } }  /* transform only: content is never left faded */
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--muted); align-items: center; }
.crumbs li + li::before { content: ""; display: inline-block; width: 5px; height: 5px; border-right: 1.5px solid var(--faint); border-top: 1.5px solid var(--faint); transform: rotate(45deg); margin: 0 8px 1px 2px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); text-decoration: underline; }
.crumbs [aria-current] { color: var(--fg); font-weight: 600; }
.ro-banner { display: flex; align-items: center; gap: 10px; background: linear-gradient(90deg, rgba(34, 211, 238, .14), rgba(34, 211, 238, .04)); color: var(--fg);
  border: 1px solid rgba(34, 211, 238, .35); border-radius: var(--r-card); padding: 10px 14px; font-size: 13px; font-weight: 500; }
.ro-banner .ic { color: var(--cyan); }
:root[data-theme="light"] .ro-banner .ic { color: #0E7490; }
body.audit-mode .top { box-shadow: inset 0 -2px 0 rgba(34, 211, 238, .55); }
@media (max-width: 960px) {
  .shell, .side-collapsed .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 60; transform: translateX(-100%); transition: transform var(--t-med) var(--ease); }
  .side-collapsed .side .lbl, .side-collapsed .side .navh, .side-collapsed .brand span { display: initial; }
  body.nav-open .side { transform: none; box-shadow: var(--shadow-3); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(2, 6, 23, .55); z-index: 55; }
  .btn.menu-btn { display: inline-grid; }
  .side-toggle { display: none; }
  .top { padding: 0 var(--s4); gap: var(--s2); }
  .content { padding: var(--s4); gap: var(--s5); }
  .top .secure .txt, .top .recording, .top .rolebadge, .usermenu .uname { display: none; }
}
@media (max-width: 600px) { .toolbar.filters > input, .toolbar.filters > select { flex: 1 1 100%; } .top form.search .kbd, .fw-switch .fwname { display: none; } :root { --fs-title: 22px; --lh-title: 28px; --fs-section: 17px; } }

/* ---------------------------------------------------------------- 4. page header */
.pagehead { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: flex-end; justify-content: space-between; }
.pagehead > div:not(.toolbar) { display: grid; gap: 6px; min-width: 0; max-width: 100%; }
.pagehead .head-ic { width: 44px; height: 44px; border-radius: var(--r-card); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line); }
.pagehead.hero { position: relative; padding: var(--s6); border-radius: 16px; border: 1px solid var(--line); background:
  radial-gradient(700px 240px at 0% 0%, rgba(59, 130, 246, .18), transparent 60%), radial-gradient(500px 200px at 100% 0%, rgba(34, 211, 238, .10), transparent 60%), var(--surface); overflow: hidden; }
.pagehead.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px); background-size: 18px 18px; pointer-events: none;
  mask-image: linear-gradient(180deg, #000 30%, transparent); -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent); }
.pagehead.hero > * { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- 5. cards, grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s5); min-width: 0; box-shadow: var(--shadow-1); }
.card.flush { padding: 0; overflow: hidden; }
.card.empty { color: var(--muted); text-align: center; padding: var(--s10) var(--s6); display: grid; justify-items: center; gap: var(--s3); border-style: dashed; background: transparent; box-shadow: none; }
.empty-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line); }
.empty .t { color: var(--fg); font-weight: 600; font-size: 15px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: var(--s5); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s5); }
@media (max-width: 520px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
section.block { display: grid; gap: var(--s3); scroll-margin-top: 80px; }

/* ---------------------------------------------------------------- 6. buttons and inputs */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 13px; line-height: 20px;
  padding: 7px 14px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); }
.btn:hover { border-color: var(--accent); background: var(--elevated); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad-primary); border-color: transparent; color: var(--on-accent); box-shadow: var(--glow); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { color: var(--bad); border-color: rgba(239, 68, 68, .35); background: transparent; }
.btn.danger:hover { background: var(--bad-bg); border-color: var(--bad-solid); }
.btn.small { padding: 4px 10px; font-size: 12px; gap: 6px; }
.btn[disabled], .btn.is-busy { opacity: .55; cursor: not-allowed; }
.btn.is-busy::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkbtn { appearance: none; background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
input[type=text], input[type=search], input[type=password], input[type=email], input[type=date], input[type=month], input[type=number], select, textarea {
  font: inherit; color: var(--fg); background: var(--sunken); border: 1px solid var(--line-strong); border-radius: var(--r-ctl); padding: 8px 12px; min-width: 0; min-height: 38px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast); }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-strong); box-shadow: 0 0 0 3px var(--accent-ring); }
input[aria-invalid="true"], input:user-invalid, select:user-invalid { border-color: var(--bad-solid); }
select { padding-right: 32px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select[multiple] { background-image: none; padding-right: 12px; min-height: 180px; }
textarea { width: 100%; min-height: 110px; resize: vertical; line-height: 1.55; }
input[type=file] { font: inherit; font-size: 13px; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: 12.5px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); padding: 6px 12px; border-radius: var(--r-ctl); margin-right: 10px; cursor: pointer; }
label.f { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
label.f .sub { font-weight: 400; }
.form { display: grid; gap: var(--s4); }
.form .row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s4); }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.toolbar input[type=search] { flex: 1 1 260px; }
.toolbar.filters { padding: var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.count { color: var(--muted); font-size: 12.5px; margin-left: auto; }
fieldset.score { border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s3) var(--s4) var(--s4); margin: 0; display: grid; gap: var(--s3); }
fieldset.score legend { font-weight: 650; font-size: 13px; padding: 0 6px; }

/* drag-and-drop upload */
.dropzone { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; padding: var(--s6) var(--s4); border: 1.5px dashed var(--line-strong); border-radius: var(--r-card);
  background: var(--sunken); color: var(--muted); transition: border-color var(--t-fast), background var(--t-fast); cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent-strong); background: var(--accent-soft); }
.dropzone .dz-ic { color: var(--accent); }
.dropzone .dz-t { color: var(--fg); font-weight: 600; font-size: 13.5px; }
.dropzone .dz-file { font-family: var(--font-mono); font-size: 12px; color: var(--ok); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.progress-indet { height: 3px; border-radius: 3px; background: var(--accent-soft); overflow: hidden; position: relative; display: none; }
.progress-indet::after { content: ""; position: absolute; inset: 0 60% 0 0; background: var(--grad-primary); animation: indet 1.1s var(--ease) infinite; }
form.is-submitting .progress-indet { display: block; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------------------------------------------------------------- 7. status chips, badges, tags */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: var(--r-pill); font-size: 12px; line-height: 18px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.chip::before { font-size: 10px; line-height: 1; font-weight: 800; width: 12px; text-align: center; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.ok::before { content: "✓"; }
.chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.warn::before { content: "!"; }
.chip.bad { background: var(--bad-bg); color: var(--bad); } .chip.bad::before { content: "✕"; }
.chip.crit { background: var(--crit-bg); color: var(--crit); border-color: rgba(225, 29, 72, .35); } .chip.crit::before { content: "▲"; font-size: 8px; }
.chip.info { background: var(--info-bg); color: var(--info); } .chip.info::before { content: "i"; font-family: Georgia, serif; font-style: italic; }
.chip.na { background: var(--na-bg); color: var(--na); } .chip.na::before { content: "–"; }
.chip.plain::before { content: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px; vertical-align: 2px; font-family: var(--font-mono); }
.badge.iar { background: rgba(168, 85, 247, .16); color: #C084FC; border: 1px solid rgba(168, 85, 247, .45); }
.badge.ir { background: rgba(34, 211, 238, .12); color: #67E8F9; border: 1px solid rgba(34, 211, 238, .45); }
:root[data-theme="light"] .badge.iar { color: #7E22CE; background: #F3E8FF; } :root[data-theme="light"] .badge.ir { color: #0E7490; background: #CFFAFE; }
.badge.iar::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--iar); }
.badge.ir::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ir); }
.catchip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 1px 8px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); color: var(--fg); background: var(--sunken); white-space: nowrap; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tag, .doc { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 11.5px; line-height: 18px; padding: 0 7px; border-radius: 6px; background: var(--accent-soft);
  color: var(--accent); text-decoration: none; white-space: nowrap; border: 1px solid rgba(96, 165, 250, .25); font-variant-ligatures: none; }
.doc { margin: 0 4px 4px 0; color: var(--fg); background: var(--sunken); border-color: var(--line); }
a.tag:hover { background: var(--accent-strong); color: #fff; text-decoration: none; }
.tag.more { background: var(--sunken); color: var(--muted); border-color: var(--line); }
.verpill { font-family: var(--font-mono); font-size: 11px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--line-strong); color: var(--muted); line-height: 17px; }
.verified { display: inline-flex; align-items: center; gap: 3px; color: var(--ok); font-size: 11.5px; font-weight: 650; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; background: var(--na-solid); }
.dot.ok { background: var(--ok-solid); } .dot.warn { background: var(--warn-solid); } .dot.bad { background: var(--bad-solid); } .dot.na { background: var(--na-solid); } .dot.crit { background: var(--crit-solid); } .dot.info { background: var(--info-solid); }
.ftype { width: 34px; height: 40px; border-radius: 7px; display: inline-grid; place-items: end center; padding-bottom: 5px; font-family: var(--font-mono); font-size: 8.5px; font-weight: 800; letter-spacing: .04em;
  color: #fff; position: relative; flex: 0 0 auto; background: var(--na-solid); }
.ftype::before { content: ""; position: absolute; top: 0; right: 0; width: 10px; height: 10px; background: rgba(255, 255, 255, .35); border-bottom-left-radius: 4px; }
.ftype.pdf { background: #DC2626; } .ftype.docx { background: #2563EB; } .ftype.xlsx, .ftype.csv { background: #059669; } .ftype.png, .ftype.jpg, .ftype.jpeg { background: #7C3AED; }
.ftype.none { background: transparent; border: 1.5px dashed var(--line-strong); color: var(--muted); }
.ftype.none::before { display: none; }
.doccell { display: flex; gap: 12px; align-items: flex-start; }

/* flashes become toasts (still in the page flow for screen readers) */
.toasts { position: fixed; right: var(--s5); bottom: var(--s5); z-index: 90; display: grid; gap: var(--s2); width: min(420px, calc(100vw - 32px)); }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-card); font-weight: 500; font-size: 13.5px; background: var(--elevated);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-3); color: var(--fg); animation: toast-in var(--t-med) var(--ease); }
.flash::before { content: ""; width: 4px; align-self: stretch; border-radius: 4px; flex: 0 0 auto; background: var(--info-solid); }
.flash.ok::before { background: var(--ok-solid); } .flash.warn::before { background: var(--warn-solid); } .flash.bad::before { background: var(--bad-solid); }
.flash .x { margin-left: auto; appearance: none; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.flash.leaving { opacity: 0; transform: translateY(6px); transition: all var(--t-med) var(--ease); }
.content > .flash, .card > .flash, form > .flash, section > .flash { box-shadow: none; animation: none; }
.content > .flash.ok, .content > .flash.warn, .content > .flash.bad { }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- 8. tables */
.tablebox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow-x: auto; box-shadow: var(--shadow-1); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
table.t th { position: sticky; top: 0; z-index: 1; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; background: var(--elevated);
  border-bottom: 1px solid var(--line); padding: 10px 14px; white-space: nowrap; }
table.t th a { color: inherit; text-decoration: none; }
table.t th a[aria-sort] { color: var(--accent); }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.link { cursor: pointer; }
table.t tbody tr { transition: background var(--t-fast); }
table.t tbody tr:hover td { background: var(--accent-soft); }
table.t td.num, table.t th.num { text-align: right; }
.dense table.t td { padding-top: 6px; padding-bottom: 6px; }
.title-cell { min-width: 260px; }
.title-cell a { color: var(--fg); text-decoration: none; font-weight: 550; }
.title-cell a:hover { color: var(--accent); text-decoration: underline; }
.table-tools { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); overflow: hidden; }
.seg button { appearance: none; border: 0; background: transparent; color: var(--muted); padding: 6px 9px; cursor: pointer; display: grid; place-items: center; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 700px) {
  .hide-sm { display: none; }
  .title-cell { min-width: 0; }
  /* tables become stacked cards */
  .tablebox.stack-sm { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .stack-sm table.t, .stack-sm table.t tbody, .stack-sm table.t tr, .stack-sm table.t td { display: block; width: 100%; }
  .stack-sm table.t thead { display: none; }
  .stack-sm table.t tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); margin-bottom: var(--s2); padding: 6px 0; }
  .stack-sm table.t td { border: 0; padding: 5px 14px; text-align: left !important; }
  .stack-sm table.t td[data-label]:not(.title-cell)::before { content: attr(data-label); display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 650; }
  .stack-sm table.t td.hide-sm { display: none; }
}
/* document grid view (toggle) */
.docgrid table.t thead { display: none; }
.docgrid table.t tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s3); padding: var(--s3); }
.docgrid table.t tr { display: grid; gap: 6px; background: var(--elevated); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s3); transition: transform var(--t-fast), border-color var(--t-fast); }
.docgrid table.t tr:hover { transform: translateY(-2px); border-color: var(--accent-strong); }
.docgrid table.t td { display: block; border: 0; padding: 0; background: transparent !important; }
.docgrid table.t td.hide-sm { display: block; }
.docgrid table.t td[data-label]:not(.title-cell)::before { content: attr(data-label) " "; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 650; margin-right: 6px; }
.docgrid .tablebox, .tablebox.docgrid { background: transparent; border-style: dashed; }

/* ---------------------------------------------------------------- 9. KPIs, rings, bars */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s3); }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4); display: grid; gap: 2px; text-decoration: none; color: inherit;
  box-shadow: var(--shadow-1); transition: transform var(--t-fast) var(--ease), border-color var(--t-fast), box-shadow var(--t-fast); overflow: hidden; }
a.kpi:hover { border-color: var(--accent-strong); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.kpi .v { font-size: 28px; font-weight: 700; line-height: 34px; letter-spacing: -.02em; }
.kpi .k { font-size: 13px; font-weight: 600; }
.kpi .d { font-size: 12px; color: var(--muted); line-height: 17px; }
.kpi .kic { position: absolute; right: 14px; top: 14px; color: var(--faint); }
.kpi.accent::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--grad-primary); }
.kpi.tone-ok .v { color: var(--ok); } .kpi.tone-warn .v { color: var(--warn); } .kpi.tone-bad .v { color: var(--bad); }
.ring { --p: 0; --size: 132px; --thick: 12px; width: var(--size); height: var(--size); position: relative; flex: 0 0 auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--sunken); }
.ring .val { stroke: url(#ringgrad); stroke-linecap: round; transition: stroke-dashoffset 600ms var(--ease); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .lbl b { font-size: 28px; line-height: 30px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ring .lbl span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.ring.sm { --size: 64px; } .ring.sm .lbl b { font-size: 15px; line-height: 16px; } .ring.sm .lbl span { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); margin-bottom: var(--s3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.ok { background: var(--ok-solid); } .sw.na { background: var(--na-solid); } .sw.warn { background: var(--warn-solid); } .sw.bad { background: var(--bad-solid); } .sw.crit { background: var(--crit-solid); }
.bars { display: grid; gap: 4px; }
.barrow { display: grid; grid-template-columns: 52px minmax(0, 1fr) 40px; gap: 10px; align-items: center; padding: 5px 6px; border-radius: var(--r-ctl); text-decoration: none; color: inherit; }
.barrow:hover { background: var(--accent-soft); }
.barrow .lab { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; }
.barrow .n { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted); }
.stack { display: flex; gap: 2px; height: 12px; }
.stack i { display: block; height: 100%; min-width: 3px; }
.stack i:first-child { border-radius: 4px 0 0 4px; } .stack i:last-child { border-radius: 0 4px 4px 0; } .stack i:only-child { border-radius: 4px; }
.stack i.ok { background: var(--ok-solid); } .stack i.na { background: var(--na-solid); } .stack i.warn { background: var(--warn-solid); } .stack i.bad { background: var(--bad-solid); }
.hbar { display: block; height: 6px; background: var(--sunken); border-radius: 4px; overflow: hidden; min-width: 60px; }
.hbar i { display: block; height: 100%; background: var(--grad-primary); border-radius: 4px; }
.hbar.ok i { background: var(--ok-solid); } .hbar.warn i { background: var(--warn-solid); }
.tip { position: fixed; z-index: 100; pointer-events: none; background: var(--elevated); color: var(--fg); border: 1px solid var(--line-strong); padding: 6px 10px; border-radius: var(--r-ctl);
  font-size: 12px; max-width: 300px; display: none; box-shadow: var(--shadow-2); }
.due-soon { color: var(--warn); font-weight: 600; }
.overdue { color: var(--bad); font-weight: 600; }
.compl { font-size: 12.5px; color: var(--muted); }
.warn-t { color: var(--warn); font-weight: 650; }

/* ---------------------------------------------------------------- 10. timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; display: grid; gap: 2px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
.timeline li::after { content: ""; position: absolute; left: 8.5px; top: 18px; bottom: 0; width: 1px; background: var(--line-strong); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); }

/* ---------------------------------------------------------------- 11. framework landing */
.fw-hero { position: relative; padding: var(--s8) var(--s6); border-radius: 18px; border: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(900px 300px at 10% -20%, rgba(59, 130, 246, .25), transparent 60%), radial-gradient(600px 260px at 100% 0%, rgba(34, 211, 238, .12), transparent 60%), var(--surface); }
.fw-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(var(--grid-dot) 1px, transparent 1px), linear-gradient(90deg, var(--grid-dot) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: radial-gradient(ellipse at 30% 0%, #000 20%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 30% 0%, #000 20%, transparent 70%); }
.fw-hero > * { position: relative; z-index: 1; }
.fw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s5); }
.fw-card { --tint: #3B82F6; position: relative; display: grid; gap: var(--s4); text-decoration: none; color: inherit; padding: var(--s6); border: 1px solid var(--line); border-radius: 16px; background:
  radial-gradient(420px 180px at 100% 0%, color-mix(in srgb, var(--tint) 18%, transparent), transparent 70%), var(--surface); box-shadow: var(--shadow-1);
  transition: transform var(--t-med) var(--ease), border-color var(--t-med), box-shadow var(--t-med); overflow: hidden; }
.fw-card:hover, .fw-card:focus-visible { transform: translateY(-3px); border-color: color-mix(in srgb, var(--tint) 60%, transparent); box-shadow: var(--shadow-2), 0 0 0 1px color-mix(in srgb, var(--tint) 30%, transparent); }
.fw-card.pci { --tint: #3B82F6; } .fw-card.iso { --tint: #22D3EE; } .fw-card.niac { --tint: #A855F7; }
.fw-top { display: flex; gap: var(--s4); align-items: center; justify-content: space-between; }
.emblem { width: 56px; height: 64px; flex: 0 0 auto; color: var(--tint); filter: drop-shadow(0 6px 16px color-mix(in srgb, var(--tint) 40%, transparent)); }
.emblem svg { width: 100%; height: 100%; }
.fw-name { font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
.fw-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: var(--s2); font-size: 12px; color: var(--muted); }
.fw-stats span { display: grid; gap: 0; padding: 8px 10px; border-radius: var(--r-ctl); background: var(--sunken); border: 1px solid var(--line); }
.fw-stats b { color: var(--fg); font-size: 18px; font-variant-numeric: tabular-nums; line-height: 22px; }
.fw-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.fw-enter { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--fg); }
.fw-card:hover .fw-enter .ic { transform: translateX(3px); }
.fw-enter .ic { transition: transform var(--t-fast); }

/* section cards */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s3); }
.sec-card { gap: 8px; align-content: start; padding-top: 14px; }
.sec-card .k { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.sec-card .k .ic { color: var(--accent); }
.sec-card .d { font-size: 12.5px; }
.sec-card .hbar { margin-top: 4px; }

/* ---------------------------------------------------------------- 12. requirement two-pane */
.twopane { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.reqtree { position: sticky; top: calc(var(--top-h) + 12px); max-height: calc(100dvh - var(--top-h) - 24px); display: grid; grid-template-rows: auto 1fr; padding: 0; overflow: hidden; }
.reqtree .rt-head { padding: var(--s3); border-bottom: 1px solid var(--line); display: grid; gap: var(--s2); }
.reqtree .rt-head input { width: 100%; }
.reqtree .rt-body { overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.reqtree details > summary { list-style: none; cursor: pointer; padding: 6px 8px; border-radius: var(--r-ctl); font-weight: 650; font-size: 12.5px; display: flex; gap: 8px; align-items: center; color: var(--fg); }
.reqtree details > summary::-webkit-details-marker { display: none; }
.reqtree details > summary:hover { background: var(--accent-soft); }
.reqtree details > summary .gid { font-family: var(--font-mono); color: var(--accent); min-width: 26px; }
.reqtree details > summary .gname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 500; }
.reqtree a { display: flex; gap: 8px; align-items: center; padding: 4px 8px 4px 14px; border-radius: 6px; text-decoration: none; color: var(--muted); font-size: 12.5px; line-height: 18px; }
.reqtree a .rid { font-family: var(--font-mono); color: var(--fg); min-width: 58px; font-size: 12px; }
.reqtree a .rt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reqtree a:hover { background: var(--accent-soft); color: var(--fg); }
.reqtree a[aria-current] { background: var(--accent-soft); color: var(--fg); box-shadow: inset 2px 0 0 var(--accent-strong); }
.pane-main { display: grid; gap: var(--s5); min-width: 0; }
@media (max-width: 1100px) { .twopane { grid-template-columns: 1fr; } .reqtree { position: static; max-height: 420px; } }

/* ---------------------------------------------------------------- 13. detail blocks (existing modules) */
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s3) var(--s5); margin: 0; }
.meta dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 650; }
.meta dd { margin: 3px 0 0; }
.req-text { white-space: pre-wrap; padding: 14px 16px; border-left: 3px solid var(--accent-strong); background: var(--sunken); border-radius: var(--r-ctl); line-height: 1.6; }
.just { padding: 12px 14px; border-radius: var(--r-ctl); background: var(--sunken); white-space: pre-wrap; border: 1px solid var(--line); }
.flag { padding: 10px 14px; border-radius: var(--r-ctl); background: var(--warn-bg); color: var(--warn); font-weight: 500; }
.azure { padding: 10px 14px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); }
details.more { margin-top: 10px; }
details.more summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details.more > .just, details.more > ul { margin-top: 8px; }
.cite { border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.cite-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--elevated); }
.para-q { padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.cite-body { padding: 4px 16px 12px; max-height: 360px; overflow: auto; }
.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.list li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.notes { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.doc-html { font-size: 14px; line-height: 1.65; min-width: 0; overflow-wrap: anywhere; }
.doc-html table { border-collapse: collapse; margin: 10px 0; width: 100%; }
.doc-html td, .doc-html th { border: 1px solid var(--line-strong); padding: 6px 8px; vertical-align: top; font-size: 13px; }
.doc-html h1 { font-size: 19px; margin: 24px 0 8px; } .doc-html h2 { font-size: 16.5px; margin: 20px 0 6px; }
.doc-html h3 { font-size: 14.5px; margin: 16px 0 6px; text-transform: none; letter-spacing: 0; color: var(--fg); }
.doc-html h1, .doc-html h2, .doc-html h3, .doc-html h4 { scroll-margin-top: 80px; }
.doc-html p { margin: 6px 0; max-width: 85ch; }
.doc-html .hit { background: var(--accent-soft); outline: 2px solid var(--accent); border-radius: 4px; }
.doc-html .para-hit { background: var(--warn-bg); outline: 2px solid var(--warn-solid); border-radius: 4px; }
.doclayout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--s5); align-items: start; }
.doclayout aside { position: sticky; top: 80px; max-height: calc(100dvh - 100px); overflow: auto; }
.toc a { display: block; text-decoration: none; color: var(--fg); padding: 3px 0; font-size: 13px; }
.toc a:hover { color: var(--accent); }
.toc a.l2 { padding-left: 12px; } .toc a.l3 { padding-left: 24px; color: var(--muted); }
@media (max-width: 1000px) { .doclayout { grid-template-columns: 1fr; } .doclayout aside { position: static; max-height: none; } }
.secidx { columns: 2 300px; column-gap: 24px; margin: 0; padding: 0; list-style: none; }
.secidx li { break-inside: avoid; margin-bottom: 8px; }
.pager { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 13.5px; padding: 10px 14px; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tabs button:hover { color: var(--fg); }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent-strong); }
.tabs .n { font-size: 11px; background: var(--sunken); border-radius: var(--r-pill); padding: 0 7px; color: var(--muted); font-variant-numeric: tabular-nums; }
[role="tabpanel"][hidden] { display: none !important; }

/* service provider cards */
.prov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s4); }
.prov-card { display: grid; gap: var(--s3); text-decoration: none; color: inherit; padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-1);
  transition: transform var(--t-med) var(--ease), border-color var(--t-med); }
.prov-card:hover { transform: translateY(-2px); border-color: var(--accent-strong); }
.prov-head { display: flex; gap: var(--s3); align-items: center; }
.prov-name { font-weight: 700; font-size: 15px; }
.prov-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.avatar.t-cloud { background: linear-gradient(135deg, #0EA5E9, #6366F1); } .avatar.t-bank { background: linear-gradient(135deg, #10B981, #0D9488); } .avatar.t-other { background: linear-gradient(135deg, #64748B, #475569); }

/* import stepper */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); list-style: none; margin: 0; padding: 0; counter-reset: step; }
.stepper li { counter-increment: step; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 13px; }
.stepper li::before { content: counter(step); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--sunken); border: 1px solid var(--line-strong); color: var(--muted); flex: 0 0 auto; }
.stepper li.done { color: var(--fg); } .stepper li.done::before { content: "✓"; background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.stepper li.current { color: var(--fg); border-color: var(--accent-strong); box-shadow: var(--glow); } .stepper li.current::before { background: var(--grad-primary); color: #fff; border-color: transparent; }
@media (max-width: 700px) { .stepper { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- 14. evidence viewer */
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s3); }
.ev-card { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); overflow: hidden; display: grid; grid-template-rows: auto 1fr; min-width: 0;
  transition: transform var(--t-fast), border-color var(--t-fast); }
.ev-card:hover { border-color: var(--accent-strong); transform: translateY(-2px); }
.ev-img { appearance: none; border: 0; padding: 0; margin: 0; background: none; cursor: zoom-in; display: block; width: 100%; }
.ev-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; background: var(--sunken); display: block; border-bottom: 1px solid var(--line); }
.ev-cap { padding: 8px 10px; font-size: 12px; line-height: 1.4; display: grid; gap: 4px; overflow-wrap: anywhere; }
.ev-cap form { display: inline; }
dialog { border: 0; padding: 0; color: var(--fg); }
#viewer { width: calc(100vw - 24px); max-width: none; height: calc(100dvh - 24px); max-height: none; background: #070C17; color: #E6EDF7; border-radius: 14px; border: 1px solid rgba(148, 163, 184, .2); }
#viewer::backdrop, dialog.modal::backdrop, #cmdk::backdrop { background: rgba(2, 6, 23, .7); backdrop-filter: blur(6px); }
.vw { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.vw-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid rgba(148, 163, 184, .16); }
.vw-title { flex: 1 1 240px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.vw-title small { color: #94A3B8; font-weight: 400; display: block; font-size: 12px; }
.vw-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.vw-btn { appearance: none; border: 1px solid rgba(148, 163, 184, .2); background: #111A2E; color: #E6EDF7; border-radius: var(--r-ctl); height: 34px; min-width: 34px; padding: 0 10px;
  font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.vw-btn:hover { border-color: #60A5FA; } .vw-btn[disabled] { opacity: .4; cursor: default; }
.vw-stage { overflow: auto; display: grid; place-items: center; padding: 12px; min-height: 0; }
.vw-stage img { max-width: 100%; max-height: calc(100dvh - 110px); background: #fff; cursor: zoom-in; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); }
.vw-stage.zoom { place-items: start; } .vw-stage.zoom img { max-width: none; max-height: none; cursor: zoom-out; }

/* modal + command palette */
dialog.modal { width: min(460px, calc(100vw - 32px)); background: var(--elevated); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow-3); padding: var(--s6); color: var(--fg); }
dialog.modal[open] { animation: toast-in var(--t-med) var(--ease); }
dialog.modal .m-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--bad-bg); color: var(--bad); margin-bottom: var(--s3); }
dialog.modal .m-t { font-size: 17px; font-weight: 700; margin: 0 0 6px; }
dialog.modal .m-b { color: var(--muted); margin: 0 0 var(--s5); }
dialog.modal .m-actions { display: flex; justify-content: flex-end; gap: var(--s2); }
#cmdk { width: min(640px, calc(100vw - 24px)); margin-top: 12vh; background: var(--glass); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow-3); padding: 0; color: var(--fg); }
#cmdk .ck-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
#cmdk .ck-in input { flex: 1; border: 0; background: transparent; font-size: 16px; padding: 4px 0; box-shadow: none; min-height: 0; }
#cmdk .ck-in input:focus { box-shadow: none; }
#cmdk ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
#cmdk li a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--r-ctl); text-decoration: none; color: var(--fg); }
#cmdk li a .grp { margin-left: auto; font-size: 11.5px; color: var(--faint); }
#cmdk li[aria-selected="true"] a { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent-strong); }
#cmdk .ck-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--faint); }

/* ---------------------------------------------------------------- 15. risk heat map */
.heat-wrap { display: flex; align-items: center; gap: 6px; }
.heat-y { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.heat-x { text-align: center; font-size: 11px; margin-top: 6px; padding-left: 60px; letter-spacing: .08em; text-transform: uppercase; }
table.heat { border-collapse: separate; border-spacing: 4px; width: 100%; table-layout: fixed; }
table.heat th { font-size: 11px; font-weight: 600; color: var(--muted); line-height: 1.2; }
table.heat th.hl { text-align: right; padding-right: 6px; width: 96px; }
table.heat th.hi { text-align: center; padding-top: 4px; }
table.heat td.hc { height: 44px; text-align: center; border-radius: var(--r-ctl); font-weight: 750; font-variant-numeric: tabular-nums; font-size: 15px; transition: transform var(--t-fast); }
table.heat td.hc.ok { background: var(--heat-ok); } table.heat td.hc.warn { background: var(--heat-warn); }
table.heat td.hc.bad { background: var(--heat-bad); } table.heat td.hc.crit { background: var(--heat-crit); }
table.heat td.hc.empty { opacity: .45; color: var(--muted); font-weight: 400; }
table.heat td.hc:not(.empty):hover { transform: scale(1.06); }
table.heat td.hc a { display: block; height: 100%; line-height: 44px; color: var(--fg); text-decoration: none; border-radius: var(--r-ctl); }
table.heat td.hc a:hover, table.heat td.hc a:focus-visible { outline: 2px solid var(--accent); }
@media (max-width: 600px) { table.heat th.hl { width: 28px; } .heat-x { padding-left: 30px; } table.heat td.hc { height: 36px; } table.heat td.hc a { line-height: 36px; } }

/* ---------------------------------------------------------------- 16. sign-in (split layout) */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); }
.auth-brand { position: relative; overflow: hidden; padding: var(--s10); display: flex; flex-direction: column; justify-content: space-between; gap: var(--s8); color: #E6EDF7;
  background: radial-gradient(800px 500px at 0% 0%, rgba(59, 130, 246, .35), transparent 60%), radial-gradient(600px 400px at 100% 100%, rgba(34, 211, 238, .18), transparent 60%), #070C17; }
.auth-brand::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(148, 163, 184, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, .07) 1px, transparent 1px);
  background-size: 32px 32px; mask-image: radial-gradient(ellipse at 40% 40%, #000 25%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 40% 40%, #000 25%, transparent 75%); animation: drift 30s linear infinite; }
@keyframes drift { to { background-position: 32px 32px; } }
.auth-brand > * { position: relative; z-index: 1; }
.auth-shield { width: 120px; height: 136px; color: #60A5FA; filter: drop-shadow(0 12px 40px rgba(59, 130, 246, .55)); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.auth-brand h1 { font-size: 36px; line-height: 42px; color: #fff; max-width: 16ch; }
.auth-brand p { color: #A9B6CA; max-width: 46ch; margin: 0; }
.trust-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.trust-list li { display: flex; gap: 12px; align-items: center; color: #CBD5E1; font-size: 13.5px; }
.trust-list .ic { color: #22D3EE; width: 20px; height: 20px; }
.auth-panel { display: grid; place-items: center; padding: var(--s6); background: var(--bg); }
.login .card { width: min(400px, 100%); display: grid; gap: var(--s4); padding: var(--s8); border-radius: 16px; box-shadow: var(--shadow-2); }
.login .brandrow { display: flex; align-items: center; gap: 12px; }
.login .brandrow img { height: 30px; background: #fff; border-radius: 6px; padding: 3px 5px; }
.login .card .flash { box-shadow: none; animation: none; }
.login .fineprint { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .auth-brand { padding: var(--s6); gap: var(--s4); } .auth-brand h1 { font-size: 24px; line-height: 30px; }
  .auth-shield { width: 56px; height: 64px; } .trust-list, .auth-brand .bp { display: none; } }

/* ---------------------------------------------------------------- 17. motion + print */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --elevated: #fff; --sunken: #f4f6f9; --fg: #000; --muted: #444; --line: #ccc; --line-strong: #bbb; --accent: #1d4ed8; color-scheme: light; }
  .side, .top, .toasts, .ro-banner .x, .btn, .toolbar.filters, form[method="post"], dialog, .seg, .reqtree, .tabs, .crumbs { display: none !important; }
  .shell { display: block; } .content { padding: 0; max-width: none; animation: none; }
  .card, .tablebox, .kpi { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  table.t th { position: static; background: #eee; color: #000; }
  .twopane { display: block; }
  [role="tabpanel"][hidden] { display: block !important; }
  a { color: #000; text-decoration: none; }
  .ro-banner { border: 1px solid #000; background: none; }
}

/* ---------------------------------------------------------------- 19. Latpay logo */
.brand-logo { height: 30px; width: auto; display: block; flex: 0 0 auto; }
.brand-sym { display: none; height: 30px; width: auto; }
.brand span { border-left: 1px solid rgba(148, 163, 184, .3); padding-left: 10px; }
.side-collapsed .brand-logo { display: none; }
.side-collapsed .brand-sym { display: block; }
@media (max-width: 960px) { .side-collapsed .brand-logo { display: block; } .side-collapsed .brand-sym { display: none; } }
.auth-logo { display: flex; align-items: center; gap: 14px; }
.auth-logo img { height: 44px; width: auto; }
.auth-logo span { border-left: 1px solid rgba(148, 163, 184, .35); padding-left: 14px; }
.auth-logo b { color: #fff; display: block; font-size: 16px; line-height: 20px; }
.auth-logo small { color: #7C8BA3; font-size: 12px; }
.tlogo { display: inline-flex; flex: 0 0 auto; }
.tlogo img { height: 30px; width: auto; display: block; }
.tlogo .logo-on-light, :root[data-theme="light"] .tlogo .logo-on-dark { display: none; }
:root[data-theme="light"] .tlogo .logo-on-light { display: block; }
.login .brandrow .tlogo img { height: 28px; background: none; padding: 0; border-radius: 0; }
.hero-logo { margin-bottom: var(--s4); }
.hero-logo img { height: 40px; }
@media print { .tlogo .logo-on-dark { display: none; } .tlogo .logo-on-light { display: block; } }
.brand small { white-space: nowrap; font-size: 10.5px; }
.brand b { white-space: nowrap; }
.brand-logo { height: 26px; }
