:root {
  --navy: #132837;
  --navy-2: #1f3c4d;
  --paper: #f3f1e8;
  --white: #fffefa;
  --ink: #20231f;
  --muted: #68706b;
  --line: #bdc1b9;
  --amber: #e7ad38;
  --red: #c24f42;
  --green: #287c62;
  --blue: #4386aa;
  --brand-red: #ff1745;
  --mono: "Courier New", ui-monospace, monospace;
  --sans: Inter, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; }
body { min-height: 100vh; color: var(--ink); background: #d9dcd5; font-family: var(--sans); }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid #ff617e; outline-offset: 2px; }
.masthead { width: min(1240px, calc(100% - 28px)); min-height: 72px; margin: 14px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 15px; color: var(--white); background: #08080b; border-bottom: 5px solid var(--brand-red); }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-block { display: block; width: 40px; height: 40px; border-radius: 9px; background: #030305; box-shadow: 0 0 0 1px rgba(255,23,69,.3), 0 0 16px rgba(255,23,69,.14); }
.brand > span:last-child { display: grid; gap: 4px; }
.brand strong { font: 700 .84rem var(--mono); }
.brand small { color: #9db0bb; font: 500 .5rem var(--mono); }
.desk-state { display: flex; gap: 10px; font: 600 .56rem var(--mono); }
.desk-state span { color: #8da3af; }
.desk-state strong { color: var(--amber); }
.page { width: min(1240px, calc(100% - 28px)); margin: 0 auto; background: var(--paper); border: 1px solid var(--navy); border-top: 0; }
.title-strip { min-height: 130px; display: grid; grid-template-columns: 130px 1fr 280px; align-items: end; gap: 20px; padding: 24px; border-bottom: 1px solid var(--navy); }
.title-strip > span { color: var(--red); font: 700 .59rem var(--mono); }
.title-strip h1 { margin: 0; font-size: 2.3rem; line-height: 1; font-weight: 650; letter-spacing: 0; }
.title-strip p { margin: 0; color: var(--muted); font: 500 .66rem/1.5 var(--mono); text-align: right; }
.error-banner { min-height: 51px; display: flex; align-items: center; gap: 16px; padding: 10px 24px; color: #fff; background: var(--red); font-size: .78rem; }
.error-banner strong { font: 700 .58rem var(--mono); }
.intake { display: grid; grid-template-columns: 1.08fr .92fr; }
.source-section, .scope-section { min-width: 0; padding: 23px; }
.source-section { border-right: 1px solid var(--navy); }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 17px; }
.section-head span { color: var(--red); font: 700 .55rem var(--mono); }
.section-head h2 { margin: 0; font-size: 1rem; }
.drop-zone { min-height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 25px; background: var(--white); border: 2px dashed #8e9690; text-align: center; cursor: pointer; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--amber); background: #fbf4df; }
.drop-zone.has-files { border-style: solid; border-color: var(--green); background: #edf4ed; }
.drop-zone input { position: absolute; opacity: 0; pointer-events: none; }
.stack-icon { position: relative; width: 58px; height: 49px; margin-bottom: 18px; }
.stack-icon i { position: absolute; left: 4px; width: 49px; height: 31px; border: 2px solid var(--navy); background: var(--white); }
.stack-icon i:nth-child(1) { top: 0; left: 0; }
.stack-icon i:nth-child(2) { top: 8px; left: 5px; }
.stack-icon i:nth-child(3) { top: 16px; left: 10px; background: var(--amber); }
.drop-zone strong { max-width: 100%; font-size: .94rem; overflow-wrap: anywhere; }
.drop-zone small { margin-top: 7px; color: var(--muted); font: 400 .58rem/1.4 var(--mono); }
.file-ledger { max-height: 142px; overflow-y: auto; border: 1px solid var(--line); border-top: 0; }
.file-ledger > div { min-height: 34px; display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 8px; padding: 4px 9px; border-bottom: 1px solid #dfe1db; font-size: .69rem; }
.file-ledger > div:last-child { border-bottom: 0; }
.file-ledger span, .file-ledger small { color: var(--muted); font: 500 .55rem var(--mono); }
.file-ledger strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.address-field, .year-field { display: grid; gap: 7px; margin-top: 17px; }
.address-field > span, .year-field > span, .check-head > span { color: var(--muted); font: 700 .55rem var(--mono); }
.address-field textarea { min-height: 86px; resize: vertical; padding: 10px; border: 1px solid var(--line); border-radius: 0; color: var(--ink); background: var(--white); font: 400 .69rem/1.5 var(--mono); }
.year-field { grid-template-columns: 100px 1fr; align-items: center; margin-top: 0; padding: 11px 0 16px; border-bottom: 1px solid var(--line); }
.year-field select { height: 38px; border: 1px solid var(--line); border-radius: 0; padding: 0 9px; color: var(--ink); background: var(--white); }
.check-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0 8px; }
.check-head button { border: 0; color: var(--blue); background: transparent; cursor: pointer; font: 700 .56rem var(--mono); }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.check-row { min-height: 55px; display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 8px; padding: 7px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; background: var(--white); }
.check-row:hover { background: #eceee8; }
.check-row input { position: absolute; opacity: 0; }
.check-box { width: 16px; height: 16px; border: 1px solid var(--navy); }
.check-row input:checked + .check-box { background: var(--navy); box-shadow: inset 0 0 0 4px var(--white); }
.check-copy { min-width: 0; display: grid; gap: 3px; }
.check-copy strong { font-size: .65rem; line-height: 1.15; overflow-wrap: anywhere; }
.check-copy small { color: var(--muted); font: 500 .5rem var(--mono); }
.run-button { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: space-between; margin-top: 17px; padding: 0 16px; border: 1px solid var(--navy); color: #fff; background: var(--navy); cursor: pointer; font: 700 .66rem var(--mono); }
.run-button:hover:not(:disabled) { color: var(--navy); background: var(--amber); }
.run-button:disabled { opacity: .6; cursor: wait; }
.run-button i { font-style: normal; font-size: 1.15rem; }
.is-working .run-button i { animation: pulse-right .6s infinite alternate; }
@keyframes pulse-right { to { transform: translateX(5px); } }
.run-status { margin: 8px 0 0; color: var(--green); text-align: right; font: 700 .52rem var(--mono); }
.result-section { border-top: 6px solid var(--navy); }
.result-heading { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 24px; border-bottom: 1px solid var(--navy); }
.result-heading > div { display: grid; gap: 6px; }
.result-heading > div span { color: var(--green); font: 700 .56rem var(--mono); }
.result-heading h2 { margin: 0; font-size: 1.5rem; }
.download-button { min-height: 43px; display: inline-flex; align-items: center; gap: 18px; padding: 0 15px; color: #fff; background: var(--green); border: 1px solid var(--green); text-decoration: none; font: 700 .61rem var(--mono); }
.download-button:hover { color: var(--navy); background: var(--amber); border-color: var(--navy); }
.metric-row { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--navy); }
.metric-row > div { min-height: 116px; display: flex; flex-direction: column; justify-content: space-between; padding: 14px; border-right: 1px solid var(--line); }
.metric-row > div:last-child { border-right: 0; }
.metric-row span { color: var(--muted); font: 700 .53rem var(--mono); }
.metric-row strong { color: var(--navy); font: 650 2.3rem var(--sans); }
.metric-row small { color: var(--muted); font: 400 .52rem var(--mono); }
.result-grid { display: grid; grid-template-columns: 1.2fr .8fr; }
.issue-ledger { min-width: 0; border-right: 1px solid var(--navy); }
.source-ledger { min-width: 0; }
.table-title { min-height: 47px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 13px; border-bottom: 1px solid var(--line); font: 700 .55rem var(--mono); }
.table-title small { color: var(--muted); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { padding: 9px 10px; border-bottom: 1px solid #d5d8d1; text-align: left; font-size: .65rem; overflow-wrap: anywhere; }
th { color: var(--muted); background: #e4e6df; font: 700 .51rem var(--mono); text-transform: uppercase; }
.issue-ledger th:nth-child(1) { width: 68px; }.issue-ledger th:nth-child(3) { width: 85px; }.issue-ledger th:nth-child(4) { width: 55px; }
.source-ledger th:nth-child(2) { width: 90px; }.source-ledger th:nth-child(3) { width: 55px; }
td.number { text-align: right; font: 700 .66rem var(--mono); }
tr.is-zero { opacity: .46; }
td small { display: block; margin-top: 3px; color: var(--red); font: 500 .48rem var(--mono); }
.severity { display: inline-block; min-width: 52px; padding: 3px 5px; text-align: center; font: 700 .49rem var(--mono); }
.severity-high { color: #fff; background: var(--red); }
.severity-review { color: var(--navy); background: var(--amber); }
.packet-contents { margin: 13px; padding: 12px; color: #fff; background: var(--navy-2); }
.packet-contents span { color: var(--amber); font: 700 .51rem var(--mono); }
.packet-contents p { margin: 7px 0 0; font-size: .65rem; line-height: 1.45; }
.foot { width: min(1240px, calc(100% - 28px)); min-height: 42px; margin: 0 auto 25px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; color: #9a9da5; background: #08080b; font: 600 .51rem var(--mono); }
.foot a { color: inherit; }
.flintglade-attribution { color: #ff617e !important; font-weight: 800; letter-spacing: .05em; text-decoration: none; text-transform: uppercase; }
.policy-page { min-height: 100vh; padding: 28px 14px; background: var(--paper); }
.policy-shell { width: min(760px, 100%); margin: 0 auto; padding: 28px; color: var(--navy); border: 1px solid var(--navy); background: var(--white); }
.policy-shell .brand { width: fit-content; margin-bottom: 72px; color: var(--navy); }
.policy-kicker { color: var(--red); font: 700 .58rem var(--mono); }
.policy-shell h1 { max-width: 650px; margin: 10px 0 24px; font: 700 clamp(1.8rem, 5vw, 3.3rem)/1 var(--sans); }
.policy-shell p { max-width: 650px; color: var(--muted); font-size: .9rem; line-height: 1.7; }
.policy-back { display: inline-block; margin-top: 24px; color: var(--navy); font: 700 .58rem var(--mono); }
.guide-page { padding: 14px; background: var(--paper); }
.guide-topline { width: min(1040px, 100%); min-height: 77px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 10px 16px; color: #fff; background: #08080b; border-bottom: 5px solid var(--brand-red); }
.guide-topline .brand { color: #fff; }
.guide-topline nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 15px; }
.guide-topline nav a { color: #cbd5d9; font: 700 .55rem var(--mono); letter-spacing: .04em; }
.guide-topline nav a:hover { color: var(--amber); }
.guide-shell { width: min(1040px, 100%); margin: 0 auto 30px; color: var(--navy); border: 1px solid var(--navy); border-top: 0; background: var(--white); }
.guide-shell article > section, .guide-contact { padding: clamp(28px, 5vw, 62px) clamp(20px, 7vw, 76px); border-top: 1px solid var(--navy); }
.guide-hero { padding: clamp(34px, 7vw, 78px) clamp(20px, 7vw, 76px); }
.guide-kicker, .guide-number { margin: 0 0 12px; color: var(--red); font: 700 .58rem var(--mono); letter-spacing: .04em; }
.guide-hero h1 { max-width: 850px; margin: 0; font: 700 clamp(2.2rem, 7vw, 5.2rem)/.96 var(--sans); letter-spacing: -.045em; }
.guide-deck { max-width: 780px; margin: 25px 0 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.25rem); line-height: 1.65; }
.guide-facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 42px 0 0; border: 1px solid var(--line); }
.guide-facts div { padding: 17px; border-right: 1px solid var(--line); }
.guide-facts div:last-child { border-right: 0; }
.guide-facts dt { color: var(--green); font: 700 clamp(1.5rem, 3vw, 2.3rem) var(--sans); }
.guide-facts dd { margin: 5px 0 0; color: var(--muted); font: 600 .58rem/1.4 var(--mono); text-transform: uppercase; }
.guide-disclaimer { margin: 0; padding: 18px clamp(20px, 7vw, 76px); color: var(--navy); border-top: 1px solid var(--navy); background: var(--amber); font-size: .88rem; line-height: 1.6; }
.guide-shell h2 { max-width: 760px; margin: 0 0 24px; font: 700 clamp(1.65rem, 4vw, 3rem)/1.05 var(--sans); letter-spacing: -.025em; }
.guide-shell h3 { margin: 0 0 8px; font-size: .9rem; }
.guide-shell section > p:not(.guide-number), .guide-contact p:not(.guide-number) { max-width: 780px; color: var(--muted); font-size: .98rem; line-height: 1.75; }
.guide-shell code { padding: .1em .3em; background: var(--paper); font-family: var(--mono); }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 30px 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.guide-grid > div { padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.guide-grid p { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.6; }
.guide-callout { display: grid; grid-template-columns: minmax(170px, .4fr) 1fr; gap: 20px; margin: 28px 0 0; padding: 20px; color: #fff; background: var(--navy); }
.guide-callout strong { color: var(--amber); }
.guide-callout span { font-size: .9rem; line-height: 1.6; }
.guide-table-wrap { margin: 30px 0; overflow-x: auto; border: 1px solid var(--line); }
.guide-table { min-width: 680px; width: 100%; border-collapse: collapse; }
.guide-table th, .guide-table td { padding: 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.guide-table th:last-child, .guide-table td:last-child { border-right: 0; }
.guide-table tr:last-child td { border-bottom: 0; }
.guide-table th { color: #fff; background: var(--navy); font: 700 .56rem var(--mono); text-transform: uppercase; }
.guide-table td { color: var(--muted); font-size: .82rem; line-height: 1.55; }
.guide-table td:first-child { color: var(--navy); font-weight: 700; }
.guide-steps { margin: 30px 0 0; padding: 0; list-style: none; counter-reset: guide-step; border-top: 1px solid var(--line); }
.guide-steps li { counter-increment: guide-step; display: grid; grid-template-columns: 36px minmax(130px, .35fr) 1fr; gap: 15px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.guide-steps li::before { content: counter(guide-step, decimal-leading-zero); color: var(--red); font: 700 .62rem var(--mono); }
.guide-steps span { color: var(--muted); font-size: .86rem; line-height: 1.55; }
.guide-checklist { max-width: 820px; margin: 25px 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.guide-checklist li { position: relative; padding: 14px 10px 14px 34px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .9rem; line-height: 1.55; }
.guide-checklist li::before { content: '\2713'; position: absolute; left: 8px; color: var(--green); font-weight: 800; }
.guide-contact { background: #e3eaec; }
.guide-contact a { color: var(--navy); }
.guide-cta { min-height: 49px; max-width: 430px; display: flex; align-items: center; justify-content: space-between; margin-top: 28px; padding: 0 17px; color: #fff !important; background: var(--green); border: 1px solid var(--navy); text-decoration: none; font: 700 .62rem var(--mono); }
.guide-cta:hover { color: var(--navy) !important; background: var(--amber); }
@media (max-width: 860px) {
  .title-strip { grid-template-columns: 100px 1fr; }
  .title-strip p { grid-column: 2; text-align: left; }
  .intake, .result-grid { grid-template-columns: 1fr; }
  .source-section { border-right: 0; border-bottom: 1px solid var(--navy); }
  .issue-ledger { border-right: 0; border-bottom: 1px solid var(--navy); }
  .metric-row { grid-template-columns: 1fr 1fr; }
  .metric-row > div:nth-child(2) { border-right: 0; }
  .metric-row > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .guide-page { padding: 0; }
  .guide-topline { width: 100%; }
  .guide-topline nav { display: none; }
  .guide-grid, .guide-facts { grid-template-columns: 1fr; }
  .guide-grid > div, .guide-facts div { border-right: 0; }
  .guide-facts div { border-bottom: 1px solid var(--line); }
  .guide-facts div:last-child { border-bottom: 0; }
  .guide-callout, .guide-steps li { grid-template-columns: 1fr; }
  .masthead, .page, .foot { width: 100%; margin-left: 0; margin-right: 0; border-left: 0; border-right: 0; }
  .masthead { margin-top: 0; }
  .desk-state span { display: none; }
  .title-strip { min-height: 145px; grid-template-columns: 1fr; gap: 8px; padding: 18px 14px; }
  .title-strip p { grid-column: 1; }
  .title-strip h1 { font-size: 1.65rem; }
  .source-section, .scope-section { padding: 18px 14px; }
  .check-grid { grid-template-columns: 1fr; }
  .result-heading { align-items: stretch; flex-direction: column; }
  .download-button { justify-content: space-between; }
  .metric-row { grid-template-columns: 1fr; }
  .metric-row > div { min-height: 95px; border-right: 0; border-bottom: 1px solid var(--line); }
  .metric-row > div:last-child { border-bottom: 0; }
  .result-grid { overflow-x: auto; }
  .issue-ledger, .source-ledger { min-width: 560px; }
  .foot span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
