/* NGaugeBench 共通デザイン — build.mjs が生成する全ページが読む。
   艦隊の railplan 系デザインシステムを踏襲(light/dark 両対応・system-ui・角丸カード)。
   この隻固有の追加は「内外価格差バー」「状態ランクのバッジ」「モバイルで横スクロールする表」。 */
:root {
  color-scheme: light dark;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface2: #eef1f6;
  --text: #1b2430;
  --muted: #5b6675;
  --faint: #8a94a4;
  --border: #dce2ea;
  --divider: #e9edf2;
  --accent: #17603f;          /* 深緑 = 鉄道模型のレール/車両の落ち着いた色 */
  --accent-soft: #e6f2eb;
  --hot: #b3452b;             /* 内外差が大きい = 輸出妙味 */
  --hot-soft: #fbeee9;
  --cool: #2c5aa0;            /* 海外のほうが安い */
  --cool-soft: #e8eef8;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1319;
    --surface: #161c24;
    --surface2: #1e2631;
    --text: #e6eaf0;
    --muted: #98a3b2;
    --faint: #6b7686;
    --border: #29323f;
    --divider: #222b36;
    --accent: #4dbd8a;
    --accent-soft: #142b21;
    --hot: #ff9070;
    --hot-soft: #35201a;
    --cool: #7ba7e8;
    --cool-soft: #16233a;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Meiryo, "Noto Sans JP", sans-serif;
  margin: 0; background: var(--bg); color: var(--text); line-height: 1.65; font-size: 14px;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); }
.shell { max-width: 1180px; margin: 0 auto; padding: 0 18px; }
main.shell { padding-top: 24px; padding-bottom: 40px; }

/* ── ヘッダー ── */
.siteheader { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.nav-shell { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; min-height: 52px; padding-top: 6px; padding-bottom: 6px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; color: var(--text); text-decoration: none; }
.brand svg { width: 26px; height: 26px; flex: none; }
.sitenav { display: flex; flex-wrap: wrap; gap: 2px 4px; margin-left: auto; }
.sitenav a { color: var(--muted); text-decoration: none; font-size: 13px; padding: 5px 10px; border-radius: 7px; }
.sitenav a:hover, .sitenav a[aria-current] { color: var(--accent); background: var(--accent-soft); }

/* ── 見出し ── */
h1 { font-size: 21px; margin: 0 0 8px; line-height: 1.45; }
h2 { font-size: 15px; margin: 30px 0 10px; }
h3 { font-size: 13.5px; margin: 0; }
.lead { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; max-width: 74ch; }
.lead strong { color: var(--text); }
.crumb { font-size: 12px; color: var(--faint); margin: 0 0 8px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }

/* ── 数値タイル ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; margin: 16px 0 6px; padding: 0; list-style: none; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; box-shadow: var(--shadow); }
.tile .v { font-size: 20px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.tile .k { font-size: 11.5px; color: var(--muted); }
.tile.hot .v { color: var(--hot); }

/* ── 内外価格差バー ── */
.gap { margin: 4px 0 2px; }
.gap .bars { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin: 2px 0; }
/* ★track/fill は span なので display:block を明示しないと width/height が効かない
   (track はグリッド項目なので blockify されるが、その中の fill は inline のまま潰れる)。 */
.gap .track { display: block; background: var(--surface2); border-radius: 999px; height: 9px; overflow: hidden; }
.gap .fill { display: block; height: 100%; border-radius: 999px; min-width: 4px; }
.gap .fill.dom { background: var(--accent); }
.gap .fill.ov { background: var(--hot); }
.gap .amt { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; white-space: nowrap; }

/* ── カード ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 13px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 13px 15px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 7px; }
.card a.t { color: var(--text); text-decoration: none; font-weight: 650; font-size: 13.5px; }
.card a.t:hover { color: var(--accent); }
.card .meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }

/* ── バッジ ── */
.b { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 7px; white-space: nowrap; background: var(--surface2); color: var(--muted); }
.b.hb { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .01em; color: var(--text); }
.b.ratio { background: var(--hot-soft); color: var(--hot); }
.b.ratio.low { background: var(--cool-soft); color: var(--cool); }
.b.rank { background: var(--accent-soft); color: var(--accent); }

/* ── 表(モバイルでは横スクロール) ── */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 6px; }
table { border-collapse: separate; border-spacing: 0; font-size: 13px; width: 100%; min-width: 560px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
th, td { border: none; border-top: 1px solid var(--divider); padding: 8px 13px; text-align: left; vertical-align: top; }
tr:first-child > th, tr:first-child > td { border-top: none; }
th { background: var(--surface2); font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td a { font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }
tbody tr:hover td { background: var(--surface2); }

/* ── 注記 ── */
.note { font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 9px; padding: 9px 13px; margin: 12px 0; }
.note strong { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 18px; padding: 0; list-style: none; }
.chips a, .chips li { font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 11px; text-decoration: none; }
.chips a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* ── フッター ── */
.sitefoot { margin-top: 48px; border-top: 1px solid var(--border); background: var(--surface); font-size: 12px; color: var(--muted); }
.sitefoot .shell { padding-top: 16px; padding-bottom: 28px; }
.sitefoot p { margin: 5px 0; }
.sitefoot .sitenav { margin-left: 0; justify-content: flex-start; }
.sitefoot .sitenav a:first-child { padding-left: 0; }

@media (max-width: 560px) {
  h1 { font-size: 19px; }
  .tile .v { font-size: 18px; }
  main.shell { padding-top: 18px; }
}

/* 小さい表(状態ランク/他店)はページ幅いっぱいに伸ばすと間延びするので上限を付ける */
.tablewrap.narrow { max-width: 560px; }
.tablewrap.narrow table { min-width: 0; }  /* 3列しかないのでモバイル375pxでも横スクロールなしで収める */
