/*
 * クルマ維持費ラボ — デザインの考え方
 * 主役は「ナンバープレート」。ツールの答え（金額・残り期間）は、普通車なら白地に緑、
 * 軽自動車なら黄色地に黒のプレートで出す。入力欄は車検証の枠組みを下敷きにする。
 * 地の色は車検証の淡い緑がかった紙。数字は DIN 系（プレートの数字と同じ系統）。
 * 外部フォント・画像・外部スクリプトは使わない。
 */

:root {
  --paper: #eef2ea;        /* 車検証の紙 */
  --paper-2: #e3e9de;      /* 一段沈んだ紙 */
  --sheet: #fbfcf8;        /* 入力欄・プレートの白 */
  --ink: #1d2427;          /* 文字・枠 */
  --muted: #56625b;
  --rule: #b9c4b3;         /* 罫線（車検証の緑がかった灰） */
  --green: #165434;        /* 自家用ナンバーの緑 */
  --green-2: #2c7a52;
  --yellow: #f2c11b;       /* 軽自動車のナンバー */
  --heavy: #a8352a;        /* 重課の増額だけに使う */

  --font-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "YuGothic", "Meiryo", system-ui, sans-serif;
  --font-num: "DIN Alternate", "DIN Condensed", "DIN 2014", "Bahnschrift", "D-DIN", "Roboto Condensed", var(--font-ja);

  --measure: 38rem;
  --wide: 74rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ja);
  font-size: 1.0625rem;
  line-height: 1.9;
  letter-spacing: 0.03em;
  font-feature-settings: "palt" 0;
  overflow-wrap: anywhere;
  line-break: strict;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
a:hover { color: var(--ink); text-decoration-thickness: 2px; }
:where(a, button, input, select, summary):focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--ink);
  border-radius: 2px;
}

/* ---------------------------------------------------------------- ヘッダー */

.site-header { border-bottom: 1.5px solid var(--ink); background: var(--paper); }
.site-header-inner {
  max-width: var(--wide); margin: 0 auto; padding: 0.75rem var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem;
}
.site-name {
  display: inline-flex; align-items: center; gap: 0.65rem;
  color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.05rem; letter-spacing: 0.06em;
}
/* 検査標章（車検ステッカー）を模した印。13年の「13」 */
.mark {
  position: relative; display: inline-grid; place-items: center;
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  background: var(--green); color: var(--sheet);
  font-family: var(--font-num); font-weight: 700; font-size: 1.05rem; letter-spacing: 0;
  box-shadow: inset 0 0 0 3px var(--green), inset 0 0 0 5px var(--sheet);
}
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 0.92rem; font-weight: 600; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--green); }

/* ---------------------------------------------------------------- 本文 */

.site-main { max-width: var(--wide); margin: 0 auto; padding: clamp(1.5rem, 5vw, 3.5rem) var(--gutter) 4rem; }

.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0 0 1.5rem; padding: 0; list-style: none; font-size: 0.82rem; color: var(--muted); }
.breadcrumb li + li::before { content: "／"; margin-right: 0.25rem; color: var(--rule); }
.breadcrumb a { color: var(--muted); }

.page { max-width: var(--measure); }
.page-tool { max-width: none; }

.page h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 0.75rem + 3vw, 3.2rem);
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-feature-settings: "palt" 1;
  text-wrap: balance;
  max-width: 22em;
}
.page-tool h1 { max-width: 18em; }

.body > * + * { margin-top: 1.15em; }
.body h2 {
  margin: 3.25rem 0 0.9rem;
  padding-top: 1rem;
  border-top: 1.5px solid var(--ink);
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.55rem);
  line-height: 1.45;
  font-weight: 800;
  font-feature-settings: "palt" 1;
}
.body h3 { margin: 2.25rem 0 0.5rem; font-size: 1.15rem; line-height: 1.5; font-weight: 800; }
.body h4 { margin: 1.75rem 0 0.25rem; font-size: 1rem; font-weight: 800; }
.body p { margin: 0; }
.body ul, .body ol { padding-left: 1.4em; }
.body li + li { margin-top: 0.35em; }
.body li::marker { color: var(--green); }
.body strong { font-weight: 800; background: linear-gradient(transparent 62%, rgba(242, 193, 27, 0.45) 62%); }
.body blockquote { margin: 1.5em 0; padding: 0.25em 0 0.25em 1.1em; border-left: 3px solid var(--green); color: var(--muted); }
.body hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0; }
.body code { font-size: 0.9em; background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 3px; }
.body pre { overflow-x: auto; background: var(--sheet); border: 1px solid var(--rule); padding: 1rem; }

/* 表: 数字が主役。見出し行は太罫、行は細罫、数字は右寄せの等幅 */
.table-wrap { overflow-x: auto; margin: 1.5em 0; -webkit-overflow-scrolling: touch; }
.body table, .tool table {
  width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
.body th, .body td, .tool th, .tool td { padding: 0.6rem 0.75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.body thead th, .tool thead th { border-bottom: 2px solid var(--ink); font-size: 0.82rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.body td:not(:first-child), .tool td:not(:first-child) { text-align: right; font-family: var(--font-num); font-size: 1.02rem; letter-spacing: 0.02em; white-space: nowrap; }
.body > .table-wrap tbody tr:last-child > * { border-bottom: 1.5px solid var(--ink); }
.body caption, .tool caption { caption-side: top; text-align: left; font-weight: 800; font-size: 0.95rem; padding-bottom: 0.5rem; }

/* PR 表記・出典・更新日 */
.pr-notice { display: flex; gap: 0.6rem; align-items: baseline; margin: -0.75rem 0 2rem; font-size: 0.85rem; color: var(--muted); }
.pr-label { flex: none; padding: 0.05rem 0.45rem; background: var(--yellow); color: var(--ink); font-weight: 800; font-size: 0.78rem; border-radius: 2px; }
.sources { margin-top: 3.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: 0.85rem; color: var(--muted); }
.sources h2 { margin: 0 0 0.5rem; font-size: 0.95rem; color: var(--ink); }
.sources ul { margin: 0; padding-left: 1.2em; }
.sources li + li { margin-top: 0.25em; }
.updated { margin-top: 1rem; font-size: 0.82rem; color: var(--muted); font-family: var(--font-num); letter-spacing: 0.04em; }

/* ---------------------------------------------------------------- ツール */

.tool { margin: 2rem 0 3rem; }
.page-tool .body > .tool:first-child { margin-top: 0; }

@media (min-width: 60rem) {
  .tool--ready {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    grid-template-areas: "form result" "foot result";
    grid-template-rows: auto 1fr;
    gap: 0 clamp(1.5rem, 3vw, 3rem);
    align-items: start;
  }
  .tool--ready > .tool-form { grid-area: form; }
  .tool--ready > .tool-result { grid-area: result; position: sticky; top: 1.25rem; }
  .tool--ready > div:last-child { grid-area: foot; }
  /* 記事の中のツールは本文の幅を越えて広げる */
  .page:not(.page-tool) .tool--ready { width: min(var(--wide) - 2 * var(--gutter), 100vw - 2 * var(--gutter)); }
}

/* 入力欄: 車検証の枠。項目名の欄（左・沈んだ紙色）と値の欄（右・白）を細罫で区切り、外枠は太く */
.tool-form {
  --label-w: 9.5rem;
  background: var(--sheet);
  border: 1.5px solid var(--ink);
}
.tool-form [hidden] { display: none !important; }
.tool-form .tool-row {
  display: grid;
  grid-template-columns: var(--label-w) minmax(0, 1fr);
  align-items: stretch;
  margin: 0; padding: 0; min-width: 0;
  border: 0; border-bottom: 1px solid var(--rule);
}
.tool-form .tool-row > label, .tool-form .tool-row > legend {
  grid-column: 1; grid-row: 1 / span 3;
  float: left; width: auto; /* legend を普通の箱にしてグリッドに載せる */
  margin: 0; padding: 0.7rem 0.75rem;
  background: var(--paper-2);
  border-right: 1px solid var(--rule);
  font-size: 0.8rem; font-weight: 700; line-height: 1.5; color: var(--ink); letter-spacing: 0.04em;
}
.tool-form .tool-row > select, .tool-form .tool-row > input { grid-column: 2; align-self: center; margin: 0.45rem 0.85rem; width: auto; }
.tool-form .tool-row > .tool-note { grid-column: 2; margin: -0.15rem 0.85rem 0.55rem; }

/* 年・月の組 */
.tool-form fieldset.tool-row { grid-template-columns: var(--label-w) minmax(0, 1fr) minmax(0, 1fr); }
.tool-form fieldset.tool-row > label:not(:first-of-type), .tool-form fieldset.tool-row > label:first-of-type {
  grid-row: 1; background: none; border: 0; padding: 0.45rem 0.85rem 0; font-size: 0.68rem; font-weight: 600; color: var(--muted);
}
.tool-form fieldset.tool-row > label:nth-of-type(1) { grid-column: 2; }
.tool-form fieldset.tool-row > label:nth-of-type(2) { grid-column: 3; }
.tool-form fieldset.tool-row > select { grid-row: 2; margin-top: 0; }
.tool-form fieldset.tool-row > select:nth-of-type(1) { grid-column: 2; margin-right: 0.35rem; }
.tool-form fieldset.tool-row > select:nth-of-type(2) { grid-column: 3; margin-left: 0.35rem; }

/* 任意入力のまとまり（見出しの行＋入れ子の行） */
.tool-form > fieldset:not(.tool-row) { margin: 0; padding: 0; border: 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.tool-form > fieldset:not(.tool-row) > legend {
  float: left; width: 100%; margin: 0; padding: 0.55rem 0.75rem;
  background: var(--paper); border-bottom: 1px solid var(--rule);
  font-size: 0.8rem; font-weight: 700; color: var(--muted);
}
.tool-form > fieldset:not(.tool-row) > .tool-row:last-child { border-bottom: 0; }

.tool-form select, .tool-form input {
  padding: 0.3rem 0 0.25rem;
  border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--ink);
  font: inherit; font-size: 1.02rem; font-weight: 600; min-width: 0;
}
.tool-form input { font-family: var(--font-num); font-size: 1.2rem; letter-spacing: 0.04em; }
.tool-form select {
  appearance: none; -webkit-appearance: none;
  padding-right: 1.3rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 9px) 55%, calc(100% - 4px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.tool-form input:focus, .tool-form select:focus { border-bottom-color: var(--green); }
.tool-form .tool-note { font-size: 0.76rem; color: var(--muted); line-height: 1.6; }

/* 計算するボタンの行 */
.tool-form > .tool-row:last-child { display: block; border-bottom: 0; padding: 0.75rem; }
.tool-form button {
  width: 100%; margin: 0; padding: 0.85rem 1rem;
  border: 0; border-radius: 3px;
  background: var(--ink); color: var(--sheet);
  font: inherit; font-weight: 800; font-size: 1rem; letter-spacing: 0.12em;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.tool-form button:hover { background: var(--green); }
.tool-form button:active { transform: translateY(1px); }

/* 結果 */
.tool-result { margin-top: 1.5rem; min-width: 0; }
@media (min-width: 60rem) { .tool-result { margin-top: 0; } }
.tool-result > * + * { margin-top: 1rem; }
.tool-result h3 { margin: 1.75rem 0 0.25rem; font-size: 1rem; font-weight: 800; }
.tool-result > p:not(.tool-note) { margin-bottom: 0; font-weight: 600; }
.tool-result table { background: var(--sheet); border: 1px solid var(--rule); }
.tool-result > .table-wrap { margin-bottom: 0; }
.tool-result td:first-child { color: var(--ink); }
.tool-result tbody tr:last-child > * { border-bottom: 0; }
.tool-result tr.is-total > * { font-weight: 800; background: var(--paper-2); }
.tool-result tbody th { font-weight: 600; text-align: left; }
.tool-note { font-size: 0.82rem; color: var(--muted); line-height: 1.7; margin: 0; }
.tool-result ul { margin: 0.25rem 0 0; padding-left: 1.2em; font-size: 0.85rem; color: var(--muted); }
.tool-sources { padding-top: 0.25rem; border-top: 1px solid var(--rule); }
.tool-sources h3 { margin-top: 0.75rem; }
.tool > div:last-child > .tool-note { margin-top: 0.75rem; }

/* ---------------------------------------------------------------- ナンバープレート（主役） */

.plate {
  --plate-bg: var(--sheet);
  --plate-fg: var(--green);
  position: relative;
  margin: 0;
  padding: 1.1rem 1.25rem 1.15rem;
  border-radius: 14px;
  background: var(--plate-bg);
  color: var(--plate-fg);
  text-align: center;
  /* 縁の打ち出し: 外側の細い縁 → 地 → 内側の太い縁 */
  box-shadow:
    inset 0 0 0 2px var(--plate-bg),
    inset 0 0 0 5px var(--plate-fg),
    0 1px 0 rgba(29, 36, 39, 0.25),
    0 14px 30px -18px rgba(29, 36, 39, 0.55);
  border: 1.5px solid var(--ink);
  container-type: inline-size;
}
.plate--kei { --plate-bg: var(--yellow); --plate-fg: var(--ink); }
.plate--heavy { --plate-fg: var(--heavy); }
.plate--empty { --plate-fg: #9aa79d; box-shadow: inset 0 0 0 2px var(--plate-bg), inset 0 0 0 5px #c4cec2; }

/* 取り付けボルトの穴 */
.plate-bolt {
  position: absolute; top: 1.05rem; width: 0.66rem; height: 0.66rem; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffffff 0 18%, #c7ccc4 30%, #8d958e 70%);
  box-shadow: inset 0 0 0 1px rgba(29, 36, 39, 0.35);
}
.plate-bolt:first-child { left: 1.15rem; }
.plate-bolt:nth-child(2) { right: 1.15rem; }

.plate-label {
  margin: 0 auto; max-width: calc(100% - 4rem);
  font-size: 0.85rem; font-weight: 800; letter-spacing: 0.08em; line-height: 1.45;
  text-wrap: balance;
}
.plate-value {
  margin: 0.15rem 0 0;
  display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 0 0.15em;
  font-family: var(--font-num); font-weight: 700;
  font-size: min(4.8rem, 17cqi);
  line-height: 1.05; letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums lining-nums;
}
.plate--range .plate-value { font-size: min(3.4rem, 9.5cqi); }
.plate-unit { font-family: var(--font-ja); font-size: 0.34em; font-weight: 800; letter-spacing: 0.04em; }
.plate-sub { margin: 0.35rem 0 0; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; color: var(--ink); opacity: 0.78; }

/* 桁が回るカウンター（ユーザーの入力に応えて、前の値から新しい値へ回る） */
.odo { display: inline-flex; align-items: baseline; }
.odo-d {
  display: inline-block; height: 1.05em; overflow: hidden; vertical-align: bottom;
}
.odo-strip {
  display: flex; flex-direction: column;
  transform: translateY(calc(var(--d, 0) * -1.05em));
  transition: transform 620ms cubic-bezier(0.2, 0.9, 0.15, 1);
}
.odo-strip > span { display: block; height: 1.05em; }
.odo-sep { width: 0.28em; overflow: visible; }
.odo-txt { font-family: var(--font-ja); font-size: 0.42em; font-weight: 800; margin: 0 0.12em; }

@media (prefers-reduced-motion: reduce) {
  .odo-strip, .tool-form button { transition: none !important; }
}

/* ---------------------------------------------------------------- ツールページの冒頭 */

.page-tool .body > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.page-tool .body > :not(.tool) { max-width: var(--measure); }

/* ---------------------------------------------------------------- フッター */

.site-footer {
  background: var(--ink); color: #d9e0d6;
  padding: 2.5rem var(--gutter) 3rem;
  font-size: 0.85rem; line-height: 1.8;
}
.site-footer > * { max-width: var(--wide); margin: 0 auto; }
.site-footer a { color: var(--sheet); }
.site-footer p + p { margin-top: 0.5rem; }
.site-footer-name { font-weight: 800; color: var(--sheet); letter-spacing: 0.08em; }

/* ---------------------------------------------------------------- 小さい画面 */

@media (max-width: 34rem) {
  body { font-size: 1rem; }
  .tool-form { --label-w: 6.8rem; }
  .plate { padding: 1rem 0.9rem; border-radius: 12px; }
  .plate-label { max-width: 78%; font-size: 0.8rem; }
  .site-nav ul { gap: 0.15rem 1rem; }
}

@media print {
  .site-header, .site-footer, .tool-form { display: none; }
  body { background: #fff; }
}

/* 調整 */
.tool-form > fieldset:not(.tool-row) > .tool-row { clear: both; }
.body thead th:not(:first-child), .tool thead th:not(:first-child) { text-align: right; }

@media (max-width: 34rem) {
  .tool th[scope="row"] { min-width: 7.5em; }
  .tool td:not(:first-child), .body td:not(:first-child) { white-space: normal; }
  .tool th, .tool td { padding: 0.55rem 0.5rem; }
  /* スマホでは見出しの行も折り返す（折り返さないと長い見出しの列だけが広がり、数字が画面の外に出る）。
     列が潰れすぎないよう最小幅を置き、はみ出す分は .table-wrap の中で横にスクロールする */
  .body thead th { white-space: normal; }
  .body > .table-wrap th, .body > .table-wrap td { min-width: 5em; padding: 0.55rem 0.5rem; }
  .body > .table-wrap td:first-child { min-width: 6.5em; }
}

/* 横にスクロールできる表は、続きがある側の端に影を出す（スクロールし切ると影が消える） */
.table-wrap {
  background:
    linear-gradient(to right, var(--paper) 30%, rgba(238, 242, 234, 0)) left center / 2.5rem 100% no-repeat local,
    linear-gradient(to left, var(--paper) 30%, rgba(238, 242, 234, 0)) right center / 2.5rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(29, 36, 39, 0.22), rgba(29, 36, 39, 0)) left center / 0.9rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(29, 36, 39, 0.22), rgba(29, 36, 39, 0)) right center / 0.9rem 100% no-repeat scroll;
}

/* ツールは tools.js が描くまで空の箱。描いたときに下の本文が押し下げられないよう（CLS）、
   描かれるフォームの高さを先に取っておく。値は各画面幅で実測した高さより少し小さめ。
   JS が動かない環境では取らない。読み込みに失敗したときは中にメッセージが入るので :empty から外れる */
@media (scripting: enabled) {
  .tool:empty[data-tool="simulator"] { min-height: 1480px; }
  .tool:empty[data-tool="shaken"] { min-height: 1050px; }
  .tool:empty[data-tool="thirteen"] { min-height: 970px; }
  .tool:empty[data-tool="tsukiwari"] { min-height: 960px; }
  .tool:empty[data-tool="urudoki"] { min-height: 1260px; }
}
@media (scripting: enabled) and (min-width: 60rem) {
  .tool:empty[data-tool="simulator"] { min-height: 920px; }
  .tool:empty[data-tool="shaken"] { min-height: 650px; }
  .tool:empty[data-tool="thirteen"] { min-height: 500px; }
  .tool:empty[data-tool="tsukiwari"] { min-height: 520px; }
  .tool:empty[data-tool="urudoki"] { min-height: 710px; }
}

/* 車種の一覧・記事の導線 */
.breadcrumb { overflow-x: auto; margin-bottom: 1.5rem; }
.breadcrumb ol { align-items: center; flex-wrap: nowrap; white-space: nowrap; width: max-content; margin-bottom: 0; }
.breadcrumb li { display: flex; align-items: center; flex-shrink: 0; }
.breadcrumb li + li::before { content: "›"; color: var(--muted); }
.page-hub { max-width: none; }
.car-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; list-style: none; padding: 0; }
.car-card { padding: 1rem; border: 1px solid var(--rule); background: var(--sheet); }
.car-card > a { font-weight: 700; }
.car-card p { font-size: .9rem; margin: .5rem 0; }
.car-generations { padding: 0; list-style: none; }
.car-generations .car-card { margin-top: .75rem; background: var(--paper); }
.car-filters { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0; }
.car-filters button { font: inherit; padding: .5rem 1rem; border: 1px solid var(--green); background: var(--sheet); color: var(--green); cursor: pointer; }
.car-filters button[aria-pressed="true"] { background: var(--green); color: var(--sheet); }
.toc, .related { border-block: 1px solid var(--rule); padding: 1rem 0; margin: 1.5rem 0; }
.toc summary { cursor: pointer; font-weight: 700; }
.related-title { font-weight: 700; margin-bottom: .25rem; }
[hidden] { display: none !important; }

/* Directory lists must override the article's list indentation and sibling spacing. */
.body .car-grid, .body .car-generations { padding: 0; list-style: none; }
.body .car-grid > li, .body .car-generations > li { margin: 0; list-style: none; text-indent: 0; }
.body .car-generations > li { margin-top: .75rem; }
@media (max-width: 639px) {
  .toc:not([open]) { margin-bottom: .75rem; }
  .toc:not([open]) + .body > :first-child { margin-top: 0; }
}
/* 条件の共有と画面外の結果への導線 */
.tool-preset { padding: 0.6rem 0.75rem; }
.tool-share button, .tool-sticky button {
  font: inherit; font-weight: 700; cursor: pointer; padding: 0.7rem;
  color: var(--sheet); background: var(--ink); border: 1px solid var(--ink); border-radius: 3px;
}
.tool-share input { display: block; width: 100%; box-sizing: border-box; font: inherit; }
.tool-share input[hidden], .tool-sticky[hidden] { display: none; }
.tool-result:focus { outline: 2px solid var(--green); outline-offset: 4px; }
.tool-sticky { display: none; }
@media (max-width: 719px) {
  body { padding-bottom: var(--tool-sticky-space, 0px); }
  .tool-sticky {
    position: fixed; z-index: 20; bottom: 0; left: 0; right: 0;
    display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
    padding: 0.6rem var(--gutter) calc(0.6rem + env(safe-area-inset-bottom));
    border-top: 2px solid var(--ink); background: var(--sheet); color: var(--ink);
    font-size: 0.85rem; font-weight: 700;
  }
  .tool-sticky button { flex-shrink: 0; }
}
@media print { .tool-share, .tool-sticky { display: none; } }

/* 現在地と操作領域 */
.site-nav a, .breadcrumb a, .related a, .car-card a {
  display: inline-flex; align-items: center; min-height: 44px; min-width: 44px;
}
.site-name, button, .toc summary { min-height: 44px; }
.site-nav a[aria-current="page"] {
  color: var(--green); border-bottom-color: var(--green); font-weight: 800;
}
.breadcrumb { margin-bottom: .5rem; }
.body > .table-wrap { isolation: isolate; }
.body > .table-wrap tr > :first-child {
  position: sticky; left: 0; z-index: 1; background-color: var(--paper);
  box-shadow: 2px 0 3px rgba(29, 36, 39, .18);
}
.body > .table-wrap thead tr > :first-child { z-index: 2; background-color: var(--paper-2); }

@media (max-width: 719px) {
  .site-header-inner { flex-wrap: nowrap; gap: .75rem; padding-block: .5rem; }
  .site-name { flex: none; gap: .35rem; font-size: .8rem; letter-spacing: 0; white-space: nowrap; }
  .mark { width: 1.8rem; height: 1.8rem; font-size: .85rem; flex: none; }
  .site-nav { min-width: 0; overflow-x: auto; scrollbar-width: none;
    mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent); }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav ul { flex-wrap: nowrap; gap: 1rem; width: max-content; padding: 4px 24px 4px 4px; }
  .site-nav li { flex: none; }
  .site-nav a { white-space: nowrap; font-size: .85rem; }
  .site-main { padding-top: .75rem; }
  .page h1 { margin-bottom: .75rem; line-height: 1.35; }
  .toc { margin: .5rem 0; padding: 0; font-size: .9rem; }
  .toc summary { padding-block: .4rem; }
  .toc:not([open]) + .body > :first-child { margin-top: 0; }
  .body > h2:first-child { margin-top: .75rem; padding-top: .5rem; }
  .body > h2:first-child + .tool { margin-top: .75rem; }
}

/* 埋め込み・引用コードはキーボードでも選択できます。 */
.reuse-box { margin: 1.5rem 0; padding: 1rem; border: 1px solid #687970; border-radius: .5rem; }
.reuse-box summary { cursor: pointer; min-height: 44px; }
.copy-field { margin-top: 1rem; }
.copy-field label { display: block; }
.copy-field textarea { display: block; width: 100%; box-sizing: border-box; min-height: 8rem; padding: .75rem; font: inherit; color: #182d23; background: #fff; }
.copy-field button { min-height: 44px; margin-top: .5rem; }
.embed-page { background: #fff; margin: 0; padding: 0; }
.embed-content { padding: 12px; display: flow-root; }
.embed-credit { margin: 1rem 0 0; }
.embed-credit a { display: inline-block; min-height: 44px; }
.embed-page .tool-sticky { display: none; }
