/* КОПШ v8 · dense editorial redesign (r13) */
:root {
  --bg: #060b14;
  --bg-side: #081020;
  --surface: #0c1526;
  --surface-2: #101b30;
  --surface-3: #152238;
  --line: rgba(148, 178, 210, .13);
  --line-strong: rgba(148, 178, 210, .24);
  --text: #e9eff6;
  --muted: #97a9bc;
  --faint: #66798e;
  --accent: #38dbd0;
  --accent-dim: rgba(56, 219, 208, .12);
  --blue: #64a9ff;
  --blue-dim: rgba(100, 169, 255, .12);
  --amber: #ffb454;
  --green: #45d483;
  --red: #ff7a76;
  --shadow: 0 10px 30px rgba(2, 6, 14, .45);
  --r-s: 8px;
  --r-m: 11px;
  --r-l: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 -apple-system, "SF Pro Text", "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(56, 219, 208, .25); }

/* ---------- shell ---------- */
.app-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.main-content { min-width: 0; padding: 0 26px 40px; }

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg-side); border-right: 1px solid var(--line);
  padding: 16px 14px 14px; scrollbar-width: thin;
}
.brand-block { display: flex; align-items: center; gap: 10px; padding: 2px 4px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 17px; color: #052a27;
  background: linear-gradient(135deg, #43e5d5, #1fb9c9); box-shadow: 0 4px 14px rgba(56, 219, 208, .3);
}
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: .04em; }
.brand-caption { font-size: 10px; line-height: 1.35; color: var(--faint); margin-top: 1px; }
.version-pill {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--surface); font-size: 11px; color: var(--muted);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(69, 212, 131, .8); flex: none; }
.build-stamp {
  padding: 1px 7px; border: 1px solid rgba(56, 219, 208, .3); border-radius: 999px;
  font-size: 10px; color: var(--accent); white-space: nowrap; letter-spacing: .02em;
}
.version-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ver-btn {
  padding: 6px 8px; border-radius: var(--r-s); border: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted); text-align: center; transition: .15s;
}
.ver-btn:hover { border-color: var(--line-strong); color: var(--text); }
.ver-btn.active { background: var(--accent-dim); border-color: rgba(56, 219, 208, .4); color: var(--accent); font-weight: 600; }
.main-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 9px; border-radius: var(--r-s); font-size: 12.5px; color: var(--muted);
  text-align: left; transition: .12s;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
.nav-icon { width: 16px; text-align: center; opacity: .8; flex: none; }
.nav-count { margin-left: auto; font-size: 10.5px; color: var(--faint); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 3px; padding-top: 10px; border-top: 1px solid var(--line); }
.auth-btn { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: var(--r-s); font-size: 12.5px; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--line); margin-bottom: 6px; transition: .15s; }
.auth-btn:hover { border-color: var(--line-strong); }
.auth-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.side-link { display: flex; align-items: center; gap: 8px; padding: 5px 9px; border-radius: var(--r-s); font-size: 12px; color: var(--muted); }
.side-link span { opacity: .7; width: 14px; text-align: center; flex: none; }
.side-link:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.admin-link { color: var(--amber); }
.side-note { margin-top: 8px; padding: 0 9px; font-size: 10px; line-height: 1.5; color: var(--faint); }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px;
  padding: 10px 0 9px; background: linear-gradient(var(--bg) 82%, transparent); margin-bottom: 4px;
}
.mobile-menu { display: none; font-size: 17px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--r-s); }
.crumbs { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.crumbs b { margin: 0 6px; opacity: .5; }
.crumbs strong { color: var(--text); font-weight: 600; }
.global-search { display: flex; align-items: center; gap: 7px; flex: 1; max-width: 430px; margin-left: auto; padding: 6px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--faint); transition: .15s; }
.global-search:focus-within { border-color: rgba(56, 219, 208, .45); }
.global-search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font-size: 12.5px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.live-label { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.live-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.top-actions a { font-size: 11.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }
.top-actions a:hover { color: var(--text); border-color: var(--line-strong); text-decoration: none; }
.version-banner { display: none; padding: 9px 14px; border-radius: var(--r-s); background: rgba(255, 180, 84, .1); border: 1px solid rgba(255, 180, 84, .3); color: var(--amber); font-size: 12.5px; margin: 4px 0 10px; }
body.is-archive .version-banner { display: block; }
body.is-archive .version-pill { border-color: rgba(255, 180, 84, .35); }

/* ---------- pages ---------- */
.page-section { display: none; }
.page-section.active { display: block; }

/* ---------- cover ---------- */
.briefing-cover {
  border: 1px solid var(--line); border-radius: var(--r-l);
  background: radial-gradient(1100px 420px at 12% -10%, rgba(56, 219, 208, .09), transparent 60%), radial-gradient(900px 400px at 95% 0%, rgba(100, 169, 255, .08), transparent 55%), var(--surface);
  padding: 26px 28px 20px; margin-top: 8px;
}
.cover-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 10.5px; letter-spacing: .1em; color: var(--faint); margin-bottom: 16px; }
.cover-meta span { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.cover-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 26px; align-items: start; }
.eyebrow { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.cover-copy h1 { font-size: clamp(26px, 3.2vw, 36px); line-height: 1.12; margin: 0 0 12px; font-weight: 800; letter-spacing: -.01em; }
.cover-copy h1 em { font-style: normal; color: var(--accent); }
.cover-lead { color: var(--muted); font-size: 13.5px; max-width: 560px; margin: 0 0 16px; }
.cover-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.primary-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #3fe0d2, #23b8c9); color: #04241f;
  font-weight: 700; font-size: 13px; padding: 10px 18px; border-radius: 999px; transition: .15s;
  box-shadow: 0 6px 18px rgba(56, 219, 208, .25);
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(56, 219, 208, .35); text-decoration: none; }
.quiet-btn, .outline-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-strong); color: var(--text);
  font-size: 12.5px; font-weight: 600; padding: 9px 16px; border-radius: 999px; transition: .15s;
}
.quiet-btn:hover, .outline-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* presentation showcase */
.showcase-card { border: 1px solid var(--line-strong); border-radius: var(--r-m); background: linear-gradient(160deg, var(--surface-2), var(--surface)); padding: 14px; box-shadow: var(--shadow); }
.showcase-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.showcase-head .eyebrow { margin: 0; }
.slide-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.slide-thumb {
  aspect-ratio: 16/10; border-radius: 6px; border: 1px solid var(--line);
  background: linear-gradient(150deg, #122036, #0b1526); padding: 6px;
  display: flex; flex-direction: column; justify-content: space-between; transition: .15s; cursor: pointer;
}
.slide-thumb:hover { border-color: var(--accent); transform: translateY(-2px); }
.slide-thumb i { font-style: normal; font-size: 8px; color: var(--faint); }
.slide-thumb b { font-size: 8.5px; font-weight: 600; color: var(--muted); line-height: 1.25; }
.slide-thumb.hero { background: linear-gradient(150deg, rgba(56, 219, 208, .25), rgba(11, 21, 38, .9)); border-color: rgba(56, 219, 208, .4); }
.slide-thumb.hero b { color: var(--accent); }
.showcase-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.showcase-meta > div { border: 1px solid var(--line); border-radius: var(--r-s); padding: 7px 9px; }
.showcase-meta strong { display: block; font-size: 13px; font-weight: 800; color: var(--text); }
.showcase-meta span { font-size: 9.5px; color: var(--faint); line-height: 1.3; display: block; margin-top: 1px; }
.showcase-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.showcase-actions .primary-btn, .showcase-actions .quiet-btn { justify-content: center; padding: 9px 10px; font-size: 12px; }
.showcase-note { margin: 9px 2px 0; font-size: 10px; color: var(--faint); line-height: 1.5; }
.cover-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--faint); }
.cover-foot span { display: flex; align-items: center; gap: 6px; }
.cover-foot span::before { content: "▪"; color: var(--accent); font-size: 8px; }

/* Compact economic argument, inside the existing cover and report. */
.cover-economy { margin-top: 17px; border-top: 1px solid var(--line); }
.cover-economy-row { display: grid; grid-template-columns: 175px minmax(0, 1fr); gap: 14px; padding: 12px 0; align-items: center; }
.cover-economy-row + .cover-economy-row { border-top: 1px solid var(--line); }
.economy-label { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.cover-economy-number strong { color: var(--accent); font-size: 25px; line-height: 1.2; letter-spacing: -.03em; white-space: nowrap; }
.cover-economy-number small { font-size: 11px; font-weight: 600; letter-spacing: 0; }
.cover-economy-row p { font-size: 11px; line-height: 1.55; color: var(--muted); margin: 0; }
.cover-economy-row p b { color: var(--text); font-weight: 600; }
.cover-economy-row.future strong { color: var(--blue); }
.cover-economy-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; font-size: 10px; line-height: 1.5; color: var(--muted); }
.cover-economy-foot button { color: var(--accent); padding: 5px 0; font-size: 11px; font-weight: 600; }
.fiscal-scenario { scroll-margin-top: 75px; margin-top: 16px; }
.fiscal-scope { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.fiscal-equation { display: grid; grid-template-columns: 1.2fr auto 1fr auto 1fr; align-items: start; gap: 14px; }
.fiscal-equation > div > span { color: var(--muted); font-size: 11px; }
.fiscal-equation strong { display: block; font-size: 28px; color: var(--accent); margin: 5px 0; line-height: 1.2; }
.fiscal-equation strong small, .future-metrics small { font-size: 12px; font-weight: 600; white-space: nowrap; }
.fiscal-equation p { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 0; }
.fiscal-arrow { color: var(--faint); padding-top: 27px; font-size: 20px; }
.fiscal-total { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding: 13px 0; margin-top: 15px; border-block: 1px solid var(--line); }
.fiscal-total b { color: var(--text); font-size: 15px; }
.fiscal-total span { flex: 1 1 320px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.fiscal-details summary { cursor: pointer; padding: 13px 0; font-size: 12px; color: var(--accent); font-weight: 600; }
.fiscal-details summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.fiscal-assumptions { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.fiscal-assumptions p { font-size: 12px; line-height: 1.65; color: var(--muted); margin: 0 0 14px; }
.fiscal-assumptions b { color: var(--text); }
.fiscal-table-scroll { overflow-x: auto; }
.fiscal-cycle { color: var(--blue); font-size: 12px; line-height: 1.6; margin: 0; }
.future-condition { color: var(--muted); font-size: 13px; line-height: 1.6; max-width: 820px; }
.future-condition b { color: var(--text); font-weight: 600; }
.future-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 14px 0; border-block: 1px solid var(--line); }
.future-metrics strong { display: block; font-size: 28px; color: var(--blue); line-height: 1.2; margin-bottom: 5px; }
.future-metrics span { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.future-metrics .future-result strong { color: var(--accent); }
@media (max-width: 650px) {
  .cover-economy-row { grid-template-columns: 1fr; gap: 7px; }
  .cover-economy-number strong { font-size: 27px; }
  .cover-economy-row p { font-size: 12px; }
  .cover-economy-foot { font-size: 11px; }
  .fiscal-equation { grid-template-columns: 1fr; gap: 10px; }
  .fiscal-equation > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: center; }
  .fiscal-equation strong { font-size: 24px; }
  .fiscal-equation p { grid-column: 1 / -1; }
  .fiscal-arrow { display: none; }
  .fiscal-total span { flex-basis: 100%; }
  .fiscal-assumptions { grid-template-columns: 1fr; gap: 0; }
  .future-metrics { grid-template-columns: 1fr 1fr; }
  .future-metrics strong { font-size: 25px; }
}

/* ---------- briefing sections ---------- */
.briefing-section { padding: 26px 0 6px; }
.briefing-section.tinted-section > .section-title-row h2 em { color: var(--blue); }
.section-topline { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: .12em; color: var(--faint); border-top: 1px solid var(--line); padding-top: 10px; margin-bottom: 10px; }
.section-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.section-title-row h2 { font-size: clamp(19px, 2.2vw, 25px); line-height: 1.15; margin: 0; font-weight: 800; letter-spacing: -.01em; }
.section-title-row h2 em { font-style: normal; color: var(--accent); }
.section-index { font-size: 30px; font-weight: 800; color: var(--surface-3); -webkit-text-stroke: 1px var(--line-strong); flex: none; }
.section-intro { color: var(--muted); font-size: 13px; max-width: 760px; margin: 0 0 14px; }

/* metrics + workstreams */
.workspace-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.workspace-metrics > div { border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); padding: 10px 12px; }
.workspace-metrics strong { display: block; font-size: 20px; font-weight: 800; color: var(--accent); }
.workspace-metrics span { font-size: 11px; color: var(--faint); }
.workstream-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.workstream-card {
  text-align: left; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface);
  padding: 12px; display: flex; flex-direction: column; gap: 5px; transition: .15s;
}
.workstream-card:hover { border-color: rgba(56, 219, 208, .45); transform: translateY(-2px); }
.workstream-card span { font-size: 10px; font-weight: 700; color: var(--accent); letter-spacing: .1em; }
.workstream-card strong { font-size: 13px; line-height: 1.3; }
.workstream-card small { color: var(--faint); font-size: 11px; line-height: 1.45; flex: 1; }
.workstream-card b { font-size: 11px; color: var(--blue); font-weight: 600; }

/* sheet cards + tables */
.sheet-card { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 14px 16px; margin-bottom: 10px; }
.sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sheet-heading h3 { font-size: 14.5px; margin: 0; font-weight: 700; }
.sheet-heading .eyebrow { margin-bottom: 3px; }
.sheet-lead { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.sheet-foot { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; font-size: 11px; color: var(--faint); line-height: 1.5; }
.evidence-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.evidence-table th {
  text-align: left; font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); font-weight: 700; padding: 6px 10px; border-bottom: 1px solid var(--line-strong);
}
.evidence-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--muted); }
.evidence-table td b, .evidence-table td strong { color: var(--text); }
.evidence-table tr:last-child td { border-bottom: 0; }
.evidence-table tbody tr:hover td { background: rgba(56, 219, 208, .03); }
.compact-table td, .compact-table th { padding: 5px 10px; }
.status-tag {
  display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 999px; border: 1px solid; white-space: nowrap;
}
.status-tag.model { color: var(--accent); border-color: rgba(56, 219, 208, .4); background: var(--accent-dim); }
.status-tag.ok { color: var(--green); border-color: rgba(69, 212, 131, .4); background: rgba(69, 212, 131, .1); }
.status-tag.verify { color: var(--amber); border-color: rgba(255, 180, 84, .4); background: rgba(255, 180, 84, .1); }
.status-tag.hypothesis { color: var(--blue); border-color: rgba(100, 169, 255, .4); background: var(--blue-dim); }
.status-tag.scenario { color: #c9a2ff; border-color: rgba(201, 162, 255, .4); background: rgba(201, 162, 255, .1); }

/* argument / problem cards */
.argument-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.argument-card {
  text-align: left; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface);
  padding: 13px 14px; display: flex; flex-direction: column; gap: 6px; transition: .15s;
}
.argument-card:hover { border-color: rgba(56, 219, 208, .45); transform: translateY(-2px); }
.card-number { font-size: 10px; font-weight: 800; color: var(--accent); letter-spacing: .12em; }
.card-label { font-size: 9.5px; font-weight: 700; letter-spacing: .14em; color: var(--faint); }
.argument-card strong { font-size: 13.5px; line-height: 1.3; }
.argument-card p { margin: 0; color: var(--faint); font-size: 11.5px; line-height: 1.5; flex: 1; }
.card-link { font-size: 11px; color: var(--blue); font-weight: 600; }
.evidence-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.evidence-strip > div { border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); padding: 10px 12px; }
.evidence-strip strong { display: block; font-size: 19px; font-weight: 800; color: var(--accent); }
.evidence-strip span { font-size: 11px; color: var(--faint); }
.source-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 14px; font-size: 11px; color: var(--faint); }
.source-line button, .source-line a {
  font-size: 11px; color: var(--blue); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
.source-line button:hover, .source-line a:hover { border-color: var(--blue); text-decoration: none; }

.problem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.problem-card { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 13px 14px; }
.problem-mark { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--accent-dim); color: var(--accent); font-weight: 800; font-size: 12px; margin-bottom: 7px; }
.problem-card h3 { margin: 0 0 5px; font-size: 13.5px; }
.problem-card p { margin: 0 0 9px; color: var(--faint); font-size: 11.5px; line-height: 1.5; }
.problem-card button { font-size: 11px; color: var(--blue); font-weight: 600; padding: 0; }

/* mechanism */
.theory-flow, .architecture-flow { display: flex; align-items: stretch; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.flow-step, .arch-node {
  flex: 1; min-width: 150px; border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface); padding: 11px 12px;
}
.flow-step span, .arch-node span { font-size: 10px; font-weight: 800; color: var(--faint); letter-spacing: .1em; }
.flow-step strong, .arch-node strong { display: block; font-size: 12.5px; margin: 3px 0 2px; }
.flow-step small, .arch-node small { color: var(--faint); font-size: 10.5px; line-height: 1.4; }
.flow-step.accent, .arch-node.accent { border-color: rgba(56, 219, 208, .5); background: linear-gradient(150deg, rgba(56, 219, 208, .1), var(--surface)); }
.theory-flow > i, .architecture-flow > i { align-self: center; color: var(--faint); font-style: normal; }
.contour-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.contour-card { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
.contour-a .contour-code { background: var(--accent-dim); color: var(--accent); }
.contour-b .contour-code { background: var(--blue-dim); color: var(--blue); }
.contour-head { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.contour-code { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 16px; flex: none; }
.contour-head h3 { margin: 0; font-size: 14px; }
.contour-head .eyebrow { margin: 0; color: var(--faint); }
.contour-head .status-tag { margin-left: auto; }
.contour-body { padding: 10px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.contour-body > div { display: grid; grid-template-columns: 82px 1fr; gap: 10px; font-size: 11.5px; }
.contour-body b { color: var(--faint); font-weight: 600; text-transform: uppercase; font-size: 9.5px; letter-spacing: .08em; padding-top: 1px; }
.contour-body span { color: var(--muted); }
.contour-link { margin: 0 14px 12px; align-self: flex-start; font-size: 11.5px; font-weight: 600; color: var(--accent); padding: 0; }
.guardrail-band { display: flex; gap: 12px; align-items: flex-start; border: 1px solid rgba(255, 180, 84, .3); background: rgba(255, 180, 84, .06); border-radius: var(--r-m); padding: 11px 14px; margin-bottom: 10px; }
.guardrail-icon { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 7px; background: rgba(255, 180, 84, .15); color: var(--amber); font-weight: 800; }
.guardrail-band strong { font-size: 12.5px; }
.guardrail-band p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
.formula-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.formula-grid > div { border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; background: var(--surface-2); }
.formula-grid span { font-size: 9.5px; font-weight: 700; letter-spacing: .12em; color: var(--faint); }
.formula-grid code { display: block; margin: 5px 0; font-size: 12px; color: var(--accent); font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.formula-grid p { margin: 0; font-size: 11px; color: var(--muted); }
.formula-note { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.formula-note code { font-size: 11.5px; color: var(--accent); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 6px 10px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.formula-note span { font-size: 11px; color: var(--faint); flex: 1; min-width: 220px; }

/* cycle */
.cycle-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.cycle-step { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 11px 12px; }
.cycle-step span { font-size: 10px; font-weight: 800; color: var(--accent); }
.cycle-step strong { display: block; font-size: 12.5px; margin: 3px 0 3px; }
.cycle-step p { margin: 0; font-size: 11px; color: var(--faint); line-height: 1.45; }
.pull-quote { display: flex; gap: 12px; align-items: flex-start; border-left: 3px solid var(--accent); padding: 6px 0 6px 14px; margin-bottom: 14px; }
.pull-quote span { font-size: 30px; color: var(--accent); line-height: .8; font-weight: 800; }
.pull-quote p { margin: 0; font-size: 14.5px; font-weight: 600; max-width: 640px; }

/* law */
.law-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; margin-bottom: 10px; }
.law-lead, .law-quote { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 14px 16px; }
.big-statement { font-size: 15.5px; font-weight: 700; margin: 0 0 8px; line-height: 1.4; }
.law-lead p:not(.big-statement) { color: var(--muted); font-size: 12.5px; margin: 0 0 12px; }
.law-quote span { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.law-quote blockquote { margin: 8px 0 12px; padding: 0; font-size: 13px; line-height: 1.55; color: var(--text); border-left: 3px solid var(--accent); padding-left: 12px; }
.law-quote button { font-size: 11.5px; color: var(--blue); font-weight: 600; padding: 0; }
.gate-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.gate-card { text-align: left; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); padding: 10px 12px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: baseline; transition: .15s; }
.gate-card:hover { border-color: rgba(56, 219, 208, .45); }
.gate-card span { font-size: 11px; font-weight: 800; color: var(--accent); }
.gate-card strong { font-size: 12.5px; }
.gate-card small { grid-column: 1 / -1; color: var(--faint); font-size: 10.5px; line-height: 1.4; }

/* finance */
.finance-hero { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: stretch; margin-bottom: 10px; }
.finance-number { border: 1px solid rgba(56, 219, 208, .35); border-radius: var(--r-m); background: linear-gradient(150deg, rgba(56, 219, 208, .12), var(--surface)); padding: 14px 20px; }
.finance-number strong { display: block; font-size: 40px; font-weight: 800; color: var(--accent); line-height: 1.05; letter-spacing: -.02em; }
.finance-number span { font-size: 11px; color: var(--faint); }
.finance-side { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.finance-side > div { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 11px 13px; display: flex; flex-direction: column; justify-content: center; }
.finance-side span { font-size: 18px; font-weight: 800; }
.finance-side small { font-size: 10.5px; color: var(--faint); }
.budget-layout, .finance-detail-grid, .data-columns { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; margin-bottom: 10px; }
.budget-bars { display: flex; flex-direction: column; gap: 8px; }
.budget-bar > div { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 4px; }
.budget-bar b { color: var(--text); }
.budget-bar i { display: block; height: 7px; border-radius: 999px; background: var(--accent); }
.budget-bar.blue i { background: var(--blue); }
.budget-bar.amber i { background: var(--amber); }
.budget-bar.green i { background: var(--green); }
.budget-note h3, .sheet-card h3 { font-size: 14px; margin: 0 0 6px; }
.budget-note p { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.mini-metric { border: 1px solid var(--line); border-radius: var(--r-s); padding: 9px 12px; background: var(--surface-2); }
.mini-metric strong { font-size: 17px; color: var(--accent); font-weight: 800; }
.mini-metric span { display: block; font-size: 10.5px; color: var(--faint); margin-top: 2px; }

/* research */
.research-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.research-card { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 12px 13px; display: flex; flex-direction: column; gap: 5px; }
.research-card span { font-size: 9px; font-weight: 700; letter-spacing: .12em; color: var(--faint); }
.research-card strong { font-size: 13px; }
.research-card p { margin: 0; font-size: 11px; color: var(--faint); flex: 1; line-height: 1.45; }
.research-card button { font-size: 11px; color: var(--blue); font-weight: 600; text-align: left; padding: 0; }

/* data */
.entity-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.entity-cloud span { font-size: 11px; font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--blue); background: var(--blue-dim); border: 1px solid rgba(100, 169, 255, .3); border-radius: 999px; padding: 3px 10px; }
.threshold-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.threshold-list > div { border: 1px solid var(--line); border-radius: var(--r-s); padding: 9px 11px; background: var(--surface-2); }
.threshold-list strong { display: block; font-size: 17px; font-weight: 800; color: var(--accent); }
.threshold-list span { font-size: 10.5px; color: var(--faint); }

/* regions */
.region-score-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 11px 14px; margin-bottom: 10px; flex-wrap: wrap; }
.region-score-banner strong { font-size: 13px; font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--accent); }
.region-score-banner div span { display: block; font-size: 11px; color: var(--faint); margin-top: 2px; }
.region-score-banner button { font-size: 11.5px; color: var(--blue); font-weight: 600; }

/* roadmap */
.roadmap-line { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.roadmap-item { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 11px 12px; position: relative; }
.roadmap-item span { font-size: 9.5px; font-weight: 700; letter-spacing: .1em; color: var(--faint); }
.roadmap-item strong { display: block; font-size: 13px; margin: 3px 0; }
.roadmap-item p { margin: 0; font-size: 11px; color: var(--faint); line-height: 1.45; }
.roadmap-item.final { border-color: rgba(56, 219, 208, .45); background: linear-gradient(150deg, rgba(56, 219, 208, .1), var(--surface)); }
.go-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-bottom: 10px; }
.go-grid > div { border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 10px; background: var(--surface-2); }
.go-grid span { font-size: 9px; font-weight: 800; color: var(--red); }
.go-grid b { display: block; font-size: 11.5px; margin: 2px 0 1px; }
.go-grid small { font-size: 9.5px; color: var(--faint); line-height: 1.3; display: block; }
.no-go-note { border: 1px solid rgba(255, 122, 118, .3); background: rgba(255, 122, 118, .07); border-radius: var(--r-s); padding: 9px 12px; font-size: 11.5px; color: var(--muted); }

/* diagrams */
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.filter-chip { font-size: 11.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; transition: .13s; }
.filter-chip:hover { color: var(--text); border-color: var(--line-strong); }
.filter-chip.active { background: var(--accent-dim); border-color: rgba(56, 219, 208, .45); color: var(--accent); }
.dg-panel { display: none; }
.dg-panel.active { display: block; }
.diagram-wrap { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 10px; margin-bottom: 10px; }
.diagram-wrap svg { width: 100%; height: auto; display: block; }
.gates-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 10px; }
.gate-chip { text-align: left; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); padding: 9px 11px; font-size: 11px; color: var(--muted); line-height: 1.4; transition: .13s; display: flex; gap: 8px; align-items: baseline; }
.gate-chip b { color: var(--accent); font-size: 11px; flex: none; }
.gate-chip:hover, .gate-chip.sel { border-color: var(--accent); color: var(--text); background: var(--accent-dim); }
.dg-detail { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-s); background: var(--surface); padding: 11px 14px; margin-bottom: 12px; }
.dg-detail b { font-size: 13px; }
.dg-detail p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

/* decision */
.decision-layout { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; margin-bottom: 10px; }
.decision-copy, .decision-card { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 14px 16px; }
.decision-list { display: flex; flex-direction: column; gap: 7px; }
.decision-list > div { display: grid; grid-template-columns: 26px 1fr; gap: 9px; align-items: start; font-size: 12.5px; color: var(--muted); }
.decision-list span { font-size: 10px; font-weight: 800; color: var(--accent); background: var(--accent-dim); border-radius: 6px; text-align: center; padding: 3px 0; margin-top: 1px; }
.decision-list p { margin: 0; }
.decision-card blockquote { margin: 0 0 12px; font-size: 13px; line-height: 1.55; border-left: 3px solid var(--accent); padding-left: 12px; }
.closing-band { display: flex; align-items: center; gap: 14px; border: 1px solid rgba(56, 219, 208, .35); border-radius: var(--r-m); background: linear-gradient(120deg, rgba(56, 219, 208, .1), transparent 60%), var(--surface); padding: 13px 16px; margin-bottom: 12px; }
.closing-band strong { font-size: 15px; color: var(--accent); white-space: nowrap; }
.closing-band span { font-size: 12px; color: var(--muted); }

/* ---------- documents page ---------- */
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 14px 0 10px; }
.page-intro h1 { font-size: 22px; margin: 0; font-weight: 800; letter-spacing: -.01em; }
.page-intro .eyebrow { margin-bottom: 4px; }
.intro-count { text-align: right; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 8px 14px; flex: none; }
.intro-count strong { display: block; font-size: 19px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.intro-count span { font-size: 10.5px; color: var(--faint); }
.catalog-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 9px 12px; margin-bottom: 8px; }
.catalog-toolbar .filter-chips { flex: 1 1 380px; }
.local-search { display: flex; align-items: center; gap: 7px; padding: 5px 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; color: var(--faint); min-width: 210px; }
.local-search:focus-within { border-color: rgba(56, 219, 208, .45); }
.local-search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font-size: 12px; min-width: 120px; }
.catalog-hint { margin: 0 0 10px; font-size: 11px; color: var(--faint); }
.document-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.doc-card {
  display: flex; align-items: center; gap: 11px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface);
  padding: 10px 12px; transition: .13s; cursor: pointer;
}
.doc-card:hover { border-color: rgba(56, 219, 208, .5); transform: translateY(-1px); background: var(--surface-2); }
.file-type {
  flex: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  font-size: 9px; font-weight: 800; letter-spacing: .04em;
}
.file-type.md { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(56, 219, 208, .3); }
.file-type.pdf, .file-type.visual { background: rgba(255, 122, 118, .12); color: #ff9d99; border: 1px solid rgba(255, 122, 118, .3); }
.file-type.data { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(100, 169, 255, .3); }
.doc-info { flex: 1; min-width: 0; }
.doc-heading { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 2px; }
.doc-title { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.doc-scope, .doc-status { font-size: 8.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--faint); white-space: nowrap; }
.doc-card.canon .doc-scope { color: var(--accent); border-color: rgba(56, 219, 208, .4); background: var(--accent-dim); }
.doc-card.workbench .doc-scope { color: var(--blue); border-color: rgba(100, 169, 255, .4); background: var(--blue-dim); }
.doc-card.archive { opacity: .62; }
.doc-card.archive:hover { opacity: 1; }
.doc-card.archive .doc-scope { color: var(--amber); border-color: rgba(255, 180, 84, .35); }
.doc-purpose { margin: 0; font-size: 11px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-path { display: block; font-size: 9.5px; color: var(--faint); opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.doc-size { flex: none; font-size: 10px; color: var(--faint); }
.doc-arrow { flex: none; color: var(--faint); transition: .13s; }
.doc-card:hover .doc-arrow { color: var(--accent); transform: translateX(2px); }
.empty-state { padding: 26px; text-align: center; color: var(--faint); font-size: 13px; border: 1px dashed var(--line-strong); border-radius: var(--r-m); }
.empty-state h2 { margin: 0 0 6px; font-size: 16px; color: var(--text); }
.empty-state p { margin: 0 0 12px; }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }

/* ---------- reader ---------- */
.reader-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; position: sticky; top: 44px; background: linear-gradient(var(--bg) 80%, transparent); z-index: 30; }
.back-btn { font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; }
.back-btn:hover { color: var(--text); border-color: var(--line-strong); }
.reader-meta { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.reader-meta strong { font-size: 12px; color: var(--muted); font-family: ui-monospace, "SF Mono", Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.download-btn { font-size: 12px; font-weight: 600; color: var(--accent); border: 1px solid rgba(56, 219, 208, .4); border-radius: 999px; padding: 6px 13px; }
.download-btn:hover { background: var(--accent-dim); text-decoration: none; }
.reader-surface { max-width: 860px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); padding: 26px 30px; margin-bottom: 30px; }
.reader-loading { color: var(--faint); padding: 30px 0; text-align: center; }
.reader-surface h1, .reader-surface h2, .reader-surface h3, .reader-surface h4 { line-height: 1.25; margin: 1.2em 0 .5em; }
.reader-surface h1 { font-size: 24px; margin-top: 0; }
.reader-surface h2 { font-size: 19px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.reader-surface h3 { font-size: 15.5px; }
.reader-surface p, .reader-surface li { font-size: 13.5px; color: #c6d2de; }
.reader-surface ul, .reader-surface ol { padding-left: 22px; }
.reader-surface blockquote { margin: 1em 0; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--accent-dim); border-radius: 0 var(--r-s) var(--r-s) 0; color: var(--muted); }
.reader-surface code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.reader-surface pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px 14px; overflow-x: auto; }
.reader-surface pre code { border: 0; padding: 0; background: none; }
.reader-surface table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 1em 0; }
.reader-surface th, .reader-surface td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; }
.reader-surface th { background: var(--surface-2); font-size: 11px; }
.reader-surface hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.reader-surface a { color: var(--blue); }

/* ---------- drawer ---------- */
.drawer-backdrop, .login-backdrop { position: fixed; inset: 0; background: rgba(3, 7, 14, .7); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: .2s; z-index: 90; }
.drawer-backdrop.open, .login-backdrop.open { opacity: 1; pointer-events: auto; }
.detail-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(520px, 94vw);
  background: var(--bg-side); border-left: 1px solid var(--line-strong);
  transform: translateX(102%); transition: transform .24s ease; z-index: 100;
  display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.detail-drawer.open { transform: none; }
.drawer-panel { display: flex; flex-direction: column; height: 100%; }
.drawer-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.drawer-top .eyebrow { margin: 0; }
.drawer-close { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); font-size: 15px; display: grid; place-items: center; }
.drawer-close:hover { color: var(--text); border-color: var(--line-strong); }
.drawer-content { padding: 16px 18px 26px; overflow-y: auto; flex: 1; }
.drawer-content h2 { font-size: 18px; margin: 0 0 10px; }
.drawer-content h3 { font-size: 13.5px; margin: 16px 0 7px; color: var(--accent); }
.drawer-content p, .drawer-content li { font-size: 12.5px; color: var(--muted); }
.drawer-content ol, .drawer-content ul { padding-left: 20px; }
.drawer-content blockquote { margin: 10px 0; padding: 8px 13px; border-left: 3px solid var(--amber); background: rgba(255, 180, 84, .07); border-radius: 0 var(--r-s) var(--r-s) 0; font-size: 12px; color: var(--muted); }
.drawer-table { width: 100%; border-collapse: collapse; font-size: 11.5px; margin: 8px 0; }
.drawer-table th, .drawer-table td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; }
.drawer-table th { background: var(--surface-2); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.drawer-doc {
  display: block; width: 100%; text-align: left; margin: 6px 0; font-size: 12px; font-weight: 600;
  color: var(--blue); border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 12px; transition: .13s;
}
.drawer-doc:hover { border-color: var(--blue); background: var(--blue-dim); }
.drawer-source { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11px; color: var(--faint); }
.drawer-source a { color: var(--blue); margin-right: 8px; }

/* ---------- login / feedback modals ---------- */
.login-modal {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 110;
  opacity: 0; pointer-events: none; transition: .2s;
}
.login-modal.open { opacity: 1; pointer-events: auto; }
.login-panel {
  width: min(380px, 92vw); background: var(--bg-side); border: 1px solid var(--line-strong);
  border-radius: var(--r-l); padding: 20px 22px; box-shadow: var(--shadow);
  transform: translateY(10px); transition: .2s;
}
.login-modal.open .login-panel { transform: none; }
.login-title { margin: 2px 0 4px; font-size: 19px; }
.login-sub { margin: 0 0 14px; font-size: 12px; color: var(--muted); }
.field { display: block; margin-bottom: 10px; }
.field span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 5px; }
.field input, .field textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-s);
  color: var(--text); font: inherit; font-size: 13px; padding: 9px 12px; outline: 0; transition: .15s; resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.login-error { margin: 0 0 10px; padding: 8px 12px; border-radius: var(--r-s); background: rgba(255, 122, 118, .12); border: 1px solid rgba(255, 122, 118, .35); color: var(--red); font-size: 12px; }
.login-btn { width: 100%; justify-content: center; }

/* ---------- fab / toast / preauth ---------- */
.fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 16px;
  background: linear-gradient(135deg, #3fe0d2, #23b8c9); color: #04241f; box-shadow: 0 8px 22px rgba(56, 219, 208, .35); transition: .15s;
}
.fab:hover { transform: translateY(-2px); }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px); z-index: 200;
  background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--text);
  font-size: 12.5px; padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: .22s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.preauth > *:not(script):not(style) { visibility: hidden !important; }
body.preauth::after {
  content: "КОПШ · проверка доступа…"; position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg); color: var(--muted); font: 600 14px/1.4 -apple-system, "Inter", Arial, sans-serif;
  letter-spacing: .08em; z-index: 2147483647;
}

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .workstream-grid, .research-grid, .gate-grid { grid-template-columns: repeat(2, 1fr); }
  .cycle-grid, .roadmap-line { grid-template-columns: repeat(2, 1fr); }
  .go-grid { grid-template-columns: repeat(3, 1fr); }
  .cover-grid { grid-template-columns: 1fr; }
  .showcase-card { max-width: 480px; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: min(300px, 86vw); z-index: 80;
    transform: translateX(-102%); transition: transform .22s; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .mobile-menu { display: block; }
  .main-content { padding: 0 16px 32px; }
  .document-list { grid-template-columns: 1fr; }
  .argument-grid, .problem-grid, .contour-grid, .law-layout, .decision-layout,
  .budget-layout, .finance-detail-grid, .data-columns, .gates-grid { grid-template-columns: 1fr; }
  .workspace-metrics, .evidence-strip { grid-template-columns: repeat(2, 1fr); }
  .finance-hero { grid-template-columns: 1fr; }
  .finance-side { grid-template-columns: repeat(3, 1fr); }
  .crumbs { display: none; }
  .reader-surface { padding: 18px 16px; }
}
@media (max-width: 560px) {
  .workspace-metrics, .evidence-strip, .cycle-grid, .roadmap-line, .go-grid,
  .workstream-grid, .research-grid, .gate-grid, .showcase-meta { grid-template-columns: 1fr 1fr; }
  .slide-strip { grid-template-columns: repeat(4, 1fr); }
  .global-search { display: none; }
  .top-actions .live-label { display: none; }
  .section-index { display: none; }
}

/* ---------- защита от копирования и водяной знак ---------- */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
.watermark {
  position: fixed; inset: 0; z-index: 70; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='300'%20height='150'%3E%3Ctext%20x='150'%20y='82'%20fill='rgba(158,224,222,0.09)'%20font-family='Arial,Helvetica,sans-serif'%20font-size='15'%20font-weight='700'%20letter-spacing='3'%20text-anchor='middle'%20transform='rotate(-28%20150%2075)'%3EConfidencial%20%C2%B7%20VB%3C/text%3E%3C/svg%3E");
  background-repeat: repeat;
}
.manifesto-section .section-index { font-size: 26px; }
.manifesto-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.manifesto-card { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 13px 14px; }
.manifesto-card span { font-size: 10px; font-weight: 800; color: var(--accent); letter-spacing: .1em; }
.manifesto-card h3 { font-size: 13px; margin: 5px 0 5px; line-height: 1.3; }
.manifesto-card p { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.manifesto-note { border: 1px solid rgba(56,219,208,.35); border-radius: var(--r-m); background: linear-gradient(120deg, rgba(56,219,208,.1), transparent 60%), var(--surface); padding: 12px 15px; font-size: 12px; color: var(--muted); line-height: 1.55; }
@media (max-width: 900px) { .manifesto-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .manifesto-grid { grid-template-columns: 1fr; } }
.manifesto-note strong { color: var(--text); }
.examples-sheet .sheet-heading { margin-bottom: 8px; }

/* ---------- мобильная вёрстка (iPhone) и навигация ---------- */
.app-shell { min-height: 100vh; min-height: 100dvh; }
.briefing-section, .briefing-cover { scroll-margin-top: 58px; }
.pdf-open-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pdf-open-bar .primary-btn, .pdf-open-bar .quiet-btn { font-size: 12.5px; }
button.slide-thumb { text-align: left; font: inherit; }
.region-score-banner strong { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .sidebar { height: 100vh; height: 100dvh; }
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
  .fab { bottom: max(22px, env(safe-area-inset-bottom)); right: max(22px, env(safe-area-inset-right)); }
  .sheet-card, .reader-surface { overflow-x: auto; }
  .evidence-table { min-width: 0; }
  .slide-strip { grid-template-columns: repeat(4, 1fr); }
  .manifesto-grid { grid-template-columns: 1fr 1fr; }
  .pdf-open-bar .primary-btn, .pdf-open-bar .quiet-btn { flex: 1; justify-content: center; }
}
