:root {
  --bg: #12140f;
  --bg-2: #1b1f16;
  --card: #23291c;
  --line: #343b2c;
  --text: #f3efe4;
  --muted: #9a937f;
  --gold: #e4b84a;
  --mint: #8fce6a;
  --warn: #e0b15a;
  --bad: #e07a5f;
  --thumb: 92px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; }
a { color: var(--gold); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

#app {
  min-height: 100dvh;
  padding: calc(18px + var(--safe-t)) 16px calc(118px + var(--safe-b));
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
}
.brand { font-size: 28px; font-weight: 750; letter-spacing: -0.04em; }
.brand span { color: var(--gold); }
.subtle { color: var(--muted); font-size: 13px; }

.saved {
  background: linear-gradient(180deg, #2a3220, var(--card));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px 18px 16px;
  margin-bottom: 18px;
}
.saved .label { color: var(--muted); font-size: 13px; }
.saved .num { font-size: 44px; font-weight: 760; letter-spacing: -0.05em; line-height: 1.05; }
.saved .num.plus { color: var(--mint); }
.saved .num.minus { color: var(--bad); }
.saved .meta { margin-top: 8px; color: var(--muted); font-size: 13px; }
.pile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 4px;
}
.pile-grid .k { color: var(--muted); font-size: 12px; }
.pile-grid .v { font-size: 20px; font-weight: 760; letter-spacing: -0.04em; }

.walk-card {
  background: linear-gradient(180deg, #2a3220, var(--card));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px 16px 14px;
  text-align: center;
  margin: 8px 0 12px;
}
.walk-card .label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; }
.walk-card .walk {
  font-size: 48px;
  font-weight: 780;
  letter-spacing: -0.05em;
  line-height: 1.05;
  margin: 6px 0 8px;
}
.verdict-line { margin: 8px 0 10px; font-size: 15px; line-height: 1.35; }
.memory {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: #24301c;
  border: 1px solid #3a4a2c;
  color: #d7e4c4;
  font-size: 14px;
  line-height: 1.4;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.thumb {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  background: #111;
  flex: none;
}
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list { display: grid; gap: 10px; }
.section-title {
  margin: 22px 0 10px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dock {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-b));
  display: grid;
  grid-template-columns: 1fr var(--thumb) 1fr;
  gap: 8px;
  align-items: end;
  z-index: 20;
}
.dock-btn {
  height: 56px;
  border-radius: 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.dock-btn.on { color: var(--text); border-color: #4a5338; }
.scan-btn {
  width: var(--thumb);
  height: var(--thumb);
  border-radius: 50%;
  background: var(--gold);
  color: #1a1608;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 10px 30px rgba(228, 184, 74, 0.28);
}

.hero-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 24px;
  background: #0c0d0a;
  margin-bottom: 16px;
}

.caveat {
  color: var(--warn);
  font-size: 13px;
  margin-bottom: 6px;
}
.name {
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.tap-hint { margin-top: 8px; color: var(--muted); font-size: 13px; }

.primary, .ghost, .danger {
  width: 100%;
  min-height: 56px;
  border-radius: 18px;
  font-weight: 700;
}
.primary { background: var(--gold); color: #1a1608; }
.ghost { background: var(--bg-2); border: 1px solid var(--line); }
.danger { background: #3a221c; color: #ffd4c8; }
.stack { display: grid; gap: 10px; margin-top: 16px; }

.price-box {
  margin: 18px 0 12px;
  padding: 10px 8px 4px;
  text-align: center;
}
.price-box .label { color: var(--muted); font-size: 13px; }
.price-box .value {
  font-size: 56px;
  font-weight: 780;
  letter-spacing: -0.05em;
  min-height: 68px;
}

.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pad button {
  height: 64px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 24px;
  font-weight: 700;
}

.score-ring {
  width: 168px;
  height: 168px;
  margin: 8px auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--score, var(--gold)) calc(var(--pct) * 1%), #2a2e24 0);
}
.score-inner {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: var(--bg);
  display: grid;
  place-items: center;
  text-align: center;
}
.score-inner strong { font-size: 44px; letter-spacing: -0.06em; }
.score-inner span { color: var(--muted); font-size: 12px; display: block; }
.score-ring.small {
  width: 88px;
  height: 88px;
  margin: 4px auto 8px;
  opacity: 0.85;
}
.score-ring.small .score-inner {
  width: 68px;
  height: 68px;
}
.score-ring.small .score-inner strong { font-size: 22px; }
.score-ring.small .score-inner span { font-size: 10px; }

.band { text-align: center; font-weight: 800; letter-spacing: 0.08em; margin-bottom: 8px; }
.band.steal, .verdict.steal { color: var(--mint); }
.band.good, .verdict.good { color: #b7d86a; }
.band.fair, .verdict.fair { color: var(--warn); }
.band.high, .verdict.high { color: #e08a4f; }
.band.skip, .verdict.skip { color: var(--bad); }

.verdict {
  text-align: center;
  font-size: 40px;
  font-weight: 830;
  letter-spacing: 0.08em;
  border-radius: 22px;
  padding: 16px 12px;
  margin: 14px 0 10px;
  border: 1px solid var(--line);
}
.verdict.steal { background: #1a2816; }
.verdict.good { background: #222918; }
.verdict.fair { background: #2a2618; }
.verdict.high { background: #2e2016; }
.verdict.skip { background: #3a221c; }

.meta-line { color: var(--muted); margin-top: 6px; font-size: 15px; }
.replica {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: #3a221c;
  color: #ffd4c8;
  font-size: 14px;
}
.range-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  text-align: center;
  margin: 8px 0 12px;
}
.range-card .range {
  font-size: 34px;
  font-weight: 780;
  letter-spacing: -0.04em;
  margin: 4px 0 8px;
}
.venue { margin-bottom: 12px; }
.venue strong { display: block; margin: 4px 0 6px; }
.legal { color: var(--muted); font-size: 12px; line-height: 1.4; margin: 10px 0 0; }

.toggle {
  display: flex;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin: 12px 0 16px;
}
.toggle button {
  flex: 1;
  height: 40px;
  border-radius: 999px;
  color: var(--muted);
}
.toggle button.on { background: var(--card); color: var(--text); }

.listing {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
}
.listing img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  background: #111;
}
.listing .price { font-weight: 750; }

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  z-index: 30;
}
.sheet-card {
  width: 100%;
  background: #1a1e15;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 16px 16px calc(20px + var(--safe-b));
  max-height: 86dvh;
  overflow: auto;
}
.choice {
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  margin-bottom: 8px;
}
.choice small { color: var(--muted); }

.busy {
  display: grid;
  place-items: center;
  min-height: 48vh;
  text-align: center;
  gap: 12px;
}
.spin {
  width: 42px;
  height: 42px;
  border: 3px solid #3a4030;
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.field {
  width: 100%;
  min-height: 56px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 0 14px;
}

.empty { color: var(--muted); padding: 24px 8px; text-align: center; }
.offline-pill {
  display: inline-block;
  background: #3a3220;
  color: var(--warn);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}
