/* Amarisa — 買い時を一目で。落ち着いた緑を土台に、判定の色（買い時=緑 / 待ち=赤）だけを強く見せる */
:root {
  --bg: #f2f6f5;
  --surface: #ffffff;
  --surface-2: #e9f0ee;
  --text: #0f1f1d;
  --muted: #566866;
  --line: #dde7e4;
  --brand: #0c7a6e;
  --brand-ink: #ffffff;
  --brand-soft: #d8f0eb;
  --hero-1: #073d37;
  --hero-2: #0c7a6e;
  --hero-3: #35b79e;
  --buy: #15803d;
  --buy-bg: #e2f6e8;
  --good: #0c7a6e;
  --good-bg: #daf0ec;
  --hold: #a16207;
  --hold-bg: #fdf0cf;
  --wait: #b42318;
  --wait-bg: #fde5e2;
  --unknown: #566866;
  --unknown-bg: #eaeeed;
  --amazon: #c2410c;
  --rakuten: #bf0000;
  --yahoo: #6d28d9;
  --zone: rgba(21, 128, 61, 0.12);
  --shadow: 0 1px 2px rgba(15, 31, 29, 0.05), 0 8px 24px rgba(15, 31, 29, 0.06);
  --shadow-lg: 0 2px 4px rgba(15, 31, 29, 0.06), 0 18px 48px rgba(7, 61, 55, 0.18);
  --radius: 18px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09110f;
    --surface: #101c1a;
    --surface-2: #172a27;
    --text: #e7f1ef;
    --muted: #94a9a5;
    --line: #223b37;
    --brand: #2dd4bf;
    --brand-ink: #04211d;
    --brand-soft: #0f3732;
    --hero-1: #04211d;
    --hero-2: #0a5b52;
    --hero-3: #1f8f7c;
    --buy: #4ade80;
    --buy-bg: #11301b;
    --good: #2dd4bf;
    --good-bg: #0e332e;
    --hold: #fbbf24;
    --hold-bg: #38290a;
    --wait: #fb8c7e;
    --wait-bg: #3d1713;
    --unknown: #94a9a5;
    --unknown-bg: #1a2927;
    --amazon: #fb923c;
    --rakuten: #f87171;
    --yahoo: #a78bfa;
    --zone: rgba(74, 222, 128, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.5), 0 18px 48px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  line-height: 1.7;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-feature-settings: "palt";
}
main { flex: 1; outline: none; }
a { color: var(--brand); text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.3; margin: 0; letter-spacing: 0.01em; }
p { margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: var(--brand-ink); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; top: 8px; }
.page { padding-top: 22px; padding-bottom: 56px; }

/* ヘッダー */
.site-header { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-in { display: flex; align-items: center; justify-content: space-between; min-height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); }
.brand-mark { width: 30px; height: 30px; color: var(--brand); flex: none; }
.brand-name { font-weight: 800; font-size: 21px; letter-spacing: 0.005em; }
.brand-kana { color: var(--muted); font-size: 12px; margin-top: 4px; }
.header-nav { display: flex; gap: 4px; }
.header-nav a { color: var(--muted); text-decoration: none; font-size: 14px; padding: 8px 10px; border-radius: 10px; }
.header-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 26px 0 40px; margin-top: 8px; }
.fine { color: var(--muted); font-size: 12.5px; line-height: 1.75; margin-top: 8px; }

/* ボタン・入力 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 0; background: var(--brand); color: var(--brand-ink); font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.ico { width: 20px; height: 20px; flex: none; }

/* ヒーロー */
.hero {
  background: radial-gradient(1200px 400px at 85% -10%, rgba(255,255,255,0.18), transparent 60%), linear-gradient(135deg, var(--hero-1), var(--hero-2) 60%, var(--hero-3));
  color: #fff;
  padding: 36px 0 64px;
}
.hero-in { display: grid; gap: 34px; align-items: center; }
@media (min-width: 900px) { .hero-in { grid-template-columns: 1.05fr 0.95fr; } .hero { padding: 64px 0 90px; } }
.hero .eyebrow { display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; background: rgba(255,255,255,0.16); padding: 4px 12px; border-radius: 999px; }
.hero h1 { font-size: clamp(30px, 8vw, 44px); margin-top: 14px; line-height: 1.25; }
.nb { display: inline-block; }
.hero h1 em { font-style: normal; color: #a8f0dd; }
.hero .lead { margin-top: 14px; font-size: 16px; opacity: 0.92; max-width: 34em; }
.search { display: flex; gap: 8px; margin-top: 24px; background: #fff; border-radius: 18px; padding: 6px; box-shadow: var(--shadow-lg); }
.search .field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.search .field .ico { position: absolute; left: 12px; color: #6b7d7a; pointer-events: none; }
.search input[type="search"] {
  width: 100%; height: 52px; padding: 0 14px 0 42px; border: 0; background: transparent; color: #0f1f1d; font-size: 16px; border-radius: 12px; -webkit-appearance: none; appearance: none;
}
.search input[type="search"]::placeholder { color: #7a8b88; }
.search input[type="search"]:focus { outline: none; }
.search:focus-within { box-shadow: 0 0 0 3px rgba(255,255,255,0.55), var(--shadow-lg); }
.search .btn { height: 52px; padding: 0 22px; border-radius: 13px; background: #0c7a6e; color: #fff; }
.scan-btn { border: 0; background: var(--surface-2); color: #0c7a6e; width: 52px; height: 52px; border-radius: 13px; cursor: pointer; display: grid; place-items: center; flex: none; }
.scan-btn:hover { filter: brightness(0.97); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips .k { font-size: 12.5px; opacity: 0.85; align-self: center; margin-right: 2px; }
.chip { border: 1px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.12); color: #fff; border-radius: 999px; padding: 4px 13px; font-size: 13px; cursor: pointer; }
.chip:hover { background: rgba(255,255,255,0.24); }
.hero-sample { position: relative; }
.sample-tag { position: absolute; top: -12px; left: 18px; background: #fff; color: #0c7a6e; font-size: 12px; font-weight: 800; padding: 3px 12px; border-radius: 999px; box-shadow: var(--shadow); z-index: 2; }
.hero-sample .sample { pointer-events: none; user-select: none; }
.sample-card { background: var(--surface); color: var(--text); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 16px; display: grid; gap: 12px; }
.pull-up { margin-top: -38px; position: relative; z-index: 1; }

.section { margin-top: 30px; }
.section > h2 { font-size: 19px; margin-bottom: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.steps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps .card h3 { font-size: 16px; margin-bottom: 4px; }
.steps .card p { color: var(--muted); font-size: 14px; }
.step-no { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 14px; margin-bottom: 10px; }

/* 一覧 */
.list { display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.item { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.item:hover { border-color: var(--brand); }
.thumb { width: 76px; height: 76px; flex: none; border-radius: 12px; background: #fff; object-fit: contain; border: 1px solid var(--line); }
.thumb.empty { background: var(--surface-2); }
.item-body { min-width: 0; flex: 1; }
.item-title { font-size: 14.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.item-price { font-weight: 800; font-size: 18px; margin-top: 2px; }
.go { color: var(--muted); font-size: 22px; padding: 0 4px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); margin-left: 6px; vertical-align: middle; }
.searchbar { padding-top: 6px; }
.searchbar .search { background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow); margin-top: 0; }
.searchbar .search input[type="search"] { color: var(--text); }
.searchbar .search .ico { color: var(--muted); }
.searchbar .scan-btn { background: var(--surface-2); }

/* 商品ページ */
.crumbs { font-size: 13.5px; margin-bottom: 12px; }
.crumbs a { text-decoration: none; }
.product-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.product-head .thumb { width: 88px; height: 88px; }
.product-head h1 { font-size: 17px; line-height: 1.5; font-weight: 700; }
.product-head .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
@media (min-width: 900px) { .product-head h1 { font-size: 20px; } .product-head .thumb { width: 104px; height: 104px; } }
.pcols { display: grid; gap: 16px; }
.col { display: contents; }
.col > * { min-width: 0; }
.o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; } .o6 { order: 6; } .o7 { order: 7; }
@media (min-width: 900px) {
  .pcols { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: start; gap: 20px; }
  .col { display: flex; flex-direction: column; gap: 16px; }
  .col.side { position: sticky; top: 76px; }
}

.verdict { border-radius: 22px; padding: 18px; border: 1px solid transparent; }
.verdict.buy { --vc: var(--buy); background: var(--buy-bg); color: var(--buy); border-color: color-mix(in srgb, var(--buy) 28%, transparent); }
.verdict.good { --vc: var(--good); background: var(--good-bg); color: var(--good); border-color: color-mix(in srgb, var(--good) 28%, transparent); }
.verdict.hold { --vc: var(--hold); background: var(--hold-bg); color: var(--hold); border-color: color-mix(in srgb, var(--hold) 28%, transparent); }
.verdict.wait { --vc: var(--wait); background: var(--wait-bg); color: var(--wait); border-color: color-mix(in srgb, var(--wait) 28%, transparent); }
.verdict.unknown { --vc: var(--unknown); background: var(--unknown-bg); color: var(--unknown); }
.verdict-top { display: flex; gap: 16px; align-items: center; }
.dial { position: relative; width: 88px; height: 88px; flex: none; }
@media (min-width: 560px) { .dial { width: 104px; height: 104px; } }
.dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial .track { stroke: color-mix(in srgb, currentColor 18%, transparent); }
.dial .bar { stroke: currentColor; stroke-linecap: round; }
.dial-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.dial-num b { font-size: clamp(27px, 7vw, 32px); font-weight: 800; letter-spacing: -0.02em; }
.dial-num span { font-size: 11px; opacity: 0.8; margin-top: 4px; }
.verdict-label { font-size: 12.5px; font-weight: 800; letter-spacing: 0.06em; opacity: 0.95; }
.verdict h2 { font-size: clamp(20px, 5.6vw, 25px); margin-top: 3px; text-wrap: balance; }
.verdict .summary { color: var(--text); margin-top: 8px; font-size: 14.5px; }
.verdict-body { min-width: 0; }
.reasons { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.reasons li { background: color-mix(in srgb, var(--surface) 72%, transparent); color: var(--text); border-radius: 12px; padding: 9px 12px 9px 34px; font-size: 14px; position: relative; line-height: 1.6; }
.reasons li::before { content: ""; position: absolute; left: 13px; top: 1.05em; width: 9px; height: 9px; border-radius: 50%; background: var(--vc); }
.reasons .lbl { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: 0.06em; margin: 0 0 -2px; }
.more { margin-top: 10px; border: 0; background: transparent; color: var(--text); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px 2px; opacity: 0.85; }
.verdict-note { font-size: 12px; color: var(--muted); margin-top: 12px; }

.target { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.target-text { font-size: 14.5px; }
.target-text strong { font-size: 24px; letter-spacing: -0.01em; }
.target-actions { display: flex; gap: 8px; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.stat.now { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.stat.now .v { color: var(--brand); }

.chart-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.chart-top h2 { font-size: 16px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 6px 12px; min-height: 36px; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.chart { width: 100%; height: auto; max-height: 340px; display: block; touch-action: pan-y; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--brand); opacity: 0.1; }
.chart .ref { stroke: var(--muted); stroke-dasharray: 4 4; stroke-width: 1; }
.chart .low { stroke: var(--buy); stroke-dasharray: 2 4; stroke-width: 1.2; }
.chart .zone { fill: var(--zone); }
.chart .zone-label { fill: var(--buy); font-weight: 700; }
.chart .now { fill: var(--brand); stroke: var(--surface); stroke-width: 2.5; }
.chart-tip { min-height: 22px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.chart-tip strong { color: var(--text); }

/* 価格比較 */
.compare h2 { font-size: 17px; margin-bottom: 10px; }
.compare-sum { background: linear-gradient(135deg, var(--buy-bg), var(--brand-soft)); border-radius: 14px; padding: 12px 14px; font-size: 14.5px; margin-bottom: 12px; color: var(--text); }
.compare-sum .big { display: block; color: var(--buy); font-weight: 800; font-size: 22px; letter-spacing: -0.01em; }
.rows { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; color: inherit; }
a.row:hover { border-color: var(--brand); }
.row.best { border-color: var(--buy); box-shadow: 0 0 0 1px var(--buy) inset; background: color-mix(in srgb, var(--buy-bg) 55%, var(--surface)); }
.mall-tag { font-size: 11.5px; font-weight: 800; color: #fff; padding: 3px 8px; border-radius: 7px; white-space: nowrap; }
.mall-tag.amazon { background: var(--amazon); }
.mall-tag.rakuten { background: var(--rakuten); }
.mall-tag.yahoo { background: var(--yahoo); }
.row-main { min-width: 0; }
.row-shop { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-price { text-align: right; }
.row-price .p { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.row-price .e { font-size: 11.5px; color: var(--muted); }
.row-go { font-size: 12px; color: var(--brand); }
.mall-note { color: var(--muted); font-size: 13px; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; margin-top: 8px; }

.sales { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.sale { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 14px; }
.sale small { color: var(--muted); display: block; }
.sale .when { font-weight: 800; white-space: nowrap; color: var(--brand); }
.card > h2 { font-size: 16px; margin-bottom: 10px; }

.watch-item { display: flex; gap: 10px; align-items: center; }
.watch-item .item { flex: 1; min-width: 0; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; width: 42px; height: 42px; cursor: pointer; color: var(--muted); flex: none; }
.icon-btn:hover { color: var(--wait); border-color: var(--wait); }
.hit { color: var(--buy); font-weight: 800; font-size: 13px; }

/* 状態（読み込み・エラー） */
.state { text-align: center; padding: 34px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.state .ico-lg { width: 44px; height: 44px; color: var(--muted); margin: 0 auto 10px; display: block; }
.state h2 { font-size: 18px; margin-bottom: 6px; }
.state p { color: var(--muted); font-size: 14.5px; max-width: 30em; margin: 0 auto; }
.state .btn { margin-top: 16px; }
.state.err .ico-lg { color: var(--wait); }
.notice { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; color: var(--muted); font-size: 14.5px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sk 1.3s linear infinite; border-radius: 16px; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } html { scroll-behavior: auto; } }

/* バーコード読み取り */
.scan { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.88); display: grid; place-items: center; padding: 16px; }
.scan-box { width: min(520px, 100%); background: var(--surface); border-radius: 20px; overflow: hidden; }
.scan-box video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #000; display: block; }
.scan-guide { position: relative; }
.scan-guide::after { content: ""; position: absolute; left: 12%; right: 12%; top: 38%; bottom: 38%; border: 2px solid rgba(255,255,255,0.9); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,0.35); }
.scan-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; font-size: 14px; }

.prose { max-width: 720px; margin: 0 auto; }
.prose h1 { font-size: 26px; margin-bottom: 12px; }
.prose h2 { font-size: 18px; margin: 26px 0 8px; }
.prose p, .prose li { font-size: 15px; }
.prose p + p { margin-top: 10px; }
.prose ul { padding-left: 1.2em; margin: 8px 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; margin-top: 8px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
