:root {
  color-scheme: light;
  --ink: #15231d;
  --muted: #647169;
  --paper: #f2f1eb;
  --surface: #fffefa;
  --soft: #e7eee9;
  --line: #d5d9d4;
  --forest: #164c3b;
  --forest-dark: #0f352a;
  --lime: #c8ee72;
  --amber: #d8912b;
  --red: #a73535;
  --blue: #376784;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { min-height: 1.2rem; color: var(--red); font-size: .85rem; }
.kicker, .step-label { color: var(--forest); font-size: .7rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 4rem); line-height: 1; letter-spacing: -.035em; }
h2 { font-family: Georgia, serif; font-size: clamp(1.4rem, 2.3vw, 2.2rem); line-height: 1.08; }
h3 { font-size: 1rem; }

.topbar { position: sticky; z-index: 20; top: 0; min-height: 4.5rem; padding: .75rem clamp(1rem, 4vw, 4rem); display: flex; align-items: center; justify-content: space-between; background: var(--forest-dark); color: white; box-shadow: 0 5px 20px #10221922; }
.brand { display: flex; gap: .8rem; align-items: center; color: inherit; text-decoration: none; }
.brand-logo { width: 3rem; height: 2.6rem; padding: .18rem; object-fit: contain; border-radius: .3rem; background: white; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: .1rem; color: #b8c9c1; font-size: .7rem; }
.top-actions { display: flex; gap: 1rem; align-items: center; }
.status-dot { color: #c8d5cf; font-size: .75rem; }
.status-dot::before { content: ""; width: .5rem; height: .5rem; margin-right: .4rem; display: inline-block; border-radius: 50%; background: var(--amber); }
.status-dot.live::before { background: var(--lime); }

main { width: min(1500px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 5rem; }
.button { min-height: 2.7rem; padding: .65rem 1rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: .35rem; font-weight: 750; text-decoration: none; cursor: pointer; }
.button:hover { filter: brightness(1.05); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button.primary { color: white; background: var(--forest); }
.button.secondary { color: var(--forest); background: white; border-color: #9baba3; }
.button.ghost { color: white; background: transparent; border-color: #648176; }
.button.text { min-height: 2.2rem; padding: .3rem .6rem; color: var(--forest); background: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }

.login-shell { min-height: calc(100vh - 9rem); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); align-items: center; gap: clamp(2rem, 8vw, 8rem); padding: 5vh clamp(0rem, 5vw, 5rem); }
.login-story { max-width: 760px; }
.login-story p { max-width: 62ch; color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.check-list { padding: 0; display: flex; flex-wrap: wrap; gap: .8rem 1.6rem; list-style: none; color: var(--forest); font-size: .85rem; font-weight: 700; }
.check-list li::before { content: "✓"; margin-right: .4rem; }
.login-card { padding: clamp(1.5rem, 4vw, 3rem); display: grid; gap: 1rem; background: var(--surface); border-top: 5px solid var(--lime); box-shadow: 0 22px 70px #1e352927; }

label { display: grid; gap: .35rem; color: #324239; font-size: .76rem; font-weight: 760; }
input, select, textarea { width: 100%; min-height: 2.65rem; border: 1px solid #b8c0ba; border-radius: .3rem; padding: .65rem .72rem; color: var(--ink); background: white; }
input[type="checkbox"] { width: 1rem; min-height: 1rem; accent-color: var(--forest); }

.workspace-head { padding: 1.4rem 0 1.6rem; display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
.workspace-head h1 { max-width: 760px; margin: .4rem 0 0; font-size: clamp(2rem, 4vw, 3.5rem); }
.mini-metrics { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: end; }
.mini-metric { min-width: 7rem; padding: .7rem .9rem; background: var(--surface); border: 1px solid var(--line); }
.mini-metric strong { display: block; color: var(--forest); font-family: Georgia, serif; font-size: 1.45rem; }
.mini-metric span { color: var(--muted); font-size: .68rem; }
.view-tabs { margin-bottom: 1.2rem; display: flex; gap: .3rem; border-bottom: 1px solid #bfc6c1; }
.view-tab { padding: .9rem 1.2rem; border: 0; border-bottom: 3px solid transparent; color: var(--muted); background: transparent; font-weight: 780; cursor: pointer; }
.view-tab.active { color: var(--forest); border-color: var(--forest); }

.panel { margin-bottom: 1.2rem; padding: clamp(1.1rem, 2vw, 1.8rem); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 24px #24372e0a; }
.panel-head, .results-title, .section-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.panel-head h2, .results-title h2 { margin: .3rem 0 0; }
.generator-layout { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(270px, .7fr); gap: 1.2rem; align-items: start; }
.configuration-panel { padding: clamp(1.2rem, 2.5vw, 2.2rem); }
.guidance-panel { position: sticky; top: 5.8rem; }
.guidance-panel h2 { margin-top: .5rem; }
.preset-row { margin: 1rem 0 1.5rem; display: flex; gap: .45rem; flex-wrap: wrap; }
.preset { padding: .5rem .7rem; border: 1px solid #a7b3ac; border-radius: 1rem; color: var(--forest); background: white; font-size: .72rem; cursor: pointer; }
.preset.active { border-color: var(--forest); color: white; background: var(--forest); }
fieldset { margin: 0 0 1rem; padding: 0; border: 0; }
legend { margin-bottom: .8rem; color: var(--forest); font-size: .74rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.form-grid { display: grid; gap: .8rem; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
details { border-top: 1px solid var(--line); }
summary { padding: 1rem 0; color: var(--forest); font-weight: 800; cursor: pointer; }
summary span { margin-left: .5rem; color: var(--muted); font-size: .72rem; font-weight: 500; }
.detail-body { padding: 0 0 1.2rem; }
.choice-grid { margin-top: .8rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.choice { min-height: 2.4rem; padding: .55rem .65rem; display: flex; gap: .55rem; align-items: start; border: 1px solid var(--line); border-radius: .3rem; background: #fff; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--forest); background: var(--soft); }
.choice span { font-size: .76rem; font-weight: 680; line-height: 1.3; }
.instrument-tools { display: grid; grid-template-columns: 1fr auto; gap: .7rem; align-items: center; }
.priority-filters { display: flex; gap: .4rem; flex-wrap: wrap; }
.priority-filter { padding: .4rem .55rem; display: flex; gap: .3rem; align-items: center; border: 1px solid var(--line); border-radius: 1rem; font-size: .7rem; }
.instrument-list { max-height: 22rem; margin-top: .8rem; overflow-y: auto; border: 1px solid var(--line); }
.instrument-option { padding: .65rem .75rem; display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: start; border-bottom: 1px solid var(--line); cursor: pointer; }
.instrument-option:last-child { border: 0; }
.instrument-option:has(input:checked) { background: var(--soft); }
.instrument-option strong, .instrument-option small { display: block; }
.instrument-option small { margin-top: .2rem; color: var(--muted); font-size: .68rem; }
.badge { display: inline-block; padding: .22rem .45rem; border-radius: 1rem; color: var(--forest); background: #dfeae4; font-size: .65rem; font-weight: 850; white-space: nowrap; }
.badge.blocked, .badge.critical, .badge.high { color: #842b2b; background: #f8dddd; }
.badge.warning, .badge.medium, .badge.weak { color: #7c5316; background: #fff0ce; }
.badge.allowed, .badge.approved, .badge.low { color: #215943; background: #dcf1e7; }
.policy-box { margin-top: 1rem; padding: 1rem; display: grid; gap: .8rem; background: #edf3ef; border-left: 4px solid var(--forest); }
.switch-row { grid-template-columns: auto 1fr; align-items: start; gap: .7rem; }
.switch-row strong, .switch-row small { display: block; }
.switch-row small { margin-top: .15rem; color: var(--muted); font-weight: 450; }
.action-row { display: flex; gap: .6rem; justify-content: end; flex-wrap: wrap; }
.configuration-panel > .action-row { margin-top: 1.2rem; }
.journey { padding: 0; list-style: none; counter-reset: journey; }
.journey li { padding: .8rem 0 .8rem 2.3rem; position: relative; border-bottom: 1px solid var(--line); }
.journey li::before { counter-increment: journey; content: counter(journey, decimal-leading-zero); position: absolute; left: 0; color: var(--amber); font-size: .72rem; font-weight: 900; }
.journey strong, .journey span { display: block; }
.journey span { margin-top: .25rem; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.warning-card { margin-top: 1rem; padding: 1rem; background: #fff2dc; border-left: 4px solid var(--amber); }
.warning-card p { margin: .35rem 0 0; color: #715426; font-size: .78rem; line-height: 1.45; }

.metric-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); border: 1px solid var(--line); }
.metric { min-height: 5rem; padding: .8rem 1rem; background: var(--surface); border-right: 1px solid var(--line); }
.metric:last-child { border: 0; }
.metric strong { display: block; color: var(--forest); font-family: Georgia, serif; font-size: 1.7rem; }
.metric span { color: var(--muted); font-size: .68rem; line-height: 1.2; }
.major { margin-bottom: 1rem; }
.review-list { display: grid; gap: .55rem; }
.review-row { padding: .85rem 1rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .8rem; background: white; border: 1px solid var(--line); }
.review-row h3 { margin: 0 0 .25rem; }
.review-row p { margin: .15rem 0; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.review-row .row-badges { display: flex; gap: .3rem; align-items: start; flex-wrap: wrap; justify-content: end; }

.results-title { margin: 2.2rem 0 1rem; }
.results-title h2 { font-size: clamp(1.8rem, 3vw, 3rem); }
.artifact-tabs { display: flex; overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
.artifact-tab { padding: .8rem 1rem; border: 0; border-right: 1px solid var(--line); color: var(--muted); background: white; font-size: .76rem; font-weight: 780; white-space: nowrap; cursor: pointer; }
.artifact-tab.active { color: white; background: var(--forest); }
.artifact-view { min-height: 12rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-top: 0; }
.result-tools { margin-bottom: 1rem; display: grid; grid-template-columns: 1fr 220px auto; gap: .7rem; align-items: center; }
.question-list { display: grid; gap: .7rem; }
.question-card { padding: 1rem; border: 1px solid var(--line); border-left: 5px solid var(--forest); background: white; }
.question-card.blocked { border-left-color: var(--red); background: #fffafa; }
.question-card.weak { border-left-color: var(--amber); }
.question-head { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: start; }
.question-number { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--forest); font-size: .68rem; font-weight: 900; }
.question-card.blocked .question-number { background: var(--red); }
.question-text { font-weight: 760; line-height: 1.4; }
.question-meta { margin-top: .35rem; color: var(--muted); font: .68rem ui-monospace, monospace; }
.metadata-grid { margin-top: .8rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.metadata { padding: .55rem; background: #f5f6f2; }
.metadata strong, .metadata span { display: block; }
.metadata strong { color: var(--muted); font-size: .6rem; letter-spacing: .05em; text-transform: uppercase; }
.metadata span { margin-top: .2rem; font-size: .72rem; overflow-wrap: anywhere; }
.explanation { margin: .7rem 0 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.score-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .7rem; }
.score-card { padding: 1rem; background: #edf3ef; border-top: 4px solid var(--forest); }
.score-card strong { display: block; color: var(--forest); font: 2rem Georgia, serif; }
.score-card span { color: var(--muted); font-size: .7rem; }
.artifact-section { margin-bottom: 1.2rem; }
.artifact-section h3 { margin-bottom: .6rem; color: var(--forest); }
.code-block { max-height: 32rem; padding: 1rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: #10251d; color: #d8e9df; font: .72rem/1.5 ui-monospace, monospace; }

.section-intro { padding: 2rem 0; display: flex; justify-content: space-between; gap: 2rem; }
.section-intro h2 { margin: .4rem 0; font-size: clamp(2rem, 3vw, 3.2rem); }
.section-intro p { max-width: 76ch; color: var(--muted); line-height: 1.55; }
.search-row { display: grid; grid-template-columns: 1fr minmax(190px, .35fr) auto; gap: .7rem; }
.search-row.compact { grid-template-columns: 260px 130px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .8rem .9rem; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; }
td { font-size: .78rem; line-height: 1.4; }
td:first-child { font-family: ui-monospace, monospace; white-space: nowrap; }
.pagination { padding-top: 1rem; display: flex; align-items: center; justify-content: center; gap: 1rem; }

.guided-intro { margin-bottom: 1.2rem; padding: clamp(1.4rem, 3vw, 2.5rem); display: flex; align-items: end; justify-content: space-between; gap: 2rem; color: white; background: linear-gradient(125deg, var(--forest-dark), var(--forest)); }
.guided-intro h2 { max-width: 820px; margin: .35rem 0; font-size: clamp(1.8rem, 3vw, 3.1rem); }
.guided-intro p { max-width: 78ch; margin: 0; color: #d6e5de; line-height: 1.55; }
.guided-intro .kicker { color: var(--lime); }
.guided-progress { display: flex; flex-wrap: wrap; gap: .4rem; }
.guided-progress span { padding: .45rem .65rem; border: 1px solid #719187; border-radius: 2rem; color: #d6e5de; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.guided-progress span.active { border-color: var(--lime); color: var(--forest-dark); background: var(--lime); }
.guided-form { max-width: 1200px; margin: 0 auto; }
.guided-step { padding: clamp(1.2rem, 3vw, 2.2rem); }
.guided-step-head { margin-bottom: 1.3rem; display: flex; align-items: start; gap: 1rem; }
.guided-step-head h2 { margin: 0 0 .25rem; font-size: clamp(1.45rem, 2vw, 2rem); }
.guided-step-head p { margin: 0; color: var(--muted); font-size: .86rem; }
.step-number { width: 2.35rem; height: 2.35rem; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: var(--forest-dark); background: var(--lime); font-weight: 900; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.mode-card { min-height: 9rem; padding: 1.2rem; display: grid; grid-template-columns: auto auto 1fr; gap: .9rem; align-items: start; border: 2px solid var(--line); border-radius: .5rem; background: white; cursor: pointer; }
.mode-card:hover { border-color: #82978c; }
.mode-card.selected, .mode-card:has(input:checked) { border-color: var(--forest); background: var(--soft); box-shadow: 0 0 0 2px #164c3b18; }
.mode-card input { margin-top: .45rem; }
.mode-icon { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: .45rem; color: white; background: var(--forest); font: 1.2rem Georgia, serif; }
.mode-card strong, .mode-card small { display: block; }
.mode-card strong { margin-bottom: .45rem; color: var(--ink); font-size: 1rem; }
.mode-card small { color: var(--muted); font-size: .78rem; font-weight: 500; line-height: 1.5; }
.guided-filter-block { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.filter-heading { margin-bottom: .75rem; display: flex; justify-content: space-between; gap: 1rem; }
.filter-heading span { color: var(--muted); font-size: .72rem; }
.domain-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.tier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.guided-choice { min-height: 3.4rem; padding: .75rem; display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: start; border: 1px solid var(--line); border-radius: .4rem; background: white; cursor: pointer; }
.guided-choice:has(input:checked) { border-color: var(--forest); background: var(--soft); }
.guided-choice input { position: static; width: 1.15rem; min-height: 1.15rem; margin-top: .1rem; opacity: 1; pointer-events: auto; }
.choice-check { display: none; }
.guided-choice strong, .guided-choice small { display: block; }
.guided-choice small { margin-top: .3rem; color: var(--muted); font-weight: 450; line-height: 1.4; }
.scope-preview { margin-top: .6rem; padding: .9rem; display: flex; align-items: center; gap: 1rem; background: #f4f6f3; border-left: 4px solid var(--forest); }
.scope-summary { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.scope-summary.warning { color: #7c5316; }
.guided-submit-bar { position: sticky; z-index: 10; bottom: .6rem; margin: 1rem 0; padding: 1rem 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: white; background: var(--forest-dark); box-shadow: 0 10px 35px #10221955; }
.guided-submit-bar strong, .guided-submit-bar span { display: block; }
.guided-submit-bar span { margin-top: .2rem; color: #c9d9d1; font-size: .75rem; }
.button.large { min-height: 3.2rem; padding-inline: 1.5rem; background: var(--lime); color: var(--forest-dark); }
.guided-result-tab { padding: .8rem 1rem; border: 0; border-right: 1px solid var(--line); color: var(--muted); background: white; font-size: .76rem; font-weight: 780; white-space: nowrap; cursor: pointer; }
.guided-result-tab.active { color: white; background: var(--forest); }
.guided-result-view { min-height: 12rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-top: 0; }
.guided-notice { margin-bottom: .7rem; padding: .9rem 1rem; border-left: 4px solid var(--amber); background: #fff4e3; }
.guided-notice p { margin: .2rem 0 0; color: #715426; font-size: .78rem; line-height: 1.45; }
.guided-question-list { display: grid; gap: .7rem; }
.guided-question { padding: 1rem; border: 1px solid var(--line); border-left: 5px solid var(--forest); background: white; }
.guided-question.supplement { border-left-color: var(--amber); background: #fffdfa; }
.guided-question-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: start; }
.source-line { margin-top: .3rem; color: var(--forest); font-size: .7rem; font-weight: 780; }
.guided-question.supplement .source-line { color: #8a5a18; }
.guided-question-meta, .match-list { margin-top: .8rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.match-list { grid-template-columns: 1fr 1fr; }
.guided-summary-panel { box-shadow: none; }
.guided-summary-panel p { max-width: 85ch; margin: 0; color: var(--muted); line-height: 1.55; }
.promote-panel { margin-top: 1rem; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; border-left: 5px solid var(--amber); }
.promote-panel h3 { margin: .25rem 0; }
.promote-panel p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.matrix-heading { margin-bottom: .9rem; }
.matrix-heading h3 { margin: 0 0 .35rem; color: var(--forest); font-size: 1.35rem; }
.matrix-heading p { max-width: 95ch; margin: .25rem 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.matrix-heading .readiness-boundary { padding: .65rem .8rem; border-left: 4px solid var(--amber); color: #674917; background: #fff4df; font-weight: 650; }
.matrix-legend { margin: .8rem 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.legend-item { padding: .38rem .55rem; border: 1px solid #0002; border-radius: .25rem; font-size: .67rem; font-weight: 850; }
.matrix-mode-switch, .matrix-level-controls { margin: .65rem 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.matrix-mode, .matrix-level-toggle { min-height: 2.35rem; padding: .45rem .7rem; border: 1px solid #9baaa3; border-radius: .3rem; color: var(--forest); background: white; font-size: .7rem; font-weight: 820; cursor: pointer; }
.matrix-mode.active { color: white; border-color: var(--forest); background: var(--forest); }
.matrix-level-toggle[aria-expanded="false"] { opacity: .56; text-decoration: line-through; }
.geo-level_1 { --level-color: #174b3b; }
.geo-level_2 { --level-color: #376784; }
.geo-level_3 { --level-color: #8a642a; }
.geo-level_4 { --level-color: #7b477d; }
.matrix-level-toggle[class*="geo-"] { border-left: 5px solid var(--level-color); }
.matrix-controls { margin: .8rem 0; display: flex; flex-wrap: wrap; gap: .7rem; align-items: end; }
.matrix-control { min-width: 190px; display: grid; gap: .25rem; color: var(--muted); font-size: .7rem; font-weight: 800; }
.matrix-control select, .matrix-control input { min-height: 2.6rem; background: white; }
.matrix-summary { margin: .5rem 0; font-size: .72rem; }
.matrix-scroll { max-width: 100%; max-height: 68vh; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); background: white; box-shadow: inset -16px 0 18px -20px #10221988; }
.compliance-matrix { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.compliance-matrix th, .compliance-matrix td { padding: .35rem; border-top: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; }
.compliance-matrix thead th { position: sticky; z-index: 3; top: 0; min-width: 92px; max-width: 130px; padding: .65rem .45rem; color: #31443d; background: #edf2ef; font-size: .62rem; line-height: 1.35; text-align: center; white-space: normal; }
.compliance-matrix thead .matrix-level-heading { top: 0; color: white; background: var(--level-color); }
.compliance-matrix thead tr:nth-child(2) th { top: 2.9rem; }
.compliance-matrix thead .matrix-column-heading[class*="geo-"] { border-top: 5px solid var(--level-color); background: color-mix(in srgb, var(--level-color) 11%, white); }
.compliance-matrix .matrix-row-heading { position: sticky; z-index: 2; left: 0; width: 290px; min-width: 290px; max-width: 290px; padding: .65rem .75rem; box-shadow: 8px 0 12px -12px #102219; text-align: left; text-transform: none; letter-spacing: 0; }
.compliance-matrix thead .matrix-row-heading { z-index: 4; background: #dfeae4; text-transform: uppercase; letter-spacing: .06em; }
.compliance-matrix .matrix-row-heading strong, .compliance-matrix .matrix-row-heading small { display: block; }
.compliance-matrix .matrix-row-heading strong { color: var(--ink); font-size: .72rem; line-height: 1.35; }
.compliance-matrix .matrix-row-heading small { margin-top: .3rem; color: var(--muted); font-size: .61rem; line-height: 1.35; }
.compliance-matrix tr.matrix-tier-start th, .compliance-matrix tr.matrix-tier-start td { border-top: 4px solid #729487; }
.matrix-cluster-row th { position: sticky; z-index: 1; left: 0; padding: .25rem .5rem !important; border-top: 3px solid #789489 !important; color: white; background: var(--forest-dark) !important; }
.matrix-cluster-toggle { width: 100%; padding: .5rem; border: 0; color: white; background: transparent; font-size: .72rem; font-weight: 850; text-align: left; cursor: pointer; }
.matrix-law-link { display: block; padding: 0; border: 0; color: var(--forest); background: transparent; font: 760 .72rem/1.35 inherit; text-align: left; text-decoration: underline; cursor: pointer; }
.matrix-law-link.missing-source { color: #8a4e23; text-decoration-style: dashed; }
.matrix-cell { width: 100%; min-width: 72px; min-height: 2.65rem; display: grid; place-items: center; border: 2px solid transparent; border-radius: .25rem; font-size: .72rem; font-weight: 900; cursor: pointer; }
button.matrix-cell:hover, button.matrix-cell:focus-visible { outline: 3px solid #172b24; outline-offset: 1px; transform: translateY(-1px); }
.matrix-green { color: white; background: #17643f; }
.matrix-yellow { color: #332600; background: #f5d568; }
.matrix-orange { color: #301700; background: #e8933c; }
.matrix-red { color: white; background: #a63131; }
.matrix-na { color: #67736d; background: #ecefeb; cursor: default; }
.matrix-detail { min-height: 4.3rem; margin-top: .8rem; padding: .8rem 1rem; display: grid; gap: .2rem; border: 1px solid var(--line); border-left: 5px solid var(--forest); background: white; font-size: .78rem; }
.matrix-detail strong { color: var(--forest); }
.matrix-detail p { margin: .3rem 0; line-height: 1.45; }
.matrix-detail small { color: var(--muted); line-height: 1.4; }
.matrix-detail h3, .matrix-detail h4 { margin: .4rem 0 .2rem; }
.matrix-detail-content { display: grid; gap: .3rem; }
.matrix-detail-verdict { width: fit-content; padding: .3rem .5rem; border-radius: .25rem; background: var(--soft); }
.matrix-attention, .matrix-articles, .matrix-improve-actions { margin-top: .45rem; padding-top: .45rem; border-top: 1px solid var(--line); }
.matrix-attention ul { margin: .35rem 0; padding-left: 1.3rem; line-height: 1.5; }
.source-warning { padding: .65rem .8rem; color: #714b18; background: #fff2d9; border-left: 4px solid var(--amber); }
.improvement-proposal { margin-top: .65rem; padding: .75rem; border: 1px solid var(--line); background: #f5f8f5; }
.proposal-question { margin: .45rem 0; padding: .55rem; border-left: 3px solid var(--forest); background: white; }
.improvement-request .request-id { font: .65rem ui-monospace, monospace; overflow-wrap: anywhere; }
.improvement-actions { min-width: 11rem; }
.matrix-pager { margin-top: .65rem; display: flex; justify-content: center; align-items: center; gap: .8rem; }
footer { padding: 2rem; text-align: center; color: var(--muted); font-size: .7rem; }

@media (max-width: 1050px) {
  .generator-layout { grid-template-columns: 1fr; }
  .guidance-panel { position: static; }
  .form-grid.four { grid-template-columns: 1fr 1fr; }
  .metadata-grid { grid-template-columns: 1fr 1fr; }
  .domain-grid { grid-template-columns: 1fr 1fr; }
  .guided-question-meta { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  main { width: min(100% - 1rem, 1500px); padding-top: 1rem; }
  .login-shell { grid-template-columns: 1fr; padding: 2rem 0; }
  .workspace-head, .section-intro, .panel-head, .results-title { align-items: stretch; flex-direction: column; }
  .mini-metrics { justify-content: start; }
  .view-tabs { overflow-x: auto; }
  .form-grid.three, .form-grid.four, .choice-grid { grid-template-columns: 1fr; }
  .instrument-tools, .result-tools, .search-row, .search-row.compact { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: 1fr 1fr; }
  .metadata-grid { grid-template-columns: 1fr; }
  .guided-intro, .filter-heading, .guided-submit-bar { align-items: stretch; flex-direction: column; }
  .mode-grid, .tier-grid, .domain-grid, .guided-question-meta, .match-list { grid-template-columns: 1fr; }
  .promote-panel { grid-template-columns: 1fr; }
  .matrix-controls { display: grid; grid-template-columns: 1fr; }
  .matrix-control { min-width: 0; }
  .matrix-scroll { max-height: 62vh; }
  .compliance-matrix .matrix-row-heading { width: 210px; min-width: 210px; max-width: 210px; }
  .matrix-cell { min-width: 66px; }
  .guided-progress { margin-top: .5rem; }
  .topbar { padding-inline: .7rem; }
  .status-dot { display: none; }
}
