:root {
  color-scheme: light;
  --accent: #00665e;
  --accent-dark: #004d46;
  --accent-soft: #eaf3f1;
  --ink: #202a2c;
  --muted: #596467;
  --surface: #fff;
  --canvas: #f4f6f5;
  --line: #d9dfdd;
  --control-line: #818d89;
  --radius: 6px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 1rem/1.55 "Segoe UI", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, select, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
h1,h2,h3,p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.75rem, 2.5vw, 2.25rem); font-weight: 650; letter-spacing: -.025em; line-height: 1.2; text-wrap: balance; }
h2 { margin-bottom: 8px; font-size: 1.125rem; line-height: 1.4; font-weight: 650; }
h3 { font-size: 1rem; line-height: 1.5; }
p { margin-bottom: 16px; }
svg { width: 24px; height: 24px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 12px; background: var(--surface); border: 2px solid var(--accent); }
.skip-link:focus { top: 12px; }
.app-shell { display: grid; grid-template-columns: 236px minmax(0,1fr); min-height: 100dvh; }
.sidebar { display: flex; flex-direction: column; padding: 32px 16px 24px; border-right: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 8px; font-size: 1rem; font-weight: 650; line-height: 1.3; text-decoration: none; color: var(--ink); }
.brand svg { width: 36px; height: 36px; color: var(--accent); }
.brand-sub { display: block; color: var(--muted); font-weight: 400; font-size: .875rem; }
.sidebar-label { margin: 48px 12px 12px; color: var(--muted); font-size: .75rem; font-weight: 650; letter-spacing: .08em; }
nav { display: grid; gap: 8px; }
nav a { display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 12px; font-size: .875rem; color: var(--muted); text-decoration: none; border-radius: var(--radius); }
nav a svg { width: 20px; height: 20px; }
nav a:hover { background: var(--canvas); }
nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 650; }
.nav-count { margin-left: auto; font-size: .75rem; }
.sidebar-bottom { margin-top: auto; padding: 64px 12px 0; font-size: .875rem; }
.sidebar-bottom p { margin: 12px 0 0; }
.sidebar-bottom p span { color: var(--muted); }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.demo-tag { display: inline-block; border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; font-size: .75rem; font-weight: 600; color: var(--muted); letter-spacing: .025em; white-space: nowrap; }
.workspace { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; min-height: 72px; padding: 16px 40px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: .875rem; }
.topbar-secondary { color: var(--muted); margin-left: 8px; }
main { padding: 36px 40px 0; max-width: 1680px; margin: 0 auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.page-heading p:last-child { margin-bottom: 0; color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 1px solid transparent; border-radius: var(--radius); line-height: 1.4; font-size: .875rem; font-weight: 600; text-decoration: none; transition: background-color 120ms; }
.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.primary:hover { background: var(--accent-dark); color: #fff; }
.primary:active { background: var(--ink); }
.secondary { background: var(--surface); color: var(--ink); border-color: var(--control-line); }
.secondary:hover { background: var(--canvas); color: var(--accent-dark); }
.text-button { border: 0; background: none; color: var(--accent); min-height: 44px; padding: 8px; text-decoration: underline; text-underline-offset: 3px; font-size: .875rem; }
.overview-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 12px; }
.overview-heading h2 { font-size: 1rem; margin: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)) minmax(0,1.25fr) minmax(0,1.25fr); border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); margin-bottom: 20px; }
.kpi { min-width: 0; padding: 20px; border-right: 1px solid var(--line); }
.kpi:last-child { border: 0; }
.kpi-label { display: block; font-size: .875rem; color: var(--muted); }
.kpi-number { font-size: 2rem; font-weight: 600; line-height: 1.4; font-variant-numeric: tabular-nums; }
.kpi-hint { display: block; color: var(--muted); font-size: .75rem; }
.kpi-action { background: var(--accent-soft); }
.kpi-action .kpi-number { color: var(--accent); }
.orientation-note { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 28px; padding: 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); font-size: .875rem; }
.orientation-note svg { width: 20px; height: 20px; color: var(--accent); margin-top: 2px; }
.orientation-note p { margin: 0; flex: 1; }
.orientation-note>a { flex-shrink: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.panel-heading { padding: 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.panel-heading h2 { margin-bottom: 4px; }
.panel-heading p { margin: 0; }
.count-label { display: inline-block; padding: 0 7px; border-radius: 4px; background: var(--canvas); font-size: .875rem; margin-left: 4px; }
.export-links { display: flex; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 16px; padding: 0 24px 24px; }
.filters>div { flex: 1 1 148px; }
.filters>.search-field { flex: 2 1 240px; }
label { display: block; margin-bottom: 6px; font-size: .875rem; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid var(--control-line); border-radius: 4px; background: var(--surface); padding: 10px 12px; color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m6 8 4 4 4-4' fill='none' stroke='%23202a2c' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 20px; }
textarea { min-height: 96px; resize: vertical; }
.case-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
.case-table th { background: var(--canvas); color: var(--muted); font-size: .75rem; font-weight: 600; padding: 12px 16px; border-block: 1px solid var(--line); }
.case-table th:first-child, .case-table td:first-child { padding-left: 24px; }
.case-table th:last-child, .case-table td:last-child { padding-right: 24px; }
.case-table td { padding: 20px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.case-table tbody tr:last-child td { border-bottom: 0; }
.case-table tbody tr:hover { background: #fafcfb; }
.case-table td:first-child { width: 35%; }
.case-title { display: block; padding: 0; min-height: 32px; border: 0; background: none; text-align: left; color: var(--accent); font-weight: 600; font-size: .875rem; line-height: 1.5; }
.case-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.case-meta { display: block; color: var(--muted); font-size: .75rem; margin-top: 4px; }
.risk-badge, .status-badge { display: inline-block; padding: 3px 8px; border: 1px solid var(--line); border-radius: 4px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.risk-badge.prohibited, .status-badge.blocked { border-color: var(--ink); background: var(--ink); color: #fff; }
.risk-badge.high { border-color: var(--ink); color: var(--ink); }
.risk-badge.limited { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.risk-badge.minimal { background: var(--canvas); color: var(--muted); }
.status-badge { border-color: transparent; background: var(--canvas); font-weight: 400; }
.review-date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.overdue { color: var(--accent-dark); font-weight: 600; }
.table-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 16px 24px; color: var(--muted); font-size: .75rem; }
.below-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.compact-panel { padding: 24px; }
.compact-panel p { color: var(--muted); font-size: .875rem; max-width: 60ch; }
.compact-panel a { font-size: .875rem; font-weight: 600; }
.page-footer { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; padding: 32px 0 24px; color: var(--muted); font-size: .75rem; }
.notice { padding: 16px; margin: 0 0 24px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius); }
.loading-state { padding: 40px 0; }
.roadmap-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.roadmap-board { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 20px; }
.quarter-heading { padding-bottom: 12px; border-bottom: 2px solid var(--accent); margin-bottom: 16px; }
.roadmap-card { padding: 20px; margin-bottom: 16px; }
.roadmap-card .case-title { margin: 12px 0 8px; font-size: 1rem; }
.roadmap-card p { font-size: .875rem; margin: 12px 0; color: var(--muted); }
.roadmap-card .status-badge { margin-top: 8px; }
.audit-list { list-style: none; margin: 0; padding: 0; }
.audit-event { display: grid; grid-template-columns: 160px 1fr; gap: 24px; padding: 24px; border-bottom: 1px solid var(--line); }
.audit-event:last-child { border: 0; }
.audit-event p { margin: 4px 0 0; font-size: .875rem; }
.audit-event time { font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.prose-panel { padding: 32px; max-width: 960px; }
.prose-panel h2:not(:first-child) { margin-top: 32px; }
.prose-panel p, .prose-panel li { max-width: 75ch; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state p { margin: 0; }
dialog { color: var(--ink); border: 1px solid var(--control-line); border-radius: 8px; padding: 32px; width: min(880px, calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; }
dialog::backdrop { background: rgb(17 31 28 / 55%); }
body:has(dialog[open]) { overflow: hidden; }
.dialog-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.dialog-top h2 { font-size: 1.5rem; text-wrap: balance; margin-bottom: 4px; }
.dialog-top .button { flex-shrink: 0; }
.detail-section { padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--line); }
.detail-section h3 { margin-bottom: 12px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; margin: 16px 0 0; }
.detail-grid dt { font-size: .875rem; color: var(--muted); }
.detail-grid dd { margin: 4px 0 0; font-size: .875rem; overflow-wrap: anywhere; }
.detail-description { color: var(--muted); }
.detail-articles { font-size: .875rem; color: var(--accent-dark); }
.detail-caveats { padding: 16px 16px 16px 36px; background: var(--canvas); font-size: .875rem; }
.detail-caveats li+li { margin-top: 8px; }
.gate-list { display: grid; gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.detail-grid .full-row { grid-column: 1/-1; }
.audit-list.compact li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .875rem; }
.audit-list.compact li:last-child { border: 0; }
.audit-list.compact time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 4px; }
.audit-event.denied strong { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.roadmap-card h3 { margin: 0; }
.role-selector { margin-top: 16px; }
.gate { display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid var(--line); border-radius: 4px; padding: 16px; }
.gate strong { font-size: .875rem; }
.gate p { margin: 4px 0 0; color: var(--muted); font-size: .875rem; }
.gate .button { flex-shrink: 0; }
.role-selector { max-width: 420px; }
.wizard-intro { color: var(--muted); font-size: .875rem; }
.wizard-progress { display: flex; gap: 6px; margin: 24px 0; }
.wizard-progress span { height: 4px; flex: 1; background: var(--line); border-radius: 2px; }
.wizard-progress span.complete { background: var(--accent); }
.wizard-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--line); }
.wizard-actions .button:last-child { margin-left: auto; }
.wizard-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.wizard-fields .full { grid-column: 1/-1; }
.field-help { display: block; margin-top: 6px; color: var(--muted); font-size: .875rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: .875rem; font-weight: 600; padding: 0; margin-bottom: 6px; }
.question { border-top: 1px solid var(--line); padding: 20px 0; }
.question:first-of-type { margin-top: 20px; }
.question .field-help { margin-bottom: 12px; max-width: 72ch; }
.radio-options { display: flex; gap: 12px; }
.radio-options label, .checkbox-options label { display: flex; gap: 10px; align-items: center; min-height: 44px; margin: 0; padding: 8px 16px; border: 1px solid var(--control-line); border-radius: 4px; font-weight: 400; cursor: pointer; }
.radio-options label:has(input:checked), .checkbox-options label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
input[type="radio"], input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex-shrink: 0; }
.checkbox-options { display: flex; gap: 8px; flex-wrap: wrap; }
.result-summary { padding: 24px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); margin: 20px 0; }
.result-summary h3 { margin: 12px 0; font-size: 1.125rem; }
.form-error { padding: 12px; border: 2px solid var(--ink); border-radius: 4px; margin: 16px 0 0; font-weight: 600; }
.noscript { position: fixed; inset: 0; z-index: 200; background: var(--surface); padding: 48px; }
@media (min-width: 1600px) { main { padding-inline: 48px; } }
@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 216px minmax(0,1fr); }
  main { padding: 28px 24px 0; }
  .topbar { padding-inline: 24px; }
  .kpi-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .kpi:nth-child(4) { border-right: 0; }
  .kpi:nth-child(n+5) { grid-column: span 2; border-top: 1px solid var(--line); }
  .kpi { padding: 16px; }
  .roadmap-board { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .panel-heading { flex-wrap: wrap; }
  .case-table td, .case-table th { padding-inline: 12px; }
  .case-table th:first-child, .case-table td:first-child { padding-left: 20px; }
  .case-table th:last-child, .case-table td:last-child { padding-right: 20px; }
  .orientation-note { flex-wrap: wrap; }
  .orientation-note>a { margin-left: 32px; }
}
@media (max-width: 960px) {
  .app-shell { display: block; }
  .sidebar { padding: 20px 24px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; }
  .sidebar-label, .sidebar-bottom { display: none; }
  nav { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 16px; padding-bottom: 12px; }
  nav a { min-height: 44px; padding: 10px; }
  .topbar { min-height: 56px; }
  .page-heading { align-items: flex-start; }
}
@media (max-width: 700px) {
  .sidebar { padding: 20px 16px 0; }
  nav a { font-size: .875rem; }
  nav a svg { display: none; }
  .topbar { padding: 12px 16px; }
  .topbar-secondary { display: none; }
  main { padding: 24px 16px 0; }
  .page-heading { flex-direction: column; gap: 20px; margin-bottom: 24px; }
  .page-heading>.button { align-self: stretch; }
  .overview-heading { flex-wrap: wrap; gap: 4px; }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(3), .kpi:nth-child(4) { border-top: 1px solid var(--line); }
  .kpi:nth-child(n+5) { grid-column: span 1; }
  .kpi-label { font-size: .875rem; }
  .orientation-note { gap: 8px; }
  .orientation-note svg { display: none; }
  .orientation-note>a { margin-left: 0; }
  .panel-heading { padding: 20px 16px; }
  .filters { padding: 0 16px 20px; gap: 12px; }
  .filters>div { flex-basis: 100%; }
  .filters .text-button { padding-left: 0; }
  .export-links { width: 100%; }
  .export-links>a { flex: 1; }
  .case-table, .case-table tbody, .case-table tr, .case-table td { display: block; width: 100%; }
  .case-table thead { display: none; }
  .case-table tr { padding: 20px 16px; border-top: 1px solid var(--line); }
  .case-table td, .case-table td:first-child, .case-table td:last-child { display: flex; align-items: baseline; gap: 12px; width: 100%; padding: 8px 0 0; border: 0; }
  .case-table td:first-child { display: block; padding-top: 0; margin-bottom: 12px; }
  .case-table td[data-label]::before { content: attr(data-label); color: var(--muted); flex: 0 0 112px; font-size: .75rem; }
  .case-table td>div { min-width: 0; }
  .case-title { font-size: 1rem; }
  .case-table .case-meta { margin-top: 2px; }
  .below-grid, .roadmap-board { grid-template-columns: 1fr; }
  .table-footer { padding-inline: 16px; }
  .audit-event { grid-template-columns: 1fr; gap: 8px; padding: 20px; }
  .prose-panel { padding: 24px 20px; }
  dialog { padding: 20px; width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .dialog-top { gap: 12px; }
  .dialog-top h2 { font-size: 1.25rem; }
  .dialog-top .button { padding-inline: 10px; }
  .detail-grid, .wizard-fields { grid-template-columns: 1fr; }
  .gate { align-items: flex-start; flex-direction: column; gap: 12px; }
  .gate .button { width: 100%; }
  .wizard-actions { flex-wrap: wrap; }
  #wizard-step-count { order: 3; width: 100%; text-align: center; }
  .checkbox-options { display: grid; grid-template-columns: 1fr; }
  .result-summary { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .risk-badge,.status-badge,.demo-tag,.kpi,.orientation-note,.result-summary { border: 1px solid CanvasText; } .wizard-progress span { border: 1px solid CanvasText; } .wizard-progress span.complete { background: Highlight; } }
@media print { .sidebar,.topbar,.button,.filters,.page-footer { display: none; } .app-shell { display: block; } main { padding: 0; } }

.nowrap { white-space: nowrap; }
.result-note { font-size: .875rem; padding: 12px; background: var(--surface); border-radius: 4px; }
.result-summary:focus-visible { outline-offset: 2px; }
.dialog-top .case-meta { font-size: .875rem; }
