/* 明るいテーマを基準に定義し、暗いテーマでは色だけ差し替える。
   端末の設定(prefers-color-scheme)と、明示指定(data-theme)の両方に対応する。 */
:root {
  --bg: #fbfbfa; --panel: #ffffff; --line: #e3e2df;
  --ink: #23211d; --muted: #6d6a63; --accent: #1f6f5c;
  --down: #b0392b; --low: #1f6f5c; --near: #8a6d1f; --flat: #6d6a63;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17161a; --panel: #201f24; --line: #34323a;
    --ink: #eceaf0; --muted: #a09daa; --accent: #64c2a6;
    --down: #f08a7c; --low: #64c2a6; --near: #d9b45c; --flat: #a09daa;
  }
}
:root[data-theme="dark"] {
  --bg: #17161a; --panel: #201f24; --line: #34323a;
  --ink: #eceaf0; --muted: #a09daa; --accent: #64c2a6;
  --down: #f08a7c; --low: #64c2a6; --near: #d9b45c; --flat: #a09daa;
}

* { box-sizing: border-box; }

/* 読み上げとキーボード操作のための飛ばしリンク。ナビは12項目ある。 */
.skip { position: absolute; left: -9999px; top: 0; z-index: 10;
  padding: 10px 16px; background: var(--accent); color: var(--bg);
  text-decoration: none; border-radius: 0 0 var(--radius) 0; }
.skip:focus { left: 0; }

/* キーボードで今どこにいるか分かるようにする。 */
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.7 -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }

.site-head { border-bottom: 1px solid var(--line); background: var(--panel); }
.site-head .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: baseline;
  padding: 14px 16px; min-width: 0; }
.site-name { font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; }
/* 12項目ある。狭い画面では折り返さず横に流す（縦1文字ずつに潰れていた）。 */
.site-nav { display: flex; gap: 16px; font-size: 14px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { white-space: nowrap; }

main { padding: 24px 16px 48px; }
h1 { font-size: 24px; line-height: 1.4; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 28px 0 8px; }
.lead { color: var(--muted); margin: 0 0 16px; }

/* サイトの規模と記録の厚み。値下がりが少ない日でも、何を持っているサイトなのか
   最初に伝わるようにする。数字だけ地の文より濃くして拾いやすくする。 */
.stats { margin: 0 0 16px; font-size: 14px; color: var(--muted); }
.stats strong { color: var(--ink); font-size: 16px; }
.sep { margin: 0 8px; opacity: .5; }

h1 .count { margin-left: 10px; font-size: 16px; font-weight: 500; color: var(--muted); }

/* 広告表記。ステマ規制で明示が必須なので文言も位置も変えない。
   枠を外して主張だけ弱める（読めることが要件で、目立つことは要件ではない）。 */
.ad-notice {
  margin: 0 0 20px; padding: 0; font-size: 13px; color: var(--muted);
}

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.card {
  display: flex; gap: 14px; padding: 12px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.card .thumb { flex: 0 0 96px; }
.card img, .card .noimg {
  display: block; width: 96px; height: 96px; object-fit: contain;
  background: var(--bg); border-radius: 6px;
}
.card .body { min-width: 0; }
.card .name { display: block; font-weight: 600; text-decoration: none; color: var(--ink); }
.card .name:hover { color: var(--accent); }
.card .price { margin: 6px 0 2px; font-size: 15px;
  font-variant-numeric: tabular-nums; }
.card .price strong { font-size: 19px; }
.card .meta { margin: 0; font-size: 13px; color: var(--muted); }
.was { color: var(--muted); text-decoration: line-through; margin-right: 4px; }
.down { color: var(--down); font-weight: 700; margin-right: 8px; }
.up { color: var(--near); font-weight: 700; margin-right: 8px; }

/* ポイント込みの実質価格。価格を置き換えず、併記する。 */
.point-line { margin: 4px 0 0; font-size: 13px; }
.point-line:empty { display: none; }
.point { display: inline-block; padding: 1px 8px; margin-right: 8px; border-radius: 999px;
  font-size: 12px; color: var(--near); border: 1px solid currentColor; }
.eff { color: var(--ink); font-weight: 600; }
.eff small { font-weight: 400; color: var(--muted); font-size: 11px; }
.empty { padding: 24px; text-align: center; color: var(--muted); list-style: none;
  border: 1px dashed var(--line); border-radius: var(--radius); }
.empty .go { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  margin-top: 12px; }
.thin { margin: 0 0 14px; padding: 10px 12px; font-size: 13px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

.badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; border: 1px solid currentColor; white-space: nowrap; }
.badge.low { color: var(--low); } .badge.near { color: var(--near); }
.badge.drop { color: var(--down); } .badge.flat { color: var(--flat); }

/* 送料と在庫。買うかどうかに直結するので、判定と並べて出す。 */
.cond { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; white-space: nowrap; }
.cond.free { color: var(--low); border: 1px solid currentColor; }
.cond.out { color: var(--down); border: 1px solid currentColor; }

.tools .check { display: flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--ink); white-space: nowrap; }
.tools .check input { width: 18px; height: 18px; }

/* 目標の値段。通知は出せないので、次に来たときに拾えるようにする。 */
.target { margin: 6px 0 14px; font-size: 14px; }
.target label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.target input { width: 130px; padding: 7px 10px; font-size: 15px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.target .note { display: block; margin-top: 4px; }
.hit.reached { background: color-mix(in srgb, var(--low) 8%, transparent); }
.down small { font-weight: 400; font-size: 12px; }

/* いまの価格が履歴のどこにあるかを一文で。高いときは高いと書く。 */
.verdict { margin: 0 0 14px; font-size: 15px; color: var(--ink); }

.item .headline { font-size: 15px; margin: 12px 0; }
.item .headline strong { font-size: 28px; }
.chart { color: var(--accent); margin: 8px 0 20px; }
.spark { width: 100%; max-width: 320px; height: auto; }
.spark-none { color: var(--muted); font-size: 13px; }

/* 一覧の並び替え・絞り込み */
.tools { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center;
  margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.tools select { font-size: 14px; padding: 5px 8px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }

/* ページ送り */
.pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 14px 0; font-size: 14px; }
.pager a { padding: 4px 9px; border: 1px solid var(--line); border-radius: 8px;
  text-decoration: none; }
.pager .now { padding: 4px 9px; border: 1px solid var(--accent); border-radius: 8px;
  color: var(--accent); font-weight: 700; }
.pager .gap { color: var(--muted); }
.pager .of { margin-left: auto; color: var(--muted); font-size: 13px; }

/* 見守り */
.watch { margin: 16px 0 8px; }
.watch button { padding: 9px 20px; font-size: 15px; font-weight: 700; cursor: pointer;
  color: var(--accent); background: var(--panel);
  border: 1px solid var(--accent); border-radius: var(--radius); }
.watch button.on { color: var(--bg); background: var(--accent); }
.watch .note { margin-left: 10px; font-size: 13px; color: var(--muted); }

/* 一覧から直接見守る。商品ページまで開かせない */
.watch-mini { margin-left: 10px; padding: 2px 9px; font-size: 12px; cursor: pointer;
  color: var(--muted); background: none;
  border: 1px solid var(--line); border-radius: 999px; }
.watch-mini.on { color: var(--accent); border-color: var(--accent); font-weight: 700; }

.tools .scope { color: var(--muted); font-size: 12px; }
.reset { padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--accent);
  background: var(--panel); border: 1px solid var(--accent); border-radius: 8px; }

/* 押せる場所を広げる。携帯では文字だけだと当てにくい。 */
.card .name { padding: 2px 0; }
.watch-mini, .reset, .pager a { min-height: 32px; display: inline-flex;
  align-items: center; }
.to-top { display: inline-block; margin: 8px 0 0; font-size: 13px; }
.hit .since { color: var(--muted); font-size: 12px; margin-left: 8px; }
.hit .badge { margin-left: 8px; }

/* 商品ページの価格推移 */
.chart-svg { width: 100%; max-width: 560px; height: auto; color: var(--accent); }

/* 商品ページの画像。一覧にあるのに詳細で消えるのは不親切。 */
.back { margin: 0 0 14px; font-size: 13px; }
.hero { margin: 4px 0 16px; }
.hero img { width: 100%; max-width: 260px; height: auto; border-radius: var(--radius);
  background: var(--panel); }

/* 全文は補足なので、見出しと同じ強さで出さない。 */
.fullname { max-width: 62em; }
.note { font-size: 13px; color: var(--muted); }
.history th { font-variant-numeric: tabular-nums; }

/* 一覧に出す小さな推移。履歴がこのサイトの値打ちなので、開く前に形を見せる。 */
.card-spark { margin-top: 6px; color: var(--accent); opacity: .8; }
.card-spark .spark { max-width: 140px; }

/* 商品を探す */
.q { width: 100%; padding: 11px 14px; font-size: 16px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.q:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.note { margin: 10px 0; font-size: 13px; color: var(--muted); }
.hits { list-style: none; margin: 0; padding: 0; }
.hit { display: flex; gap: 12px; justify-content: space-between; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--line); }
.hit a { color: var(--ink); text-decoration: none; }
.hit a:hover { color: var(--accent); }
.hit .price { white-space: nowrap; font-weight: 600;
  font-variant-numeric: tabular-nums; }

.facts { border-collapse: collapse; width: 100%; margin: 0 0 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.facts th, .facts td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line);
  font-size: 15px; }
.facts tr:last-child th, .facts tr:last-child td { border-bottom: 0; }
.facts th { color: var(--muted); font-weight: 500; white-space: nowrap; }

.buy { display: inline-block; padding: 11px 22px; border-radius: var(--radius);
  background: var(--accent); color: var(--bg); font-weight: 700; text-decoration: none; }
.shop { color: var(--muted); font-size: 14px; }

.static p, .static li { max-width: 62em; }

.site-foot { border-top: 1px solid var(--line); background: var(--panel);
  margin-top: 40px; padding: 20px 0 32px; font-size: 13px; color: var(--muted); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; }
.site-foot .disclaimer, .site-foot .copy, .updated { margin: 8px 0 0; }
.site-foot .ad-notice { background: none; border: 0; padding: 0; margin: 8px 0 0; }

.fullname { margin: -4px 0 14px; font-size: 13px; color: var(--muted); line-height: 1.6; }

@media (max-width: 560px) {
  .card { gap: 10px; }
  .card .thumb { flex-basis: 72px; }
  .card img, .card .noimg { width: 72px; height: 72px; }
  h1 { font-size: 21px; }
  .sep { margin: 0 5px; }
  .stats { font-size: 13px; }
  /* 並び替えは縦に積む。横並びだと選択肢が潰れる。 */
  .tools { flex-direction: column; align-items: stretch; gap: 8px; }
  .tools label { display: flex; justify-content: space-between; align-items: center;
    gap: 10px; }
  .tools select { flex: 1; min-width: 0; }
  .site-head .wrap { padding: 12px 16px; }
  .site-name { font-size: 16px; }
  .hit { flex-wrap: wrap; }
  .pager .of { width: 100%; margin-left: 0; }
}
