  button, [role="button"], select, summary, input:not([type="checkbox"], [type="radio"]) { min-height: 2rem; }
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; overflow-x: clip; }
  body { overflow-x: clip; }
  p, li, dd, td, .callout, .hero-lead { overflow-wrap: break-word; }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

  :root {
    --bg: #f6f4ee;
    --bg-deep: #ece7db;
    --surface: #fffdf8;
    --surface-2: #f1ecdf;
    --ink: #2a2118;
    --ink-soft: #57493a;
    --muted: #83755f;
    --line: #ddd2bd;
    --line-strong: #c4b28f;
    --accent: #b3502a;       /* rust / terracotta */
    --accent-ink: #8f3a1c;
    --accent-soft: #f6e3d8;
    --ochre: #c98f1f;
    --moss: #5d7350;
    --water: #3d6e8f;
    --water-soft: #dcebf3;
    --danger: #b3372e;
    --ok: #3e7a3a;
    --strata-1: #d9b878;
    --strata-2: #c49a58;
    --strata-3: #a9805a;
    --strata-4: #8a6a52;
    --strata-5: #6e5847;
    --strata-6: #54443a;
    --code-bg: #2e2620;
    --code-ink: #f3e9d7;
    --shadow: 0 1px 2px rgba(60, 42, 20, .06), 0 8px 24px -18px rgba(60, 42, 20, .35);
    --radius: 10px;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #171310;
      --bg-deep: #100d0a;
      --surface: #221c16;
      --surface-2: #2a231b;
      --ink: #f0e7d8;
      --ink-soft: #d3c4ab;
      --muted: #a08d70;
      --line: #40362a;
      --line-strong: #5d4c36;
      --accent: #e07f52;
      --accent-ink: #f0a37e;
      --accent-soft: #3d2718;
      --ochre: #dfa93e;
      --moss: #93ac82;
      --water: #7db1cf;
      --water-soft: #22333d;
      --danger: #e88a80;
      --ok: #8fc487;
      --strata-1: #8a6f3c;
      --strata-2: #7d5f36;
      --strata-3: #6f5138;
      --strata-4: #5f4634;
      --strata-5: #4e3a2d;
      --strata-6: #3d2f26;
      --code-bg: #0f0c09;
      --code-ink: #f3e9d7;
      --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 26px -18px rgba(0,0,0,.8);
    }
  }

  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
    font-size: 16px;
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
  }
  .mono { font-family: "IBM Plex Mono", ui-monospace, monospace; overflow-wrap: anywhere; }
  a { color: var(--accent-ink); }
  img, svg { max-width: 100%; }

  /* ---------- site nav (prototype masthead) ---------- */
  .sitenav {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
  .sitenav-inner {
    max-width: 1120px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; gap: 20px; min-height: 56px;
  }
  .brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; padding: 6px 0; }
  .brand-name { font-family: "Shippori Mincho B1", serif; font-weight: 800; font-size: 1.15rem; letter-spacing: .04em; white-space: nowrap; }
  .brand-tag { font-size: .72rem; color: var(--muted); letter-spacing: .12em; white-space: nowrap; }

  .wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

  /* ---------- hero ---------- */
  .hero { padding: 56px 0 0; }
  .hero-grid { display: grid; grid-template-columns: 1.25fr .9fr; gap: 40px; align-items: start; }
  .hero h1 {
    font-family: "Shippori Mincho B1", serif; font-weight: 800;
    font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.35; margin: 0 0 18px; letter-spacing: .02em;
  }
  .hero h1 .u { background: linear-gradient(transparent 62%, var(--accent-soft) 62%); padding: 0 2px; }
  .hero-lead { color: var(--ink-soft); font-size: 1.02rem; margin: 0 0 26px; max-width: 34em; }
  .hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }
  .btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 10px 22px;
    border-radius: 8px; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer;
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  }
  .btn:hover { border-color: var(--accent); }
  .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff8f0; }
  .btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
  @media (prefers-color-scheme: dark) { .btn-primary { color: #1d130c; } .btn-primary:hover { color: #1d130c; } }
  .hero-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
  .hero-points li { border-top: 3px solid var(--line-strong); padding-top: 10px; }
  .hero-points b { display: block; font-size: .95rem; }
  .hero-points span { font-size: .82rem; color: var(--muted); line-height: 1.6; display: block; }

  .hero-side {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
  }
  .hero-side-head { padding: 14px 18px 10px; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; align-items: baseline; }
  .hero-side-head b { font-size: .92rem; }
  .hero-side-head span { font-size: .75rem; color: var(--muted); }
  .hero-side ol { margin: 0; padding: 8px 18px 14px 36px; }
  .hero-side li { padding: 7px 0; border-bottom: 1px solid var(--surface-2); font-size: .92rem; }
  .hero-side li:last-child { border-bottom: none; }
  .hero-side li a { text-decoration: none; font-weight: 700; }
  .hero-side li a:hover { text-decoration: underline; }
  .hero-side li small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.55; }

  /* ---------- strata band ---------- */
  .strata { margin-top: 52px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
  .strata-row { display: flex; align-items: stretch; }
  .strata-label {
    writing-mode: vertical-rl; font-size: .72rem; letter-spacing: .3em; color: var(--muted);
    display: flex; align-items: center; padding: 10px 6px; background: var(--bg-deep);
  }
  .strata-svg { flex: 1; display: block; width: 100%; height: auto; }

  /* ---------- sections ---------- */
  section.block { padding: 64px 0 8px; }
  .sec-head { margin-bottom: 26px; max-width: 44em; }
  .sec-head h2 {
    font-family: "Shippori Mincho B1", serif; font-weight: 800;
    font-size: clamp(1.5rem, 3.4vw, 2rem); line-height: 1.4; margin: 0 0 10px;
    display: flex; align-items: baseline; gap: 14px;
  }
  .sec-head h2 .no { font-family: "IBM Plex Mono", monospace; font-size: .85rem; color: var(--accent); font-weight: 600; letter-spacing: .1em; }
  .sec-head p { color: var(--ink-soft); margin: 0; }

  /* ---------- topic cards ---------- */
  .topics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .topic {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow);
  }
  .topic .t-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .topic .chip {
    font-size: .7rem; font-weight: 700; letter-spacing: .06em; padding: 3px 9px; border-radius: 999px;
    background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line);
  }
  .topic .chip.live { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
  .topic h3 { margin: 0; font-size: 1.02rem; line-height: 1.5; }
  .topic p { margin: 0; font-size: .85rem; color: var(--ink-soft); line-height: 1.7; flex: 1; }
  .topic .t-meta { font-size: .76rem; color: var(--muted); display: flex; gap: 12px; border-top: 1px dashed var(--line); padding-top: 9px; }
  .topic a.t-link { font-weight: 700; font-size: .88rem; text-decoration: none; }
  .topic a.t-link:hover { text-decoration: underline; }
  .stars { color: var(--ochre); font-size: .8rem; letter-spacing: .1em; }

  /* ---------- article ---------- */
  .article-shell { display: grid; grid-template-columns: 220px 1fr; gap: 36px; align-items: start; }
  .toc {
    position: sticky; top: 76px; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px 18px; font-size: .88rem;
  }
  .toc b { display: block; font-size: .78rem; letter-spacing: .14em; color: var(--muted); margin-bottom: 8px; }
  .toc ol { margin: 0; padding-left: 20px; }
  .toc li { padding: 3px 0; }
  .toc a { color: var(--ink-soft); text-decoration: none; }
  .toc a:hover { color: var(--accent-ink); text-decoration: underline; }
  .article-shell > article.post:only-child { grid-column: 1 / -1; }
  article.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 38px 42px; }
  .post-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
  .post-meta span { font-size: .74rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft); }
  article.post h2.post-title { font-family: "Shippori Mincho B1", serif; font-weight: 800; font-size: clamp(1.6rem, 3.6vw, 2.2rem); line-height: 1.45; margin: 0 0 14px; }
  .post-lead { font-size: 1.02rem; color: var(--ink-soft); border-left: 4px solid var(--ochre); padding: 4px 0 4px 16px; margin: 0 0 28px; }
  article.post h3 { font-size: 1.22rem; margin: 38px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--surface-2); display: flex; gap: 10px; align-items: baseline; }
  article.post h3 .n { color: var(--accent); font-family: "IBM Plex Mono", monospace; font-size: .9rem; }
  article.post p { margin: 0 0 14px; }
  article.post ul { margin: 0 0 14px; padding-left: 22px; }
  article.post li { margin-bottom: 6px; }
  .callout {
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
    padding: 16px 20px; margin: 20px 0; font-size: .94rem;
  }
  .callout b.ttl { display: block; margin-bottom: 6px; color: var(--accent-ink); }
  .callout.warn { border-color: var(--danger); }
  .callout.warn b.ttl { color: var(--danger); }
  .formula {
    background: var(--code-bg); color: var(--code-ink); border-radius: 8px;
    padding: 16px 20px; margin: 18px 0; font-family: "IBM Plex Mono", monospace;
    font-size: .98rem; line-height: 1.8; white-space: normal; overflow-wrap: anywhere; word-break: break-word;
  }
  .formula small { display: block; white-space: normal; font-family: "Zen Kaku Gothic New", sans-serif; font-size: .8rem; opacity: .75; margin-top: 6px; }
  figure.diagram { margin: 22px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 18px; }
  figure.diagram figcaption { font-size: .82rem; color: var(--muted); margin-top: 10px; text-align: center; }
  table.data { width: 100%; border-collapse: collapse; margin: 16px 0 22px; font-size: .9rem; }
  table.data th, table.data td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
  table.data thead th { background: var(--surface-2); font-size: .84rem; }
  table.data td.num { font-family: "IBM Plex Mono", monospace; white-space: nowrap; }
  .table-scroll { overflow-x: auto; }
  .tables-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

  /* ---------- SPT mini simulator ---------- */
  .sim {
    border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg);
    padding: 20px; margin: 22px 0;
  }
  .sim h4 { margin: 0 0 4px; font-size: 1rem; }
  .sim p.hint { margin: 0 0 16px; font-size: .85rem; color: var(--muted); }
  .sim-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .sim-cell label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: 6px; }
  .sim-cell input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 32px; }
  .sim-cell .val { font-family: "IBM Plex Mono", monospace; font-size: 1.05rem; font-weight: 600; }
  .sim-bars { display: flex; gap: 6px; align-items: flex-end; height: 74px; margin: 18px 0 6px; border-bottom: 2px solid var(--line-strong); }
  .sim-bar { flex: 1; background: var(--strata-2); border-radius: 4px 4px 0 0; min-height: 3px; transition: height .25s ease; position: relative; }
  .sim-bar span { position: absolute; top: -22px; left: 0; right: 0; text-align: center; font-family: "IBM Plex Mono", monospace; font-size: .8rem; font-weight: 600; }
  .sim-out { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: baseline; border-top: 1px dashed var(--line); padding-top: 14px; }
  .sim-out .big { font-family: "IBM Plex Mono", monospace; font-size: 1.7rem; font-weight: 600; color: var(--accent-ink); }
  .sim-out .judge { font-weight: 700; }

  /* ---------- tools ---------- */
  .tool-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 0; }
  .tool-tab {
    min-height: 44px; padding: 10px 18px; border-radius: 10px 10px 0 0; cursor: pointer;
    border: 1px solid var(--line); border-bottom: none; background: var(--surface-2);
    font-family: inherit; font-weight: 700; font-size: .92rem; color: var(--ink-soft);
  }
  .tool-tab[aria-selected="true"] { background: var(--surface); color: var(--accent-ink); box-shadow: inset 0 3px 0 var(--accent); }
  .tool-panel {
    background: var(--surface); border: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) var(--radius);
    box-shadow: var(--shadow); padding: 26px; display: none;
  }
  .tool-panel.active { display: block; }
  .tool-panel h3 { margin: 0 0 6px; font-size: 1.15rem; }
  .tool-panel .desc { color: var(--ink-soft); font-size: .92rem; margin: 0 0 20px; max-width: 46em; }
  .tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
  .field { margin-bottom: 14px; }
  .field label { display: flex; justify-content: space-between; align-items: baseline; font-size: .88rem; font-weight: 700; margin-bottom: 5px; }
  .field label .unit { color: var(--muted); font-weight: 400; font-size: .78rem; }
  .field input[type="number"], .field select {
    width: 100%; padding: 9px 12px; font-size: 1rem; font-family: "IBM Plex Mono", monospace;
    border: 1px solid var(--line-strong); border-radius: 7px; background: var(--bg); color: var(--ink); min-height: 44px;
  }
  .field .note { font-size: .76rem; color: var(--muted); margin-top: 4px; line-height: 1.55; }
  .result-box { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; }
  .result-box .r-label { font-size: .78rem; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
  .result-box .r-value { font-family: "IBM Plex Mono", monospace; font-size: 2rem; font-weight: 600; line-height: 1.3; color: var(--accent-ink); }
  .result-box .r-value small { font-size: .95rem; color: var(--ink-soft); }
  .result-rows { margin-top: 12px; border-top: 1px dashed var(--line); }
  .result-rows div { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--surface-2); font-size: .88rem; }
  .result-rows div:last-child { border-bottom: none; }
  .result-rows dt { color: var(--ink-soft); }
  .result-rows dd { margin: 0; font-family: "IBM Plex Mono", monospace; font-weight: 600; text-align: right; }
  .verdict { margin-top: 14px; padding: 12px 16px; border-radius: 8px; font-weight: 700; font-size: .95rem; background: var(--water-soft); }
  .verdict.bad { background: var(--accent-soft); color: var(--accent-ink); }
  .steps { font-size: .82rem; color: var(--muted); margin-top: 14px; line-height: 1.7; }
  .steps .mono { color: var(--ink-soft); }

  /* ---------- glossary ---------- */
  .gloss-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
  .gloss-tools input[type="search"] {
    flex: 1; min-width: 220px; padding: 10px 14px; font-size: 1rem; min-height: 46px;
    border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font-family: inherit;
  }
  .gloss-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .term { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
  .term dt { font-weight: 900; font-size: .98rem; margin-bottom: 4px; }
  .term dt .en { font-family: "IBM Plex Mono", monospace; font-size: .72rem; color: var(--muted); font-weight: 400; margin-left: 6px; }
  .term dd { margin: 0; font-size: .85rem; color: var(--ink-soft); line-height: 1.7; }
  .gloss-empty { display: none; color: var(--muted); padding: 18px 0; }

  /* ---------- quiz ---------- */
  .quiz-shell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
  .quiz-progress { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
  .quiz-bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 22px; }
  .quiz-bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s ease; }
  .quiz-q { font-size: 1.12rem; font-weight: 700; line-height: 1.65; margin: 0 0 18px; }
  .quiz-opts { display: grid; gap: 10px; }
  .quiz-opt {
    text-align: left; font-family: inherit; font-size: .98rem; padding: 13px 16px; min-height: 48px;
    border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--ink); cursor: pointer; line-height: 1.6;
  }
  .quiz-opt:hover:not(:disabled) { border-color: var(--accent); }
  .quiz-opt:disabled { cursor: default; opacity: .85; }
  .quiz-opt.correct { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--bg)); opacity: 1; font-weight: 700; }
  .quiz-opt.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--bg)); opacity: 1; }
  .quiz-fb { display: none; margin-top: 16px; padding: 14px 18px; border-radius: 8px; background: var(--surface-2); font-size: .92rem; }
  .quiz-fb.show { display: block; }
  .quiz-fb b { display: block; margin-bottom: 4px; }
  .quiz-nav { margin-top: 18px; display: flex; justify-content: flex-end; }
  .quiz-result { text-align: center; padding: 18px 0 6px; display: none; }
  .quiz-result .score { font-family: "IBM Plex Mono", monospace; font-size: 2.6rem; font-weight: 600; color: var(--accent-ink); }
  .quiz-result p { color: var(--ink-soft); }

  /* ---------- roadmap / footer ---------- */
  .road { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
  .road div { padding: 18px; border-right: 1px dashed var(--line); }
  .road div:last-child { border-right: none; }
  .road .step-no { font-family: "IBM Plex Mono", monospace; color: var(--accent); font-weight: 600; font-size: .82rem; }
  .road b { display: block; margin: 4px 0 6px; }
  .road p { margin: 0; font-size: .84rem; color: var(--ink-soft); line-height: 1.7; }
  footer.site {
    margin-top: 72px; border-top: 1px solid var(--line); background: var(--bg-deep);
    padding: 30px 0 40px; font-size: .85rem; color: var(--muted);
  }

  /* ===== 広告スロット（AdSense 用プレースホルダ） =====
     配置ポリシー：記事は3枠（導入部の後／本文の中ほど／記事末尾）、地盤工学トップ・記事一覧・分野トップ・土木トップ・計算ツール・用語集・クイズは最下部に1枠のみ。必須ページ（about/privacy/contact/disclaimer）には置かない（コンテンツ主体でないページへの広告配置は AdSense ポリシー上推奨されないため）。
     ポップアップ・スティッキー・タイトルより上・タブバー重なり・ツール内への配置はしない。
     AdSense開始までは枠ごと隠すため、下の .ad-slot { display: none !important; } を有効化してある
     （プレースホルダを隠すためのもの。AdSense承認後に広告コードを差し込む際はこの1行を外す）:
  */
  .ad-slot { display: none !important; }
  .ad-slot {
    margin: 34px auto; padding: 14px 16px;
    max-width: 728px; min-height: 280px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius, 12px);
    color: var(--muted); text-align: center;
  }
  .ad-slot .ad-label { font-size: .68rem; letter-spacing: .18em; font-weight: 700; color: var(--muted); }
  .ad-slot .ad-ph { font-size: .85rem; color: var(--muted); }
  @media (max-width: 620px) {
    .ad-slot { min-height: 250px; margin: 28px auto; }
  }

  footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 30px; justify-content: space-between; }
  footer.site b { color: var(--ink-soft); font-family: "Shippori Mincho B1", serif; }

  /* ---------- article list ---------- */
  .alist-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
  .alist-tools .lbl { font-size: .82rem; color: var(--muted); font-weight: 700; margin-right: 2px; }
  .filter-chip {
    min-height: 38px; padding: 7px 16px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft);
    font-family: inherit; font-weight: 700; font-size: .85rem;
  }
  .filter-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff8f0; }
  @media (prefers-color-scheme: dark) { .filter-chip[aria-pressed="true"] { color: #1d130c; } }
  .alist { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
  .alist-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--surface-2); align-items: start; }
  .alist-row:last-child { border-bottom: none; }
  .alist-row.is-new { background: color-mix(in srgb, var(--accent-soft) 38%, var(--surface)); }
  .alist-no { font-family: "IBM Plex Mono", monospace; font-weight: 600; color: var(--accent); font-size: .95rem; padding-top: 2px; }
  .alist-main h3 { margin: 0 0 5px; font-size: 1rem; line-height: 1.55; }
  .alist-main h3 a { color: var(--ink); text-decoration: none; }
  .alist-main h3 a:hover { color: var(--accent-ink); text-decoration: underline; }
  .alist-main p { margin: 0; font-size: .85rem; color: var(--ink-soft); line-height: 1.7; }
  .alist-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
  .alist-tags span { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft); }
  .alist-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; min-width: 92px; }
  .status { font-size: .72rem; font-weight: 900; letter-spacing: .05em; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
  .status.live { background: var(--accent); color: #fff8f0; }
  @media (prefers-color-scheme: dark) { .status.live { color: #1d130c; } }
  .status.next { background: var(--water-soft); color: var(--water); }
  .status.soon { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
  .alist-side .meta { font-size: .76rem; color: var(--muted); white-space: nowrap; }
  .alist-side a { font-weight: 700; font-size: .85rem; text-decoration: none; white-space: nowrap; }
  .alist-side a:hover { text-decoration: underline; }
  .alist-note { font-size: .84rem; color: var(--muted); margin: 12px 2px 0; }
  @media (max-width: 620px) {
    .alist-row { grid-template-columns: 36px 1fr; }
    .alist-side { grid-column: 2; flex-direction: row; align-items: center; flex-wrap: wrap; text-align: left; }
  }

  /* ---------- pages (in-site routing) ---------- */
  [id] { scroll-margin-top: 84px; }
  .page { display: none; }
  .page.active { display: block; animation: page-in .28s ease both; }
  @keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @media (prefers-reduced-motion: reduce) { .page.active { animation: none; } }
  .page-head { padding: 34px 0 0; }
  .back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; text-decoration: none; min-height: 44px; padding: 8px 4px; }
  .back-link:hover { text-decoration: underline; }
  .pager { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-top: 28px; }
  .pager a {
    flex: 1 1 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 14px 18px; text-decoration: none; color: var(--ink); min-height: 56px;
  }
  .pager a:hover { border-color: var(--accent); }
  .pager a small { display: block; color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .08em; }
  .pager a b { color: var(--accent-ink); font-size: .95rem; line-height: 1.55; display: block; }
  .pager a.next { text-align: right; }
  .diagram-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .diagram-scroll svg { display: block; width: 100%; height: auto; }
  .diagram-hint { display: none; }

  /* ---------- bottom tab bar (sole navigation) ---------- */
  body { padding-bottom: 72px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line-strong); padding-bottom: env(safe-area-inset-bottom);
    justify-content: center;
  }
  .tabbar a {
    flex: 1; max-width: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    min-height: 56px; padding: 6px 2px; font-size: .74rem; font-weight: 700; color: var(--ink-soft); text-decoration: none;
  }
  .tabbar a .tb-ic { font-size: 1.05rem; line-height: 1.2; font-family: "IBM Plex Mono", monospace; color: var(--muted); }
  .tabbar a[aria-current="page"] { color: var(--accent-ink); }
  .tabbar a[aria-current="page"] .tb-ic { color: var(--accent); }
  .copyright { width: 100%; text-align: center; font-size: .8rem; color: var(--muted); padding-top: 14px; margin-top: 6px; border-top: 1px solid var(--line); letter-spacing: .02em; }

  /* ---------- site structure (portal / civil / breadcrumb / tree) ---------- */
  .crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .84rem; color: var(--muted); padding: 18px 0 0; }
  .crumbs a { color: var(--ink-soft); text-decoration: none; font-weight: 700; }
  .crumbs a:hover { color: var(--accent-ink); text-decoration: underline; }
  .crumbs .sep { color: var(--line-strong); font-family: "IBM Plex Mono", monospace; }
  .crumbs .here { color: var(--accent-ink); font-weight: 900; }
  .context-strip {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 13px 18px; margin-top: 14px; font-size: .9rem;
  }
  .context-strip b { color: var(--ink); }
  .context-strip span { color: var(--ink-soft); }
  .context-strip a { font-weight: 700; text-decoration: none; white-space: nowrap; }
  .context-strip a:hover { text-decoration: underline; }
  .context-strip .cs-links { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px 18px; }
  .portal-hero { padding: 10px 0 0; }
  .portal-hero h1, .page-hero h1 {
    font-family: "Shippori Mincho B1", serif; font-weight: 800;
    font-size: clamp(1.8rem, 4.4vw, 2.7rem); line-height: 1.4; margin: 14px 0 14px; letter-spacing: .02em;
  }
  .portal-hero .lead, .page-hero .lead { color: var(--ink-soft); font-size: 1.02rem; margin: 0; max-width: 42em; }
  .tree-box {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 24px 26px; overflow-x: clip;
  }
  .tree-box .tb-title { font-size: .78rem; letter-spacing: .14em; color: var(--muted); font-weight: 700; margin: 0 0 14px; }
  .tree, .tree ul { list-style: none; margin: 0; padding: 0; }
  .tree ul { margin-left: 14px; padding-left: 22px; border-left: 2px solid var(--line); }
  .tree li { position: relative; padding: 5px 0; }
  .tree ul > li::before { content: ""; position: absolute; left: -22px; top: 26px; width: 20px; border-top: 2px solid var(--line); }
  .node {
    display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; max-width: 100%;
    background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 14px;
    font-weight: 700; font-size: .95rem; color: var(--ink); text-decoration: none; line-height: 1.55;
  }
  a.node:hover { border-color: var(--accent); color: var(--accent-ink); }
  .node.root { background: var(--ink); border-color: var(--ink); color: var(--bg); font-size: 1rem; }
  @media (prefers-color-scheme: dark) { .node.root { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); } }
  .node.current { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
  .node .st { font-size: .7rem; font-weight: 900; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
  .node .st.live { background: var(--accent); border-color: var(--accent); color: #fff8f0; }
  @media (prefers-color-scheme: dark) { .node .st.live { color: #1d130c; } }
  .node small { font-weight: 400; color: var(--muted); font-size: .8rem; }
  .node.current small { color: var(--accent-ink); }
  .pathway { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
  .pathway .pw {
    flex: 1 1 200px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px 18px; text-decoration: none; color: var(--ink); display: block;
  }
  a.pw:hover { border-color: var(--accent); }
  .pathway .pw .pw-lvl { font-family: "IBM Plex Mono", monospace; font-size: .74rem; color: var(--accent); font-weight: 600; letter-spacing: .1em; display: block; margin-bottom: 4px; }
  .pathway .pw b { display: block; font-size: 1rem; line-height: 1.5; }
  .pathway .pw span.desc { font-size: .83rem; color: var(--ink-soft); line-height: 1.65; display: block; margin-top: 4px; }
  .pathway .pw.current { background: var(--accent-soft); border-color: var(--accent); }
  .pathway .pw-arrow { align-self: center; padding: 6px 10px; color: var(--accent); font-family: "IBM Plex Mono", monospace; font-weight: 600; }
  .topic.soon-card { opacity: .82; }
  .topic .t-soon { font-size: .88rem; font-weight: 700; color: var(--muted); }
  .foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; width: 100%; }
  .foot-links a { color: var(--ink-soft); text-decoration: none; font-weight: 700; }
  .foot-links a:hover { color: var(--accent-ink); text-decoration: underline; }
  @media (max-width: 620px) {
    .tree-box { padding: 18px 14px; }
    .tree ul { margin-left: 8px; padding-left: 16px; }
    .tree ul > li::before { left: -16px; width: 14px; }
    .node { padding: 7px 11px; font-size: .9rem; }
    .context-strip .cs-links { margin-left: 0; }
    .pathway { flex-direction: column; }
    .pathway .pw { flex-basis: auto; }
    .pathway .pw-arrow { transform: rotate(90deg); padding: 2px 10px; }
  }

  /* ---------- responsive ---------- */
  @media (max-width: 960px) {
    .topics { grid-template-columns: repeat(2, 1fr); }
    .gloss-grid { grid-template-columns: repeat(2, 1fr); }
    .road { grid-template-columns: repeat(2, 1fr); }
    .road div { border-bottom: 1px dashed var(--line); }
    .article-shell { grid-template-columns: 1fr; }
    .toc { position: static; }
    .hero-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 620px) {
    .topics, .gloss-grid, .road, .sim-grid, .tool-grid, .hero-points, .tables-2 { grid-template-columns: 1fr; }
    body { font-size: 15.5px; padding-bottom: 64px; }
    .wrap { padding: 0 16px; }
    /* header: brand only (top tab bar removed; navigation is breadcrumb + bottom tab bar) */
    .sitenav-inner { flex-wrap: wrap; padding: 8px 16px; gap: 4px 12px; min-height: 0; }
    .brand { width: 100%; margin-right: 0; }
    .brand-tag { display: none; }
    article.post { padding: 24px 16px; }
    .tool-panel, .quiz-shell { padding: 20px 16px; }
    section.block { padding-top: 40px; }
    .hero { padding-top: 28px; }
    .page-head { padding-top: 18px; }
    .hero h1 { font-size: 1.72rem; }
    article.post h2.post-title { font-size: 1.42rem; }
    article.post h3 { font-size: 1.08rem; flex-wrap: wrap; }
    .post-lead { font-size: .97rem; padding-left: 12px; }
    /* formulas: wrap instead of cutting off */
    .formula { font-size: .88rem; padding: 14px 14px; line-height: 1.85; }
    .formula small { font-size: .78rem; line-height: 1.7; }
    /* diagrams: keep lettering legible, pan inside the figure only */
    figure.diagram { padding: 12px 10px; }
    .diagram-scroll svg { min-width: 560px; }
    .diagram-hint { display: block; font-size: .74rem; color: var(--muted); text-align: center; margin-top: 6px; }
    .strata-svg { min-width: 560px; }
    .strata-row { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    /* tables: stack rows into cards so every cell is readable without sideways scrolling */
    .table-scroll { overflow-x: visible; }
    table.data { font-size: .9rem; margin: 12px 0 18px; }
    table.data thead { display: none; }
    table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
    table.data tr { border: 1px solid var(--line); border-bottom: none; margin-bottom: 12px; background: var(--surface); }
    table.data tr:last-child { border-bottom: 1px solid var(--line); }
    table.data td { border: none; border-bottom: 1px solid var(--surface-2); padding: 8px 12px; }
    table.data td:last-child { border-bottom: none; }
    table.data td.num { white-space: normal; }
    .tables-2 table.data tr { margin-bottom: 10px; }
    /* simulators & tools */
    .sim { padding: 16px 14px; }
    .sim-out { flex-direction: column; align-items: flex-start; gap: 6px; }
    .sim-out .big { font-size: 1.5rem; }
    .tool-tabs { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 12px; }
    .tool-tab { border-radius: 8px; border-bottom: 1px solid var(--line); text-align: left; }
    .tool-panel { border-radius: var(--radius); }
    .result-box { padding: 16px; }
    .result-box .r-value { font-size: 1.7rem; }
    .result-rows div { flex-wrap: wrap; gap: 2px 10px; }
    .result-rows dd { text-align: left; }
    .callout { padding: 14px 16px; }
    .toc { padding: 14px 16px; }
    .alist-row { padding: 16px 14px; }
    .pager a { flex-basis: 100%; }
    .pager a.next { text-align: left; }
    footer.site { margin-top: 48px; }
    /* bottom tab bar for thumb navigation */
    .tabbar {
      display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
      background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px);
      border-top: 1px solid var(--line-strong); padding-bottom: env(safe-area-inset-bottom);
    }
    .tabbar a {
      flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
      min-height: 56px; padding: 6px 2px; font-size: .72rem; font-weight: 700; color: var(--ink-soft); text-decoration: none;
    }
    .tabbar a .tb-ic { font-size: 1.05rem; line-height: 1.2; font-family: "IBM Plex Mono", monospace; color: var(--muted); }
    .tabbar a[aria-current="page"] { color: var(--accent-ink); }
    .tabbar a[aria-current="page"] .tb-ic { color: var(--accent); }
  }