:root {
  --ink: #4d382d;
  --muted: #806f65;
  --paper: #faf6f0;
  --card: #fffdfa;
  --line: #765845;
  --soft-line: #d9ccc3;
  --terracotta: #765845;
  --terracotta-dark: #5f4434;
  --apricot: #b58a70;
  --apricot-soft: #ead8ca;
  --butter: #8fa882;
  --butter-soft: #e5ecdf;
  --subtle: #9d8d84;
  --review: #eee5dc;
  --review-ink: #614b3e;
  --overlay: rgba(250, 246, 240, .95);
  font-family: "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ui-icon, .scene svg, .gacha-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  transition: color .28s ease, background-color .28s ease;
}
body[data-theme="night"] {
  --ink: #f8fafc;
  --muted: #aeb9c9;
  --paper: #0f172a;
  --card: #1e293b;
  --line: #64748b;
  --soft-line: #334155;
  --terracotta: #ea6e48;
  --terracotta-dark: #c95737;
  --apricot: #ea6e48;
  --apricot-soft: #26344a;
  --butter: #ffd600;
  --butter-soft: #3a3824;
  --subtle: #8491a3;
  --review: #162033;
  --review-ink: #dbe4ef;
  --overlay: rgba(15, 23, 42, .96);
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }
.ambient { display: none; }

.app-shell { width: min(100%, 560px); margin: 0 auto; padding: 22px 20px 64px; position: relative; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 54px; }
.topbar-tools { display: flex; align-items: center; gap: 7px; }
.debug-toggle { display: none; border: 1px solid var(--soft-line); border-radius: 8px; padding: 7px 8px; color: var(--terracotta); background: var(--card); font-family: "Poppins", sans-serif; font-size: 7px; font-weight: 800; cursor: pointer; }
.brand {
  color: var(--ink);
  text-decoration: none;
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.04em;
}
.brand-copy { display: flex; flex-direction: column; gap: 1px; line-height: 1; }
.brand-copy strong { font-family: "Poppins", sans-serif; font-size: 16px; letter-spacing: -.04em; }
.brand-copy small { color: var(--muted); font-size: 6px; font-weight: 700; letter-spacing: .16em; }
.brand-mark {
  position: relative;
  display: block;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.brand-icon { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .22s ease; }
.brand-icon-cafe { opacity: 0; }
.brand-icon-night { opacity: 1; }
.location-button {
  border: 1px solid var(--soft-line);
  background: var(--card);
  border-radius: 12px;
  padding: 8px 9px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}
.mode-switch { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.scene { border: 0; border-radius: 7px; background: transparent; padding: 5px 8px; color: var(--muted); font-size: 7px; font-weight: 700; cursor: pointer; transition: .18s ease; display: flex; align-items: center; gap: 4px; }
.scene svg { width: 13px; height: 13px; }
.scene.active { color: white; background: var(--terracotta); }
.scene:active { transform: scale(.97); }

.eyebrow, .step-label {
  color: var(--terracotta);
  font-family: "Poppins", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .17em;
}
.eyebrow { display: flex; align-items: center; gap: 9px; }
.eyebrow span { width: 25px; height: 1px; background: var(--line); }
.hero h1 {
  font-size: clamp(39px, 11vw, 54px);
  line-height: 1.18;
  letter-spacing: -.08em;
  margin: 14px 0 14px;
  font-weight: 800;
}
.hero h1 em { color: var(--terracotta); font-style: normal; }
.hero > p { color: var(--muted); font-size: 11px; line-height: 1.9; margin: 0 0 13px; }
.data-status { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 25px; color: var(--muted); font-size: 7px; font-weight: 700; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--butter); }
.data-status.loading .status-dot { background: var(--terracotta); animation: pulse .8s infinite; }
.filter-card, .result-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 23px;
}
.card-heading { display: flex; align-items: start; justify-content: space-between; padding-bottom: 19px; border-bottom: 1px solid var(--soft-line); }
.card-heading h2, .result-intro h2 { margin: 5px 0 0; font-size: 20px; letter-spacing: -.05em; }
.reset-button, .back-button { border: 0; border-bottom: 1px solid var(--soft-line); background: transparent; color: var(--muted); font-size: 9px; font-weight: 700; cursor: pointer; padding: 4px 0; }
.filter-block { margin-top: 24px; }
.filter-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.filter-label span { font-size: 10px; font-weight: 700; }
.filter-label strong { color: var(--terracotta); font-family: "Poppins", sans-serif; font-size: 10px; }
.filter-label small { color: var(--subtle); font-size: 7px; }
input[type="range"] { width: 100%; accent-color: var(--terracotta); cursor: pointer; }
.range-scale { display: flex; justify-content: space-between; color: var(--subtle); font-family: "Poppins", sans-serif; font-size: 7px; margin-top: 4px; }
.choice-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--soft-line);
  border-radius: 12px;
  background: var(--paper);
}
.people-choices { grid-template-columns: repeat(4, 1fr); }
.choice {
  min-width: 0;
  min-height: 39px;
  padding: 6px 2px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  font-family: "Poppins", "Noto Sans JP", sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}
.choice b { font-size: 11px; font-weight: 700; }
.choice span { margin-left: 1px; font-size: 6px; font-weight: 700; }
.choice.active { color: var(--terracotta); border-color: var(--line); background: var(--card); }
.choice:active { transform: scale(.98); }
.mood:active { transform: scale(.98); }
.mood-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mood {
  border: 1px solid var(--soft-line);
  background: var(--paper);
  border-radius: 12px;
  padding: 11px 4px 9px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: .18s ease;
}
.mood b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--card);
  border: 1px solid var(--soft-line);
  font-size: 9px;
}
.mood b .ui-icon { width: 15px; height: 15px; }
.mood span { font-size: 7px; font-weight: 700; }
.mood.active { border-color: var(--line); background: var(--butter-soft); }
.mood.active b { background: var(--butter); border-color: var(--line); }

.match-summary { display: flex; justify-content: space-between; padding: 17px 3px 11px; color: var(--muted); font-size: 7px; font-weight: 700; }
.match-summary b { color: var(--terracotta); font-family: "Poppins", sans-serif; font-size: 15px; }
.gacha-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--terracotta);
  color: white;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: .18s ease;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
}
.gacha-button:hover { background: var(--terracotta-dark); }
.gacha-button:active { transform: scale(.99); }
.gacha-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.gacha-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--ink);
  background: var(--butter);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: "Poppins", sans-serif;
  font-size: 19px;
  font-weight: 800;
}
.gacha-icon svg { width: 21px; height: 21px; }
.gacha-button small { display: block; font-family: "Poppins", sans-serif; font-size: 7px; letter-spacing: .16em; opacity: .72; margin-bottom: 2px; }
.gacha-button .arrow { margin-left: auto; font-family: "Poppins", sans-serif; font-size: 18px; }
.data-note { text-align: center; font-size: 7px !important; margin-top: 12px !important; color: var(--subtle) !important; }
.legal-link { margin: 8px 0 0 !important; text-align: center; font-size: 7px !important; }
.legal-link a { color: var(--muted); }
.location-onboarding {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--overlay);
  transition: opacity .2s ease, visibility .2s ease;
}
.location-onboarding.closed { opacity: 0; visibility: hidden; pointer-events: none; }
.location-onboarding-card {
  width: min(100%, 430px);
  padding: 30px 24px 22px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.location-onboarding-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 17px;
  color: white;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--terracotta);
}
.location-onboarding-icon .ui-icon { width: 23px; height: 23px; }
.location-onboarding-card h2 { margin: 8px 0 12px; font-size: 27px; line-height: 1.4; letter-spacing: -.06em; }
.location-onboarding-card p { margin: 0 auto 22px; color: var(--muted); font-size: 10px; line-height: 1.9; }
.location-consent-button, .location-later-button { width: 100%; cursor: pointer; font-weight: 800; }
.location-consent-button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; color: white; border: 1px solid var(--line); border-radius: 12px; background: var(--terracotta); font-size: 11px; }
.location-later-button { margin-top: 7px; padding: 10px; color: var(--muted); border: 0; background: transparent; font-size: 8px; }

.result-view { animation: reveal .3s ease both; }
.back-button { margin: 0 0 30px; }
.result-intro { margin-bottom: 18px; }
.result-intro h2 { font-size: 34px; }
.result-card { padding: 0; overflow: hidden; border-radius: 14px; }
.result-visual {
  min-height: 205px;
  aspect-ratio: 1.35 / 1;
  padding: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--apricot-soft);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.shop-photo { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-note { display: none; position: absolute; right: 16px; bottom: 12px; z-index: 3; color: rgba(255,255,255,.8); font-size: 6px; letter-spacing: .08em; }
.result-visual.photo-loaded .photo-note { display: block; }
.result-visual.photo-loaded::after { width: 100%; height: 100%; inset: 0; background: rgba(15, 23, 42, .38); opacity: 1; }
.result-visual.photo-loaded::before { z-index: 2; color: white; }
.result-visual.photo-loaded .result-badges { z-index: 3; }
.result-visual.photo-loaded .genre-symbol,
.result-visual.photo-loaded > p { display: none; }
.result-visual::before {
  content: attr(data-context);
  position: absolute;
  left: 17px;
  bottom: 13px;
  font-family: "Poppins", sans-serif;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .18em;
}
.result-visual::after { content: ""; position: absolute; width: 110px; height: 1px; right: 18px; bottom: 17px; background: var(--line); opacity: .4; }
.result-badges { position: absolute; left: 16px; right: 16px; top: 16px; z-index: 1; display: flex; justify-content: space-between; }
.open-badge, .distance-badge { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-family: "Poppins", sans-serif; font-size: 7px; font-weight: 700; }
.open-badge { background: var(--terracotta); color: white; }
.genre-symbol {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 24px;
  font-weight: 800;
}
.result-visual p { margin: 10px 0 0; font-family: "Poppins", "Noto Sans JP", sans-serif; font-size: 8px; letter-spacing: .12em; font-weight: 700; }
.result-content { padding: 23px; }
.result-title-row { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.result-area { color: var(--terracotta); font-family: "Poppins", "Noto Sans JP", sans-serif; font-size: 7px; font-weight: 700; letter-spacing: .08em; margin: 0 0 6px; }
.result-title-row h3 { font-size: 21px; letter-spacing: -.05em; line-height: 1.42; margin: 0; }
.rating { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; background: var(--butter-soft); border: 1px solid var(--line); padding: 7px 8px; border-radius: 9px; }
.rating .ui-icon { width: 12px; height: 12px; fill: currentColor; }
.rating strong { font-family: "Poppins", sans-serif; font-size: 13px; }
.result-reason { color: var(--muted); font-size: 9px; line-height: 1.85; margin: 14px 0 18px; }
.quick-facts { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.fact { padding: 10px 5px 12px; text-align: center; background: var(--card); border-right: 1px solid var(--line); }
.fact .ui-icon { width: 14px; height: 14px; margin-bottom: 3px; color: var(--terracotta); }
.fact:last-child { border-right: 0; }
.fact span { display: block; color: var(--muted); font-family: "Poppins", sans-serif; font-size: 7px; letter-spacing: .09em; margin-bottom: 4px; }
.fact strong { display: block; font-family: "Poppins", "Noto Sans JP", sans-serif; font-size: 9px; }
.review-box {
  position: relative;
  background: var(--review);
  border: 1px solid var(--soft-line);
  padding: 20px 17px 17px;
  border-radius: 12px;
  margin-top: 15px;
}
.review-box::before {
  content: "“";
  position: absolute;
  left: 13px;
  top: -9px;
  color: var(--terracotta);
  font-family: Georgia, serif;
  font-size: 38px;
  line-height: 1;
}
.review-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-left: 15px; }
.review-heading span { font-size: 8px; font-weight: 800; }
.review-heading small { color: var(--muted); font-size: 6px; }
.review-box p { font-size: 9px; color: var(--review-ink); line-height: 1.9; margin: 10px 0 11px; }
.review-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.review-tags span { color: var(--muted); border: 1px solid var(--soft-line); background: var(--card); border-radius: 7px; padding: 4px 6px; font-size: 6px; font-weight: 700; }
.review-source { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--soft-line); color: var(--muted); font-size: 6px; }
.review-source a { color: var(--terracotta); font-weight: 800; }
.review-source span { margin-right: auto; font-weight: 700; }
.payment-row { display: flex; justify-content: space-between; align-items: center; font-size: 7px; color: var(--muted); padding: 16px 1px; border-bottom: 1px solid var(--soft-line); }
.icon-label { display: inline-flex; align-items: center; gap: 5px; }
.payment-row strong { color: var(--ink); font-size: 7px; }
.result-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin-top: 16px; }
.result-actions a { text-decoration: none; border-radius: 12px; padding: 14px 7px; text-align: center; font-size: 9px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 6px; }
.primary-link { color: white; background: var(--terracotta); border: 1px solid var(--line); }
.secondary-link { color: var(--ink); background: var(--card); border: 1px solid var(--soft-line); }
.retry-button { width: 100%; margin-top: 12px; border: 1px solid var(--line); background: var(--butter); border-radius: 12px; padding: 14px; font-size: 9px; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.history { margin-top: 32px; }
.history h3 { font-size: 11px; }
.history-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; border-top: 1px solid var(--soft-line); padding: 13px 1px; }
.history-item strong { display: block; font-size: 9px; }
.history-item span { color: var(--muted); font-size: 7px; }

.gacha-overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: var(--overlay); opacity: 0; visibility: hidden; transition: .22s; }
.gacha-overlay.active { opacity: 1; visibility: visible; }
.machine { text-align: center; }
.machine span { width: 96px; height: 96px; display: grid; place-items: center; margin: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--terracotta); color: white; font-family: "Poppins", sans-serif; font-size: 50px; font-weight: 800; animation: shake .5s infinite; }
.machine p { font-size: 9px; font-weight: 800; margin-top: 22px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translate(-50%, 20px); background: var(--ink); color: white; border-radius: 10px; padding: 11px 15px; font-size: 8px; font-weight: 700; opacity: 0; visibility: hidden; transition: .22s; white-space: nowrap; }
.toast.active { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.install-prompt {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 30;
  width: min(calc(100% - 28px), 500px);
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.install-prompt[hidden] { display: none; }
.install-prompt strong, .install-prompt span { display: block; }
.install-prompt strong { font-size: 9px; }
.install-prompt span { margin-top: 3px; color: var(--muted); font-size: 7px; }
.install-actions { display: flex; gap: 5px; flex: 0 0 auto; }
.install-actions button { border: 1px solid var(--soft-line); border-radius: 8px; padding: 7px 8px; background: transparent; font-size: 7px; font-weight: 800; cursor: pointer; }
.install-actions button:last-child { color: white; background: var(--terracotta); border-color: var(--terracotta); }

body[data-theme="night"] .result-visual { color: var(--ink); background: #172033 !important; }
body[data-theme="night"] .genre-symbol,
body[data-theme="night"] .distance-badge { color: var(--ink); background: #1e293b; }
body[data-theme="night"] .rating span { color: var(--butter); }
body[data-theme="night"] .primary-link { border-color: var(--terracotta); }
body[data-theme="night"] .gacha-icon { color: #0f172a; }
body[data-theme="night"] .retry-button { color: #0f172a; }

body[data-theme="cafe"] .brand-icon-cafe { opacity: 1; }
body[data-theme="cafe"] .brand-icon-night { opacity: 0; }
body[data-theme="cafe"] .scene.active { color: #243020; background: #8fa882; }
body[data-theme="cafe"] .gacha-button,
body[data-theme="cafe"] .primary-link,
body[data-theme="cafe"] .open-badge,
body[data-theme="cafe"] .machine span { color: white; background: #765845; }
body[data-theme="cafe"] .result-visual { background: #d8c4b3 !important; }
body[data-theme="cafe"] .genre-symbol { background: #faf6f0; }
body[data-theme="cafe"] .choice.active { color: #526b49; border-color: #8fa882; background: #f4f7f1; }

@keyframes shake { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes pulse { 50% { opacity: .25; } }
@keyframes reveal { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 700px) { .app-shell { padding-top: 30px; } .filter-card { padding: 27px; } }
@media (max-width: 380px) { .choice b { font-size: 10px; } .choice span { font-size: 5px; } .mood-list { grid-template-columns: repeat(2, 1fr); } .result-actions { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Three-pick decision flow */
.topbar { margin-bottom: 76px; }
.hero h1 { margin-bottom: 10px; font-size: clamp(48px, 14vw, 66px); }
.hero-copy { margin-bottom: 21px !important; font-size: 13px !important; }
.hero-copy strong { color: var(--terracotta); font-weight: 800; }
.hero-gacha {
  min-height: 148px;
  margin-top: 5px;
  padding: 24px;
  border-radius: 20px;
  font-size: 21px;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.hero-gacha .gacha-icon { width: 62px; height: 62px; border-radius: 16px; }
.hero-gacha .gacha-icon svg { width: 29px; height: 29px; }
.hero-gacha strong, .hero-gacha small { display: block; }
.hero-gacha strong { font-size: 21px; }
.hero-gacha small { margin: 6px 0 0; font-family: "Noto Sans JP", sans-serif; font-size: 8px; letter-spacing: .04em; opacity: .8; }
.hero-gacha .arrow { display: none; }
.mode-section { margin-top: 28px; }
.mode-caption { display: block; margin-bottom: 8px; color: var(--muted); font-size: 7px; font-weight: 700; letter-spacing: .08em; }
.mode-section .mode-switch { width: 100%; padding: 3px; border-color: var(--soft-line); }
.mode-section .scene { flex: 1; justify-content: center; min-height: 42px; font-size: 9px; }
.advanced-settings { margin-top: 12px; border: 1px solid var(--soft-line); border-radius: 14px; background: var(--card); overflow: hidden; }
.advanced-settings summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  padding: 0 15px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}
.advanced-settings summary::-webkit-details-marker { display: none; }
.advanced-settings summary::after { content: "＋"; margin-left: 10px; color: var(--terracotta); font-family: "Poppins", sans-serif; font-size: 14px; }
.advanced-settings[open] summary::after { content: "−"; }
.advanced-settings summary span { margin-right: auto; }
.advanced-settings summary small { color: var(--subtle); font-size: 6px; font-weight: 700; }
.advanced-body { padding: 0 18px 20px; border-top: 1px solid var(--soft-line); }
.advanced-heading { display: flex; justify-content: space-between; align-items: center; padding-top: 17px; color: var(--muted); font-size: 8px; font-weight: 700; }
.priority-list { grid-template-columns: repeat(3, 1fr); }
.data-note { margin-top: 18px !important; }

.result-intro { margin-bottom: 14px; }
.result-intro h2 { margin-bottom: 6px; }
.result-intro p { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; }
.recommendation-list {
  display: flex;
  gap: 10px;
  margin: 0 -20px;
  padding: 0 20px 5px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 20px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.recommendation-list::-webkit-scrollbar { display: none; }
.recommendation-card {
  flex: 0 0 calc(100% - 28px);
  box-sizing: border-box;
  scroll-snap-align: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
}
.recommendation-photo { position: relative; height: clamp(125px, 20vh, 170px); overflow: hidden; background: var(--apricot-soft); }
.recommendation-photo::after { content: ""; position: absolute; inset: 0; background: rgba(15, 23, 42, .2); pointer-events: none; }
.recommendation-photo img { width: 100%; height: 100%; object-fit: cover; }
.recommendation-rank { position: absolute; z-index: 1; left: 13px; top: 11px; color: white; font-family: "Poppins", sans-serif; font-size: 24px; font-weight: 800; }
.recommendation-photo .open-badge { position: absolute; z-index: 1; right: 12px; top: 12px; }
.recommendation-content { padding: 13px; }
.fallback-candidate-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 12px;
  padding: 7px 8px;
  color: var(--muted);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: var(--paper);
  font-size: 7px;
  font-weight: 700;
  line-height: 1.55;
}
.fallback-candidate-note .ui-icon { width: 11px; height: 11px; color: var(--terracotta); }
.recommendation-title { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.recommendation-title span { color: var(--terracotta); font-size: 7px; font-weight: 800; }
.recommendation-title h3 { margin: 4px 0 0; font-size: 17px; line-height: 1.45; letter-spacing: -.04em; }
.recommendation-title > strong { flex: 0 0 auto; display: flex; align-items: center; gap: 3px; padding: 6px 7px; border: 1px solid var(--soft-line); border-radius: 8px; background: var(--butter-soft); font-family: "Poppins", sans-serif; font-size: 10px; }
.recommendation-title > strong .ui-icon { width: 10px; height: 10px; fill: currentColor; }
.recommendation-facts { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 10px; color: var(--muted); font-size: 7px; font-weight: 700; }
.recommendation-facts span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.recommendation-facts [hidden] { display: none; }
.recommendation-facts em { color: var(--subtle); font-size: 6px; font-style: normal; }
.recommendation-facts strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: inherit; }
.recommendation-facts .ui-icon { width: 11px; height: 11px; color: var(--terracotta); }
.recommendation-reason { margin: 10px 0; padding: 8px 9px; border-left: 2px solid var(--terracotta); color: var(--review-ink); background: var(--review); font-size: 8px; font-weight: 700; line-height: 1.55; }
.latest-review {
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: var(--paper);
}
.latest-review-heading,
.latest-review-meta,
.latest-review-source { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.latest-review-heading { padding-bottom: 9px; border-bottom: 1px solid var(--soft-line); }
.latest-review-heading strong { font-size: 8px; }
.latest-review-heading span { color: var(--muted); font-family: "Poppins", sans-serif; font-size: 6px; font-weight: 700; }
.latest-review-meta { justify-content: flex-start; margin-top: 9px; color: var(--muted); font-size: 7px; font-weight: 700; }
.latest-review-meta span:first-child { display: inline-flex; align-items: center; gap: 3px; color: var(--terracotta); }
.latest-review-meta .ui-icon { width: 10px; height: 10px; fill: currentColor; }
.latest-review-text { display: -webkit-box; margin: 7px 0 5px; overflow: hidden; color: var(--review-ink); font-size: 8px; line-height: 1.65; white-space: pre-line; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.latest-review-text.expanded { display: block; overflow: visible; }
.review-expand-button { padding: 2px 0; color: var(--terracotta); border: 0; background: transparent; font-size: 6px; font-weight: 800; cursor: pointer; }
.latest-review-source { padding-top: 9px; border-top: 1px solid var(--soft-line); color: var(--muted); font-size: 6px; font-weight: 700; }
.latest-review-source a { color: var(--terracotta); }
.latest-review-empty { margin: 10px 0 0; color: var(--muted); font-size: 7px; line-height: 1.6; }
.recommendation-actions { display: block; }
.recommendation-actions.has-phone { display: grid; grid-template-columns: .9fr 1.35fr; gap: 7px; }
.recommendation-actions a { min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; font-size: 9px; font-weight: 800; text-decoration: none; cursor: pointer; }
.recommendation-actions [hidden] { display: none; }
.recommendation-actions .phone-shop-link { color: var(--ink); border: 1px solid var(--line); background: var(--card); }
.recommendation-actions .go-to-shop-link { color: white; border: 1px solid var(--line); background: var(--terracotta); }
.carousel-guide { margin: 9px 0 0; text-align: center; color: var(--muted); font-size: 7px; font-weight: 700; }
.carousel-dots { display: flex; justify-content: center; gap: 5px; margin-top: 7px; }
.carousel-dots button { width: 5px; height: 5px; padding: 0; border: 0; border-radius: 50%; background: var(--soft-line); cursor: pointer; transition: width .18s ease, background-color .18s ease; }
.carousel-dots button.active { width: 16px; border-radius: 4px; background: var(--terracotta); }
.result-footer-actions { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; margin-top: 20px; }
.share-button, .retry-button { min-height: 42px; border-radius: 11px; font-size: 8px; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.share-button { color: var(--ink); border: 1px solid var(--line); background: var(--card); }
.retry-button { width: auto; margin: 0; padding: 9px 13px; color: var(--muted); border: 1px solid var(--soft-line); background: transparent; }
.retry-button:disabled { opacity: .35; cursor: not-allowed; }
.empty-result {
  flex: 0 0 calc(100% - 28px);
  box-sizing: border-box;
  padding: 28px 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  text-align: center;
  background: var(--card);
  scroll-snap-align: start;
}
.empty-result strong, .empty-result span { display: block; }
.empty-result strong { font-size: 12px; }
.empty-result span { margin-top: 6px; color: var(--muted); font-size: 8px; }
.empty-result-actions { display: grid; gap: 7px; margin-top: 18px; }
.empty-result-actions button { min-height: 44px; border-radius: 10px; font-size: 8px; font-weight: 800; cursor: pointer; }
.empty-result-actions .ui-icon { width: 13px; height: 13px; }
.empty-primary-action { display: flex; align-items: center; justify-content: center; gap: 6px; color: white; border: 1px solid var(--line); background: var(--terracotta); }
.empty-secondary-action { color: var(--ink); border: 1px solid var(--soft-line); background: transparent; }
body[data-theme="cafe"] .retry-button { color: var(--muted); }
body[data-theme="night"] .result-footer-actions .retry-button { color: var(--muted); }
body.result-active .topbar { margin-bottom: 18px; }
body.result-active .back-button { margin-bottom: 16px; }
.debug-panel { display: none; }

@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .debug-toggle { display: block; }
  .debug-panel {
    position: fixed;
    z-index: 50;
    top: 18px;
    right: 18px;
    display: grid;
    width: 300px;
    gap: 10px;
    padding: 16px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
  }
  .debug-panel[hidden] { display: none; }
  .debug-panel-heading { display: flex; justify-content: space-between; gap: 12px; }
  .debug-panel-heading strong, .debug-panel-heading span { display: block; }
  .debug-panel-heading strong { font-family: "Poppins", sans-serif; font-size: 11px; }
  .debug-panel-heading span, .debug-panel p { margin: 3px 0 0; color: var(--muted); font-size: 7px; }
  .debug-panel-heading button { border: 0; background: transparent; cursor: pointer; font-size: 18px; }
  .debug-panel label { display: grid; gap: 4px; color: var(--muted); font-size: 7px; font-weight: 700; }
  .debug-panel input, .debug-panel select { width: 100%; padding: 8px; color: var(--ink); border: 1px solid var(--soft-line); border-radius: 8px; background: var(--paper); font-size: 9px; }
  .debug-run-button { padding: 10px; color: white; border: 1px solid var(--line); border-radius: 9px; background: var(--terracotta); font-size: 9px; font-weight: 800; cursor: pointer; }
}

@media (min-width: 700px) {
  .app-shell { width: min(100%, 620px); }
}
@media (max-width: 380px) {
  .result-footer-actions { grid-template-columns: 1fr; }
}
