/* Pre-Mortem Analysis - design system
   Tokens → base → layout → components → public site → app shell → utilities */

:root {
  --navy-900: #121212;
  --navy-800: #1C1C1C;
  --navy-700: #2B2B2B;
  --navy-500: #595959;
  --slate-600: #4D4D4D;
  --slate-400: #8E8E8E;
  --paper: #F7F6F4;
  --white: #FFFFFF;
  --sand: #EEECE8;
  --sand-2: #E3E0DB;
  --line: #DDD9D2;
  --amber-100: #F9E4E1;
  --amber-300: #F2A69D;
  --amber-500: #B3261E;
  --amber-700: #9E1F17;
  --green-700: #2F7357;
  --red-700: #A8331F;
  --risk-none: #D0D0D0;
  --risk-low: #3C8D6E;
  --risk-medium: #D9A400;
  --risk-high: #E0782F;
  --risk-critical: #C2412D;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  --r1: 6px; --r2: 10px; --r3: 16px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --shadow-1: 0 1px 2px rgba(14, 26, 43, .06), 0 1px 1px rgba(14, 26, 43, .04);
  --shadow-2: 0 8px 24px rgba(14, 26, 43, .08), 0 2px 6px rgba(14, 26, 43, .05);
  --shadow-3: 0 24px 60px rgba(14, 26, 43, .16);
  --container: 1180px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6;
  color: var(--navy-900); background: var(--paper);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; display: inline-block; }
a { color: var(--amber-700); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--navy-900); }
h1, h2, h3, h4 { line-height: 1.12; margin: 0 0 var(--s4); letter-spacing: -0.02em; font-weight: 800; color: var(--navy-900); }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 var(--s4); }
ul, ol { padding-left: 1.25em; margin: 0 0 var(--s4); }
li { margin-bottom: var(--s1); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s6) 0; }
code { background: var(--sand); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
blockquote { margin: var(--s5) 0; padding: var(--s4) var(--s5); border-left: 3px solid var(--amber-500); background: var(--white); border-radius: 0 var(--r2) var(--r2) 0; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 3px solid var(--amber-500); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--amber-500); color: #fff; }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: var(--navy-900); color: #fff; padding: 10px 16px; border-radius: var(--r1); }
.skip-link:focus { left: 8px; color: #fff; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- layout */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s4); }
@media (min-width: 720px) { .container { padding: 0 var(--s5); } }
.narrow { max-width: 760px; }
.section { padding: var(--s8) 0; }
@media (min-width: 900px) { .section { padding: var(--s9) 0; } }
.section-sand { background: var(--sand); }
.section-dark { background: var(--navy-900); color: #E2E2E2; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark a:not(.btn) { color: var(--amber-300); }
.section-head { max-width: 720px; margin-bottom: var(--s7); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--amber-700); margin-bottom: var(--s3); }
.section-dark .eyebrow { color: var(--amber-300); }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.lead { font-size: 1.15rem; color: var(--slate-600); }
.section-dark .lead { color: #C4C4C4; }
.grid { display: grid; gap: var(--s5); }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.split { display: grid; gap: var(--s7); align-items: center; }
@media (min-width: 960px) { .split { grid-template-columns: 1.05fr .95fr; } .split.reverse > :first-child { order: 2; } }
.stack > * + * { margin-top: var(--s4); }
.row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.row.between { justify-content: space-between; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: var(--s7); font-size: 1.6rem; }
.prose h3 { margin-top: var(--s6); }
.prose p, .prose li { color: #2B3A50; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: var(--r1); border: 1px solid transparent;
  font: 600 .95rem/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s, color .15s, border-color .15s;
}
.btn .icon { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--amber-500); color: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 6px 16px rgba(179, 38, 30, .25); }
.btn-primary:hover { background: #C93A2E; color: #fff; }
.btn-dark { background: var(--navy-900); color: #fff; }
.btn-dark:hover { background: var(--navy-700); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy-900); border-color: #CFC5B5; }
.btn-ghost:hover { background: var(--white); color: var(--navy-900); border-color: var(--navy-900); }
.section-dark .btn-ghost, .hero .btn-ghost-light { color: #fff; border-color: rgba(255, 255, 255, .35); }
.section-dark .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; border-color: #fff; }
.btn-danger { background: #fff; color: var(--red-700); border-color: #E7B9AF; }
.btn-danger:hover { background: #FCEDEA; color: var(--red-700); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--amber-700); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- cards, badges, alerts */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s5); box-shadow: var(--shadow-1); }
.card-lg { padding: var(--s6); border-radius: var(--r3); }
.card h3 { margin-bottom: var(--s2); }
.card p:last-child { margin-bottom: 0; }
.card-link { display: block; text-decoration: none; color: inherit; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: #D6CBB9; color: inherit; }
.card-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--amber-100); color: var(--amber-700); margin-bottom: var(--s4); }
.card-icon .icon { width: 22px; height: 22px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--sand); color: var(--navy-700); line-height: 1.6; white-space: nowrap; }
.badge-placeholder { background: #FFF4D6; color: #7A4B00; border: 1px dashed #E0B254; }
.badge-free { background: #E3F1EA; color: var(--green-700); }
.badge-locked { background: #EFEFEF; color: var(--navy-500); }
.badge-amber { background: var(--amber-100); color: var(--amber-700); }
.badge-low { background: #E3F1EA; color: #245C45; }
.badge-medium { background: #FBF0C9; color: #6F5400; }
.badge-high { background: #FCE6D6; color: #8A3F0A; }
.badge-critical { background: #F8DCD6; color: #8E2414; }
.badge-none { background: #EFEFEF; color: var(--navy-500); }
.flash-stack { margin-bottom: var(--s4); }
.alert { padding: var(--s3) var(--s4); border-radius: var(--r1); border: 1px solid; margin-bottom: var(--s4); display: flex; gap: var(--s3); align-items: flex-start; }
.alert .icon { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.alert-success { background: #ECF6F1; border-color: #BFDDCE; color: #1F513C; }
.alert-error { background: #FCEEEB; border-color: #EDC1B8; color: #7D2516; }
.alert-info { background: #F2F2F2; border-color: #D6D6D6; color: #2B2B2B; }
.alert-warning { background: #FFF6E5; border-color: #F0D49B; color: #6B4300; }
.notice-provisional { border: 1px dashed #E0B254; background: #FFFAEE; color: #6B4300; border-radius: var(--r2); padding: var(--s3) var(--s4); font-size: .92rem; display: flex; gap: var(--s3); align-items: flex-start; }
.notice-provisional .icon { width: 18px; height: 18px; flex: none; margin-top: 3px; }

/* ---------------------------------------------------------------- forms */
.field { margin-bottom: var(--s4); }
.field label, .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; color: var(--navy-900); }
.field .hint { font-size: .85rem; color: var(--slate-600); margin: 4px 0 0; }
.field-error { color: var(--red-700); font-size: .86rem; margin: 6px 0 0; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #CFC5B5; border-radius: var(--r1);
  background: #fff; color: var(--navy-900); font: 400 1rem/1.45 var(--font); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(179, 38, 30, .35); }
[aria-invalid=true] { border-color: var(--red-700) !important; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; margin-bottom: var(--s3); }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--navy-900); flex: none; }
.form-grid { display: grid; gap: 0 var(--s5); }
@media (min-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: span 2; } }
.form-actions { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; margin-top: var(--s5); }
.input-inline { display: flex; gap: var(--s2); }
.input-inline input { flex: 1; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale label { position: relative; display: block; margin: 0; }
.scale input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.scale span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; padding: 6px 4px; border: 1px solid #CFC5B5; border-radius: var(--r1); background: #fff; font-size: .75rem; text-align: center; line-height: 1.2; color: var(--slate-600); transition: all .15s; }
.scale span b { font-size: 1.05rem; color: var(--navy-900); }
.scale input:checked + span { background: var(--navy-900); border-color: var(--navy-900); color: #E2E2E2; }
.scale input:checked + span b { color: #fff; }
.scale input:focus-visible + span { outline: 3px solid var(--amber-500); outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 0 0 var(--s4); }
legend { font-weight: 600; font-size: .92rem; margin-bottom: 6px; padding: 0; }

/* ---------------------------------------------------------------- header / nav */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(247, 246, 244, .92); backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: var(--s4); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy-900); font-weight: 750; letter-spacing: -0.02em; font-size: 1.08rem; }
.brand:hover { color: var(--navy-900); }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font-weight: 500; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--slate-600); line-height: 1; margin-top: 2px; }
.nav-links { display: none; list-style: none; margin: 0; padding: 0; gap: 2px; }
.nav-links a { display: block; padding: 10px 12px; border-radius: var(--r1); text-decoration: none; color: var(--navy-700); font-weight: 550; font-size: .95rem; }
.nav-links a:hover, .nav-links a[aria-current=page] { color: var(--navy-900); background: var(--sand); }
.nav-cta { display: none; gap: var(--s2); align-items: center; }
.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r1); border: 1px solid var(--line); background: #fff; color: var(--navy-900); cursor: pointer; }
.nav-toggle .icon { width: 22px; height: 22px; }
.mobile-menu { display: none; border-top: 1px solid var(--line); background: var(--paper); padding: var(--s4) 0 var(--s5); }
.mobile-menu.is-open { display: block; }
.mobile-menu a:not(.btn) { display: block; padding: 12px 4px; text-decoration: none; color: var(--navy-900); font-weight: 600; border-bottom: 1px solid var(--line); }
.mobile-menu .row { margin-top: var(--s4); }
@media (min-width: 1040px) {
  .nav-links, .nav-cta { display: flex; }
  .nav-toggle, .mobile-menu, .mobile-menu.is-open { display: none; }
}

/* ---------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; padding: var(--s7) 0 var(--s8); }
@media (min-width: 900px) { .hero { padding: var(--s8) 0 var(--s9); } }
.hero::before { content: ""; position: absolute; right: -240px; top: -200px; width: 720px; height: 720px; border-radius: 50%; background: radial-gradient(circle, rgba(179, 38, 30, .10), rgba(179, 38, 30, 0) 65%); pointer-events: none; }
.hero h1 { max-width: 17ch; text-transform: uppercase; font-weight: 900; letter-spacing: -0.01em; line-height: .98; font-size: clamp(2.3rem, 5.2vw, 4.2rem); }
.hero h1::after { content: ""; display: block; width: 72px; height: 4px; background: var(--amber-500); margin-top: var(--s4); }
.hero h1 em { font-style: normal; color: var(--amber-700); position: relative; white-space: nowrap; }
.hero .lead { max-width: 56ch; font-size: 1.2rem; margin-bottom: var(--s6); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.hero-meta { display: flex; flex-wrap: wrap; gap: var(--s5); margin-top: var(--s6); color: var(--slate-600); font-size: .92rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta .icon { width: 18px; height: 18px; color: var(--green-700); }
.timeline-visual { position: relative; background: var(--navy-900); color: #E2E2E2; border-radius: var(--r3); padding: var(--s6); box-shadow: var(--shadow-3); overflow: hidden; }
.timeline-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(179, 38, 30, .10), transparent 40%); pointer-events: none; }
.tl-row { display: flex; align-items: center; justify-content: space-between; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: #9C9C9C; }
.tl-line { position: relative; height: 2px; background: linear-gradient(90deg, #444444, var(--amber-500)); margin: var(--s4) 0 var(--s5); border-radius: 2px; }
.tl-line::before, .tl-line::after { content: ""; position: absolute; top: -5px; width: 12px; height: 12px; border-radius: 50%; }
.tl-line::before { left: 0; background: #9C9C9C; }
.tl-line::after { right: 0; background: var(--amber-500); box-shadow: 0 0 0 6px rgba(179, 38, 30, .2); }
.tl-headline { font-family: var(--font-serif); font-style: italic; font-size: 1.35rem; line-height: 1.35; color: #fff; margin-bottom: var(--s4); }
.tl-causes { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tl-causes li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--r1); padding: 10px 12px; font-size: .92rem; margin: 0; }
.tl-causes .score { font-weight: 700; font-size: .8rem; padding: 2px 8px; border-radius: 999px; color: var(--navy-900); }

/* ---------------------------------------------------------------- steps */
.steps-3 { counter-reset: step; }
.step-card { position: relative; padding-top: var(--s6); }
.step-card .num { position: absolute; top: -18px; left: var(--s5); width: 40px; height: 40px; border-radius: 50%; background: var(--navy-900); color: var(--amber-300); display: grid; place-items: center; font-weight: 750; box-shadow: 0 0 0 6px var(--paper); }
.section-sand .step-card .num { box-shadow: 0 0 0 6px var(--sand); }

.method-steps { list-style: none; padding: 0; margin: 0; position: relative; }
.method-steps::before { content: ""; position: absolute; left: 23px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--line), var(--amber-300)); }
.method-step { position: relative; padding-left: 72px; margin-bottom: var(--s7); }
.method-step .num { position: absolute; left: 0; top: 0; width: 48px; height: 48px; border-radius: 50%; background: var(--white); border: 2px solid var(--navy-900); display: grid; place-items: center; font-weight: 800; color: var(--navy-900); }
.method-step .num .icon { width: 22px; height: 22px; }
.method-step .card { margin-top: var(--s3); }
.method-step .example { background: var(--sand); border-radius: var(--r1); padding: var(--s4); font-size: .95rem; margin-top: var(--s4); }
.method-step .example p:last-child { margin: 0; }
.step-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.step-nav a { padding: 6px 12px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); text-decoration: none; color: var(--navy-700); font-size: .85rem; font-weight: 600; }
.step-nav a:hover { border-color: var(--navy-900); color: var(--navy-900); }

/* ---------------------------------------------------------------- book */
.book-cover { position: relative; aspect-ratio: 2 / 3; max-width: 320px; margin: 0 auto; border-radius: 4px 12px 12px 4px; background: linear-gradient(160deg, var(--navy-800), var(--navy-900) 60%); color: #fff; padding: 36px 30px; box-shadow: var(--shadow-3), inset 6px 0 0 rgba(255, 255, 255, .06); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; transform: perspective(1200px) rotateY(-8deg); transition: transform .4s var(--ease); }
.book-cover:hover { transform: perspective(1200px) rotateY(-2deg); }
.book-cover::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; border: 2px solid rgba(179, 38, 30, .5); }
.book-cover .bc-title { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.book-cover .bc-sub { color: #C4C4C4; font-size: .9rem; margin-top: 12px; }
.book-cover .bc-author { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--amber-300); }
.book-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.book-cover-wrap { text-align: center; }
.details-list { display: grid; grid-template-columns: auto 1fr; gap: 8px var(--s5); margin: 0; }
.details-list dt { color: var(--slate-600); font-size: .9rem; }
.details-list dd { margin: 0; font-weight: 600; }
.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: 30px; margin-bottom: 10px; }
.check-list li::before { content: ""; position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border-radius: 50%; background: var(--amber-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A65A00' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat; }
.chapter-list { list-style: none; counter-reset: ch; padding: 0; }
.chapter-list li { counter-increment: ch; display: grid; grid-template-columns: 48px 1fr; gap: var(--s3); padding: var(--s4) 0; border-bottom: 1px solid var(--line); margin: 0; }
.chapter-list li::before { content: counter(ch, decimal-leading-zero); font-weight: 800; color: var(--amber-700); font-size: 1.1rem; }
.quote-card { font-family: var(--font-serif); font-size: 1.15rem; }
.quote-card footer { font-family: var(--font); font-size: .9rem; color: var(--slate-600); margin-top: var(--s3); }

/* ---------------------------------------------------------------- dashboard preview (homepage) */
.preview { background: var(--white); border-radius: var(--r3); border: 1px solid var(--line); box-shadow: var(--shadow-3); overflow: hidden; }
.preview-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--sand); border-bottom: 1px solid var(--line); font-size: .78rem; color: var(--slate-600); }
.preview-bar i { width: 10px; height: 10px; border-radius: 50%; background: #D6CBB9; display: inline-block; }
.preview-body { display: grid; gap: var(--s4); padding: var(--s5); }
@media (min-width: 720px) { .preview-body { grid-template-columns: 1.1fr .9fr; } }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-stats div { background: var(--paper); border-radius: var(--r1); padding: 10px; font-size: .72rem; color: var(--slate-600); }
.mini-stats b { display: block; font-size: 1.3rem; color: var(--navy-900); }

/* ---------------------------------------------------------------- risk matrix */
.matrix-wrap { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: 1fr auto; gap: 6px; }
.matrix-y { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--slate-600); }
.matrix-x { grid-column: 2; text-align: center; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--slate-600); }
.matrix { display: grid; grid-template-columns: 64px repeat(5, 1fr); grid-auto-rows: minmax(78px, auto); gap: 4px; }
.matrix.mini { grid-template-columns: 22px repeat(5, 1fr); grid-auto-rows: 44px; gap: 3px; }
.matrix .axis { display: flex; align-items: center; justify-content: center; text-align: center; font-size: .7rem; color: var(--slate-600); line-height: 1.15; padding: 2px; }
.matrix .axis b { display: block; color: var(--navy-900); font-size: .85rem; }
.matrix .cell { border-radius: 6px; padding: 5px; display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; position: relative; min-width: 0; }
.matrix .cell .cell-score { position: absolute; right: 6px; bottom: 4px; font-size: .68rem; font-weight: 700; opacity: .55; }
.cell.b-low { background: #E3F1EA; } .cell.b-medium { background: #FBF0C9; } .cell.b-high { background: #FCE2CF; } .cell.b-critical { background: #F6D3CB; }
.chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 8px; border-radius: 999px; background: #fff; border: 1px solid rgba(14, 26, 43, .14); font-size: .74rem; font-weight: 600; color: var(--navy-900); text-decoration: none; line-height: 1.3; box-shadow: var(--shadow-1); transition: transform .12s, box-shadow .12s; }
.chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); color: var(--navy-900); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.chip.is-priority { border-color: var(--navy-900); border-width: 2px; }
.matrix.mini .chip { padding: 0; width: 14px; height: 14px; border-radius: 50%; }
.matrix.mini .chip .t, .matrix.mini .cell-score { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s3); font-size: .82rem; color: var(--slate-600); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.score-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: .8rem; }
.score-pill.b-low { background: var(--risk-low); color: #fff; } .score-pill.b-medium { background: var(--risk-medium); color: var(--navy-900); }
.score-pill.b-high { background: var(--risk-high); color: #fff; } .score-pill.b-critical { background: var(--risk-critical); color: #fff; }
.score-pill.b-none { background: var(--risk-none); color: var(--navy-900); }
@media (max-width: 640px) { .matrix { grid-template-columns: 34px repeat(5, 1fr); grid-auto-rows: minmax(56px, auto); } .matrix .axis span { display: none; } .chip .t { display: none; } .chip { padding: 4px; } }

/* ---------------------------------------------------------------- quick scan */
.qs-question { padding: var(--s5) 0; border-bottom: 1px solid var(--line); }
.qs-question:last-of-type { border-bottom: 0; }
.qs-question h3 { font-size: 1.08rem; font-weight: 650; line-height: 1.4; }
.qs-num { font-size: .78rem; font-weight: 700; letter-spacing: .1em; color: var(--amber-700); text-transform: uppercase; }
.gauge { position: relative; width: 180px; height: 180px; margin: 0 auto; }
.gauge svg { transform: rotate(-90deg); }
.gauge .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge .val b { display: block; font-size: 2.6rem; letter-spacing: -0.04em; line-height: 1; }
.gauge .val small { color: var(--slate-600); font-size: .8rem; }
.bar { height: 10px; border-radius: 999px; background: var(--sand-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--navy-700); transition: width .8s var(--ease); }
.bar-row { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 44px; gap: var(--s3); align-items: center; font-size: .92rem; margin-bottom: 10px; }
.bar-row b { text-align: right; font-size: .85rem; }
@media (max-width: 560px) { .bar-row { grid-template-columns: 1fr 44px; } .bar-row .bar { grid-column: 1 / -1; grid-row: 2; } }

/* ---------------------------------------------------------------- resources */
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; margin-bottom: var(--s6); }
.filter-bar .field { margin: 0; flex: 1 1 180px; }
.resource-card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--s3); }
.resource-card h3 { font-size: 1.12rem; }
.resource-card p { color: var(--slate-600); font-size: .95rem; }
.locked-box { text-align: center; padding: var(--s6); border: 1px dashed #CFC5B5; border-radius: var(--r2); background: var(--white); }
.video-embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r2); overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------------------------------------------------------------- FAQ */
.faq details { background: var(--white); border: 1px solid var(--line); border-radius: var(--r2); margin-bottom: var(--s3); transition: box-shadow .2s; }
.faq details[open] { box-shadow: var(--shadow-2); }
.faq summary { list-style: none; cursor: pointer; padding: var(--s4) var(--s5); font-weight: 650; display: flex; justify-content: space-between; gap: var(--s4); align-items: center; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; font-weight: 400; color: var(--amber-700); transition: transform .2s; flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 var(--s5) var(--s4); color: var(--slate-600); }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--navy-900); color: #B0B0B0; padding: var(--s8) 0 var(--s5); font-size: .94rem; }
.site-footer a { color: #E2E2E2; text-decoration: none; }
.site-footer a:hover { color: var(--amber-300); text-decoration: underline; }
.site-footer h4 { color: #fff; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: var(--s4); }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: 10px; }
.footer-grid { display: grid; gap: var(--s6); }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: var(--s7); padding-top: var(--s5); display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between; font-size: .85rem; }
.site-footer .brand { color: #fff; }
.site-footer .brand small { color: #9C9C9C; }
.newsletter-form { display: flex; gap: var(--s2); flex-wrap: wrap; }
.newsletter-form input[type=email] { flex: 1 1 220px; }
.section-dark .newsletter-form input[type=email], .site-footer input[type=email] { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .25); color: #fff; }
.section-dark .check, .site-footer .check { color: #C4C4C4; font-size: .85rem; }

/* ---------------------------------------------------------------- cookie banner */
.cookie-banner { position: fixed; left: var(--s4); right: var(--s4); bottom: var(--s4); z-index: 100; max-width: 560px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow-3); padding: var(--s5); }
.cookie-banner[hidden] { display: none; }
.cookie-banner p { font-size: .92rem; color: var(--slate-600); }

/* ---------------------------------------------------------------- auth pages */
.auth-wrap { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: var(--s7) var(--s4); }
.auth-card { width: 100%; max-width: 460px; }
.auth-card h1 { font-size: 1.9rem; }
.auth-alt { text-align: center; margin-top: var(--s5); font-size: .95rem; color: var(--slate-600); }
.pw-meter { height: 4px; border-radius: 2px; background: var(--sand-2); margin-top: 6px; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; background: var(--risk-critical); transition: width .2s, background .2s; }

/* ---------------------------------------------------------------- app shell (dashboard & admin) */
.app-body { background: #F4F3F1; }
.app-shell { display: grid; min-height: 100vh; }
@media (min-width: 1040px) { .app-shell { grid-template-columns: 260px 1fr; } }
.sidebar { background: var(--navy-900); color: #B0B0B0; padding: var(--s5) var(--s4); display: none; flex-direction: column; gap: var(--s5); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar.is-open { display: flex; position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 80; box-shadow: var(--shadow-3); }
@media (min-width: 1040px) { .sidebar { display: flex; } .sidebar.is-open { position: sticky; width: auto; box-shadow: none; } }
.admin-body .sidebar { background: var(--navy-700); }
.sidebar .brand { color: #fff; padding: 0 var(--s2); }
.sidebar .brand small { color: #9C9C9C; }
.side-nav { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.side-nav .group { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: #8A8A8A; padding: var(--s4) var(--s3) var(--s2); }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r1); color: #D4D4D4; text-decoration: none; font-weight: 550; font-size: .94rem; }
.side-nav a .icon { width: 19px; height: 19px; opacity: .85; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav a[aria-current=page] { background: rgba(179, 38, 30, .14); color: #fff; box-shadow: inset 3px 0 0 var(--amber-500); }
.side-foot { margin-top: auto; font-size: .82rem; }
.side-foot .level { display: block; background: rgba(255, 255, 255, .06); padding: var(--s3); border-radius: var(--r1); color: #E2E2E2; }
.side-foot .level b { color: var(--amber-300); }
.app-main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 12px var(--s4); background: rgba(244, 243, 241, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
@media (min-width: 720px) { .topbar { padding: 12px var(--s6); } }
.topbar .menu-btn { display: inline-flex; }
@media (min-width: 1040px) { .topbar .menu-btn { display: none; } }
.topbar .user { display: flex; align-items: center; gap: var(--s3); font-size: .9rem; color: var(--slate-600); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy-900); color: var(--amber-300); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.app-content { padding: var(--s5) var(--s4) var(--s8); max-width: 1240px; }
@media (min-width: 720px) { .app-content { padding: var(--s6) var(--s6) var(--s8); } }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--s4); margin-bottom: var(--s6); }
.page-head h1 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--slate-600); }
.breadcrumb { font-size: .85rem; color: var(--slate-600); margin-bottom: var(--s2); }
.breadcrumb a { color: var(--slate-600); }
.stat-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(2, 1fr); margin-bottom: var(--s6); }
@media (min-width: 1000px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s4) var(--s5); }
.stat .k { font-size: .8rem; color: var(--slate-600); font-weight: 600; }
.stat .v { font-size: 2rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1.2; }
.stat .s { font-size: .8rem; color: var(--slate-600); }
.stat.warn .v { color: var(--red-700); }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r2); margin-bottom: var(--s5); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { font-size: 1.05rem; margin: 0; }
.panel-body { padding: var(--s5); }
.panel-body.flush { padding: 0; }
.dash-grid { display: grid; gap: var(--s5); }
@media (min-width: 1100px) { .dash-grid { grid-template-columns: 1.4fr 1fr; } }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; font-size: .93rem; }
.table th { text-align: left; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-600); font-weight: 700; padding: 10px var(--s4); border-bottom: 1px solid var(--line); white-space: nowrap; background: #FCFAF7; }
.table td { padding: 12px var(--s4); border-bottom: 1px solid #EFE9DF; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FCFAF7; }
.table .actions { white-space: nowrap; text-align: right; }
.table a.title { font-weight: 650; color: var(--navy-900); text-decoration: none; }
.table a.title:hover { color: var(--amber-700); text-decoration: underline; }
.empty { text-align: center; padding: var(--s7) var(--s5); color: var(--slate-600); }
.empty .icon { width: 40px; height: 40px; color: var(--slate-400); margin-bottom: var(--s3); }
.empty h3 { color: var(--navy-900); }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain > li { padding: 12px var(--s5); border-bottom: 1px solid #EFE9DF; margin: 0; display: flex; justify-content: space-between; gap: var(--s3); align-items: center; }
.list-plain > li:last-child { border-bottom: 0; }
.muted { color: var(--slate-600); }
.small { font-size: .86rem; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: var(--s5); overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--slate-600); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current=page], .tabs a:hover { color: var(--navy-900); border-bottom-color: var(--amber-500); }
.progress { height: 6px; background: var(--sand-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--amber-500); }

/* stepper (analysis wizard) */
.stepper { list-style: none; padding: 0; margin: 0 0 var(--s6); display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; counter-reset: s; }
.stepper li { margin: 0; }
.stepper a { display: block; text-decoration: none; padding: 10px 6px 8px; border-top: 4px solid var(--sand-2); color: var(--slate-400); font-size: .78rem; font-weight: 650; text-align: left; }
.stepper a .n { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.stepper .done a { border-top-color: var(--navy-700); color: var(--navy-700); }
.stepper .current a { border-top-color: var(--amber-500); color: var(--navy-900); }
.stepper a:hover { color: var(--navy-900); }
@media (max-width: 760px) { .stepper a .l { display: none; } .stepper a { text-align: center; } }
.wizard-grid { display: grid; gap: var(--s5); }
@media (min-width: 1100px) { .wizard-grid { grid-template-columns: 1fr 320px; } .wizard-aside { position: sticky; top: 88px; align-self: start; } }
.guide { background: var(--navy-900); color: #D4D4D4; border-radius: var(--r2); padding: var(--s5); font-size: .93rem; }
.guide h3 { color: #fff; font-size: 1rem; }
.guide a { color: var(--amber-300); }
.autosave-status { font-size: .82rem; color: var(--slate-600); display: inline-flex; align-items: center; gap: 6px; min-height: 20px; }
.autosave-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--slate-400); }
.autosave-status[data-state=saving]::before { background: var(--amber-500); }
.autosave-status[data-state=saved]::before { background: var(--risk-low); }
.autosave-status[data-state=error]::before { background: var(--risk-critical); }
.risk-item { border: 1px solid var(--line); border-radius: var(--r2); background: #fff; margin-bottom: var(--s4); }
.risk-item > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s3); padding: var(--s4); flex-wrap: wrap; }
.risk-item > summary::-webkit-details-marker { display: none; }
.risk-item > summary .t { font-weight: 650; flex: 1 1 200px; }
.risk-item[open] > summary { border-bottom: 1px solid var(--line); }
.risk-item .body { padding: var(--s4) var(--s5) var(--s5); }
.cat-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.explain { font-size: .85rem; color: var(--slate-600); background: var(--paper); border-radius: var(--r1); padding: 8px 12px; }
.kanban { display: grid; gap: var(--s4); }
@media (min-width: 1000px) { .kanban { grid-template-columns: repeat(3, 1fr); } }
.kanban h3 { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-600); display: flex; justify-content: space-between; }
.action-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s4); margin-bottom: var(--s3); }
.action-card.overdue { border-left: 4px solid var(--risk-critical); }
.action-card .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .82rem; color: var(--slate-600); margin-top: 8px; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(14, 26, 43, .45); z-index: 70; }
.overlay.is-open { display: block; }
.level-card { border: 2px solid var(--line); }
.level-card.current { border-color: var(--amber-500); }
.code-input { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; font-size: 1.15rem !important; text-align: center; }
.codes-output { font-family: ui-monospace, Consolas, monospace; font-size: .95rem; min-height: 220px; }

/* ---------------------------------------------------------------- misc / utilities */
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; } .mt-4 { margin-top: var(--s4); } .mt-5 { margin-top: var(--s5); } .mt-6 { margin-top: var(--s6); } .mb-4 { margin-bottom: var(--s4); } .mb-5 { margin-bottom: var(--s5); }
.text-center { text-align: center; }
@media (min-width: 720px) { .col-span-2 { grid-column: span 2; } }
@media (min-width: 720px) and (max-width: 999px) { .grid-3 > .col-span-2 { grid-column: 1 / -1; } }
.nowrap { white-space: nowrap; }
.hide-sm { display: none; }
@media (min-width: 720px) { .hide-sm { display: initial; } }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
.error-page { text-align: center; padding: var(--s9) var(--s4); }
.error-page .code { font-size: 6rem; font-weight: 800; letter-spacing: -0.05em; color: var(--sand-2); line-height: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .book-cover { transform: none; }
}

@media print {
  .site-header, .site-footer, .sidebar, .topbar, .cookie-banner, .btn, form { display: none !important; }
  body, .app-body { background: #fff; }
}
