/* ============================================================
   SteamDealScope — デザインシステム（ブラッシュアップ版）
   基調: ニュートラルグレー寄りのダーク / アクセント: ブルー + グリーン
   方針: ゲームメディア × 金融ダッシュボード。面の色味を抑え、罫線と
   数字で構造を作る。角丸は最大8px、影はホバー時のみごく薄く。
   補助テキストは両テーマで WCAG AA（4.5:1以上）を目安に設計。
   トークンの決めごとは DESIGN.md を参照。
   ============================================================ */

/* ---------- テーマトークン ---------- */
:root {
  color-scheme: light;
  --bg: #f4f4f6;
  --surface: #ffffff;
  --surface-2: #eeeef0;
  --surface-3: #e3e3e7;
  --border: #dbdbe0;
  --border-strong: #bdbdc4;
  --text: #16171a;
  --text-2: #45464c;
  --text-3: #5d5e66;
  --blue: #1f6ae1;
  --blue-strong: #1859c4;
  --blue-soft: rgba(31, 106, 225, 0.07);
  --btn-bg: #1f6ae1;
  --btn-bg-hover: #1859c4;
  --green: #0a7a43;
  --green-strong: #0a7a43;
  --green-soft: rgba(10, 122, 67, 0.08);
  --sale-bg: #0a7a43;
  --sale-text: #ffffff;
  --chart-line: #2f7de1;
  --band-op: 0.1;
  --shadow-card: 0 10px 28px rgba(16, 16, 20, 0.1);
  --header-bg: #0b0b0d;
  --header-border: #232329;
  --header-text: #f4f4f5;
  --header-text-2: #a7a8ae;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f0f11;
    --surface: #17181b;
    --surface-2: #1e1f23;
    --surface-3: #26272c;
    --border: #26272d;
    --border-strong: #3d3e46;
    --text: #f4f4f5;
    --text-2: #bcbcc2;
    --text-3: #92939b;
    --blue: #6aa8f0;
    --blue-strong: #8abcf5;
    --blue-soft: rgba(106, 168, 240, 0.12);
    --btn-bg: #2f6fd0;
    --btn-bg-hover: #3a7cd8;
    --green: #3ecf82;
    --green-strong: #5ce39a;
    --green-soft: rgba(62, 207, 130, 0.12);
    --sale-bg: #0a7a43;
    --sale-text: #ffffff;
    --chart-line: #6aa8f0;
    --band-op: 0.13;
    --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.45);
    --header-bg: #0b0b0d;
    --header-border: #232329;
    --header-text: #f4f4f5;
    --header-text-2: #a7a8ae;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f11;
  --surface: #17181b;
  --surface-2: #1e1f23;
  --surface-3: #26272c;
  --border: #26272d;
  --border-strong: #3d3e46;
  --text: #f4f4f5;
  --text-2: #bcbcc2;
  --text-3: #92939b;
  --blue: #6aa8f0;
  --blue-strong: #8abcf5;
  --blue-soft: rgba(106, 168, 240, 0.12);
  --btn-bg: #2f6fd0;
  --btn-bg-hover: #3a7cd8;
  --green: #3ecf82;
  --green-strong: #5ce39a;
  --green-soft: rgba(62, 207, 130, 0.12);
  --sale-bg: #0a7a43;
  --sale-text: #ffffff;
  --chart-line: #6aa8f0;
  --band-op: 0.13;
  --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.45);
  --header-bg: #0b0b0d;
  --header-border: #232329;
  --header-text: #f4f4f5;
  --header-text-2: #a7a8ae;
}

/* ---------- 基礎 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans",
    "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: 0.01em;
}
.num {
  font-family: "Inter", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.01em;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.35; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* 見出しの階層: 日本語見出し + 緑の縦バー + 右端の補足（編集デザイン）。
   横罫線や英字マイクロラベル（eyebrow）は量産テンプレートの定型なので使わない。 */
.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 32px 0 14px;
}
.section-head h2 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-head h2::before {
  content: "";
  width: 3px;
  height: 17px;
  background: var(--green);
  flex: none;
}
.section-head .sub { font-size: 12px; color: var(--text-3); white-space: nowrap; margin-left: auto; }

/* ---------- ヘッダー（1段構成・両テーマ共通のニュートラルブラック） ----------
   ロゴ＋サイト名 / ナビ / テーマ切替を1行に収める。罫線は下端の1本だけ。
   日付・更新時刻などの補助情報はヘッダーに置かず、トップのイントロに
   小さなメタテキストとして静かに置く。 */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  min-height: 56px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--header-text);
  flex: none;
}
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand-name {
  /* ワードマークは英字キャメルケース「SteamDealScope」。
     Inter の英字は字間を詰め気味にした方がワードマークとして締まる。 */
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.main-nav { display: flex; gap: 24px; margin-left: 36px; }
.main-nav a {
  color: var(--header-text-2);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.main-nav a:hover { color: var(--header-text); text-decoration: none; }
.theme-toggle {
  flex: none;
  width: 34px;
  height: 34px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--header-text-2);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, background 0.15s ease;
}
.theme-toggle:hover { color: var(--header-text); background: rgba(255, 255, 255, 0.07); }
.theme-toggle svg { width: 17px; height: 17px; }

/* ---------- イントロ（トップ上部） ----------
   メタ情報 → 検索 → 統計＋まもなく終了、の順に余白だけで区切る。
   枠・罫線・カードは使わない。見出し＋説明文のヒーローブロックは
   置かず、ページの主題を示す h1 は .sr-only で不可視に残す。
   統計は大きな数字＋小さなラベルのテキスト組みで見せる（数値は実データ）。 */
/* 視覚的には表示せず、支援技術と検索エンジンにだけ伝える */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.intro { padding: 30px 0 0; }
.intro-meta {
  margin: 0;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.03em;
}
.intro-meta .meta-part { white-space: nowrap; }
/* 検索はページ上部の主役として大きく置く（絞り込み・並び替えは一覧直上に残す） */
.search-box.hero-search { margin-top: 22px; max-width: 680px; }
.hero-search svg { left: 13px; width: 17px; height: 17px; }
.hero-search input { height: 46px; padding-left: 39px; font-size: 15px; }
.intro-data {
  display: flex;
  align-items: flex-start;
  gap: 44px;
  margin-top: 30px;
}
.stats {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}
.stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat-value { font-size: 27px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.stat-value .stat-unit { font-size: 13px; font-weight: 700; margin-left: 2px; }
.stat-value.is-sale { color: var(--green-strong); }
.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.stat-sub {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* まもなく終了: 速報ティッカーではなく、統計の脇の静かな小リストにする */
.ending-soon { flex: none; width: 296px; }
.ending-soon h2 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-2);
  margin: 3px 0 7px;
}
.ending-soon h2 svg { width: 13px; height: 13px; color: var(--text-3); }
.ending-soon ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
}
.ending-soon li { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.ending-soon a {
  color: var(--text);
  font-weight: 600;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ending-soon a:hover { color: var(--blue); text-decoration: none; }
.ending-when { color: var(--text-2); font-size: 12.5px; white-space: nowrap; }

/* ---------- 注意事項（要約 + 詳細展開） ----------
   独立した角丸ボックスにはせず、余白だけでイントロの地に統合する。 */
.notice {
  margin: 26px 0 0;
  padding: 0 2px;
}
.notice summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.6;
  list-style: none;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.notice summary::-webkit-details-marker { display: none; }
.notice summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--text-3);
  border-bottom: 1.6px solid var(--text-3);
  transform: rotate(-45deg) translateY(-1px);
  flex: none;
  transition: transform 0.15s ease;
}
.notice[open ] summary::before { transform: rotate(45deg) translateY(-1px); }
.notice summary strong { color: var(--text); font-weight: 700; }
.notice .notice-body { padding: 8px 0 2px 15px; }
.notice .notice-body p { margin: 0 0 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.75; }
.notice .notice-body p:last-child { margin-bottom: 0; }

/* ---------- ツールバー（検索・絞り込み・並び替え） ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 12px;
}
.search-box { position: relative; flex: 1 1 240px; max-width: 420px; }
.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-3);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.search-box input::placeholder { color: var(--text-3); }
.search-box input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
.filter-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.filter-check:hover { border-color: var(--border-strong); }
.filter-check input { accent-color: var(--blue); width: 15px; height: 15px; margin: 0; cursor: pointer; }
.filter-check:has(input:checked) { color: var(--text); border-color: var(--blue); background: var(--blue-soft); }
.sort-box { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.sort-box label { font-size: 12.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 5px; }
.sort-box label svg { width: 14px; height: 14px; }
.sort-box select {
  height: 38px;
  padding: 0 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.result-count { font-size: 12.5px; color: var(--text-3); margin: 0 0 10px; }

/* ---------- ゲームカード ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 14px;
}
.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.game-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.game-card[hidden] { display: none; }
.game-card.paged-out { display: none; }
.more-wrap { display: flex; justify-content: center; margin: 20px 0 4px; }
.more-btn {
  height: 40px;
  padding: 0 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.more-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.more-btn[hidden] { display: none; }
.game-card .thumb { display: block; aspect-ratio: 460 / 215; background: var(--surface-2); overflow: hidden; }
.game-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s ease; }
.game-card:hover .thumb img { transform: scale(1.03); }
.thumb-fallback {
  width: 100%;
  height: 100%;
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}
.card-body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 14px; font-weight: 700; margin: 0; line-height: 1.45; }
.card-title a { color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color 0.15s ease; }
.card-title a:hover { color: var(--blue); text-decoration: none; }
/* 価格を主役に: 大きな現在価格 + 控えめな定価、その下にタグ行 */
.price-block { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin-top: auto; }
.price-now { font-size: 21px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.price-was { font-size: 12.5px; color: var(--text-3); text-decoration: line-through; }
.card-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.disc-tag {
  background: var(--sale-bg);
  color: var(--sale-text);
  font-family: "Inter", sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 7px;
  border-radius: 4px;
}
.lowest-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green-strong);
  border: 1px solid var(--green);
  border-radius: 4px;
  padding: 2px 6px;
  line-height: 1.5;
}
.lowest-tag::before { content: ""; width: 6px; height: 6px; background: var(--green); flex: none; }
.status-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 2px 6px;
  line-height: 1.5;
}
/* カード内では主張を弱め、面の段差だけで示す */
.game-card .status-tag { background: var(--surface-2); border-color: var(--border); }
.card-meta { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 12px; color: var(--text-2); }
.card-meta .m-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.card-meta svg { width: 13px; height: 13px; color: var(--text-3); flex: none; }
.card-meta .m-ends { color: var(--green-strong); font-weight: 600; }
.card-meta .m-ends svg { color: var(--green); }
.empty-state {
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  padding: 36px 16px;
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
}
.empty-state[hidden] { display: none; }

/* ---------- 注目セール ---------- */
.featured-section[hidden] { display: none; }
/* 左に大きなリードカード、右に2枚を積む編集レイアウト。
   画像はカプセルの自然な比率を保ち、左右が切れないようにする。 */
.featured-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
}
.featured-card { position: relative; }
.featured-card .card-title { font-size: 15px; }
.featured-card .price-now { font-size: 24px; }
.feat-rank {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-3);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 7px;
}
.feat-rank::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.featured-card.is-lead { grid-row: 1 / -1; }
.featured-card.is-lead .card-body { padding: 16px 18px; }
.featured-card.is-lead .card-title { font-size: 19px; }
.featured-card.is-lead .price-now { font-size: 32px; }
.featured-card.is-lead .price-block { margin-top: 10px; }
.featured-grid .featured-card:not(.is-lead) .thumb { aspect-ratio: 460 / 200; }
.feat-gauge { margin-top: 14px; }
.feat-gauge .gauge-head {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.feat-gauge .gauge-head .num { font-weight: 700; color: var(--text); }
.gauge-track { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.gauge-fill { height: 100%; background: var(--green); border-radius: 3px; }
.feat-specs {
  margin: auto 0 0;
  padding-top: 11px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
}
.feat-specs .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.feat-specs dt { color: var(--text-2); }
.feat-specs dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn svg { width: 14px; height: 14px; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--btn-bg); color: #fff; }
.btn-primary:hover { background: var(--btn-bg-hover); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }

/* ---------- 詳細ページ ---------- */
.back-link { font-size: 13px; margin: 18px 0 12px; display: inline-block; }
.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: start;
}
.detail-thumb {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 460 / 215;
}
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-thumb .thumb-fallback { min-height: 240px; font-size: 18px; }
.price-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.price-panel h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.tag-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag-row .disc-tag { font-size: 14px; padding: 6px 8px; }
.ends-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--green-strong);
  border: 1px solid var(--green);
  border-radius: 4px;
  padding: 3px 7px;
  line-height: 1.5;
}
.ends-tag svg { width: 13px; height: 13px; }
.detail-price { display: flex; align-items: baseline; gap: 10px; }
.detail-price .price-now { font-size: 36px; font-weight: 800; line-height: 1.1; }
.detail-price .price-was { font-size: 15px; }
.spec-list { margin: 2px 0 0; border-top: 1px solid var(--border); }
.spec-list .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.spec-list dt { color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.spec-list dt svg { width: 14px; height: 14px; color: var(--text-3); }
.spec-list dd { margin: 0; font-weight: 600; text-align: right; }
.spec-list dd.good { color: var(--green-strong); }
.prov-note {
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  line-height: 1.65;
  margin: 0;
}
.price-actions { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.fetch-note { font-size: 11.5px; color: var(--text-3); margin: 0; }

/* ---------- パネル・チャート ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  margin-top: 20px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.panel h2 { font-size: 16px; font-weight: 700; margin: 0; }
.range-tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.range-tabs button {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.range-tabs button:last-child { border-right: 0; }
.range-tabs button:hover { background: var(--surface-2); }
.range-tabs button[aria-pressed="true"] { background: var(--btn-bg); color: #fff; }
.chart-readout {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 10px 0 6px;
  min-height: 30px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  flex-wrap: wrap;
}
.chart-readout .date { color: var(--text-2); font-size: 13px; }
.chart-readout .val { font-size: 21px; font-weight: 800; }
.chart-readout .diff { font-size: 12.5px; font-weight: 700; }
.chart-readout .diff.down { color: var(--green-strong); }
.chart-readout .diff.flat { color: var(--text-3); }
.chart-readout .lowmark { font-size: 12px; font-weight: 700; color: var(--green-strong); margin-left: auto; }
.chart-readout .lowmark:empty { display: none; }
.chart-box { position: relative; }
.chart-box svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis { fill: var(--text-3); font-size: 11px; font-family: "Inter", "Noto Sans JP", sans-serif; }
.chart-line { fill: none; stroke: var(--chart-line); stroke-width: 2; stroke-linejoin: miter; stroke-linecap: square; }
.chart-area { fill: var(--chart-line); opacity: 0.07; }
.chart-saleband { fill: var(--green); opacity: var(--band-op); }
.chart-lowline { stroke: var(--green); stroke-width: 1; stroke-dasharray: 4 4; }
.chart-lowlabel { fill: var(--green-strong); font-size: 11px; font-weight: 700; font-family: "Inter", "Noto Sans JP", sans-serif; }
.chart-dot { fill: var(--chart-line); stroke: var(--surface); stroke-width: 2; }
.chart-lowdot { fill: var(--green); stroke: var(--surface); stroke-width: 2; }
.chart-guide { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-note { color: var(--text-2); font-size: 12.5px; margin: 10px 0 0; }
.chart-empty {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 13px 15px;
  margin-top: 12px;
  background: var(--surface-2);
  display: flex;
  gap: 11px;
  align-items: flex-start;
}
.chart-empty[hidden] { display: none; }
.chart-empty svg { width: 17px; height: 17px; color: var(--text-3); flex: none; margin-top: 2px; }
.chart-empty .ce-title { font-size: 13px; font-weight: 700; color: var(--text); margin: 0 0 2px; }
.chart-empty .ce-body { font-size: 12.5px; color: var(--text-2); margin: 0; line-height: 1.65; }

/* ---------- テーブル ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { color: var(--text-2); font-weight: 600; font-size: 12px; background: var(--surface-2); }
td.r, th.r { text-align: right; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: var(--surface-2); }

/* ---------- 広告（体験を妨げない位置にのみ配置） ---------- */
.ad-slot { margin: 28px 0 8px; }
.ad-label { font-size: 11px; color: var(--text-3); margin-bottom: 6px; letter-spacing: 0.08em; }
.ad-box {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.ad-note { color: var(--text-3); font-size: 12px; position: absolute; }
.ad-box ins.adsbygoogle { position: relative; z-index: 1; }

/* ---------- 固定ページ ---------- */
.prose { max-width: 760px; padding: 26px 0 10px; }
.prose h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 14px; }
.prose h2 { font-size: 17px; font-weight: 700; margin: 28px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.prose p, .prose li { color: var(--text-2); font-size: 14.5px; }
.prose strong { color: var(--text); }
.prose .muted { color: var(--text-3); font-size: 13px; }
.prose ul { padding-left: 20px; }

/* ---------- フッター ---------- */
.site-footer {
  margin-top: 44px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 0 30px;
}
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.site-footer nav a { color: var(--text-2); font-size: 13px; }
.site-footer p { color: var(--text-3); font-size: 12px; margin: 4px 0; line-height: 1.7; }

main { display: block; padding-bottom: 10px; }

/* ---------- モバイル ---------- */
/* PCでは「まもなく終了」を統計の脇に置くため、タイトルと日時を縦に組む
   （横1行だと長い英字タイトルが途中で切れる）。横幅が確保できる帯では1行に保つ。 */
@media (min-width: 1021px) {
  .ending-soon ul { gap: 9px; }
  .ending-soon li { flex-direction: column; align-items: flex-start; gap: 0; }
  .ending-soon a { max-width: 100%; }
  .ending-when { font-size: 12px; color: var(--text-3); }
}
@media (max-width: 1020px) {
  .intro-data { flex-direction: column; gap: 24px; }
  .ending-soon { width: auto; max-width: 400px; }
}
@media (max-width: 900px) {
  .featured-grid { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .featured-card.is-lead { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 14px; }
  .header-inner { min-height: 52px; }
  .brand-name { font-size: 15px; }
  .brand svg { width: 26px; height: 26px; }
  /* モバイルではナビを「トップ」のみに絞り、右端に寄せる（全リンクはフッターにもある） */
  .main-nav { margin-left: auto; gap: 0; }
  .main-nav a { font-size: 12.5px; }
  .main-nav a[href$="about.html"],
  .main-nav a[href$="contact.html"] { display: none; }
  .theme-toggle { margin-left: 8px; }
  .intro { padding-top: 22px; }
  .search-box.hero-search { margin-top: 18px; }
  .intro-data { margin-top: 24px; gap: 20px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 18px 24px; }
  .stat-value { font-size: 23px; }
  .toolbar { gap: 8px; }
  .featured-grid { grid-template-columns: 1fr; }
  .featured-card.is-lead .card-title { font-size: 16px; }
  .featured-card.is-lead .price-now { font-size: 26px; }
  .featured-card.is-lead .price-block { margin-top: 0; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .card-body { padding: 10px 11px 12px; }
  .card-title { font-size: 13px; }
  .price-now { font-size: 17px; }
  .featured-card .price-now { font-size: 19px; }
  .detail-head { grid-template-columns: 1fr; }
  .detail-price .price-now { font-size: 29px; }
  .panel { padding: 14px; }
  .table-wrap { margin: 0 -14px; padding: 0 14px; }
  .range-tabs button { padding: 6px 9px; }
  .section-head .sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
