:root {
  --bg: #0c0b09;
  --surface: #13120f;
  --surface-2: #1a1915;
  --border: #2a2820;
  --text: #ede9e0;
  --muted: #9b9588;
  --gold: #d4c5a0;
  --gold-dim: rgba(212, 197, 160, 0.14);
  --danger: #e8a0a0;
  --danger-bg: #2a1414;
  --ok: #a8c9a0;
  --ok-bg: #142018;
  --warn: #e0c090;
  --warn-bg: #241c10;
  --fill-bg: #1e1c16;
  --fill-border: #d4c5a0;
  --radius: 12px;
  --font-display: "Cabinet Grotesk", system-ui, sans-serif;
  --font-body: "Satoshi", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --max: 44rem;
  --header-h: 3.25rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
}

img, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:hover { color: var(--text); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}
h1 { font-size: clamp(1.55rem, 4.5vw, 2rem); margin: 0 0 0.6rem; }
h2 {
  font-size: clamp(1.2rem, 3.5vw, 1.45rem);
  margin: 2rem 0 0.85rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
  color: var(--gold);
}
h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
h3 { font-size: 1.05rem; margin: 1.4rem 0 0.45rem; color: var(--text); }
h4 { font-size: 0.95rem; margin: 1.1rem 0 0.35rem; color: var(--muted); }

p, li { margin: 0.45rem 0; }
ul, ol { padding-left: 1.2rem; }
strong { font-weight: 600; color: var(--text); }
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.75rem 0;
}
blockquote {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--gold);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
}
blockquote p:first-child { margin-top: 0; }
blockquote p:last-child { margin-bottom: 0; }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
}
code {
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Header — single row: start | brand | actions */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--header-h);
  height: auto;
  background: rgba(12, 11, 9, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: calc(var(--max) + 4rem);
  margin: 0 auto;
  padding: 0.55rem 1rem;
  min-height: var(--header-h);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.65rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
  flex: 1;
}
.brand:hover { color: var(--gold); }
.brand svg { width: 1.85rem; height: 1.85rem; flex-shrink: 0; }
.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-left: auto;
}
a.icon-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
}
.icon-btn, .nav-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
  flex-shrink: 0;
}
.icon-btn:hover, .nav-toggle:hover { border-color: var(--gold); color: var(--gold); }

/* Search */
.search-panel {
  display: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0.75rem 1rem;
}
.search-panel.open { display: block; }
.search-panel .inner {
  max-width: calc(var(--max) + 4rem);
  margin: 0 auto;
}
#site-search {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  font-family: var(--font-body);
  font-size: 1rem;
}
#site-search:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}
#search-results {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  max-height: 50vh;
  overflow: auto;
}
#search-results li a {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
}
#search-results li a:hover {
  background: var(--gold-dim);
  border-color: var(--border);
}
#search-results .meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* Layout */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem 1rem 4.5rem;
}
.page-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.page-hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.45rem;
}
.page-hero p { margin: 0.35rem 0 0; color: var(--muted); }
.updated {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

/* Urgent cards on home */
.urgent-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}
@media (min-width: 540px) {
  .urgent-grid { grid-template-columns: 1fr 1fr; }
}
.urgent-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.urgent-card:hover {
  border-color: var(--gold);
  background: var(--surface-2);
  color: inherit;
}
.urgent-card.danger {
  border-color: #5a3030;
  background: var(--danger-bg);
}
.urgent-card .label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.urgent-card.danger .label { color: var(--danger); }
.urgent-card .title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 0.25rem;
}
.urgent-card .hint { color: var(--muted); font-size: 0.92rem; margin: 0; }
.phone-big {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--gold);
  margin: 0.2rem 0;
}

/* Nav cards */
.nav-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}
@media (min-width: 540px) {
  .nav-grid { grid-template-columns: 1fr 1fr; }
}
.nav-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}
.nav-card:hover {
  border-color: var(--gold);
  color: inherit;
}
.nav-card .num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--gold);
  letter-spacing: 0.04em;
}
.nav-card .title {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0.2rem 0;
}
.nav-card .hint { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* Priority badges */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  vertical-align: middle;
}
.badge.essential { color: var(--ok); background: var(--ok-bg); border-color: #2a4030; }
.badge.useful { color: #9bb8d0; background: #141c28; border-color: #2a3848; }
.badge.nice { color: var(--warn); background: var(--warn-bg); border-color: #403420; }

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 0.85rem 0 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 280px;
}
th, td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }
td strong { color: var(--gold); }

/* FILL markers */
.fill, .fill-blank {
  display: inline;
  background: var(--fill-bg);
  border-bottom: 2px dashed var(--fill-border);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0 0.2em;
}
.fill-block {
  display: block;
  margin: 0.75rem 0;
  padding: 0.75rem 0.9rem;
  background: var(--fill-bg);
  border: 1px dashed var(--fill-border);
  border-radius: 8px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* Checklists */
.content ul li input[type="checkbox"],
.content li > input[type="checkbox"] {
  margin-right: 0.4rem;
}
.checklist li::marker { color: var(--gold); }

/* CO / warn callouts */
.callout {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.callout.co {
  background: var(--danger-bg);
  border-color: #5a3030;
}
.callout.co strong { color: var(--danger); }
.callout.warn {
  background: var(--warn-bg);
  border-color: #403420;
}

/* Section nav / footer */
.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.section-nav a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}
.section-nav a:hover { color: var(--gold); border-color: var(--gold); }

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1rem 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer p { margin: 0.35rem 0; }

/* Mobile bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 35;
  background: rgba(12, 11, 9, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom));
}
.bottom-nav a {
  text-decoration: none;
  color: var(--muted);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.35rem 0.15rem;
  border-radius: 6px;
}
.bottom-nav a:hover,
.bottom-nav a.active { color: var(--gold); }
.bottom-nav .bn-label { display: block; margin-top: 0.1rem; }

/* Drawer nav */
.drawer {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 45;
  background: rgba(0,0,0,0.55);
}
.drawer.open { display: block; }
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(20rem, 92vw);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 1rem;
}
.drawer-panel a {
  display: block;
  padding: 0.7rem 0.75rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 8px;
  border: 1px solid transparent;
  margin-bottom: 0.25rem;
}
.drawer-panel a:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--gold);
}
.drawer-panel .group {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.85rem 0 0.35rem;
  padding: 0 0.75rem;
}

/* Q&A */
.qa-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 1.25rem;
}
.qa-nav a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}
.qa-nav a:hover { color: var(--gold); border-color: var(--gold); }
.qa-item {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 0.65rem 0;
}
.qa-item h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  color: var(--gold);
}
.qa-item > *:last-child { margin-bottom: 0; }

.toc-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 0 0 1.25rem;
}
.toc-mini ol { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.toc-mini a { text-decoration: none; }
.toc-mini a:hover { text-decoration: underline; }

.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn.primary {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

.note-muted { color: var(--muted); font-size: 0.92rem; }

/* Print */
@media print {
  :root { --bg: #fff; --text: #111; --muted: #444; --gold: #333; --surface: #fff; --surface-2: #f5f5f5; --border: #ccc; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .site-header, .bottom-nav, .drawer, .search-panel, .nav-toggle, .header-actions, .section-nav, .btn { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  a { color: #111; text-decoration: none; }
  .page-hero, .urgent-card, .nav-card, .qa-item, .table-wrap, blockquote, .callout {
    border-color: #bbb;
    background: #fff;
    break-inside: avoid;
  }
  h2, h3 { break-after: avoid; color: #111; }
  .fill, .fill-blank, .fill-block {
    background: #fff;
    border-bottom: 1px solid #666;
    color: #333;
  }
  table { break-inside: auto; }
  tr { break-inside: avoid; }
}

@media (min-width: 720px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
}
body { padding-bottom: 4.25rem; }
@media (min-width: 720px) {
  body { padding-bottom: 0; }
}

/* Contact tables: keep website links readable */
.content table a {
  word-break: break-word;
  color: var(--gold);
}
.content table a:hover { text-decoration: underline; }

.download-bank-btn {
  white-space: nowrap;
}
/* Short label on narrow screens via data attribute text swap */
.download-bank-btn .label-full { display: inline; }
.download-bank-btn .label-short { display: none; }
@media (max-width: 720px) {
  .brand-sub { display: none; }
  .download-bank-btn .label-full { display: none; }
  .download-bank-btn .label-short { display: inline; }
}
@media (max-width: 420px) {
  .brand-title { font-size: 0.82rem; }
  .icon-btn, .nav-toggle { padding: 0.3rem 0.45rem; font-size: 0.62rem; }
}


/* Contact cards — website always visible */
.contact-cards {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem 1.05rem;
}
.contact-title {
  margin: 0 0 0.55rem;
  font-size: 1.02rem;
  color: var(--text);
  border: 0;
  padding: 0;
}
.contact-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.35rem;
}
.contact-number {
  font-size: 1.05rem;
  margin: 0.25rem 0;
  color: var(--gold);
}
.contact-number strong { color: var(--gold); }
.contact-tel {
  color: var(--gold);
  text-decoration: none;
}
.contact-tel:hover { text-decoration: underline; }
.contact-web {
  margin: 0.45rem 0 0.15rem;
  font-size: 0.95rem;
  line-height: 1.45;
  word-break: break-word;
}
.contact-web a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.contact-when {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}


/* Home urgent cards: phone + website both clickable */
.urgent-card .phone-big {
  display: block;
  text-decoration: none;
  color: inherit;
}
.urgent-card a.phone-big:hover { color: var(--gold); }
.urgent-card .hint a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.card-web {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  word-break: break-word;
}
.card-web a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.urgent-card.danger .card-web a { color: var(--danger); }
