/* ---------------------------------------------------------------------
   Palette adapted from llody9977.github.io/vulnsignal — light paper
   background throughout (no black), accent blue, mono/tracked labels.
--------------------------------------------------------------------- */

/* JFZSKSealScript by Jingfeng Liu (SIL OFL 1.1) — subset to the 9 glyphs
   used in the homepage proverb. Full font, license, and source:
   https://github.com/jeffi369/JFZSKSealScript — see assets/fonts/OFL-JFZSKSealScript.txt */
@font-face {
  font-family: "JFZSK Seal Script";
  src: url("/journal/assets/fonts/jfzsk-seal-script-subset.woff2") format("woff2");
  font-display: swap;
}

:root {
  --paper: #f4f6f8;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --ink: #111827;
  --ink-2: #334155;
  --muted: #475569;
  --rule: #d7dee7;
  --rule-strong: #8491a3;
  --accent: #2457d6;
  --accent-dark: #193e9f;
  --accent-wash: #e9efff;
  --focus: #5b82f1;
  --teal: #0f766e;
  --amber: #a14c00;
  --amber-wash: #fdf1e0;
  --critical: #9f1239;
  --neutral: #64748b;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --sidebar-w: 264px;
  --header-h: 64px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.nav-open { overflow: hidden; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent-wash); color: var(--accent-dark); }

/* ---------------- Header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-weight: 600; font-size: 1rem; color: var(--ink); }
.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  margin: 0 auto;
  background: var(--ink-2);
}

/* ---------------- Layout / Sidebar ---------------- */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
  align-items: start;
}

.sidebar {
  border-right: 1px solid var(--rule);
  padding: 1.25rem 0.75rem 3rem;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior-y: contain;
  box-sizing: border-box;
}

.sidenav-section { margin-bottom: 0.25rem; }

.sidenav-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-align: left;
  color: var(--rule-strong);
  margin: 0;
  padding: 0.55rem 0.6rem;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
}

.sidenav-heading span { text-align: left; }

.sidenav-heading .chevron { margin-top: 0.2rem; }
.sidenav-heading:hover { background: var(--paper); color: var(--muted); }

.sidenav-heading .chevron {
  flex-shrink: 0;
  transition: transform 0.15s ease;
  color: var(--rule-strong);
}

.sidenav-section.is-expanded > .sidenav-heading .chevron { transform: rotate(180deg); }

.sidenav-body {
  display: none;
  padding-bottom: 0.5rem;
}

.sidenav-section.is-expanded > .sidenav-body { display: block; }

.sidenav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidenav-list-flat { margin-bottom: 0.25rem; }
.sidenav-list .sidenav-list { padding-left: 0.75rem; }
.sidenav-list-root { padding-left: 0; }

.sidenav-heading-sub {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--muted);
  padding: 0.4rem 0.6rem;
}

.sidenav-heading-sub:hover { color: var(--ink-2); }

.sidenav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--ink-2);
  border-left: 2px solid transparent;
}
.sidenav-link:hover { background: var(--paper); text-decoration: none; }

.sidenav-link.is-active {
  background: var(--accent-wash);
  color: var(--accent-dark);
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidenav-link.sidenav-top { font-weight: 600; color: var(--ink); }

.sidenav-link.is-soon {
  color: var(--rule-strong);
  cursor: default;
}

.badge-soon {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--neutral);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

/* ---------------- Content ---------------- */

.content {
  padding: 2.5rem 3rem 5rem;
  max-width: 1280px;
  width: 100%;
  min-width: 0;
}

.topic-metadata-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  margin: 0 auto 1.5rem;
  max-width: fit-content;
}

.meta-divider { color: var(--rule-strong); }
.meta-item strong { color: var(--ink); font-weight: 600; }

.status-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.status-fips-approved { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.status-ietf-standard { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.status-cnsa { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.status-not-fips { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.status-draft { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }

/* ---------------- Topic Footer Navigation ---------------- */

.topic-footer-nav {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.topic-nav-link {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--panel);
  text-decoration: none !important;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  min-width: 220px;
}

.topic-nav-link:hover {
  border-color: var(--accent);
  background: var(--paper);
}

.nav-prev { text-align: left; }
.nav-next { text-align: right; margin-left: auto; }

.nav-direction {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.nav-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

/* ---------------- Interactive ECB Demo Widget ---------------- */

.interactive-demo-card {
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--panel);
  padding: 1.5rem;
  margin: 1.75rem 0;
}

.demo-header {
  margin-bottom: 1.25rem;
}

.demo-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent-wash);
  color: var(--accent-dark);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.demo-header h3 {
  margin: 0.25rem 0 0.4rem;
  font-size: 1.2rem;
  color: var(--ink);
}

.demo-header p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.demo-form-group {
  margin-bottom: 1rem;
}

.demo-form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.demo-textarea, .demo-input {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}

.demo-textarea:focus, .demo-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.demo-help {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.demo-actions {
  display: flex;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-secondary {
  background: var(--paper);
  color: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--panel);
  color: var(--ink);
}

.demo-output-area {
  margin-top: 1.25rem;
}

.ecb-summary-banner {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge-padded {
  font-size: 0.72rem;
  color: var(--amber);
}

.ecb-blocks-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ecb-block-item {
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  background: var(--paper);
}

.ecb-block-item.is-repeat-block {
  border-color: #fca5a5;
  background: #fef2f2;
}

.block-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.block-num { font-weight: 600; color: var(--ink); }

.block-hex-val {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink);
}

.repeat-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* ---------------- Dictionary Attack Playground ---------------- */

.dict-table-wrapper {
  margin: 1rem 0;
  overflow-x: auto;
}

.dict-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.dict-table th, .dict-table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  text-align: left;
}

.dict-table th {
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
}

.matched-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.unmatched-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.target-block-decrypted {
  border-color: #bbf7d0 !important;
  background: #f0fdf4 !important;
}

.content h1 {
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.5rem;
}

.content h2 {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--ink);
  margin: 2rem 0 0.8rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.content h2:first-of-type { border-top: none; padding-top: 0; margin-top: 1.5rem; }

.content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 1.75rem 0 0.6rem;
}

.content p { margin: 0 0 1rem; max-width: 100%; }
.content ul, .content ol { margin: 0 0 1.1rem; padding-left: 1.3rem; max-width: 100%; }
.content li { margin-bottom: 0.35rem; }
.content li > ul, .content li > ol { margin-top: 0.35rem; }

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.lede {
  font-size: 1.1rem;
  color: var(--ink-2);
  max-width: 100%;
}

code, pre, kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

code {
  background: var(--accent-wash);
  color: var(--accent-dark);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  overflow-wrap: break-word;
  min-width: 0;
}

pre {
  background: var(--ink);
  color: #e5e9f0;
  padding: 1rem 1.1rem;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: none; color: inherit; padding: 0; }

table {
  display: table;
  max-width: 100%;
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: 0.92rem;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 1.5rem;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  max-width: none;
  margin: 0;
}

.table-scroll:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

th, td {
  border: 1px solid var(--rule);
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

th {
  background: var(--accent-wash);
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

tr:nth-child(even) td { background: var(--paper); }

blockquote {
  margin: 0 0 1.25rem;
  padding: 0.1rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-wash);
  border-radius: 0 6px 6px 0;
  color: var(--ink-2);
}

.callout {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  background: var(--panel);
  border-radius: 0 8px 8px 0;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.5rem;
}
.callout.warn { border-left-color: var(--amber); background: var(--amber-wash); }
.callout p:last-child { margin-bottom: 0; }
.callout-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  display: block;
  margin-bottom: 0.35rem;
}
.callout.warn .callout-title { color: var(--amber); }

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

/* ---------------- Diagrams / images ---------------- */

.diagram-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 0 auto 1.75rem;
  text-align: center;
  width: 100%;
}

.diagram-frame img, .content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.diagram-frame picture {
  display: block;
  width: 100%;
}

.diagram-open-link {
  position: relative;
  display: block;
  width: 100%;
  color: inherit;
  border-radius: 8px;
  cursor: zoom-in;
}

.diagram-open-link::after {
  content: "Open full size ↗";
  display: inline-block;
  margin: 0.5rem auto 0;
  padding: 0.25rem 0.45rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  pointer-events: none;
}

.diagram-open-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.diagram-video {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  background: var(--paper);
}

.diagram-caption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.9rem auto 0;
  text-align: center;
}

/* Displayed formula. Plain text, not a math renderer: the site loads no
   MathJax or KaTeX, so formulas are written as literal Unicode. */
.formula {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  text-align: center;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  margin: 1rem auto;
  overflow-x: auto;
}

/* ---------------- Security discipline layers ---------------- */

.security-layer-map {
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--panel);
  padding: 1.25rem;
  margin: 0 0 1.75rem;
}

.security-layer {
  display: grid;
  grid-template-columns: minmax(7.5rem, 0.28fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 9px;
  padding: 0.8rem 1rem;
  background: var(--paper);
}

.security-layer-purpose { border-left-color: var(--critical); }
.security-layer-direct { border-left-color: var(--amber); }
.security-layer-understand { border-left-color: var(--accent); }
.security-layer-protect { border-left-color: var(--teal); }
.security-layer-operate { border-left-color: var(--accent-dark); }
.security-layer-assure { border-left-color: var(--neutral); }

.security-layer-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.security-layer strong { color: var(--ink); }
.security-layer p { margin: 0.2rem 0 0; font-size: 0.9rem; }

.security-layer-connector {
  min-height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 600px) {
  .diagram-frame-openable { padding: 0.75rem; }
  .diagram-open-link::after { content: "Full size ↗"; }
  .security-layer-map { padding: 0.9rem; }
  .security-layer { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
}

@media (max-width: 560px) {
  .topic-footer-nav { flex-direction: column; }
  .topic-nav-link { min-width: 0; width: 100%; }
  .nav-next { margin-left: 0; }
}

.image-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.image-pair-compact {
  display: flex;
  justify-content: flex-start;
  gap: 2.5rem;
  align-items: flex-start;
  margin: 1.5rem 0;
}

.image-pair figure,
.image-pair-compact figure {
  margin: 0;
  text-align: center;
}

.image-pair img,
.image-pair-compact img {
  max-width: 200px;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.image-pair figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--ink-2);
}

.image-pair figcaption code {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  word-break: break-all;
}

@media (max-width: 600px) {
  .image-pair { grid-template-columns: 1fr; }
  .image-pair-compact { flex-wrap: wrap; gap: 1.25rem; }
}

/* ---------------- Topic cards (landing page) ---------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
}

.topic-card {
  display: block;
  border: 1px solid var(--rule);
  background: var(--panel);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  color: var(--ink-2);
}

a.topic-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(36, 87, 214, 0.08);
  text-decoration: none;
}

.topic-card.is-soon {
  border-style: dashed;
  color: var(--neutral);
}

.topic-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.topic-card-title {
  font-weight: 600;
  color: var(--ink);
  font-size: 1rem;
}
.topic-card.is-soon .topic-card-title { color: var(--muted); }

.topic-card-desc { font-size: 0.88rem; margin: 0; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  margin: 1.5rem 0 2rem;
}

.stat-cell { background: var(--panel); padding: 0.9rem 1.1rem; }
.stat-cell-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 0.3rem;
}
.stat-cell-value { color: var(--ink); font-weight: 600; }

.page-footer {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
  .nav-toggle { display: flex; }

  .layout { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    left: 0;
    top: var(--header-h);
    width: min(85vw, 320px);
    height: calc(100vh - var(--header-h));
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior-y: contain;
    box-sizing: border-box;
    background: var(--paper);
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    z-index: 20;
    box-shadow: 2px 0 12px rgba(15, 23, 42, 0.08);
  }

  .sidebar.is-open { transform: translateX(0); }

  .content { padding: 2rem 1.25rem 4rem; }
  .content h1 { font-size: 1.9rem; }

  .table-scroll table {
    width: max(100%, 44rem);
    min-width: 100%;
    table-layout: auto;
  }
}
