/* ==========================================================================
   辐射备忘录 — site design system
   Plain CSS, no build step.  Light, paper-like scientific reading surface.
   ========================================================================== */

:root {
  --paper: #f6f5f0;
  --surface: #fffefb;
  --surface-2: #efeee7;
  --surface-3: #e7e6de;
  --ink: #17212b;
  --ink-soft: #35414c;
  --muted: #69747e;
  --line: #dedfd7;
  --line-strong: #c8cabf;
  --accent: #0d5c63;
  --accent-deep: #08454b;
  --accent-soft: #e5efed;
  --accent-tint: #f1f6f4;
  --amber: #92571a;
  --amber-soft: #f4ecdf;
  --red: #8b3030;
  --radius: 4px;
  --header-h: 68px;
  --shell: 1220px;
  --measure: 44rem;
  --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    Arial, "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei",
    "Hiragino Sans GB", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono",
    Menlo, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.85;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg, video, canvas { max-width: 100%; }
img { height: auto; }
figure { margin: 0; }
p { margin: 0 0 1.1em; }
h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  font-weight: 650;
  line-height: 1.28;
  letter-spacing: -0.012em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.2rem, 4.2vw, 3.35rem); line-height: 1.14; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.45rem, 2.1vw, 1.8rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.02rem; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-deep); text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
strong, b { color: var(--ink); font-weight: 650; }
small { font-size: 0.86em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
::selection { background: var(--accent-soft); color: var(--ink); }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }
.muted { color: var(--muted); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius);
  text-decoration: none; font-size: 14px;
}
.skip-link:focus { top: 12px; color: #fff; }

.icon { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: -0.18em; }
.icon-lg { width: 30px; height: 30px; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 245, 240, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(140%) blur(10px);
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 26px;
  position: relative;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: 0 0 auto; }
.brand-mark { width: 30px; height: 30px; color: var(--accent); display: inline-flex; }
.brand-mark svg { width: 30px; height: 30px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 17px; letter-spacing: 0.01em; color: var(--ink); }
.brand-sub { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.primary-nav { display: flex; align-items: stretch; gap: 2px; margin-left: auto; height: var(--header-h); }
.primary-nav a {
  display: inline-flex; align-items: center; padding: 0 11px;
  color: var(--ink-soft); text-decoration: none; font-size: 14.5px;
  border-bottom: 2px solid transparent;
}
.primary-nav a:hover { color: var(--accent); border-bottom-color: var(--accent-soft); }
.primary-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.header-tools { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.search-link {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-soft); text-decoration: none; font-size: 13.5px;
}
.search-link:hover { border-color: var(--accent); color: var(--accent); }
.search-link .icon { width: 16px; height: 16px; }
.key-hint {
  font-family: var(--font-mono); font-size: 10.5px; line-height: 1;
  padding: 3px 5px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted);
  background: var(--paper);
}
.nav-drawer { display: none; position: relative; }
.nav-toggle {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
  color: var(--ink-soft); font-size: 13.5px; cursor: pointer; list-style: none;
}
.nav-toggle::-webkit-details-marker { display: none; }
.nav-toggle .icon { width: 18px; height: 18px; }
.nav-panel {
  position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 60;
  background: var(--surface); border-bottom: 1px solid var(--line-strong);
  padding: 12px clamp(20px, 4vw, 40px) 22px;
  box-shadow: 0 14px 30px rgba(23, 33, 43, 0.08);
  max-height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.nav-panel nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.nav-panel nav a {
  display: block; padding: 12px 2px; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-size: 16px;
}
.nav-panel nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.nav-panel-search {
  display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 12px 14px;
  background: var(--accent-tint); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--accent); text-decoration: none; font-size: 14px;
}
.nav-panel-meta { display: flex; gap: 20px; margin-top: 16px; font-size: 13px; }
.nav-panel-meta a { color: var(--muted); text-decoration: none; }
.nav-panel-meta a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Buttons, chips, forms
   -------------------------------------------------------------------------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius);
  font-family: inherit; font-size: 14px; font-weight: 550; line-height: 1;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
}
.button-solid { background: var(--accent); color: #fff; border-color: var(--accent); }
.button-solid:hover { background: var(--accent-deep); color: #fff; border-color: var(--accent-deep); }
.button-outline { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.button-outline:hover { border-color: var(--accent); color: var(--accent); }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius);
  background: transparent; color: var(--muted); cursor: pointer;
}
.icon-button:hover { color: var(--ink); border-color: var(--line-strong); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--ink-soft); font-family: inherit; font-size: 12.5px; text-decoration: none; cursor: pointer;
}
.chip span { color: var(--muted); font-size: 11px; }
.chip:hover, .chip.is-active { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }
.chip.is-active span { color: var(--accent); }
.chip-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0; }
.chip-bar .chip { background: var(--surface); }

.kicker, .eyebrow {
  font-size: 11px; line-height: 1.5; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px; font-weight: 600;
}
.kicker a { color: var(--accent); text-decoration: none; }
.kicker .kicker-sep { margin: 0 8px; color: var(--line-strong); }
.eyebrow { color: var(--accent); }

.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 16px 0 0; }
.tag-list li {
  font-size: 11.5px; line-height: 1.6; padding: 2px 8px;
  border: 1px solid var(--line); border-radius: 2px; color: var(--muted); background: var(--surface);
}
.badge {
  display: inline-flex; align-items: center; height: 21px; padding: 0 7px;
  border-radius: 2px; font-size: 10.5px; letter-spacing: 0.06em; font-weight: 600;
  vertical-align: 1px;
}
.badge-intro { background: var(--accent-soft); color: var(--accent-deep); }
.badge-mid { background: var(--amber-soft); color: var(--amber); }
.badge-pro { background: #e8e3d8; color: #5c4a2b; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.page-home { background: var(--paper); }
.hero { padding: clamp(44px, 6vw, 78px) 0 clamp(40px, 5vw, 64px); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.hero-main, .hero-index { min-width: 0; }
.hero-main h1 { margin: 14px 0 20px; font-size: clamp(2.7rem, 5.4vw, 4.5rem); letter-spacing: -0.04em; line-height: 1.06; }
.hero-lede { font-size: clamp(16px, 1.4vw, 18px); line-height: 1.85; max-width: 35em; color: var(--ink-soft); }
.hero-search {
  width: 100%; display: flex; align-items: center; gap: 10px; margin-top: 30px; padding: 5px 5px 5px 16px;
  max-width: 620px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
.hero-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hero-search .icon { color: var(--muted); }
.hero-search input {
  flex: 1 1 auto; min-width: 0; border: 0; background: transparent; height: 46px;
  font-family: inherit; font-size: 16px; color: var(--ink); outline: none;
}
.hero-search input::placeholder { color: #8a949c; }
.hero-search .button { min-height: 42px; }
.quick-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 18px; font-size: 12.5px; }
.quick-links span { color: var(--muted); letter-spacing: 0.08em; }
.quick-links a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--line-strong); padding-bottom: 1px; }
.quick-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.hero-index { border: 1px solid var(--line); background: var(--surface); }
.hero-index-head {
  display: flex; justify-content: space-between; padding: 12px 18px;
  border-bottom: 1px solid var(--line); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
}
.index-row {
  display: grid; grid-template-columns: 34px 1fr auto 18px; align-items: center; gap: 8px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
}
.index-row:last-of-type { border-bottom: 0; }
.index-row:hover { background: var(--accent-tint); color: var(--accent); }
.index-num { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.index-label { font-size: 15px; }
.index-count { font-size: 12px; color: var(--muted); }
.index-row .icon { width: 15px; height: 15px; color: var(--line-strong); }
.index-row:hover .icon { color: var(--accent); }
.hero-index-foot { margin: 0; padding: 12px 18px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); }

/* --------------------------------------------------------------------------
   Sections & topic cards
   -------------------------------------------------------------------------- */
.section { padding: clamp(52px, 6vw, 84px) 0; }
.section-alt { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 60ch; margin-bottom: 30px; }
.section-head h2 { margin-bottom: 8px; font-size: clamp(1.65rem, 2.6vw, 2.1rem); }
.section-desc { color: var(--muted); font-size: 15.5px; line-height: 1.8; max-width: 62ch; }
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; max-width: none; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; text-decoration: none; white-space: nowrap; }
.text-link .icon { width: 15px; height: 15px; }
.text-link:hover { text-decoration: underline; }

.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.topic-card {
  display: flex; flex-direction: column; padding: 22px 22px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  min-height: 302px;
}
.topic-card:hover { border-color: var(--accent); }
.topic-head { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.topic-num { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.topic-icon { display: inline-flex; color: var(--accent); }
.topic-icon .icon { width: 19px; height: 19px; }
.topic-head h2 { font-size: 18px; margin: 0; letter-spacing: 0; }
.topic-count { font-size: 11.5px; color: var(--muted); }
.topic-blurb { font-size: 14px; line-height: 1.75; color: var(--muted); margin: 12px 0 14px; }
.topic-links { list-style: none; margin: auto 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); }
.topic-links li { border-bottom: 1px solid var(--line); }
.topic-links li:last-child { border-bottom: 0; }
.topic-links a {
  display: block; padding: 7px 0; font-size: 13px; color: var(--ink-soft);
  text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topic-links a:hover { color: var(--accent); }
.topic-more { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; font-size: 12.5px; text-decoration: none; }
.topic-more .icon { width: 14px; height: 14px; }
.topic-index { background: var(--accent-tint); border-color: var(--accent-soft); }

/* Reading paths */
.path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.path-card { border-top: 2px solid var(--ink); padding-top: 18px; }
.path-level { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; font-weight: 600; }
.path-card h3 { font-size: 19px; margin-bottom: 8px; }
.path-card > p:not(.path-level) { font-size: 14px; color: var(--muted); min-height: 3.4em; }
.path-steps { list-style: none; margin: 16px 0 0; padding: 0; }
.path-steps li { display: grid; grid-template-columns: 30px 1fr; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line); }
.step-num { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.path-steps a { font-size: 14px; text-decoration: none; color: var(--ink-soft); }
.path-steps a:hover { color: var(--accent); text-decoration: underline; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.review-grid, .tool-grid { display: grid; gap: 16px; }
.review-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.entry-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; min-height: 210px;
}
.entry-card:hover { border-color: var(--accent); }
.entry-card.has-thumb {
  display: grid; grid-template-columns: 170px minmax(0, 1fr); padding: 0; overflow: hidden; min-height: 140px;
}
.entry-thumb { display: block; background: var(--surface-2); overflow: hidden; min-height: 120px; }
.entry-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.entry-card.has-thumb .entry-body { padding: 18px 20px; }
.pdf-thumb { display: flex; align-items: center; justify-content: center; color: var(--accent); }
.pdf-thumb .icon { width: 34px; height: 34px; }
.entry-kicker { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.entry-kicker .badge { margin-left: 6px; text-transform: none; letter-spacing: 0.02em; }
.entry-card h3, .review-card h3, .tool-card h3 { font-size: 17px; line-height: 1.45; margin: 0 0 8px; letter-spacing: 0; }
.entry-card h3 a, .review-card h3 a, .tool-card h3 a { color: var(--ink); text-decoration: none; }
.entry-card h3 a:hover, .review-card h3 a:hover, .tool-card h3 a:hover { color: var(--accent); }
.entry-card p, .review-card p, .tool-card p { font-size: 14px; line-height: 1.75; color: var(--muted); margin: 0 0 12px; }
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; font-size: 11.5px; color: var(--muted); }
.meta-dot { color: var(--line-strong); }

.review-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.review-card:hover { border-color: var(--accent); }
.review-thumb { display: block; aspect-ratio: 7 / 5; background: var(--surface-2); overflow: hidden; }
.review-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.review-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.spec-list-inline { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; padding: 0; margin: auto 0 0; }
.spec-list-inline li { font-size: 10.5px; line-height: 1.6; padding: 2px 7px; border: 1px solid var(--line); color: var(--muted); border-radius: 2px; }

.tool-card {
  display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
}
.tool-card:hover { border-color: var(--accent); }
.tool-icon { width: 44px; height: 44px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); border-radius: 50%; }
.tool-icon .icon { width: 21px; height: 21px; }
.tool-body { min-width: 0; }
.tool-open { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; letter-spacing: 0.04em; color: var(--accent); }
.tool-open .icon { width: 13px; height: 13px; }
.tool-list .tool-card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 0; background: transparent; grid-template-columns: 34px 1fr; gap: 12px; }
.tool-list .tool-icon { width: 32px; height: 32px; background: transparent; border: 1px solid var(--line); }
.tool-list .tool-icon .icon { width: 17px; height: 17px; }
.tool-list .tool-card h3 { font-size: 15px; margin-bottom: 4px; }
.tool-list .tool-card p { font-size: 13px; margin-bottom: 6px; }
.tool-list .entry-kicker, .tool-list .tool-open { display: none; }

/* --------------------------------------------------------------------------
   Timeline / about band
   -------------------------------------------------------------------------- */
.home-columns { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 6vw, 80px); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 1px solid var(--line-strong); }
.log-item { position: relative; padding: 0 0 22px 12px; }
.log-item::before {
  content: ""; position: absolute; left: -22px; top: 7px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--paper); border: 1px solid var(--accent);
}
.log-date { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent); letter-spacing: 0.02em; }
.log-body p { margin: 4px 0 0; font-size: 14.5px; line-height: 1.7; color: var(--ink-soft); }
.log-body a { color: var(--ink-soft); text-decoration: none; }
.log-body a:hover { color: var(--accent); text-decoration: underline; }
.timeline-compact .log-item { padding-bottom: 16px; }
.timeline-compact .log-body p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.about-band {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.5fr); gap: 40px;
  background: var(--ink); color: #e9e7de; padding: clamp(28px, 4vw, 48px); border-radius: var(--radius);
}
.about-band .eyebrow { color: #9fc3bf; }
.about-band h2 { color: #fdfbf4; font-size: clamp(1.5rem, 2.4vw, 2rem); }
.about-band p { color: #c9c7bd; font-size: 15px; max-width: 56ch; }
.about-band a { color: #e9e7de; }
.about-band .button-outline { border-color: #5b666c; color: #f3f1e9; }
.about-band .button-outline:hover { border-color: #9fc3bf; color: #fff; }
.about-band-links { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 20px; }
.about-band-side { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-content: start; border-left: 1px solid #3a454c; padding-left: 32px; }
.stat-value { display: block; font-size: 30px; line-height: 1; color: #fdfbf4; font-weight: 600; letter-spacing: -0.02em; }
.stat-label { display: block; margin-top: 7px; font-size: 11px; letter-spacing: 0.08em; color: #9ba5aa; }

/* --------------------------------------------------------------------------
   Hub pages
   -------------------------------------------------------------------------- */
.page-hub, .page-sitemap, .page-changelog, .page-search, .page-about { padding-bottom: 40px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 22px 0 0; font-size: 12.5px; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.crumb-sep { color: var(--line-strong); }
.breadcrumb [aria-current="page"] { color: var(--ink-soft); }
.hub-head { padding: 34px 0 30px; border-bottom: 1px solid var(--line); }
.hub-head h1 { margin: 8px 0 16px; }
.hub-lede { max-width: 52em; font-size: 17px; line-height: 1.85; color: var(--ink-soft); }
.hub-intro { max-width: 64em; margin: 18px 0 0; padding-left: 16px; border-left: 2px solid var(--accent-soft); }
.hub-intro p { font-size: 14.5px; margin-bottom: 4px; }
.hub-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin-top: 22px; font-size: 12px; color: var(--muted); }
.hub-meta .text-link { margin-left: auto; }
.chip-bar { position: sticky; top: var(--header-h); z-index: 12; margin: 0 0 8px; padding: 12px 0; background: var(--paper); border-bottom: 1px solid var(--line); }
.listing-group { padding: 42px 0 10px; scroll-margin-top: calc(var(--header-h) + 60px); }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.group-head h2 { font-size: 20px; margin: 0; }
.group-count { font-size: 11.5px; color: var(--muted); }
.hub-foot { padding: 30px 0 0; border-top: 1px solid var(--line); margin-top: 40px; }

/* --------------------------------------------------------------------------
   Article page
   -------------------------------------------------------------------------- */
.page-article { padding-bottom: 40px; }
.article-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: clamp(36px, 5vw, 64px);
  max-width: 1080px; margin: 0 auto; padding: 30px 0 20px; align-items: start;
}
.article-grid--wide { grid-template-columns: minmax(0, 1fr); max-width: 1000px; }
.article-head { padding-bottom: 8px; }
.article-head h1 { margin: 8px 0 16px; font-size: clamp(2rem, 3.7vw, 2.9rem); }
.title-note { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin: -8px 0 14px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 12.5px; color: var(--muted); }
.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-item .icon { width: 14px; height: 14px; }
.article-head .tag-list { margin-top: 14px; }

.toc-inline { display: none; margin: 20px 0 0; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }
.toc-inline summary { display: flex; justify-content: space-between; padding: 12px 16px; cursor: pointer; font-size: 13px; color: var(--ink); }
.toc-inline summary span { color: var(--muted); font-size: 11.5px; }
.toc-inline .toc-list { padding: 0 16px 14px; }

.article-side { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; font-size: 13px; }
.toc { border-top: 2px solid var(--ink); padding-top: 12px; }
.side-title { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.toc-list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc-item { margin: 0; padding: 3px 0; line-height: 1.55; }
.toc-item a { display: block; padding: 2px 0 2px 9px; border-left: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 12.5px; }
.toc-item a:hover { color: var(--accent); border-left-color: var(--accent); }
.toc-item a.is-active { color: var(--accent); border-left: 2px solid var(--accent); font-weight: 600; }
.toc-item.toc-l3 { padding-left: 12px; font-size: 0.95em; }
.side-block { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); }
.side-links { list-style: none; margin: 0; padding: 0; }
.side-links a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; color: var(--ink-soft); text-decoration: none; font-size: 12.5px; line-height: 1.5; border-bottom: 1px solid var(--line); }
.side-links a:hover { color: var(--accent); }
.side-links .icon { width: 13px; height: 13px; color: var(--line-strong); flex: 0 0 auto; margin-top: 3px; }
.side-back { display: inline-block; margin-top: 24px; font-size: 12px; color: var(--muted); text-decoration: none; }
.side-back:hover { color: var(--accent); }

.notice { margin: 24px 0 0; padding: 14px 18px; border-left: 3px solid var(--amber); background: var(--amber-soft); font-size: 13.5px; line-height: 1.75; }
.notice strong { display: block; margin-bottom: 3px; color: #6f4212; }
.notice p { margin: 0; color: #6b5945; }
.notice a { color: #6f4212; }

.article-foot { margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--line); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.pager-link { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.pager-link:hover { border-color: var(--accent); }
.pager-link span { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pager-link strong { font-size: 14px; font-weight: 550; color: var(--ink); line-height: 1.5; }
.pager-next { text-align: right; }
.article-back { display: flex; justify-content: space-between; gap: 16px; font-size: 12.5px; }
.article-back a { color: var(--muted); text-decoration: none; }
.article-back a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Prose — the reading surface
   -------------------------------------------------------------------------- */
.prose { max-width: var(--measure); font-size: 17px; line-height: 1.95; color: var(--ink-soft); }
.article-grid--wide .prose { max-width: 100%; }
.prose > :first-child { margin-top: 0; }
.prose > p:first-of-type { font-size: 1.06em; color: var(--ink); }
.prose p { margin: 0 0 1.35em; }
.prose h2 {
  margin: 3rem 0 0.9rem; padding-top: 1.25rem; border-top: 1px solid var(--line);
  font-size: clamp(1.32rem, 2vw, 1.52rem); line-height: 1.4;
}
.prose h3 { margin: 2.2rem 0 0.6rem; font-size: 1.17rem; line-height: 1.5; }
.prose h4 { margin: 1.8rem 0 0.5rem; font-size: 1rem; color: var(--ink); }
.prose h2 + p, .prose h3 + p, .prose h4 + p { margin-top: 0.4em; }
.prose ul, .prose ol { margin: 0 0 1.35em; padding-left: 1.45em; }
.prose li { margin: 0.42em 0; padding-left: 0.15em; }
.prose ul > li::marker { color: var(--accent); }
.prose ol > li::marker { color: var(--muted); font-family: var(--font-mono); font-size: 0.9em; }
.prose li > ul, .prose li > ol { margin: 0.4em 0 0.5em; }
.prose a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a.external::after { content: "↗"; font-size: 0.72em; margin-left: 2px; opacity: 0.55; text-decoration: none; display: inline-block; }
.prose strong { font-weight: 650; }
.prose u.spelling { text-decoration: underline dotted; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.prose s { color: var(--muted); }
.prose sup, .prose sub { line-height: 0; font-size: 0.72em; }
.prose code, .prose kbd, .prose samp {
  font-family: var(--font-mono); font-size: 0.87em; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 2px; padding: 0.08em 0.32em; color: var(--ink);
}
.prose pre { background: var(--ink); color: #e9eee9; padding: 16px 18px; overflow-x: auto; border-radius: var(--radius); font-size: 13.5px; line-height: 1.7; }
.prose pre code { background: transparent; border: 0; padding: 0; color: inherit; }
.prose blockquote { margin: 1.8rem 0; padding: 14px 20px; border-left: 3px solid var(--accent); background: var(--accent-tint); color: var(--ink-soft); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { margin: 2.4rem 0; }

.prose img.content-img {
  display: block; max-width: 100%; height: auto; margin: 1.7rem auto;
  border: 1px solid var(--line); background: var(--surface); border-radius: 2px;
}
.prose img.content-img:not([width]) { width: auto; }
.prose figure { margin: 1.8rem 0; }
.prose figcaption { margin-top: 7px; font-size: 12px; line-height: 1.6; color: var(--muted); text-align: center; }

.figure-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 10px; margin: 1.9rem 0; }
.figure-grid .gallery-item { margin: 0; padding: 8px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.figure-grid .gallery-item img { margin: 0; border: 0; max-height: 340px; width: auto; max-width: 100%; object-fit: contain; }
.figure-grid .gallery-item a { display: block; line-height: 0; }
.figure-grid figcaption { margin-top: 6px; }

.embed { position: relative; aspect-ratio: 16 / 9; margin: 1.9rem 0; background: #000; border: 1px solid var(--line); }
.embed iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }
.prose video.content-video { display: block; width: 100%; height: auto; margin: 1.8rem 0; background: #000; border: 1px solid var(--line); }

/* tables */
.table-scroll {
  max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 1.9rem 0; border: 1px solid var(--line); background: var(--surface);
  border-radius: 2px; scrollbar-color: var(--line-strong) var(--surface-2);
}
.table-scroll table { margin: 0; border: 0; width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.65; }
.table-scroll[data-wide="true"] table, .table-scroll table[data-wide="true"] { min-width: 720px; }
.table-scroll thead th { position: sticky; top: 0; z-index: 2; }
.prose table { border-collapse: collapse; margin: 1.5rem 0; font-size: 14px; line-height: 1.65; }
.prose th, .prose td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.prose thead th, .prose tr > th { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.prose td.num, .prose th.num { text-align: right; font-variant-numeric: tabular-nums; }
.prose tr:last-child td { border-bottom: 0; }
.prose .table-scroll table { margin: 0; }
.table-scroll table tr:last-child td { border-bottom: 0; }
.table-scroll table td, .table-scroll table th { min-width: 3.5em; }

/* definition / specification lists in reviews */
.prose dl.spec-list { margin: 1.4rem 0 1.8rem; padding: 0; }
.prose dl.spec-list dt { margin: 1.15rem 0 0; font-weight: 650; color: var(--ink); font-size: 15.5px; }
.prose dl.spec-list dd { margin: 0.3rem 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--accent-soft); color: var(--muted); font-size: 14.5px; line-height: 1.8; }

/* old in-page directory */
.prose .toc-heading { margin-top: 1.6rem; padding-top: 0; border-top: 0; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.prose .legacy-toc { list-style: none; padding: 12px 16px; margin: 8px 0 1.8rem; background: var(--accent-tint); border: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.prose .legacy-toc li { margin: 0; }
.prose .legacy-toc a { font-size: 13px; text-decoration: none; }
.prose .legacy-toc a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Tool pages
   -------------------------------------------------------------------------- */
.page-tool .prose { max-width: 100%; }
.page-tool .prose form { margin: 1.4rem 0; }
.page-tool .prose input[type="text"], .page-tool .prose input[type="number"] {
  width: 8em; max-width: 100%; height: 36px; padding: 0 9px; border: 1px solid var(--line-strong);
  border-radius: 3px; background: var(--surface); font-family: var(--font-mono); font-size: 13.5px; color: var(--ink);
}
.page-tool .prose input[type="radio"], .page-tool .prose input[type="checkbox"] { accent-color: var(--accent); }
.page-tool .prose select { height: 34px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface); font-family: inherit; font-size: 13px; }
.page-tool .prose input[type="submit"], .page-tool .prose input[type="button"], .page-tool .prose button {
  min-height: 36px; padding: 0 12px; border: 1px solid var(--accent); border-radius: 3px;
  background: var(--accent); color: #fff; font-family: inherit; font-size: 13px; cursor: pointer;
}
.page-tool .prose input[type="button"] { background: var(--surface); color: var(--accent); }
.page-tool .prose input[type="submit"]:hover, .page-tool .prose input[type="button"]:hover, .page-tool .prose button:hover { filter: brightness(0.96); }
.page-tool #placeholder, .page-tool #sp_graph {
  width: 100% !important; height: clamp(280px, 44vw, 420px) !important; float: none !important;
  margin: 1.6rem 0; background: var(--surface); border: 1px solid var(--line);
}
.page-tool #legend { float: none !important; margin: 0 0 1.4rem; font-size: 12px; }
.page-tool #result_url { font-size: 11px !important; line-height: 1.7; word-break: break-all; color: var(--muted); }
.page-tool #time_table { width: 100%; }
.page-tool table.csv { border: 1px solid var(--line); border-collapse: collapse; font-size: 13px; background: var(--surface); }
.page-tool table.csv th { background: var(--surface-2); border: 1px solid var(--line); padding: 7px 9px; font-size: 12.5px; font-weight: 600; color: var(--ink); text-align: left; }
.page-tool table.csv td { border: 1px solid var(--line); padding: 7px 9px; font-size: 13px; }
.page-tool table.noborder, .page-tool table.noborder th, .page-tool table.noborder td { border: 0; background: transparent; }
.page-tool .legend { font-size: 12px; }
.page-tool .flot-text { color: var(--muted) !important; }
.page-tool .prose > h2:first-of-type { margin-top: 2rem; }

/* --------------------------------------------------------------------------
   About page
   -------------------------------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: clamp(36px, 5vw, 64px); padding: 36px 0 20px; max-width: 1080px; margin: 0 auto; align-items: start; }
.about-main { max-width: 100%; }
.about-side { position: sticky; top: calc(var(--header-h) + 24px); }
.quote-block { margin: 1.4rem 0; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); font-size: 15px; line-height: 2; color: var(--ink-soft); }
.quote-block p { margin: 0; }
.note-inline { font-size: 13.5px; color: var(--muted); background: var(--surface-2); padding: 12px 14px; border-radius: 2px; }
.facts-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 12px; }
.facts-list dt { color: var(--muted); }
.facts-list dd { margin: 0; color: var(--ink); }

/* --------------------------------------------------------------------------
   Search page & dialog
   -------------------------------------------------------------------------- */
.search-head { padding-bottom: 26px; }
.search-form {
  display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
}
.search-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-form .icon { color: var(--muted); }
.search-form input { flex: 1 1 auto; min-width: 0; height: 44px; border: 0; background: transparent; font-family: inherit; font-size: 16px; color: var(--ink); outline: none; }
.search-form .button { min-height: 40px; }
.search-form-large { max-width: 720px; margin-top: 24px; }
.search-page-body { padding: 32px 0 60px; max-width: 860px; }
.search-result { display: block; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink-soft); }
.search-result:hover { background: var(--accent-tint); }
.search-result .result-path { font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.search-result h3 { font-size: 17px; margin: 4px 0 4px; color: var(--ink); }
.search-result p { font-size: 13.5px; line-height: 1.7; color: var(--muted); margin: 0; }
.search-result mark { background: #f5e6b8; color: var(--ink); padding: 0 1px; }
.search-empty { padding: 30px 0; color: var(--muted); }
.search-group-title { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 26px 0 6px; }

.search-dialog {
  width: min(760px, calc(100vw - 32px)); max-height: min(84vh, 720px); padding: 0;
  border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface);
  color: var(--ink-soft); box-shadow: 0 24px 70px rgba(15, 24, 30, 0.24);
}
.search-dialog::backdrop { background: rgba(19, 28, 35, 0.42); backdrop-filter: blur(2px); }
.search-dialog-inner { padding: clamp(18px, 3vw, 26px); }
.search-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.search-dialog-head h2 { font-size: 21px; margin: 0; }
.search-dialog-head .icon-button { margin-top: -4px; }
.search-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 2px; }
.search-filters .chip { min-height: 28px; font-size: 11.5px; }
.search-results { max-height: min(48vh, 380px); overflow-y: auto; margin-top: 8px; border-top: 1px solid var(--line); }
.search-results .search-result { padding: 12px 4px; }
.search-results .search-result h3 { font-size: 15px; }
.search-result.is-selected { background: var(--accent-tint); }
.search-footnote { margin: 12px 0 0; font-size: 11px; color: var(--muted); }
.search-footnote kbd { font-family: var(--font-mono); font-size: 10px; border: 1px solid var(--line); padding: 1px 4px; border-radius: 2px; }
.search-status { font-size: 11.5px; color: var(--muted); margin: 10px 0 0; }

/* --------------------------------------------------------------------------
   Sitemap / changelog
   -------------------------------------------------------------------------- */
.sitemap-group { padding: 34px 0 6px; }
.sitemap-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
.sitemap-list li { border-bottom: 1px solid var(--line); padding: 8px 0; font-size: 14px; }
.sitemap-list a { color: var(--ink-soft); text-decoration: none; }
.sitemap-list a:hover { color: var(--accent); text-decoration: underline; }
.log-wrap { padding: 24px 0 20px; max-width: 900px; }
.log-year { padding: 22px 0 6px; }
.log-year > h2 { font-size: 20px; margin-bottom: 14px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { margin-top: 40px; border-top: 1px solid var(--line-strong); background: #efeee7; padding: 54px 0 26px; }
.footer-top { display: grid; grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(120px, 0.6fr)); gap: 36px; }
.footer-brand .brand { margin-bottom: 12px; }
.footer-brand p { font-size: 13.5px; line-height: 1.8; color: var(--muted); max-width: 32em; }
.footer-note { font-size: 11.5px; letter-spacing: 0.04em; color: var(--muted); }
.footer-col h2 { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin: 6px 0; }
.footer-col a { font-size: 13.5px; color: var(--ink-soft); text-decoration: none; }
.footer-col a:hover { color: var(--accent); text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.8; color: var(--muted); }
.footer-bottom p { margin: 0; }
.footer-meta a { color: var(--muted); }
.footer-meta a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */
.lightbox { position: fixed; inset: 0; z-index: 150; background: rgba(13, 20, 25, 0.94); display: flex; align-items: center; justify-content: center; padding: 32px; }
.lightbox[hidden] { display: none; }
.lightbox figure { max-width: 92vw; max-height: 88vh; margin: 0; text-align: center; }
.lightbox img { max-width: 92vw; max-height: 82vh; width: auto; height: auto; border: 1px solid #4a545b; background: #fff; }
.lightbox figcaption { color: #c9ceca; font-size: 12px; margin-top: 8px; }
.lightbox-close { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; border: 1px solid #5c666c; border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer; display: grid; place-items: center; }
.lightbox-close .icon { width: 20px; height: 20px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .article-grid { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
  .article-side { display: none; }
  .toc-inline { display: block; }
  .article-grid--wide { max-width: 960px; }
  .home-columns { gap: 40px; }
}

@media (max-width: 1060px) {
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .path-grid { gap: 22px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr); gap: 36px; }
}

@media (max-width: 940px) {
  .primary-nav { display: none; }
  .nav-drawer { display: block; }
  .header-inner { gap: 12px; }
  .brand { margin-right: auto; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-index { max-width: 560px; }
  .path-grid { grid-template-columns: 1fr; gap: 26px; }
  .path-card > p:not(.path-level) { min-height: 0; }
  .home-columns { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .about-side { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .about-band { grid-template-columns: 1fr; }
  .about-band-side { border-left: 0; border-top: 1px solid #3a454c; padding-left: 0; padding-top: 24px; grid-template-columns: repeat(4, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .sitemap-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  :root { --header-h: 60px; }
  body { font-size: 16.5px; line-height: 1.85; }
  .shell { padding: 0 18px; }
  .brand-sub { display: none; }
  .search-link-text, .keyword-hint, .key-hint { display: none; }
  .search-link { width: 38px; justify-content: center; padding: 0; }
  .hero { padding: 36px 0 34px; }
  .hero-main, .hero-index { min-width: 0; }
.hero-main h1 { font-size: clamp(2.35rem, 9vw, 3.1rem); }
  .hero-search { flex-wrap: nowrap; }
  .hero-search .button { padding: 0 14px; }
  .section { padding: 44px 0; }
  .section-head-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .topic-grid, .review-grid, .tool-grid { grid-template-columns: 1fr; }
  .topic-card { min-height: 0; }
  .entry-card.has-thumb { grid-template-columns: 130px minmax(0, 1fr); }
  .article-grid { padding-top: 22px; gap: 26px; }
  .article-head h1 { font-size: clamp(1.85rem, 7vw, 2.4rem); }
  .prose { font-size: 16.5px; line-height: 1.92; max-width: 100%; }
  .prose h2 { margin-top: 2.4rem; padding-top: 1.05rem; }
  .table-scroll { margin-left: -2px; margin-right: -2px; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; }
  .article-back { flex-direction: column; gap: 6px; }
  .hub-head { padding: 26px 0 24px; }
  .hub-meta .text-link { margin-left: 0; }
  .chip-bar { position: static; padding: 10px 0; }
  .listing-group { padding-top: 32px; }
  .group-head h2 { font-size: 18px; }
  .about-band { padding: 24px 20px; }
  .about-band-side { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 10px; }
  .sitemap-list { grid-template-columns: 1fr; }
  .search-page-body { padding: 22px 0 40px; }
  .search-dialog { width: calc(100vw - 20px); max-height: 88vh; }
  .search-results { max-height: 44vh; }
  .search-footnote { display: none; }
  .search-filters { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
  .search-filters .chip { flex: 0 0 auto; }
  .about-side { grid-template-columns: 1fr; }
  .figure-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figure-grid .gallery-item img { max-height: 220px; }
  .prose .legacy-toc { flex-direction: column; gap: 4px; }
}

@media (max-width: 480px) {
  .entry-card.has-thumb { grid-template-columns: 1fr; }
  .entry-thumb { aspect-ratio: 16 / 10; }
  .footer-top { grid-template-columns: 1fr; }
  .figure-grid { grid-template-columns: 1fr; }
  .hero-search { padding-left: 12px; }
  .hero-search input { font-size: 15px; }
  .hero-search .button { min-height: 40px; font-size: 13px; padding: 0 12px; }
  .topic-head { grid-template-columns: auto auto 1fr; }
  .topic-count { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
  :root { --paper: #fff; --surface: #fff; --surface-2: #f4f4f4; }
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.6; }
  .site-header, .site-footer, .article-side, .toc-inline, .pager, .article-back,
  .search-dialog, .lightbox, .skip-link, .hub-foot, .site-footer, .breadcrumb,
  .search-link, .nav-drawer { display: none !important; }
  .article-grid, .article-grid--wide { display: block; max-width: none; padding: 0; }
  .prose { max-width: none; font-size: 11pt; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }
  img, table, figure, .table-scroll { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
}


/* Runtime enhancements */
.site-header.is-scrolled { box-shadow: 0 2px 14px rgba(23, 33, 43, 0.06); }
.table-scroll.is-scrollable { box-shadow: inset -14px 0 14px -14px rgba(23, 33, 43, 0.22); }
.reading-progress {
  position: fixed; top: 0; left: 0; z-index: 120;
  width: 100%; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%; pointer-events: none;
}
.search-filters-page { margin: 6px 0 20px; }

/* Article heading rhythm: tolerate legacy <br> left after headings */
.prose h2 + br, .prose h3 + br, .prose h4 + br { display: none; }


/* Long editorial headlines should break in balanced lines */
.hero-main h1, .hub-head h1, .article-head h1 { text-wrap: balance; }
.prose p { text-wrap: pretty; }

/* Legacy comparison tables (nested tables used for side-by-side figures) */
.prose table.layout-table { width: 100%; table-layout: fixed; border: 0; background: transparent; margin: 1.5rem 0; }
.prose table.layout-table > tbody > tr > th,
.prose table.layout-table > tr > th { border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: center; }
.prose table.layout-table > tbody > tr > td,
.prose table.layout-table > tr > td { border: 0; padding: 0 8px 0 0; vertical-align: top; }
.prose table.layout-table > tbody > tr > td:empty { padding: 0; }
.prose table.layout-table table { width: 100%; margin: 6px 0 0; border: 1px solid var(--line); font-size: 13px; }
.prose table.layout-table table th { white-space: nowrap; }
.prose table.layout-table table th, .prose table.layout-table table td { padding: 6px 8px; }

.figure-grid[data-count="1"] { grid-template-columns: 1fr; }
.figure-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.figure-grid[data-count="1"] .gallery-item img { max-height: 520px; }

@media (max-width: 760px) {
  .prose table.layout-table,
  .prose table.layout-table > tbody,
  .prose table.layout-table > tr,
  .prose table.layout-table > tbody > tr,
  .prose table.layout-table > thead,
  .prose table.layout-table > tbody > tr > td,
  .prose table.layout-table > tr > td,
  .prose table.layout-table > tbody > tr > th,
  .prose table.layout-table > tr > th {
    display: block; width: 100% !important; padding: 0 0 12px;
  }
  .prose table.layout-table > tbody > tr > td:empty { display: none; }
  .prose table.layout-table table { width: 100%; }
}

.legacy-icon { vertical-align: -2px; margin-left: 2px; }
.pdf-thumb { flex-direction: column; gap: 4px; }
.log-icon { vertical-align: -1px; margin-right: 2px; opacity: 0.9; }

/* Keep wide data tables readable by scrolling instead of squeezing columns. */
.table-scroll[data-cols="8"] table, .table-scroll[data-cols="9"] table { min-width: 900px; }
.table-scroll[data-cols="10"] table, .table-scroll[data-cols="11"] table,
.table-scroll[data-cols="12"] table { min-width: 1040px; }

/* Primary call to action on the WESViewer landing page */
.tool-cta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px;
  margin: 22px 0 6px; padding: 16px 18px; border: 1px solid var(--line);
  background: var(--accent-tint);
}
.tool-cta span { font-size: 13px; color: var(--muted); }

.table-hint {
  margin: -0.9rem 0 1.8rem; font-size: 11.5px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.table-hint::before { content: "↔"; color: var(--accent); font-size: 13px; }

/* Knowledge tip band (legacy random tip, re-implemented without document.write) */
.tip-band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.tip-inner { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; align-items: start; padding-top: 22px; padding-bottom: 22px; }
.tip-inner .eyebrow { margin: 3px 0 0; }
.tip-item { margin: 0; font-size: 14.5px; line-height: 1.8; color: var(--ink-soft); max-width: 72ch; }
.tip-item[hidden] { display: none; }
@media (max-width: 760px) {
  .tip-inner { grid-template-columns: 1fr; gap: 4px; padding-top: 18px; padding-bottom: 18px; }
  .tip-item { font-size: 14px; }
}

@media (max-width: 600px) {
  .search-dialog-inner { padding: 16px; }
  .search-dialog-head { display: block; position: relative; padding-right: 46px; margin-bottom: 12px; }
  .search-dialog-head .eyebrow { margin: 0 0 4px; }
  .search-dialog-head h2 { font-size: 19px; line-height: 1.35; }
  .search-dialog-head .icon-button { position: absolute; top: -6px; right: 0; margin: 0; }
  .search-dialog .search-form input { font-size: 15px; }
  .search-dialog .search-form .button { padding: 0 12px; min-height: 38px; }
}

.prose p, .prose li, .prose td, .prose th, .prose dd { overflow-wrap: break-word; }
.prose code, .prose a { overflow-wrap: anywhere; }

.prose .standfirst {
  font-size: 1.16rem; line-height: 1.75; color: var(--ink);
  padding: 2px 0 2px 14px; border-left: 2px solid var(--accent-soft);
  margin: 0 0 1.7rem;
}

.prose .long-quote { color: var(--ink-soft); }

@media (max-width: 360px) {
  .header-inner { gap: 8px; }
  .brand-text strong { font-size: 15px; }
  .nav-toggle span { display: none; }
  .nav-toggle { width: 38px; justify-content: center; padding: 0; }
  .search-link { width: 36px; }
  .hero-main h1 { font-size: 2.25rem; }
  .hero-search { padding-left: 10px; }
  .hero-search .button { padding: 0 10px; }
  .quick-links { gap: 5px 10px; }
}

.visitor-ip { font-size: 0.82em; color: var(--muted); margin-left: 6px; }
