/* The Watch List — palette and type from the design system:
   #1C1917 ink, #CA8A04 gold, Playfair Display + Inter.
   Dark by default because gold reads best on it; light mode fully supported. */

:root{
  color-scheme:light;   /* keeps UA widgets — select popups, scrollbars — on theme */
  --ink:#0C0A09; --ink-2:#1C1917; --ink-3:#292524;
  --on-gold:#1C1917;    /* text on gold never flips between themes */
  --paper:#FAFAF9; --paper-2:#F5F5F4;
  --gold:#CA8A04; --gold-soft:#E3B341; --gold-deep:#8A5E02;
  /* --gold at 13px on near-white measures 2.94:1, under the 4.5:1 floor. Gold as a
     BACKGROUND is fine (it carries dark text); gold as TEXT uses this darker tone,
     which measures 5.70:1. Dark mode already passes at 6.24:1 and keeps --gold. */
  --gold-text:#8A5E02;
  --green:#15803D; --green-soft:#DCFCE7;
  --line:rgba(0,0,0,.12); --muted:#57534E;
  --bg:var(--paper); --bg-2:#fff; --bg-3:var(--paper-2);
  --fg:var(--ink); --fg-2:#44403C; --fg-3:var(--muted);
  --card:#fff; --shadow:0 1px 2px rgba(12,10,9,.06), 0 8px 24px -12px rgba(12,10,9,.18);
  --shadow-lg:0 2px 4px rgba(12,10,9,.08), 0 24px 48px -20px rgba(12,10,9,.35);
  --r:14px; --r-sm:9px;
  --serif:"Playfair Display",Georgia,serif;
  --sans:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
  --maxw:1240px;
  --tabh:0px;                       /* the bottom bar only exists on small screens */
}
html[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0C0A09; --bg-2:#141110; --bg-3:#1C1917;
  --fg:#FAFAF9; --fg-2:#D6D3D1; --fg-3:#A8A29E;
  --card:#171413; --line:rgba(250,250,249,.13); --gold-text:var(--gold);
  --green:#4ADE80; --green-soft:rgba(74,222,128,.14);
  --shadow:0 1px 2px rgba(0,0,0,.5), 0 8px 24px -12px rgba(0,0,0,.7);
  --shadow-lg:0 2px 6px rgba(0,0,0,.55), 0 28px 56px -20px rgba(0,0,0,.85);
}
/* With JavaScript unavailable no data-theme is ever set; a dark-OS visitor must
   still get the dark default. Keep this block identical to html[data-theme="dark"]. */
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]){
    color-scheme:dark;
    --bg:#0C0A09; --bg-2:#141110; --bg-3:#1C1917;
    --fg:#FAFAF9; --fg-2:#D6D3D1; --fg-3:#A8A29E;
    --card:#171413; --line:rgba(250,250,249,.13); --gold-text:var(--gold);
    --green:#4ADE80; --green-soft:rgba(74,222,128,.14);
    --shadow:0 1px 2px rgba(0,0,0,.5), 0 8px 24px -12px rgba(0,0,0,.7);
    --shadow-lg:0 2px 6px rgba(0,0,0,.55), 0 28px 56px -20px rgba(0,0,0,.85);
  }
}

*{box-sizing:border-box}
/* a display rule anywhere below would otherwise beat the hidden attribute */
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{
  margin:0; background:var(--bg); color:var(--fg);
  font:400 16px/1.6 var(--sans);
  -webkit-font-smoothing:antialiased;
}
.wrap{
  max-width:var(--maxw); margin:0 auto;
  padding-left:max(20px, env(safe-area-inset-left));
  padding-right:max(20px, env(safe-area-inset-right));
}
h1,h2,h3{font-family:var(--serif); font-weight:600; letter-spacing:-.01em; margin:0}
a{color:inherit}
img{max-width:100%; display:block}
button{font:inherit}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.skip{
  position:fixed; top:10px; left:10px; z-index:99; transform:translateY(-200%);
  background:var(--gold); color:var(--on-gold); font-weight:600; font-size:14px;
  padding:12px 18px; border-radius:var(--r-sm); text-decoration:none;
}
.skip:focus-visible{transform:none}
:focus-visible{outline:2px solid var(--gold-text); outline-offset:2px; border-radius:4px}
/* removes the 300ms tap delay that makes a phone feel laggy */
button,a,select,summary,input[type=range],.card,.chip,.tab{touch-action:manipulation}

/* anchored sections must clear the sticky header rather than hide behind it */
html{scroll-behavior:smooth}
#grid,#map,#dream{scroll-margin-top:244px}   /* topbar 63px + the stuck controls strip ~173px, measured */
@media (prefers-reduced-motion:reduce){ html{scroll-behavior:auto} }

/* ---------- loading placeholder ---------- */
.sk{display:grid; gap:20px; grid-template-columns:repeat(auto-fill,minmax(290px,1fr))}
.sk-card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  overflow:hidden; animation:pulse 1.5s ease-in-out infinite;
}
.sk-shot{aspect-ratio:1; background:var(--bg-3)}
.sk-line{height:11px; border-radius:6px; background:var(--bg-3); margin:13px 16px}
.sk-line.short{width:45%} .sk-line.mid{width:68%}
@keyframes pulse{0%,100%{opacity:1} 50%{opacity:.5}}
@media (prefers-reduced-motion:reduce){ .sk-card{animation:none} }

/* ---------- top bar ---------- */
.topbar{
  position:sticky; top:0; z-index:30;
  background:color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter:blur(12px); border-bottom:1px solid var(--line);
  padding-top:env(safe-area-inset-top,0px);   /* clears the status bar once installed */
}
.topbar-in{display:flex; align-items:center; justify-content:space-between; gap:16px; height:62px}
.brand{display:flex; align-items:center; gap:11px; font-family:var(--serif); font-size:17px}
.brand strong{display:block; font-weight:600; line-height:1.2}
.brand em{display:block; font:400 11.5px/1.4 var(--sans); color:var(--fg-3); font-style:normal}
.brand-mark{
  width:24px;height:24px;border-radius:50%;flex:none;
  background:conic-gradient(from 210deg,var(--gold),var(--gold-soft),var(--gold-deep),var(--gold));
  box-shadow:inset 0 0 0 3px var(--bg);
  outline:1.5px solid var(--gold); outline-offset:-1px;
}
.topnav{display:flex; align-items:center; gap:4px}
.navlink{
  padding:8px 12px; border-radius:var(--r-sm); text-decoration:none;
  font-size:14px; color:var(--fg-2); transition:background .2s,color .2s;
}
.navlink:hover{background:var(--bg-3); color:var(--fg)}
.icon-btn{
  position:relative; display:grid;place-items:center;width:38px;height:38px;margin-left:4px;
  border:1px solid var(--line); background:var(--bg-2); color:var(--fg-2);
  border-radius:var(--r-sm); cursor:pointer; transition:background .2s,color .2s,border-color .2s;
}
/* the visual stays 38px; the touch target reaches 46px */
.icon-btn::after,.sheet-close::after{content:""; position:absolute; inset:-4px; border-radius:inherit}
.icon-btn:hover{background:var(--bg-3); color:var(--gold-text); border-color:var(--gold)}
@media (max-width:640px){ .navlink{display:none} }

/* ---------- hero ---------- */
.hero{padding:52px 0 30px; border-bottom:1px solid var(--line)}
.eyebrow{
  margin:0 0 12px; font-size:11.5px; font-weight:600; letter-spacing:.13em;
  text-transform:uppercase; color:var(--gold-text);
}
.hero h1{font-size:clamp(34px,6vw,58px); line-height:1.04; margin-bottom:14px}
/* both fill from data.json after the fetch; reserving their resting height keeps
   the controls strip and grid from jumping when the text lands */
.lede{max-width:62ch; color:var(--fg-2); font-size:16.5px; margin:0 0 24px; min-height:53px}
.stats{display:flex; flex-wrap:wrap; gap:10px; min-height:62px}
.stat{
  background:var(--bg-2); border:1px solid var(--line); border-radius:var(--r-sm);
  padding:10px 14px; min-width:96px;
}
.stat b{display:block; font-family:var(--serif); font-size:22px; line-height:1.1}
.stat span{font-size:11.5px; color:var(--fg-3); letter-spacing:.03em}
.stat.gold b{color:var(--gold-text)}

/* ---------- controls ---------- */
.controls{
  position:sticky; top:62px; z-index:20; padding:14px 0;
  background:color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter:blur(12px); border-bottom:1px solid var(--line);
}
.searchrow{display:flex; gap:10px; flex-wrap:wrap}
.searchbox{
  flex:1 1 260px; display:flex; align-items:center; gap:9px; padding:0 13px;
  background:var(--bg-2); border:1px solid var(--line); border-radius:var(--r-sm);
  color:var(--fg-3); transition:border-color .2s;
}
/* the input's own outline is off, so the ring must live here or nowhere */
.searchbox:focus-within{border-color:var(--gold); outline:2px solid var(--gold-text); outline-offset:2px}
.searchbox input{
  flex:1; min-width:0; height:44px; border:0; background:none; color:var(--fg);
  font-size:15px; outline:none;
}
.selects{display:flex; gap:8px}
select,.ghost-btn{
  height:44px; padding:0 14px; border-radius:var(--r-sm); cursor:pointer;
  border:1px solid var(--line); background:var(--bg-2); color:var(--fg-2);
  font-size:14px; transition:border-color .2s,color .2s,background .2s;
}
select:hover,.ghost-btn:hover{border-color:var(--gold); color:var(--gold-text)}
.chiprow{display:flex; gap:8px; flex-wrap:wrap; margin-top:11px}
.chip{
  display:inline-flex; align-items:center; gap:7px; cursor:pointer;
  padding:8px 13px; min-height:38px; border-radius:100px; font-size:13.5px;
  border:1px solid var(--line); background:var(--bg-2); color:var(--fg-2);
  transition:background .2s,color .2s,border-color .2s;
}
.chip:hover{border-color:var(--gold); color:var(--gold-text)}
.chip[aria-pressed="true"]{background:var(--gold); border-color:var(--gold); color:var(--on-gold); font-weight:600}
/* the tertiary token instead of an opacity fade: the faded composite measured
   3.34:1 on white — quiet must still clear 4.5:1 at 12px */
.chip .n{color:var(--fg-3); font-variant-numeric:tabular-nums; font-size:12px}
.chip[aria-pressed="true"] .n{color:inherit; opacity:.85}
.advanced{margin-top:12px}
.advanced summary{
  cursor:pointer; display:inline-flex; align-items:center; gap:8px;
  font-size:13.5px; color:var(--fg-3); padding:7px 2px; user-select:none;
}
.advanced summary::marker{color:var(--gold)}
.advanced[open] summary{color:var(--gold-text)}
.count-pill{
  background:var(--gold); color:var(--on-gold); border-radius:100px;
  padding:1px 8px; font-size:11px; font-weight:700;
}
.advgrid{
  display:grid; gap:22px; padding:18px 0 6px;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
}
.fgroup .ftitle{
  font-family:var(--sans); font-size:11.5px; font-weight:600; letter-spacing:.1em;
  text-transform:uppercase; color:var(--fg-3); margin-bottom:11px;
  display:flex; justify-content:space-between; gap:8px; align-items:baseline;
}
.rangeval{
  font-family:var(--sans); font-size:12.5px; letter-spacing:0; text-transform:none;
  color:var(--gold-text); font-weight:600; font-variant-numeric:tabular-nums;
}
.chips{display:flex; flex-wrap:wrap; gap:7px}
input[type=range]{width:100%; accent-color:var(--gold-text); height:26px; cursor:pointer}

/* ---------- cards ---------- */
.gridsec{padding:26px 0 10px}
.resultline{color:var(--fg-3); font-size:13.5px; margin:0 0 16px}
.cards{
  display:grid; gap:20px;
  grid-template-columns:repeat(auto-fill,minmax(290px,1fr));
}
.card{
  position:relative; display:flex; flex-direction:column; cursor:pointer;
  background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  overflow:hidden; box-shadow:var(--shadow); text-align:left; padding:0;
  color:inherit; transition:border-color .22s, box-shadow .22s, transform .22s;
}
.card:hover{border-color:var(--gold); box-shadow:var(--shadow-lg); transform:translateY(-3px)}
.card:focus-within{border-color:var(--gold)}
.card.t1{border-color:color-mix(in srgb,var(--gold) 55%, var(--line))}
.card.t1::before{
  content:""; position:absolute; inset:0 0 auto; height:3px; z-index:2;
  background:linear-gradient(90deg,var(--gold),var(--gold-soft),var(--gold));
}
.shot{position:relative; aspect-ratio:1; background:var(--bg-3); overflow:hidden}
.shot img{width:100%; height:100%; object-fit:cover; transition:transform .5s ease}
.card:hover .shot img{transform:scale(1.045)}
/* the photograph is its own button: it opens the viewer, the body opens the details */
button.shot{display:block; width:100%; padding:0; border:0; cursor:zoom-in; color:inherit}
.zoomtag{
  position:absolute; left:11px; bottom:11px; z-index:3; display:flex; align-items:center; gap:5px;
  background:rgba(12,10,9,.72); color:#FAFAF9; border-radius:100px; padding:5px 9px;
  font-size:11px; font-weight:600; opacity:0; transform:translateY(4px);
  transition:opacity .2s, transform .2s; pointer-events:none;
}
.card:hover .zoomtag, button.shot:focus-visible .zoomtag{opacity:1; transform:none}
.cbody{position:relative}
.cname .open{
  background:none; border:0; padding:0; margin:0; font:inherit; color:inherit;
  text-align:left; cursor:pointer;
}
.cname .open::after{content:""; position:absolute; inset:0; z-index:1}   /* covers the text half */
.rank,.flags,.mm{pointer-events:none}
.noshot{display:grid; place-items:center; height:100%; color:var(--fg-3); font-size:12px}
.rank{
  position:absolute; top:11px; left:11px; z-index:2;
  min-width:34px; height:34px; padding:0 8px; border-radius:9px;
  display:grid; place-items:center; font-family:var(--serif); font-size:17px; font-weight:600;
  background:var(--bg-3); color:var(--fg-3); border:1px solid var(--line);
}
.card.t1 .rank{background:var(--gold); color:var(--on-gold); border-color:var(--gold-deep)}
.card.t2 .rank{background:var(--gold-soft); color:var(--on-gold); border-color:transparent}
.flags{position:absolute; top:11px; right:11px; z-index:2; display:flex; flex-direction:column; gap:6px; align-items:flex-end}
.flag{
  font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
  padding:4px 9px; border-radius:100px;
}
.flag.new{background:var(--gold); color:var(--on-gold)}
/* the only translucent badge — the blur is real here and wasted on the solid ones */
.flag.osaka{background:rgba(12,10,9,.72); color:#FAFAF9; backdrop-filter:blur(6px)}
/* pinned like the osaka overlay: dark-mode --green is a light tint and white text
   on it measured 1.74:1 */
.flag.deal{background:#15803D; color:#FAFAF9}
.mm{
  position:absolute; bottom:11px; right:11px; z-index:2;
  background:rgba(12,10,9,.82); color:#FAFAF9; font-size:11.5px; font-weight:600;
  padding:4px 9px; border-radius:6px; letter-spacing:.02em;
}
.cbody{padding:15px 16px 17px; display:flex; flex-direction:column; gap:3px; flex:1}
.cbody p,.dbody p{margin:0}       /* default paragraph margins were padding the cards out */
.cbrand{font-size:10.5px; letter-spacing:.13em; text-transform:uppercase; color:var(--fg-3)}
.cname{font-family:var(--serif); font-size:19px; line-height:1.22; margin:2px 0 0}
.cdesc{font-family:var(--serif); font-style:italic; font-size:13.5px; color:var(--gold-text); line-height:1.35}
.cshop{font-size:12px; color:var(--fg-3); margin-top:7px}
.cpay{
  margin-top:auto; padding-top:13px; display:flex; align-items:baseline;
  justify-content:space-between; gap:10px; flex-wrap:wrap;
}
.cmo{font-size:20px; font-weight:700; color:var(--green); font-variant-numeric:tabular-nums; line-height:1.2}
.cmo small{display:block; font-size:11px; font-weight:500; color:var(--fg-3)}
.cprice{text-align:right; font-size:14px; font-weight:600; font-variant-numeric:tabular-nums}
.cprice small{display:block; font-size:11px; font-weight:400; color:var(--fg-3)}

/* ---------- map ---------- */
.mapsec{padding:44px 0; margin-top:28px; border-top:1px solid var(--line)}
.mapsec h2,.dreamsec h2{font-size:clamp(24px,3.6vw,34px); margin-bottom:8px}
.sublede{color:var(--fg-3); max-width:64ch; margin:0 0 20px; font-size:14.5px}
.maplayout{display:grid; gap:18px; grid-template-columns:minmax(0,1.55fr) minmax(0,1fr)}
@media (max-width:860px){ .maplayout{grid-template-columns:1fr} }
#leaflet{
  height:430px; border-radius:var(--r); border:1px solid var(--line);
  box-shadow:var(--shadow); z-index:1;
}
.shoplist{display:flex; flex-direction:column; gap:9px; max-height:430px; overflow:auto; padding-right:4px}
.shopcard{
  background:var(--card); border:1px solid var(--line); border-radius:var(--r-sm);
  padding:12px 14px; cursor:pointer; text-align:left; color:inherit;
  transition:border-color .2s,background .2s;
}
.shopcard:hover{border-color:var(--gold)}
.shopcard b{display:block; font-size:14px}
.shopcard span{font-size:12px; color:var(--fg-3)}
.shopcard .badge-osaka{color:var(--gold-text); font-weight:600}
.leaflet-popup-content{font:400 13px/1.5 var(--sans)}
.leaflet-popup-content b{font-family:var(--serif); font-size:14px}
.pin-a{color:var(--gold-deep); font-weight:600}
/* Leaflet's default blue link is a second hue the system forbids; the popup and
   attribution grounds are always light, so the deep gold never flips */
.leaflet-container a{color:var(--gold-deep)}

/* ---------- dream ---------- */
.dreamsec{padding:44px 0 60px; border-top:1px solid var(--line)}
.dreamgrid{display:grid; gap:16px; grid-template-columns:repeat(auto-fill,minmax(210px,1fr))}
.dcard{
  background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  overflow:hidden; box-shadow:var(--shadow); display:flex; flex-direction:column;
}
.dcard .shot{aspect-ratio:1}
.dbody{padding:13px 14px 15px}
.dbody .cname{font-size:16px}
.dprice{margin-top:9px; font-size:13.5px; font-weight:600; font-variant-numeric:tabular-nums}
.dmo{font-size:12px; color:var(--gold-text); font-weight:600}
.dnote{font-size:11.5px; color:var(--fg-3); line-height:1.5; margin-top:7px}
.dnote b{color:var(--fg-2); font-weight:600}

/* ---------- detail sheet ---------- */
.sheet{position:fixed; inset:0; z-index:50; display:grid; place-items:end center}
/* display:grid above would otherwise defeat the hidden attribute and leave the
   backdrop painted over the whole page. Keep this rule next to it. */
.sheet[hidden]{display:none}
.sheet-backdrop{position:absolute; inset:0; background:rgba(12,10,9,.62); backdrop-filter:blur(3px)}
.sheet-panel{
  position:relative; width:min(760px,100%); max-height:92vh; overflow:auto;
  overscroll-behavior:contain;      /* stops the page behind scrolling once this hits its end */
  background:var(--bg-2); border:1px solid var(--line);
  border-radius:var(--r) var(--r) 0 0; box-shadow:var(--shadow-lg);
  animation:rise .3s cubic-bezier(.2,.7,.3,1);
}
@media (min-width:720px){
  .sheet{place-items:center}
  .sheet-panel{border-radius:var(--r); max-height:88vh}
}
@keyframes rise{from{transform:translateY(26px); opacity:0} to{transform:none; opacity:1}}
.sheet-close{
  position:absolute; top:12px; right:12px; z-index:3; width:38px; height:38px;
  display:grid; place-items:center; cursor:pointer; border-radius:50%;
  border:1px solid var(--line); background:var(--bg-2); color:var(--fg-2);
}
.sheet-close:hover{color:var(--gold-text); border-color:var(--gold)}
.sheet-hero{display:grid; grid-template-columns:1fr 1fr; gap:0}
@media (max-width:620px){ .sheet-hero{grid-template-columns:1fr} }
.shotfig{display:block; padding:0; border:0; background:none; cursor:zoom-in; position:relative}
/* an SVG glyph, not a text character — those render differently on every platform */
.shotfig::after{
  content:""; position:absolute; right:10px; bottom:8px; z-index:2;
  width:32px; height:32px; border-radius:50%; background-color:rgba(12,10,9,.66);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FAFAF9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7.5 7.5M3 21l7.5-7.5'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:center; background-size:15px;
  transition:background-color .2s;
}
.shotfig:hover::after{background-color:var(--gold)}
.sheet-hero img{width:100%; aspect-ratio:1; object-fit:cover}
.sheet-hero figure{margin:0; position:relative}
.sheet-hero figcaption{
  position:absolute; left:0; bottom:0; background:rgba(12,10,9,.78); color:#FAFAF9;
  font-size:10px; letter-spacing:.1em; text-transform:uppercase; padding:5px 10px;
}
.sheet-main{padding:22px 24px 26px}
.sheet-main h2{font-size:27px; line-height:1.15}
.sheet-desc{font-family:var(--serif); font-style:italic; color:var(--gold-text); font-size:16px; margin:3px 0 0}
.metarow{display:flex; flex-wrap:wrap; gap:8px; margin:15px 0 18px}
.meta{background:var(--bg-3); border:1px solid var(--line); border-radius:100px; padding:6px 12px; font-size:12.5px}
.meta b{font-weight:600}
/* a hairline all the way round rather than a fat bar down one side — the tinted
   ground and the large coloured figure already carry the emphasis */
.payblock{
  background:var(--green-soft);
  border:1px solid color-mix(in srgb, var(--green) 32%, transparent);
  border-radius:var(--r-sm); padding:14px 16px; margin-bottom:16px;
}
.payblock.warn{
  background:color-mix(in srgb,var(--gold) 12%,transparent);
  border-color:color-mix(in srgb,var(--gold) 36%,transparent);
}
.payblock .big{font-size:27px; font-weight:700; color:var(--green); font-variant-numeric:tabular-nums; line-height:1.2}
.payblock.warn .big{color:var(--gold-text)}
.payblock .per{font-size:14px; font-weight:500}   /* typography.ui */
.payblock .sub{font-size:12.5px; color:var(--fg-2); margin-top:2px}
.payblock .extra{font-size:12.5px; color:var(--fg-2); margin-top:8px; line-height:1.5}
.sheet-note{font-size:14.5px; line-height:1.65; color:var(--fg-2)}
.sheet-note b{color:var(--fg); font-weight:600}
.dots{display:flex; gap:18px; flex-wrap:wrap; margin:16px 0}
.dotgrp{display:flex; align-items:center; gap:7px; font-size:11px; letter-spacing:.09em; text-transform:uppercase; color:var(--fg-3)}
.dotgrp i{display:flex; gap:3px}
.dotgrp b{width:11px; height:11px; border-radius:3px; background:var(--bg-3); border:1px solid var(--line)}
/* gold-text, not gold: a lit dot is state information and must clear 3:1 on paper */
.dotgrp b.on{background:var(--gold-text); border-color:var(--gold-text)}
.actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:20px}
.btn{
  display:inline-flex; align-items:center; gap:8px; cursor:pointer; text-decoration:none;
  padding:12px 18px; border-radius:var(--r-sm); font-size:14px; font-weight:600;
  border:1px solid var(--gold); background:var(--gold); color:var(--on-gold);
  transition:filter .2s, background .2s, color .2s;
}
.btn:hover{filter:brightness(1.08)}
.btn.sec{background:transparent; color:var(--gold-text)}
.btn.sec:hover{background:color-mix(in srgb,var(--gold) 12%,transparent)}

.empty{color:var(--fg-3); padding:36px 0; text-align:center}
.linkbtn{background:none;border:0;color:var(--gold-text);cursor:pointer;text-decoration:underline;padding:0;font-size:inherit}
.foot{border-top:1px solid var(--line); padding:26px 0 40px; color:var(--fg-3); font-size:13px}
.foot .fine{font-size:11.5px; margin-top:8px; max-width:76ch; line-height:1.6}

/* ---------- photograph viewer ---------- */
/* Built to depend on nothing browser-specific: a flex column inside a fixed box,
   and the photograph absolutely placed inside a stage of definite size. Percentage
   sizing against an auto-height parent is the one thing engines disagree about, so
   there is none of it here. overflow:hidden stops the thumbnail strip from ever
   widening the overlay and carrying the picture off-screen. */
.lb{
  position:fixed; inset:0; z-index:60; background:#080706;
  display:flex; flex-direction:column; overflow:hidden; overscroll-behavior:contain;
  padding-bottom:env(safe-area-inset-bottom,0px);
}
.lb > *{flex:0 0 auto; min-width:0; max-width:100%}
/* as with the sheet: display above would beat the hidden attribute on its own */
.lb[hidden]{display:none}
.lb-top{
  display:flex; align-items:center; gap:10px;
  padding:10px 14px; padding-top:max(10px, env(safe-area-inset-top));
}
.lb-count{
  color:#A8A29E; font-size:12.5px; font-variant-numeric:tabular-nums; letter-spacing:.06em;
}
.lb-btn{
  width:42px; height:42px; display:grid; place-items:center; cursor:pointer;
  border-radius:50%; border:1px solid rgba(250,250,249,.18);
  background:rgba(250,250,249,.06); color:#FAFAF9;
}
.lb-btn:hover{background:rgba(250,250,249,.14)}
.lb-stage{
  position:relative; flex:1 1 auto; min-height:120px; overflow:hidden;
  touch-action:pan-y;
}
.lb-figure{position:absolute; inset:10px; margin:0; display:block}
.lb-stage img{
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  max-width:100%; max-height:100%; width:auto; height:auto;
  border-radius:6px; user-select:none; -webkit-user-drag:none;
}
.lb-kind{
  background:rgba(250,250,249,.1); color:#D6D3D1; border-radius:100px;
  font-size:9.5px; letter-spacing:.11em; text-transform:uppercase; padding:5px 11px;
}
.lb-spacer{flex:1}
.lb-fail{
  position:absolute; top:50%; left:0; right:0; transform:translateY(-50%);
  text-align:center; color:#A8A29E; font-size:13.5px; padding:0 24px; line-height:1.6;
}
.lb-nav{
  position:absolute; top:50%; transform:translateY(-50%); z-index:2;
  width:46px; height:46px; display:grid; place-items:center; cursor:pointer;
  border-radius:50%; border:1px solid rgba(250,250,249,.18);
  background:rgba(12,10,9,.55); color:#FAFAF9; backdrop-filter:blur(4px);
  transition:background .2s;
}
.lb-nav:hover{background:color-mix(in srgb, var(--gold) 90%, transparent); color:var(--on-gold); border-color:var(--gold)}
/* max() keeps the arrows clear of a notch in sideways phones */
.lb-nav.prev{left:max(6px, env(safe-area-inset-left))} .lb-nav.next{right:max(6px, env(safe-area-inset-right))}
.lb-bar{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:12px 16px; border-top:1px solid rgba(250,250,249,.1);
}
.lb-meta{min-width:0}
.lb-meta b{display:block; font-family:var(--serif); font-size:17px; color:#FAFAF9; line-height:1.25}
.lb-meta span{display:block; font-size:12.5px; color:#A8A29E; margin-top:2px}
.btn.sm{padding:12px 15px; font-size:13px; flex:none}
.lb-strip{
  display:flex; gap:7px; overflow-x:auto; overflow-y:hidden; padding:0 12px 12px;
  scrollbar-width:thin; -webkit-overflow-scrolling:touch; width:100%;
}
.lb-strip button{
  flex:none; width:50px; height:50px; padding:0; cursor:pointer; border-radius:7px;
  overflow:hidden; border:1px solid rgba(250,250,249,.16); background:#1C1917;
  opacity:.5; transition:opacity .2s, border-color .2s;
}
.lb-strip button img{width:100%; height:100%; object-fit:cover}
.lb-strip button.on{opacity:1; border-color:var(--gold); border-width:2px}

/* ---------- filter panel footer + bottom bar (small screens only) ---------- */
.advfoot{display:none}
.tabbar{display:none}
.ledemore{
  display:none; background:none; border:0; padding:12px 0; cursor:pointer;
  color:var(--gold-text); font:600 12.5px var(--sans); text-decoration:underline;
}

/* ---------- small screens ----------
   The second condition catches a phone whose browser is lying about its width —
   "Request Desktop Website" reports a 980px viewport, which would otherwise drop
   the whole page back to the desktop grid on a 6-inch screen. A coarse pointer
   means a finger, and a finger always gets this layout. */
@media (max-width:760px), (pointer:coarse) and (max-width:1180px){
  :root{--tabh:calc(58px + env(safe-area-inset-bottom,0px))}
  body{padding-bottom:var(--tabh)}

  .topbar{top:0; height:auto}
  .topbar-in{height:52px}
  .brand{font-size:15.5px}
  .brand em{font-size:11px}

  /* the hero was eating half the first screen before a single watch appeared */
  .hero{padding:18px 0 16px}
  .eyebrow{font-size:10px; letter-spacing:.1em; margin-bottom:8px}
  .hero h1{font-size:clamp(25px,7vw,33px); margin-bottom:10px}
  .lede{font-size:14.5px; line-height:1.55; margin-bottom:10px}
  .lede.clamp{display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden}
  .ledemore{display:inline-block; margin-bottom:12px}
  .stats{
    display:flex; flex-wrap:nowrap; gap:8px; overflow-x:auto;
    margin:0 -20px; padding:2px 20px 4px; scrollbar-width:none;
    overscroll-behavior-x:contain;   /* the row's end must not hand the swipe to browser back */
    min-height:56px;
  }
  .stats::-webkit-scrollbar{display:none}
  .stat{flex:none; min-width:84px; padding:9px 12px}
  .stat b{font-size:19px}

  /* one solid sticky strip: search, sort, and a chip scroller. The topbar grows
     by the status-bar inset in the installed app, so the stick point must too */
  .controls{
    top:calc(52px + env(safe-area-inset-top,0px)); z-index:45; padding:9px 0 8px;
    background:var(--bg); backdrop-filter:none;   /* a filter here would trap the fixed panel */
  }
  .searchrow{flex-wrap:nowrap; gap:8px}
  .searchbox{flex:1 1 auto; min-width:0}
  .searchbox input{height:42px; font-size:16px}   /* 16px stops iOS zooming on focus */
  select{height:42px; padding:0 9px; font-size:16px; max-width:140px}   /* same zoom guard as the input */
  #resetBtn{display:none}
  .chiprow{
    flex-wrap:nowrap; overflow-x:auto; margin:9px -20px 0; padding:1px 20px 2px;
    scrollbar-width:none; scroll-snap-type:x proximity;
    overscroll-behavior-x:contain;
  }
  .chiprow::-webkit-scrollbar{display:none}
  .chiprow .chip{flex:none; scroll-snap-align:start}
  .chip{min-height:44px}   /* thumb-first: the pills grow to the full target size */

  /* the advanced filters become a bottom sheet driven by the Filters tab */
  .advanced{margin:0}
  .advanced summary{display:none}
  .advanced[open]{
    position:fixed; left:0; right:0; bottom:var(--tabh); z-index:46;
    max-height:min(70vh, 560px);      /* fallback: browsers without dvh drop the next line whole */
    max-height:min(70dvh, 560px); overflow:auto; overscroll-behavior:contain;
    background:var(--bg-2); border-top:1px solid var(--line);
    border-radius:16px 16px 0 0; box-shadow:0 -18px 40px -12px rgba(0,0,0,.6);
    padding:8px 20px 16px; animation:rise .26s cubic-bezier(.2,.7,.3,1);
  }
  .advanced[open]::before{
    content:""; display:block; width:38px; height:4px; border-radius:99px;
    background:var(--line); margin:2px auto 14px;
  }
  .advgrid{grid-template-columns:1fr; gap:18px; padding:0}
  input[type=range]{height:34px}                     /* a thumb-sized target */
  .leaflet-control-zoom a{width:44px!important; height:44px!important; line-height:44px!important}
  .advfoot{
    display:flex; gap:10px; margin-top:18px; position:sticky; bottom:0;
    background:var(--bg-2); padding:12px 0 2px; border-top:1px solid var(--line);
  }
  .advfoot .btn{flex:1; justify-content:center}
  .advfoot .ghost-btn{flex:none}

  /* cards: a scannable row, with the top three kept large */
  /* the sticky stack measures ~165px in a browser tab; installed as a PWA the
     topbar grows by the status-bar inset, so the margin must grow with it */
  #grid,#map,#dream{scroll-margin-top:calc(178px + env(safe-area-inset-top,0px))}
  .gridsec{padding:16px 0 6px}
  .cards,.sk{grid-template-columns:1fr; gap:11px}
  .sk-card{display:flex} .sk-shot{width:118px; flex:none; aspect-ratio:1}
  .sk-body{flex:1; padding:6px 0}
  .card{flex-direction:row; align-items:stretch; border-radius:12px}
  .card:hover{transform:none}
  button.shot{width:118px; flex:none; aspect-ratio:auto; align-self:stretch; min-height:114px}
  .card .rank{top:6px; left:6px; min-width:27px; height:27px; font-size:14px; border-radius:7px}
  .card .flags{top:6px; right:6px; gap:4px}
  .flag{font-size:8.5px; padding:3px 6px; letter-spacing:.05em}
  .card .mm{bottom:6px; right:6px; font-size:9.5px; padding:3px 6px}
  .zoomtag{display:none}
  .cbody{padding:11px 13px 12px; gap:1px}
  .cname{font-size:16.5px; line-height:1.2}
  .cdesc{
    font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }
  .cshop{margin-top:5px; font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
  /* wrap, not nowrap: if the browser is scaling text up, the two figures must be
     allowed to stack instead of colliding */
  .cpay{padding-top:8px; flex-wrap:wrap; gap:2px 10px; align-items:flex-end}
  .cprice{text-align:left}
  .cmo{font-size:17px}
  .cmo small{font-size:10px}
  .cprice{font-size:12.5px}
  .cprice small{font-size:10px}

  /* the top three keep the full-bleed treatment so the ranking still reads */
  .card.t1{flex-direction:column}
  .card.t1 button.shot{width:100%; aspect-ratio:4/3}
  .card.t1 .rank{top:11px; left:11px; min-width:34px; height:34px; font-size:17px; border-radius:9px}
  .card.t1 .flags{top:11px; right:11px}
  .card.t1 .flag{font-size:10px; padding:4px 9px; letter-spacing:.08em}
  .card.t1 .mm{bottom:11px; right:11px; font-size:11.5px; padding:4px 9px}
  .card.t1 .cbody{padding:14px 16px 16px}
  .card.t1 .cname{font-size:21px}
  .card.t1 .cdesc{font-size:13.5px; white-space:normal}
  .card.t1 .cmo{font-size:20px}
  /* ranks 4-10 are already marked by the pale gold rank chip; a bar down the side
     only crowded the photograph edge in the row layout */

  .mapsec{padding:30px 0}
  #leaflet{height:320px}
  .shoplist{max-height:none; overflow:visible}
  .dreamsec{padding:30px 0 34px}
  .dreamgrid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:11px}

  .sheet-panel{max-height:92dvh; border-radius:18px 18px 0 0}
  .sheet-main{padding:18px 18px 26px}
  .sheet-main h2{font-size:23px}
  .sheet-body{padding-bottom:env(safe-area-inset-bottom,0px)}
  .actions .btn{flex:1; justify-content:center}

  .lb-bar{padding:11px 14px}
  .lb-meta b{font-size:15px}
  .lb-nav{width:44px; height:44px}   /* the phone is where the full target matters most */
  .foot{padding-bottom:20px}

  .tabbar{
    position:fixed; left:0; right:0; bottom:0; z-index:40;
    display:grid; grid-template-columns:repeat(4,1fr);
    background:color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter:blur(14px); border-top:1px solid var(--line);
    padding-bottom:env(safe-area-inset-bottom,0px);
  }
  .tab{
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
    min-height:58px; padding:5px 2px; border:0; background:none; cursor:pointer;
    color:var(--fg-3); font-size:10.5px; letter-spacing:.02em; text-align:center;
    -webkit-tap-highlight-color:transparent;
  }
  .tab svg{flex:none}
  .tab.is-on{color:var(--gold-text)}
  .tab span{position:relative}
  .tabdot{
    position:absolute; top:-1px; right:-9px; width:6px; height:6px; border-radius:50%;
    background:var(--gold);
  }
  .tab.is-on .tabdot{background:var(--fg)}
}

@media (max-width:400px){
  button.shot{width:104px}
  .cname{font-size:15.5px}
  .cmo{font-size:16px}
}

/* a map that grabs every swipe is a trap on a phone: it waits to be woken */
.mapwrap{position:relative}
.maptap{
  position:absolute; inset:0; z-index:2; display:none; place-items:center; cursor:pointer;
  border:0; border-radius:var(--r); background:rgba(12,10,9,.42); backdrop-filter:blur(1px);
  color:#FAFAF9; font:600 13px/1 var(--sans); letter-spacing:.02em;
}
.maptap span{background:rgba(12,10,9,.82); padding:10px 16px; border-radius:100px}
@media (max-width:760px), (pointer:coarse) and (max-width:1180px){ .maptap{display:grid} }

/* a short viewport — landscape phone, or 400% zoom on a desktop — cannot afford a
   permanently stuck controls strip; the topbar alone stays */
@media (max-height:520px){
  .controls{position:static}
  #grid,#map,#dream{scroll-margin-top:80px}
}
/* an iPad Pro in landscape is 1366px wide and escapes the small-screen block, but
   its finger still triggers the iOS focus zoom under 16px */
@media (pointer:coarse){
  .searchbox input, select{font-size:16px}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important; transition-duration:.01ms!important}
  .card:hover{transform:none}
  .card:hover .shot img{transform:none}
}
