/* ==========================================================================
   グラム換算ノート — style.css
   设计参考：長谷工ブランシエラクラブ（目次・提示框・荧光高亮）
             パールエース（大图 hero・留白・相关卡片）
             Calculator Junction（工具卡片网格・分组・图标）
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  --ink: #17211d;
  --ink-soft: #3d4c45;
  --muted: #5f6f68;
  --bg: #fdfbf7;
  --surface: #ffffff;
  --surface-2: #f4f1e9;
  --line: #e5dfd2;
  --line-strong: #d3cbb9;

  --brand: #0f6b52;
  --brand-strong: #0a4f3d;
  --brand-soft: #e7f2ec;
  --brand-glow: #d3e9df;
  --warm: #c8862c;
  --mark: #ffe6a3;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(23, 33, 29, .05), 0 1px 1px rgba(23, 33, 29, .03);
  --shadow: 0 6px 18px -6px rgba(23, 33, 29, .14), 0 2px 6px rgba(23, 33, 29, .05);
  --shadow-lg: 0 18px 40px -18px rgba(23, 33, 29, .28), 0 6px 12px -6px rgba(23, 33, 29, .1);

  --wrap: 1080px;
  --read: 44rem;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9efec;
    --ink-soft: #c3cec9;
    --muted: #96a5a0;
    --bg: #12171a;
    --surface: #1a2125;
    --surface-2: #202a2d;
    --line: #2c373b;
    --line-strong: #3b484d;

    --brand: #4fc3a1;
    --brand-strong: #7fdcc0;
    --brand-soft: #1c2f2a;
    --brand-glow: #244239;
    --warm: #e0a860;
    --mark: #6d5a1d;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 6px 18px -6px rgba(0, 0, 0, .6);
    --shadow-lg: 0 18px 40px -18px rgba(0, 0, 0, .8);
  }
}

/* ---------- 2. Reset & base ---------- */
* { box-sizing: border-box; }

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

body {
  margin: 0 auto;
  max-width: var(--wrap);
  padding: 0 1.25rem 4rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-strong); }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* 正文本幅（表格・グリッド・hero は全幅のまま） */
:where(article) :where(p, ul, ol, aside, .lead, .intro) { max-width: var(--read); }

/* ---------- 3. Type scale ---------- */
h1, h2, h3, h4 { line-height: 1.45; letter-spacing: .01em; }

h1 {
  font-size: clamp(1.45rem, 3.4vw, 1.85rem);
  margin: 1.4rem 0 .7rem;
  font-weight: 700;
}

h2 {
  position: relative;
  font-size: clamp(1.14rem, 2.4vw, 1.3rem);
  margin: 2.6rem 0 .9rem;
  padding-left: .85rem;
  font-weight: 700;
}
h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: .3em;
  bottom: .3em;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
}

h3 {
  font-size: 1.05rem;
  margin: 1.7rem 0 .5rem;
  color: var(--brand-strong);
}

p { margin: .7rem 0; }

strong { font-weight: 700; }

small { font-size: .82em; }

/* 荧光ペン風ハイライト */
mark, .hl {
  background: linear-gradient(transparent 56%, var(--mark) 56%);
  color: inherit;
  padding: 0 .12em;
  border-radius: 2px;
}

.lead { color: var(--ink-soft); font-size: 1.02rem; }
.intro { color: var(--muted); font-size: .92rem; }
.hint, .note-text, .meta { font-size: .82rem; color: var(--muted); }

/* ---------- 4. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  margin-inline: -1.25rem;
  padding: .7rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  font-size: 1.02rem;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: .01em;
}
.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), #1a8f6f);
  color: #fff;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: 0;
}

.site-nav { display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; }
.site-nav a {
  padding: .42rem .62rem;
  border-radius: 999px;
  font-size: .86rem;
  text-decoration: none;
  color: var(--ink-soft);
  transition: background .18s var(--ease), color .18s var(--ease);
}
.site-nav a:hover { background: var(--brand-soft); color: var(--brand); }

/* ---------- 5. Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  margin: 1.15rem 0 1.6rem;
  border-radius: var(--radius-lg);
  min-height: clamp(320px, 36vw, 440px);
  display: flex;
  align-items: flex-end;
  background: #1b3a30;
  color: #fff;
  isolation: isolate;
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 24, 19, .74) 0%, rgba(8, 24, 19, .46) 42%, rgba(8, 24, 19, .10) 68%, rgba(8, 24, 19, .34) 100%),
    linear-gradient(180deg, rgba(10, 28, 22, .06) 0%, rgba(8, 24, 19, .34) 55%, rgba(6, 20, 16, .78) 100%);
}
.hero-inner { padding: clamp(1.4rem, 4vw, 2.2rem); max-width: 660px; }
.hero h1 {
  margin: 0 0 .55rem;
  font-size: clamp(1.55rem, 4.4vw, 2.35rem);
  line-height: 1.3;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .25);
}
.hero p {
  margin: .35rem 0 1.15rem;
  color: rgba(255, 255, 255, .88);
  font-size: clamp(.92rem, 2vw, 1rem);
  max-width: 46ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .68rem 1.15rem;
  border-radius: 999px;
  font-size: .93rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
.btn-primary { background: #f3c877; color: #2b1d05; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .45); }
.btn-primary:hover { background: #ffd88c; color: #2b1d05; transform: translateY(-1px); }
.btn-ghost {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .55);
  color: #fff;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .22); color: #fff; }

.hero-sm { min-height: clamp(240px, 26vw, 320px); }
.hero-sm .hero-inner { padding: clamp(1.2rem, 3vw, 1.7rem) clamp(1.2rem, 3.5vw, 2rem); }
.hero-sm h1 { font-size: clamp(1.35rem, 3.4vw, 1.95rem); }

/* ページ内ヒーロー（記事ページ用の小さめ帯） */
.page-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0 1.4rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.page-hero img { width: 100%; height: 200px; object-fit: cover; }
.page-hero .page-hero-body { padding: 1.1rem 1.25rem 1.3rem; }
.page-hero h1 { margin: 0 0 .35rem; font-size: clamp(1.3rem, 3vw, 1.6rem); }
.page-hero p { margin: 0; font-size: .9rem; color: var(--muted); max-width: 60ch; }
@media (min-width: 760px) {
  .page-hero { grid-template-columns: 38% 1fr; }
  .page-hero img { height: 100%; min-height: 220px; }
  .page-hero .page-hero-body { padding: 1.4rem 1.6rem; }
}

/* ---------- 6. Answer card ---------- */
.answer {
  position: relative;
  margin: 1.1rem 0 1.5rem;
  padding: 1rem 1.15rem 1rem 1.25rem;
  border: 1px solid var(--brand-glow);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
}
.answer p { margin: .25rem 0; max-width: none; }
.answer strong { color: var(--brand-strong); }
@media (prefers-color-scheme: dark) {
  .answer strong { color: var(--brand); }
}

/* ---------- 7. Big numbers ---------- */
.big-numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
  margin: 1.2rem 0 1.8rem;
}
.num-card {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.num-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand-glow); }
.num-label { font-size: .78rem; color: var(--muted); letter-spacing: .02em; }
.num-value {
  font-size: clamp(1.85rem, 5vw, 2.35rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.num-value small { font-size: .95rem; font-weight: 500; color: var(--muted); margin-left: .12em; }

/* ---------- 8. TOC ---------- */
.toc {
  margin: 1.5rem 0;
  padding: 1rem 1.2rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.toc-title {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0 0 .65rem;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--muted);
  text-transform: uppercase;
}
.toc ol {
  margin: 0;
  padding-left: 1.3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .3rem 2rem;
  align-items: start;
}
@media (max-width: 680px) { .toc ol { grid-template-columns: 1fr; } }
.toc li { margin: 0; }
.toc a {
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  font-size: .9rem;
  transition: color .15s, border-color .15s;
}
.toc a:hover { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- 9. Tables ---------- */
table {
  width: 100%;
  margin: 1rem 0 1.7rem;
  border-collapse: collapse;
  font-size: .92rem;
  font-variant-numeric: tabular-nums;
}
thead th {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 700;
  font-size: .84rem;
  letter-spacing: .02em;
  white-space: nowrap;
  border-bottom: 2px solid var(--brand-glow);
}
th, td {
  padding: .62rem .8rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
tbody tr:hover { background: var(--brand-soft); }
tbody th { font-weight: 700; color: var(--ink); }
td a { white-space: nowrap; }
@media (prefers-color-scheme: dark) {
  thead th { color: var(--brand); }
}
/* 横スクロールが必要なときのラッパー（任意） */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 520px; }

/* ---------- 10. Tool / form ---------- */
.tool {
  margin: 1.3rem 0 1.8rem;
  padding: 1.2rem 1.3rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.tool h2 { margin-top: .2rem; }
.tool label {
  display: block;
  margin-top: .9rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
}
.tool select, .tool input[type="number"], .tool input[type="text"], .tool textarea {
  width: 100%;
  margin-top: .3rem;
  padding: .6rem .7rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.tool select:focus, .tool input:focus, .tool textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.tool textarea { line-height: 1.65; resize: vertical; }
.tool button {
  margin-top: 1.1rem;
  padding: .68rem 1.7rem;
  font-size: .98rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--brand) 70%, transparent);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), opacity .16s;
}
.tool button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--brand) 70%, transparent); }
.tool button:active { transform: translateY(0); }

.btn-sub {
  background: transparent !important;
  color: var(--brand) !important;
  border: 1px solid var(--brand) !important;
  box-shadow: none !important;
  margin-left: .5rem;
}
.btn-sub:hover { background: var(--brand-soft) !important; }

.output {
  margin-top: 1.1rem;
  padding: .95rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  border: 1px solid var(--brand-glow);
  white-space: pre-wrap;
  font-size: .95rem;
  line-height: 1.85;
  font-variant-numeric: tabular-nums;
}
.output-error {
  background: #fff4f2;
  border-color: #f0c4bc;
  color: #8a1f0f;
}
@media (prefers-color-scheme: dark) {
  .output-error { background: #3a1c17; border-color: #6b2f26; color: #ff9d8a; }
}
.hint-error { color: #b32a16; font-weight: 600; }
@media (prefers-color-scheme: dark) { .hint-error { color: #ff9d8a; } }

/* 2カラムの入力（横幅が足りるとき） */
.field-row { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 620px) { .field-row { grid-template-columns: 1fr 1fr; } }

/* ---------- 11. Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.2rem 0 2rem;
  padding: 0;
  list-style: none;
  max-width: none;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1.1rem 1.15rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-glow);
  color: inherit;
}
.card-top { display: flex; align-items: center; gap: .6rem; }
.card-title { font-weight: 700; font-size: 1rem; line-height: 1.5; }
.card-desc {
  font-size: .85rem;
  line-height: 1.7;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  margin-top: auto;
  padding-top: .35rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.card-arrow { transition: transform .18s var(--ease); }
.card:hover .card-arrow { transform: translateX(3px); }

.card-thumb { margin: -1.15rem -1.15rem .3rem; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.card-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* 食材バッジ（画像の代わり・統一スタイル） */
.badge {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-strong);
  background: linear-gradient(135deg, #eaf4ef, #d5e9df);
  border: 1px solid #cfe4d9;
}
.badge-lg { width: 3.2rem; height: 3.2rem; font-size: 1.15rem; border-radius: 14px; }
.card-grid > li:nth-child(4n+2) .badge, .badge.tone-2 { background: linear-gradient(135deg, #fdf0e0, #f7e0c4); color: #8a5a12; border-color: #f0dcc0; }
.card-grid > li:nth-child(4n+3) .badge, .badge.tone-3 { background: linear-gradient(135deg, #eaf0fb, #d6e1f7); color: #2f4a80; border-color: #d3dff3; }
.card-grid > li:nth-child(4n+4) .badge, .badge.tone-4 { background: linear-gradient(135deg, #f8eaf0, #f0d5e1); color: #7d3355; border-color: #ecd3de; }
@media (prefers-color-scheme: dark) {
  .badge { background: var(--brand-soft); color: var(--brand); border-color: var(--line); }
  .card-grid > li:nth-child(4n+2) .badge, .badge.tone-2 { background: #3a2c18; color: #e8ba74; border-color: #4d3b21; }
  .card-grid > li:nth-child(4n+3) .badge, .badge.tone-3 { background: #1f2a3f; color: #9db6e6; border-color: #2b3a55; }
  .card-grid > li:nth-child(4n+4) .badge, .badge.tone-4 { background: #35222b; color: #e3a4bf; border-color: #472f3a; }
}

/* ---------- 12. Chips / tag cloud ---------- */
.chip-row, .related ul:not(.card-grid) {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .9rem 0 1.6rem;
  padding: 0;
  list-style: none;
  max-width: none;
}
.related ul.card-grid { display: grid; margin: 1.2rem 0 2rem; padding: 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .4rem .85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: .85rem;
  color: var(--ink-soft);
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.chip:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-1px);
}
.chip-strong { background: var(--brand-soft); border-color: var(--brand-glow); color: var(--brand-strong); font-weight: 600; }

/* 旧 .hub-links / .ingredient-links もチップ風に */
.hub-links { list-style: none; padding: 0; display: grid; gap: .55rem; }
.hub-links li {
  margin: 0;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.hub-links li:hover { border-color: var(--brand-glow); box-shadow: var(--shadow); transform: translateY(-1px); }
.hub-links a { font-weight: 700; text-decoration: none; }
.hub-links .desc { display: block; margin-top: .2rem; font-size: .82rem; color: var(--muted); line-height: 1.65; }

.ingredient-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.ingredient-links li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .85rem;
  font-size: .88rem;
  background: var(--surface);
}
.ingredient-links li:hover { border-color: var(--brand); background: var(--brand-soft); }
.ingredient-links a { text-decoration: none; }

/* ---------- 13. FAQ ---------- */
.faq-item {
  margin: .6rem 0;
  padding: .15rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.faq-item[open] { border-color: var(--brand-glow); box-shadow: var(--shadow-sm); }
.faq-item summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 0;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  line-height: 1;
  transition: transform .2s var(--ease);
}
.faq-item[open] summary::after { content: "−"; transform: rotate(180deg); }
.faq-item p { margin: 0 0 .9rem; font-size: .92rem; color: var(--ink-soft); }

/* ---------- 14. Note / callout ---------- */
.note {
  margin: 2.2rem 0;
  padding: 1.1rem 1.3rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.note h2 { margin-top: .2rem; font-size: 1.05rem; }
.note h2::before { display: none; }
.note h2 { padding-left: 0; }

/* ---------- 15. Breadcrumb ---------- */
.breadcrumb {
  margin-top: .9rem;
  font-size: .8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .15rem;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }

/* ---------- 16. Related ---------- */
.related { margin-top: 2.4rem; }
.related ul li { max-width: none; }

/* ---------- 17. Footer ---------- */
.site-footer {
  margin-top: 3.5rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  color: var(--muted);
}
.site-footer p { margin: .5rem 0; max-width: var(--read); }
.footer-block { margin-top: 1.4rem; }
.footer-title {
  margin: 0 0 .6rem;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* ---------- 18. Bottom nav / to-top ---------- */
.bottom-nav { display: none; }

@media (max-width: 720px) {
  body { padding-bottom: 5.6rem; }
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    gap: .1rem;
    padding: .3rem .4rem calc(.3rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .12rem;
    padding: .38rem 0 .3rem;
    border-radius: 12px;
    font-size: .66rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--muted);
    transition: color .15s, background .15s;
  }
  .bottom-nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
  .bottom-nav svg { width: 21px; height: 21px; }
}

.to-top {
  position: fixed;
  right: 1rem;
  bottom: 1.4rem;
  z-index: 55;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
@media (max-width: 720px) { .to-top { bottom: 5.4rem; } }

/* ---------- 19. Utilities ---------- */
.ing-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.1rem 0 .7rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--brand-glow);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 35%, var(--surface)));
}
.ing-head-body { min-width: 0; }
.ing-head-body h1 { margin: 0; font-size: clamp(1.3rem, 3.2vw, 1.62rem); }
.ing-head-body .meta { margin: .25rem 0 0; font-variant-numeric: tabular-nums; }

.err-code {
  margin: 1.6rem 0 .2rem;
  font-size: clamp(3.4rem, 13vw, 5.4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--brand-glow);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.section-head h2 { margin-bottom: .5rem; }
.section-count { font-size: .78rem; color: var(--muted); font-weight: 600; }

.divider { height: 1px; background: var(--line); margin: 2.4rem 0; border: 0; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin: 1.2rem 0;
}
.stat {
  padding: .9rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.stat b { display: block; font-size: 1.3rem; color: var(--brand); font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--muted); }

/* ---------- 20. Focus / a11y ---------- */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}
.site-nav a, .breadcrumb a, .chip, .card, .bottom-nav a { display: inline-flex; }
.site-nav a, .breadcrumb a { display: inline-block; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--brand);
  color: #fff;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- 21. Print ---------- */
@media print {
  .site-header, .bottom-nav, .to-top, .hero-actions, .tool button, .site-footer .chip-row { display: none !important; }
  body { max-width: none; padding: 0; font-size: 12pt; }
  .hero { min-height: auto; }
  .hero::after { display: none; }
  .hero-inner { color: #000; padding: 0; }
  .hero h1 { color: #000; }
  a { color: #000; text-decoration: underline; }
}

/* ---------- 22. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
