:root {
  --ink: #111;
  --muted: #5f6460;
  --line: #dfdfdf;
  --paper: #fff;
  --soft: #f4f5f1;
  --sage: #eef1ea;
  --red: #c8102e;
  --gold: #c9a227;
  --green: #1f7a3d;
  --radius: 10px;
  --panel: 400px;
  font-family: Barlow, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); line-height: 1.45; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 1.2em; }
img { max-width: 100%; display: block; }
a { color: inherit; }
small { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35em;
  font: 600 .9rem/1 Barlow, sans-serif; padding: .6em .9em; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.ghost { border-color: transparent; }
.btn.wide { width: 100%; margin-top: 1rem; }
.btn[aria-pressed="true"] { background: var(--sage); }
.btn:focus-visible, .link:focus-visible, .shop-row:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.icon-btn { width: 2.5rem; height: 2.5rem; padding: 0; display: inline-grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; display: block; }
.icon-btn.ig { border-color: #c9397e; color: #c9397e; }
.icon-btn.ig:hover, .icon-btn.ig:focus-visible {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  border-color: transparent; color: #fff;
}
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }
.pill { background: var(--red); color: #fff; border-radius: 999px; font-size: .75rem; padding: .15em .5em; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .5rem;
  padding: .6rem 1rem; background: var(--paper); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; margin-right: .5rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 50%; display: block; }
.brand-text { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.brand-text small { font-weight: 500; }
.search, .city, .dialog input[type=email], .dialog input[type=text], .dialog input[type=month], textarea {
  font: 500 .95rem Barlow, sans-serif; padding: .55em .9em; border: 1.5px solid var(--line); border-radius: 999px; background: var(--soft); color: var(--ink);
}
.search { flex: 1; min-width: 0; }
textarea, .dialog input[type=email], .dialog input[type=text], .dialog input[type=month] { border-radius: var(--radius); width: 100%; display: block; margin-top: .3em; }

/* ---------- Layout ---------- */
.map-page { height: 100dvh; display: flex; flex-direction: column; }
.layout { position: relative; display: grid; grid-template-columns: var(--panel) 1fr; flex: 1; min-height: 0; }
.panel { overflow-y: auto; border-right: 1px solid var(--line); background: var(--paper); }
.map { height: 100%; }
.toggle-panel { display: none; }

.panel-head { padding: .9rem 1rem .4rem; display: flex; flex-direction: column; gap: .3rem; }
.panel-head-top { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.list-toggle { display: inline-flex; flex: none; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.list-tab { border: 0; background: none; font: inherit; font-size: .82rem; font-weight: 600; color: var(--muted); padding: .25rem .75rem; border-radius: 999px; cursor: pointer; }
.list-tab.is-active { background: var(--ink); color: #fff; }
.count { margin: 0; font-weight: 700; }
.progress { margin: 0; color: var(--green); font-weight: 600; font-size: .9rem; }

.shop-list { list-style: none; margin: 0; padding: 0 .5rem; }
.shop-row {
  display: flex; gap: .75rem; width: 100%; text-align: left; padding: .7rem .5rem; border: 0; border-bottom: 1px solid var(--line);
  background: none; font: inherit; color: inherit; cursor: pointer; border-radius: 6px;
}
.shop-row:hover, .shop-row.is-selected { background: var(--soft); }
.shop-row { text-decoration: none; }
.row-thumb.product-img { object-fit: contain; background: var(--soft); padding: 3px; }
.row-thumb { width: 84px; height: 63px; object-fit: cover; border-radius: 6px; flex: none; }
.row-thumb.placeholder { display: grid; place-items: center; background: var(--sage); font-weight: 700; font-size: 1.3rem; letter-spacing: .04em; color: var(--muted); }
.row-thumb.tier-recommended { background: var(--ink); color: #fff; box-shadow: inset 0 0 0 3px var(--gold); }
.row-thumb.tier-own-shop { background: var(--red); color: #fff; }
.row-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.row-name { font-weight: 700; }
.row-meta, .row-note { font-size: .85rem; color: var(--muted); }
.row-note { font-style: italic; }
.floor { flex: none; width: 3.2rem; font-weight: 700; color: var(--muted); }
.tick { color: var(--green); }
.heart { color: var(--red); }
.empty { padding: 2rem 1rem; color: var(--muted); }

.badges { display: flex; flex-wrap: wrap; gap: .3rem; margin: .2rem 0; }
.badge { font-size: .72rem; font-weight: 600; padding: .15em .55em; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.badge.pick { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge.own { background: var(--red); color: #fff; border-color: var(--red); }
.badge.video { border-color: var(--red); color: var(--red); }
.badge.staff { background: #fbf3d9; border-color: var(--gold); }
.tag { font-size: .72rem; font-weight: 700; padding: .15em .55em; border-radius: 4px; letter-spacing: .02em; }
.tag-jdm { background: #fde8ea; color: #9c0d24; }
.tag-swiss { background: #e8eef9; color: #1d3f86; }
.tag-era { background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.badge.indie { background: var(--sage); border-color: #9fb08f; }
.badge.warn { background: #fdecee; border-color: #f3b8c0; }
.open { font-size: .85rem; font-weight: 600; margin: .2rem 0; }
.open.is-open { color: var(--green); }
.open.is-closed { color: var(--muted); }

.promo { margin: 1rem; padding: 1rem; background: var(--sage); border-radius: var(--radius); }
.promo-kicker { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; color: var(--red); margin: 0 0 .3rem; }
.promo p { margin: 0 0 .6rem; }
.promo-links { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---------- Detail ---------- */
#detail-view .back { margin: .8rem 1rem; display: inline-block; }
.hero { position: relative; display: block; width: 100%; aspect-ratio: 16/9; padding: 0; border: 0; background: #000; cursor: pointer; }
.hero img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.hero-photo { cursor: default; background: var(--soft); }
button.hero-photo { cursor: pointer; }
.hero-photo img { object-fit: contain; opacity: 1; }
.img-credit { font-size: .7rem; color: var(--muted); margin: 0 0 .5rem; }
.img-credit a { text-decoration: underline; }
.detail-nav { display: flex; align-items: center; justify-content: space-between; }
.tour-nav { display: flex; gap: .3rem; margin: .8rem 1rem; }
.tour-arrow { width: 2rem; height: 2rem; display: grid; place-items: center; padding: 0; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); border-radius: 999px; cursor: pointer; font-size: 1rem; line-height: 1; }
.tour-arrow[disabled] { opacity: .35; cursor: default; }
.hero iframe { width: 100%; height: 100%; border: 0; }
.play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 1.5rem; }
.hero-note { position: absolute; left: .6rem; bottom: .6rem; background: rgba(0,0,0,.7); color: #fff; font-size: .8rem; font-weight: 600; padding: .2em .6em; border-radius: 4px; }
.detail-body { padding: 1rem; }
.kicker { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 .3rem; }
.detail-name { font-size: 1.6rem; margin: 0; }
.name-ja { color: var(--muted); margin: .1rem 0 .3rem; }
.actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0; }
.booking { background: #fdecee; border-left: 4px solid var(--red); padding: .7rem .9rem; border-radius: 6px; margin: .6rem 0; }
.booking b { display: block; }
.tip { background: #fbf3d9; border-left: 4px solid var(--gold); padding: .7rem .9rem; border-radius: 6px; margin: 1rem 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 1rem 0; }
.facts dt { font-weight: 700; font-size: .85rem; color: var(--muted); }
.facts dd { margin: 0; }
.stars { color: var(--gold); letter-spacing: .05em; }
.videos { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.videos a { font-size: .85rem; font-weight: 600; text-decoration: none; }
.videos img { border-radius: 6px; margin-bottom: .2rem; }
.small-print { font-size: .85rem; color: var(--muted); margin-top: 1.2rem; }

/* ---------- Dialogs ---------- */
.dialog { border: 0; border-radius: 16px; padding: 1.5rem; max-width: min(520px, calc(100vw - 32px)); width: 100%; max-height: 90dvh; }
.dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog-close { position: absolute; right: .8rem; top: .6rem; background: none; border: 0; font-size: 1.6rem; cursor: pointer; }
.dialog form { display: flex; flex-direction: column; gap: .8rem; }
.dialog label { font-weight: 600; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; position: sticky; bottom: -1.5rem; background: var(--paper); padding: .6rem 0; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 500 !important; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--ink); }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .45rem; }
legend { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .4rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: .35em .8em; border: 1.5px solid var(--line); border-radius: 999px; font-size: .88rem; font-weight: 500; cursor: pointer; }
.chip input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip input:focus-visible + span { outline: 3px solid var(--gold); }
/* "Show more" chips: hidden until expanded, but a ticked chip never disappears. */
.chips:not(.open) .chip.extra:not(:has(input:checked)) { display: none; }
.more-toggle { align-self: flex-start; border: 0; background: none; padding: .2rem 0; font: inherit; font-size: .85rem; font-weight: 600; color: var(--ink); text-decoration: underline; cursor: pointer; }
.more-toggle:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.hint { margin: 0; font-size: .85rem; color: var(--muted); }
small.block { display: block; }
.chip-group { margin: .4rem 0 0; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
input[type=range] { width: 100%; accent-color: var(--ink); }
.welcome h1 { font-size: 1.7rem; }
.form-msg { margin: 0; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 5rem; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px);
  background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 10px; font-weight: 600; text-align: center;
}

/* Support ask: a small corner card that slides in and never blocks the map. */
.support-card {
  position: fixed; right: 1rem; bottom: 8.5rem; z-index: 49; width: min(290px, calc(100vw - 2rem));
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  transform: translateY(130%); opacity: 0; transition: transform .3s ease, opacity .3s ease;
}
.support-card.in { transform: translateY(0); opacity: 1; }
.support-card .dialog-close { position: absolute; right: .35rem; top: .15rem; background: none; border: 0; font-size: 1.3rem; line-height: 1; color: var(--muted); cursor: pointer; }
.support-card .promo-kicker { margin: 0; }
.support-card .support-msg { margin: .25rem 0 .7rem; font-size: .88rem; line-height: 1.35; }
.support-card .promo-links { display: flex; gap: .4rem; flex-wrap: wrap; }
.support-card .promo-links .btn { padding: .4em .8em; font-size: .85rem; }

/* ---------- Shop page ---------- */
.shop-page main { max-width: 760px; margin: 0 auto; padding-bottom: 3rem; }
.shop-page .hero { border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.mini-map { height: 260px; border-radius: var(--radius); margin: 1rem; }
.reviews, .cta { margin: 1rem; }
.review { border-top: 1px solid var(--line); padding: .9rem 0; }
.review-head { font-weight: 700; }
.review-photos { display: flex; gap: .4rem; margin-top: .5rem; }
.review-photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; }
.cta { background: var(--sage); border-radius: var(--radius); padding: 1rem; }

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; padding: .5rem 16px; }
  .brand-text, #account { display: none; }
  .brand { margin-right: 0; }
  .search { order: 2; flex-basis: 100%; }
  .city { flex: 1; min-width: 0; }
  .layout { grid-template-columns: 1fr; }
  .panel {
    position: absolute; inset: auto 0 0 0; height: 62%; z-index: 4; border-right: 0;
    border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.15); transform: translateY(100%); transition: transform .25s;
  }
  .panel-open .panel { transform: none; }
  .toggle-panel { display: inline-flex; position: absolute; z-index: 5; left: 50%; bottom: 1.2rem; transform: translateX(-50%); }
  .panel-open .toggle-panel { bottom: calc(62% + .6rem); }
  .shop-page .topbar .search { display: none; }
}
@media (prefers-reduced-motion: reduce) { .panel { transition: none; } }
