:root {
  --bg: #faf8f4; --surface: #ffffff; --text: #23201c; --muted: #6f6a62; --line: #e7e2d9;
  --accent: #c2410c; --accent-soft: #fdeee4; --green: #15803d; --green-soft: #e7f5ec;
  --blue: #1d4ed8; --blue-soft: #e8eefc; --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #181614; --surface: #221f1c; --text: #eeeae4; --muted: #a8a197; --line: #36312b;
    --accent: #fb923c; --accent-soft: #3a2518; --green: #4ade80; --green-soft: #17301f;
    --blue: #93b4ff; --blue-soft: #1c2640;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.75;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif; }
a { color: var(--accent); }
img { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.pr { font-size: 12px; color: var(--muted); text-align: center; padding: 4px 16px; border-bottom: 1px solid var(--line); }
header.top { background: var(--surface); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 12px; padding-bottom: 12px; }
.logo { font-weight: 800; font-size: 19px; color: var(--text); text-decoration: none; }
.logo::before { content: "◎ "; color: var(--accent); }
header nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
header nav a { color: var(--text); text-decoration: none; }
header nav a:hover { color: var(--accent); }
main { padding-top: 20px; padding-bottom: 40px; }
h1 { font-size: clamp(22px, 4vw, 30px); line-height: 1.4; margin: 8px 0 12px; }
h2 { font-size: 20px; margin: 36px 0 12px; }
h2 a { color: var(--text); }
.lead { max-width: 760px; }
.muted { color: var(--muted); font-size: 13px; }
.note { background: var(--blue-soft); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; }
.crumb { font-size: 13px; color: var(--muted); }
.crumb a { color: var(--muted); }

.hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 4px; }
.hero h1 { margin-top: 0; }
.cta, .buy { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700;
  padding: 12px 22px; border-radius: 999px; }
.cta:hover, .buy:hover { filter: brightness(1.08); }

.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card > a { display: flex; gap: 12px; padding: 12px; color: inherit; text-decoration: none; height: 100%; }
.card:hover { border-color: var(--accent); }
.card img, .noimg { width: 96px; height: 96px; flex: none; object-fit: cover; border-radius: 8px; background: var(--line); }
.c-body { min-width: 0; }
.c-body p { margin: 0; }
.c-name { font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.c-city { font-size: 12px; color: var(--muted); }
.c-price { font-weight: 800; }
.c-rev { font-size: 12px; color: var(--muted); }
.rk { position: absolute; top: 6px; left: 6px; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 700;
  min-width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; z-index: 1; padding: 0 6px; }
.bs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.b { font-size: 11px; border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.b.hot { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.b.amt { background: var(--green-soft); color: var(--green); }
.b.down { background: var(--blue-soft); color: var(--blue); }
.b.up { background: var(--line); color: var(--muted); }

.tools { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 4px; font-size: 14px; }
select, input[type=number] { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text); }

.catgrid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cat { display: flex; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; color: var(--text); text-decoration: none; }
.cat span { font-size: 12px; color: var(--muted); }
.cat:hover { border-color: var(--accent); }
.yenlinks, .preflinks { display: flex; flex-wrap: wrap; gap: 8px; }
.yenlinks a, .preflinks a { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px;
  text-decoration: none; color: var(--text); font-size: 14px; }
.yenlinks a:hover, .preflinks a:hover { border-color: var(--accent); color: var(--accent); }
.yenlinks a.fit { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }

.item-top { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.item-top img { width: 300px; border-radius: var(--radius); background: var(--line); }
.item-top > div { flex: 1 1 320px; min-width: 0; }
.item h1 { font-size: 20px; }
.facts { border-collapse: collapse; margin: 8px 0 16px; font-size: 14px; }
.facts th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 16px 4px 0; white-space: nowrap; vertical-align: top; }
.facts td { padding: 4px 0; }
.chart { width: 100%; max-width: 680px; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.chart .ax { font-size: 12px; fill: var(--muted); }

.sim { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; display: grid; gap: 12px; max-width: 640px; }
.sim label { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; font-size: 15px; }
.sim label:has(input[type=checkbox]) { justify-content: flex-start; }
.sim input[type=number] { width: 120px; text-align: right; }
.sim details { font-size: 14px; }
.sim details label { margin-top: 10px; }
.result { max-width: 640px; margin: 16px 0 8px; padding: 18px 20px; border-radius: var(--radius); background: var(--accent-soft); }
.result .big { font-size: 34px; font-weight: 800; color: var(--accent); line-height: 1.3; }
.result p { margin: 4px 0; }
.tablewrap { overflow-x: auto; }
.grid { border-collapse: collapse; font-size: 14px; min-width: 560px; background: var(--surface); }
.grid th, .grid td { border: 1px solid var(--line); padding: 6px 10px; text-align: right; }
.grid th { background: var(--bg); text-align: center; }
.grid td:first-child { text-align: center; font-weight: 700; }

.b.kg { background: var(--accent); color: #fff; font-weight: 700; }
.b.end { background: var(--text); color: var(--bg); font-weight: 700; }
.b.ship { background: var(--blue-soft); color: var(--blue); }
.endtxt { color: var(--accent); }
.tools .chk { display: inline-flex; align-items: center; gap: 4px; }
.deadline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 12px 0 0; padding: 12px 16px;
  border-radius: var(--radius); background: var(--accent-soft); font-size: 14px; }
.deadline b { color: var(--accent); font-size: 15px; }

.combo { max-width: 760px; }
.combo-opts { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 12px; font-size: 13px; }
.chips button { font: inherit; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); cursor: pointer; text-decoration: line-through; }
.chips button.on { border-color: var(--accent); color: var(--accent); text-decoration: none; background: var(--accent-soft); }
.ctotal { font-size: 15px; }
.ctotal b { font-size: 20px; color: var(--accent); }
.clist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; counter-reset: c; }
.clist a { display: grid; grid-template-columns: 64px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; color: inherit; text-decoration: none; }
.clist a:hover { border-color: var(--accent); }
.clist img, .noimg.sm { grid-row: 1 / 3; width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--line); }
.clist .cn { font-size: 12px; color: var(--accent); font-weight: 700; }
.clist .nm { grid-column: 2; font-size: 13px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.clist b { grid-column: 3; grid-row: 1 / 3; white-space: nowrap; }

.b.cheap { background: var(--green); color: #fff; font-weight: 700; }
.kifu-add { font: inherit; margin-left: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--surface); color: var(--accent); font-weight: 700; cursor: pointer; }
.kifu-add:hover { background: var(--accent-soft); }
.grid.same tr.me td { background: var(--accent-soft); font-weight: 700; }
.grid.chg { min-width: 0; width: 100%; }
.grid.chg td { text-align: left; }
.grid.chg td:first-child { white-space: nowrap; font-weight: 500; }
.samegrp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }
.sg-name { margin: 0; font-weight: 700; font-size: 14px; }
.samegrp ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.samegrp li a { display: flex; gap: 8px; align-items: baseline; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px;
  color: inherit; text-decoration: none; font-size: 13px; }
.samegrp li.lo a { border-color: var(--green); background: var(--green-soft); }
.samegrp li em { font-style: normal; color: var(--green); font-weight: 700; font-size: 12px; }

.kanri { max-width: 760px; }
.k-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.k-sum > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; display: grid; }
.k-sum span { font-size: 12px; color: var(--muted); }
.k-sum b { font-size: 22px; }
.k-sum b.over { color: var(--accent); }
.k-sum small { font-size: 12px; color: var(--muted); }
.k-bar { height: 10px; background: var(--line); border-radius: 5px; margin: 10px 0; overflow: hidden; }
.k-bar i { display: block; height: 100%; background: var(--accent); }
.k-one { padding: 10px 14px; border-radius: var(--radius); background: var(--blue-soft); font-size: 14px; }
.k-one.warn { background: var(--accent-soft); color: var(--accent); }
.k-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.k-list li { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; font-size: 14px; }
.k-d { font-size: 12px; color: var(--muted); }
.k-n small { color: var(--muted); }
.k-list button { font: inherit; border: none; background: none; color: var(--muted); cursor: pointer; font-size: 18px; padding: 0 4px; }
.sim input[type=text] { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); width: 220px; }
.sim .cta { border: none; cursor: pointer; justify-self: start; font: inherit; font-weight: 700; }
@media (max-width: 520px) { .kifu-add { margin: 8px 0 0; } .k-list li { grid-template-columns: 1fr auto auto; } .k-d { grid-column: 1 / -1; } }

footer { border-top: 1px solid var(--line); background: var(--surface); padding: 16px 0; font-size: 14px; }
@media (max-width: 520px) {
  .card img, .noimg { width: 80px; height: 80px; }
  .item-top img { width: 100%; }
  .result .big { font-size: 28px; }
}

/* 返礼品スコア */
.sc { position: absolute; top: 6px; right: 6px; z-index: 1; background: var(--surface); border: 2px solid var(--accent); color: var(--accent);
  border-radius: 10px; padding: 0 7px; font-size: 11px; line-height: 1.6; }
.sc b { font-size: 17px; }
.card .c-body { padding-right: 44px; }
.score-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px 12px; max-width: 760px; }
.score-box h2 { display: flex; align-items: baseline; gap: 6px; }
.score-box h2 b { font-size: 40px; color: var(--accent); line-height: 1; }
.score-box h2 span { font-size: 14px; color: var(--muted); }
.bars { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: 4.5em 1fr 2.5em; grid-template-rows: auto auto; column-gap: 10px; align-items: center; font-size: 14px; }
.bars i { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.bars i em { display: block; height: 100%; background: var(--accent); }
.bars i.na { background: none; height: auto; font-style: normal; font-size: 12px; color: var(--muted); grid-column: 2 / 4; }
.bars b { text-align: right; }
.bars small { grid-column: 2 / 4; font-size: 12px; color: var(--muted); }
