:root {
  --bg: #f6f6f2;
  --surface: #ffffff;
  --surface-2: #f0f4f3;
  --text: #1c2024;
  --muted: #626a72;
  --line: #e2e2dc;
  --accent: #0b6e69;
  --accent-ink: #ffffff;
  --accent-soft: #e3f2f0;
  --drop: #c2410c;
  --drop-bg: #fff0e6;
  --low-bg: #e3f4f1;
  --point: #7a4b00;
  --point-bg: #fcf1d2;
  --up: #6b7280;
  --up-bg: #eef0f2;
  --cta: #bf3a0c;
  --cta-ink: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 4px 14px rgba(20, 30, 40, .05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131518;
    --surface: #1c1f23;
    --surface-2: #20272a;
    --text: #e8e9ea;
    --muted: #9aa1a8;
    --line: #2e3237;
    --accent: #4fc1b9;
    --accent-ink: #0f1f1e;
    --accent-soft: #173331;
    --drop: #ff8a50;
    --drop-bg: #3a2418;
    --low-bg: #16312e;
    --point: #f2c862;
    --point-bg: #352b12;
    --up: #a8b0b8;
    --up-bg: #2a2e33;
    --cta: #ff7a3d;
    --cta-ink: #1b0e06;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #131518;
  --surface: #1c1f23;
  --surface-2: #20272a;
  --text: #e8e9ea;
  --muted: #9aa1a8;
  --line: #2e3237;
  --accent: #4fc1b9;
  --accent-ink: #0f1f1e;
  --accent-soft: #173331;
  --drop: #ff8a50;
  --drop-bg: #3a2418;
  --low-bg: #16312e;
  --point: #f2c862;
  --point-bg: #352b12;
  --up: #a8b0b8;
  --up-bg: #2a2e33;
  --cta: #ff7a3d;
  --cta-ink: #1b0e06;
  --shadow: none;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
a { color: var(--accent); }
img { max-width: 100%; }
main, .header-inner, .main-nav, .site-footer, .pr { max-width: 1120px; margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; }
main { padding-bottom: 24px; }
.pr { font-size: 11px; color: var(--muted); padding-top: 4px; padding-bottom: 2px; margin-top: 0; margin-bottom: 0; }

/* ---- ヘッダー */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 6px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: .02em; }
.logo-mark { width: 28px; height: 28px; }
.logo-mark rect { fill: var(--accent); }
.logo-mark path { stroke: var(--accent-ink); }
.tagline { color: var(--muted); font-size: 13px; }
.main-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a { flex: none; text-decoration: none; font-size: 13px; font-weight: 700; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.main-nav a:hover, .main-nav a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---- 見出し・本文 */
h1 { font-size: 26px; line-height: 1.35; margin: 24px 0 8px; letter-spacing: .01em; }
h2 { font-size: 19px; line-height: 1.4; margin: 36px 0 14px; padding-left: 10px; border-left: 4px solid var(--accent); }
.lead { color: var(--muted); margin-top: 0; }
.crumbs { font-size: 12px; color: var(--muted); margin-top: 14px; }
.crumbs a { color: var(--muted); }
.empty, .notice { color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px 14px; }
.waiting { list-style: none; margin: 0; }
.waiting li { padding: 3px 0; }
.waiting strong { color: var(--text); font-weight: 600; }
.more { text-align: right; margin: 10px 0 0; font-weight: 700; }
.note { font-size: 12px; color: var(--muted); }

/* ---- トップのヒーロー */
.hero { background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid var(--line); border-radius: 16px; padding: 4px 20px 20px; margin-top: 16px; }
.hero p { color: var(--muted); margin-top: 0; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; text-align: center; }
.stat strong { display: block; font-size: 22px; line-height: 1.2; color: var(--accent); }
.stat span { font-size: 12px; color: var(--muted); }
.hero-search { display: flex; gap: 8px; margin: 12px 0 4px; }
.hero-search input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.hero-search button { font: inherit; font-weight: 700; padding: 10px 18px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; }

/* ---- セール */
.sales { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 16px 8px; margin-top: 16px; box-shadow: var(--shadow); }
.sales h2 { margin-top: 14px; }
.sales ul { list-style: none; padding: 0; margin: 0; }
.sales li { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.sales li:last-child { border-bottom: 0; }
.sales .when { display: inline-block; font-size: 11px; font-weight: 800; color: var(--drop); background: var(--drop-bg); border-radius: 4px; padding: 0 6px; margin-right: 8px; }

/* ---- 商品カード */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease; }
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card-link { display: flex; flex-direction: column; flex: 1; color: var(--text); text-decoration: none; }
.card img, .noimg { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; display: block; }
.card-body { padding: 8px 10px 6px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.name { margin: 0; font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.price { margin: auto 0 0; font-weight: 800; font-size: 19px; letter-spacing: .01em; }
.pts { margin: 0; font-size: 12px; color: var(--point); }
.shop { margin: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-cta { margin: 4px 10px 10px; text-align: center; font-size: 13px; font-weight: 800; text-decoration: none; color: var(--cta); border: 1.5px solid var(--cta); border-radius: 8px; padding: 5px 0; }
.card-cta:hover { background: var(--cta); color: var(--cta-ink); }
.badges { display: flex; flex-wrap: wrap; gap: 4px; min-height: 0; }
.badge { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 4px; }
.badge.drop { color: var(--drop); background: var(--drop-bg); }
.badge.low { color: var(--accent); background: var(--low-bg); }
.badge.point { color: var(--point); background: var(--point-bg); }
.badge.up, .badge.same { color: var(--up); background: var(--up-bg); }

/* ---- ジャンル一覧 */
.genre-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.genre { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; text-decoration: none; color: var(--text); font-size: 14px; font-weight: 600; }
.genre:hover { border-color: var(--accent); }
.genre span { color: var(--drop); font-size: 12px; font-weight: 700; white-space: nowrap; }

/* ---- 商品ページ */
.item-head { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 24px; align-items: start; margin-top: 8px; }
.item-head > div { min-width: 0; }
.item-head img { width: 100%; height: auto; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.item-head h1 { margin-top: 0; font-size: 21px; }
.big-price { font-size: 32px; font-weight: 800; margin: 4px 0; line-height: 1.2; }
.big-price small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.drop-line strong { color: var(--drop); }
.verdict { border-radius: var(--radius); padding: 10px 14px; margin: 10px 0; border: 1px solid var(--line); background: var(--surface); }
.verdict strong { display: block; font-size: 15px; }
.verdict span { font-size: 14px; color: var(--muted); }
.verdict.good { background: var(--low-bg); border-color: transparent; }
.verdict.good strong { color: var(--accent); }
.verdict.bad strong { color: var(--drop); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.buy { display: inline-block; background: var(--cta); color: var(--cta-ink); padding: 13px 26px; border-radius: 999px; text-decoration: none; font-weight: 800; font-size: 16px; box-shadow: var(--shadow); }
.buy:hover { filter: brightness(1.06); }
.fav { font: inherit; font-size: 14px; font-weight: 700; padding: 11px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.fav.on { border-color: var(--point); color: var(--point); background: var(--point-bg); }
.chart { width: 100%; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.chart .series { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.chart .last { fill: var(--accent); }
.chart .grid-line { stroke: var(--line); stroke-dasharray: 4 4; }
.chart .axis { fill: var(--muted); font-size: 12px; }
.stats { border-collapse: collapse; margin-top: 12px; width: 100%; max-width: 520px; }
.stats th, .stats td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.stats th { color: var(--muted); font-weight: 400; width: 45%; }
.sticky-buy { display: none; }

/* ---- フッター */
.site-footer { margin-top: 48px; padding-top: 18px; padding-bottom: 32px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.site-footer .genres { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; }
.credit a { color: var(--muted); }

/* ---- スマホ */
@media (max-width: 640px) {
  h1 { font-size: 21px; }
  h2 { font-size: 17px; }
  .tagline { display: none; }
  .hero { padding: 2px 14px 14px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat strong { font-size: 19px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .price { font-size: 17px; }
  .item-head { grid-template-columns: 1fr; gap: 12px; }
  .item-head img { max-width: 280px; margin: 0 auto; display: block; }
  .item-head h1 { font-size: 18px; }
  .big-price { font-size: 28px; }
  .sticky-buy { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(0, 0, 0, .08); }
  .sticky-buy span { font-size: 20px; font-weight: 800; }
  .sticky-buy a { background: var(--cta); color: var(--cta-ink); text-decoration: none; font-weight: 800; padding: 10px 18px; border-radius: 999px; }
  .item ~ .site-footer, body:has(.sticky-buy) .site-footer { padding-bottom: 90px; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }

/* ---- ヘッダーの道具(ポイント倍率・テーマ) */
.tools { margin-left: auto; display: flex; gap: 6px; }
.tool { font: inherit; font-size: 13px; font-weight: 700; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer; line-height: 1.5; }
.tool:hover { border-color: var(--accent); }
#pt-cur { color: var(--point); }
.t-light { display: none; }
:root[data-theme="dark"] .t-dark { display: none; }
:root[data-theme="dark"] .t-light { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .t-dark { display: none; }
  :root:not([data-theme="light"]) .t-light { display: inline; }
}
.pt-panel { max-width: 1120px; margin: 0 auto 10px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 14px; }
.pt-panel[hidden] { display: none; }
.pt-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.pt-row input { width: 90px; font: inherit; font-size: 16px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.pt-row button { font: inherit; font-weight: 700; padding: 6px 14px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.pt-row button.sub { background: var(--surface-2); color: var(--text); }
.pt-note { font-size: 12px; color: var(--muted); margin-left: 4px; }

/* ---- お買い物チェック */
.check { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px 18px 14px; margin-top: 24px; box-shadow: var(--shadow); }
.check h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.c-sum { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 2px 10px; }
.c-sum.ok { color: var(--accent); background: var(--low-bg); }
.c-sum.warn { color: var(--drop); background: var(--drop-bg); }
.check-list { list-style: none; padding: 0; margin: 8px 0 0; }
.check-list li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.check-list strong { font-size: 15px; }
.check-list p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.c-icon { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; margin-top: 2px; }
.c-ok .c-icon { color: var(--accent); background: var(--low-bg); }
.c-warn .c-icon { color: var(--drop); background: var(--drop-bg); }
.c-info .c-icon { color: var(--muted); background: var(--up-bg); font-style: italic; font-family: Georgia, serif; }
.c-warn strong { color: var(--drop); }
.badge.warn { color: var(--drop); background: var(--drop-bg); border: 1px solid currentColor; }
@media (max-width: 640px) { .tool { padding: 4px 10px; } .check { padding: 2px 14px 10px; } }

/* ---- アクセシビリティ */
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 0 0 8px 0; font-weight: 700; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.card:focus-within { border-color: var(--accent); }

/* ---- 一覧の並べ替え・絞り込み */
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 6px 0 14px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }
.list-tools[hidden] { display: none; }
.list-tools select { font: inherit; font-size: 14px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); margin-left: 4px; }
.list-count { margin-left: auto; color: var(--muted); font-weight: 700; }
.more-wrap { text-align: center; margin: 18px 0; }
.more-btn { font: inherit; font-weight: 800; padding: 10px 28px; border-radius: 999px; border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent); cursor: pointer; }
.more-btn:hover { background: var(--accent); color: var(--accent-ink); }

/* ---- 記録・概況 */
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 16px 6px; }
.summary h2 { margin-top: 14px; }
.records { margin-top: 20px; }
.records summary { cursor: pointer; font-weight: 700; color: var(--accent); padding: 6px 0; }
.table-wrap { overflow-x: auto; }
.stats.wide { max-width: none; }
.stats.wide th { width: auto; font-weight: 700; }
.stats.wide td, .stats.wide th { white-space: nowrap; }
.stats.wide td:last-child { white-space: normal; min-width: 180px; }
