:root {
  --primary: #163A32;
  --secondary: #24323A;
  --tertiary: #9B3F24;
  --neutral: #F7F4EC;
  --surface: #FFFFFF;
  --muted: #E3E8E4;
  --information: #1F5F8B;
  --warning: #7A5100;
  --critical: #8B2635;
  --success: #236747;
  --text: #182126;
  --text-muted: #4C5B62;
  --border: #ccd5d0;
  --shadow: 0 16px 35px rgba(24, 33, 38, 0.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--neutral);
  color: var(--text);
  line-height: 1.55;
}
a { color: var(--primary); text-underline-offset: 0.18em; }
a:hover { color: var(--tertiary); }
.skip-link { position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { left: 1rem; top: 1rem; width: auto; height: auto; background: var(--surface); padding: .75rem; border: 2px solid var(--primary); z-index: 10; }
.site-header { background: var(--primary); color: white; border-bottom: 5px solid var(--tertiary); }
.nav-wrap, main, .site-footer { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.nav-wrap { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 1rem 0; }
.brand { display: inline-flex; flex-direction: column; gap: .1rem; color: white; text-decoration: none; font-weight: 750; letter-spacing: -0.02em; }
.brand small { font-weight: 500; letter-spacing: .04em; text-transform: uppercase; opacity: .82; }
nav ul { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; margin: 0; padding: 0; }
nav a { color: white; text-decoration: none; padding: .55rem .75rem; border: 1px solid rgba(255,255,255,.28); border-radius: 3px; }
nav a:hover, nav a[aria-current="page"] { background: white; color: var(--primary); }
.hero { padding: 4rem 0 2.5rem; display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); align-items: center; }
.hero h1 { font-size: clamp(2.35rem, 7vw, 4.8rem); line-height: 1.02; letter-spacing: -.045em; margin: 0 0 1rem; color: var(--primary); }
.eyebrow { display: inline-flex; width: fit-content; padding: .38rem .55rem; border-radius: 3px; background: var(--muted); color: var(--secondary); font-size: .78rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.lead { font-size: clamp(1.12rem, 2.2vw, 1.38rem); color: var(--secondary); max-width: 66ch; }
.hero-card, .card, .notice, .form-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; box-shadow: var(--shadow); }
.hero-card { padding: 1.25rem; }
.hero-card h2 { margin-top: 0; }
.status-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .55rem; border-radius: 3px; font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.badge.draft { background: var(--muted); color: var(--text); }
.badge.pilot { background: var(--warning); color: #fff; }
.badge.info { background: var(--information); color: #fff; }
.badge.safe { background: var(--success); color: #fff; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: .78rem 1rem; border-radius: 3px; border: 1px solid var(--primary); background: var(--primary); color: white; text-decoration: none; font-weight: 700; }
.button:hover { background: var(--secondary); color: white; }
.button.secondary { background: transparent; color: var(--primary); }
.button.secondary:hover { background: var(--muted); color: var(--secondary); }
.section { padding: 2.5rem 0; }
.section h2 { font-size: clamp(1.8rem, 4vw, 2.65rem); line-height: 1.12; letter-spacing: -.025em; margin: 0 0 1rem; color: var(--secondary); }
.grid { display: grid; gap: 1rem; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { padding: 1.15rem; }
.card h3 { margin-top: 0; color: var(--primary); }
.card .record-id, .record-id { font-family: "IBM Plex Mono", "Consolas", monospace; font-size: .85rem; color: var(--text-muted); }
.notice { padding: 1rem 1.15rem; border-left: 6px solid var(--information); box-shadow: none; }
.notice.warning { border-left-color: var(--warning); }
.notice.critical { border-left-color: var(--critical); }
.checklist { padding-left: 1.25rem; }
.checklist li { margin: .35rem 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); background: var(--surface); border-radius: 7px; }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th, td { padding: .85rem; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
th { background: var(--secondary); color: white; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }
.doc-controls { display: grid; gap: .75rem; grid-template-columns: 1fr minmax(180px, 260px); margin: 1rem 0; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid #aebbb5; border-radius: 3px; padding: .7rem .75rem; font: inherit; background: white; color: var(--text); }
textarea { min-height: 110px; resize: vertical; }
label { display: block; font-weight: 750; color: var(--secondary); margin-bottom: .35rem; }
fieldset { border: 1px solid var(--border); border-radius: 7px; padding: 1rem; margin: 0 0 1rem; background: var(--surface); }
legend { font-weight: 800; color: var(--primary); padding: 0 .35rem; }
.form-panel { padding: 1.25rem; margin: 1rem 0; box-shadow: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem .85rem; }
.checkbox { display: flex; align-items: flex-start; gap: .55rem; font-weight: 500; color: var(--text); }
.checkbox input { width: auto; min-height: auto; margin-top: .3rem; }
.output { white-space: pre-wrap; background: #f2f5f3; border: 1px solid var(--border); padding: 1rem; border-radius: 7px; font-family: "IBM Plex Mono", "Consolas", monospace; font-size: .88rem; overflow-x: auto; }
.site-footer { padding: 2rem 0 3rem; color: var(--text-muted); font-size: .95rem; }
.footer-inner { border-top: 1px solid var(--border); padding-top: 1rem; display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between; }
@media (max-width: 820px) {
  .hero, .grid.three, .grid.two, .doc-controls, .form-grid, .checkbox-grid { grid-template-columns: 1fr; }
  .nav-wrap { align-items: flex-start; flex-direction: column; }
  nav a { display: inline-flex; }
}
@media print {
  .site-header, .cta-row, .doc-controls, .button, .skip-link { display: none !important; }
  body { background: white; }
  main, .site-footer { width: auto; }
  .card, .hero-card, .notice, .form-panel { box-shadow: none; break-inside: avoid; }
  a[href]::after { content: " (" attr(href) ")"; font-size: .85em; }
}

/* Section-page and theme-option enhancements */
.hero.slim { padding-top: 3rem; grid-template-columns: minmax(0, 1fr) minmax(260px, .55fr); }
.section-title-row { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; margin-bottom:1rem; }
.heading-link { color: inherit; text-decoration: none; }
.heading-link:hover { color: var(--tertiary); text-decoration: underline; }
.text-link { font-weight: 800; white-space: nowrap; }
.card-link { display:block; color: var(--text); text-decoration:none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.card-link:hover { transform: translateY(-3px); box-shadow: 0 22px 44px rgba(24,33,38,.14); border-color: var(--primary); color: var(--text); }
.card-link span { color: var(--primary); font-weight: 900; }
.checklist.big li { margin: .75rem 0; font-size: 1.08rem; }
.theme-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:1rem; }
.theme-card { border-radius: 12px; padding: 1.25rem; border:1px solid var(--border); box-shadow: var(--shadow); background: var(--surface); }
.theme-card h2 { font-size: 1.45rem; }
.theme-swatch { display:flex; gap:.45rem; margin-bottom: 1rem; }
.theme-swatch span { width: 42px; height: 42px; border-radius: 999px; border: 2px solid rgba(255,255,255,.75); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.theme-card.forest { background:#F7F4EC; color:#182126; border-left: 8px solid #163A32; }
.theme-card.forest .theme-swatch span:nth-child(1){background:#163A32}.theme-card.forest .theme-swatch span:nth-child(2){background:#9B3F24}.theme-card.forest .theme-swatch span:nth-child(3){background:#F7F4EC}.theme-card.forest .theme-swatch span:nth-child(4){background:#1F5F8B}
.theme-card.blueprint { background:#eef7fb; color:#102433; border-left: 8px solid #0B1F33; }
.theme-card.blueprint .theme-swatch span:nth-child(1){background:#0B1F33}.theme-card.blueprint .theme-swatch span:nth-child(2){background:#334E68}.theme-card.blueprint .theme-swatch span:nth-child(3){background:#00A6D6}.theme-card.blueprint .theme-swatch span:nth-child(4){background:#F5FAFD}
.theme-card.editorial { background:#fbf2df; color:#241b15; border-left: 8px solid #7A1F1F; }
.theme-card.editorial .theme-swatch span:nth-child(1){background:#241B15}.theme-card.editorial .theme-swatch span:nth-child(2){background:#B88935}.theme-card.editorial .theme-swatch span:nth-child(3){background:#FBF2DF}.theme-card.editorial .theme-swatch span:nth-child(4){background:#7A1F1F}
.theme-card.darkmode { background:#111615; color:#edf5ef; border-left: 8px solid #35C287; }
.theme-card.darkmode .theme-swatch span:nth-child(1){background:#090D0C}.theme-card.darkmode .theme-swatch span:nth-child(2){background:#35C287}.theme-card.darkmode .theme-swatch span:nth-child(3){background:#F0B84A}.theme-card.darkmode .theme-swatch span:nth-child(4){background:#9BA7A2}
@media (max-width: 820px){ .section-title-row, .theme-grid { grid-template-columns:1fr; display:grid; } .text-link { white-space: normal; } }
