/* happy.court — layout: sticky top bar; desktop = list + sticky map side by side; phone = single column with bottom tab bar */
:root{
  --a:#5b3df5; --dk:#3f24c9; --a12:#ede8ff; --a35:#c9bff2; --seg:#e9e4ff;
  --bg:#f4f2fb; --card:#ffffff; --soft:#f7f6fb; --ink:#17132b; --muted:#5f5a73;
  --line:#e2def0; --div:#eeeaf6;
  --green:#177c46; --green-bg:#ddf3e4; --red:#a12b2b; --red-bg:#fbe6e6;
  --warn-bg:#fffbea; --warn-ink:#6b5200; --warn-line:#f0d36b;
  --stripe1:#c2410c; --stripe2:#ffd23f; --badge:#c2410c; --heart:#e0335b; --star:#f2b705;
  --shadow:rgba(23,19,43,.12);
  --pb:#3d6fd1; --pb-k:#2c55a8; --tn:#3f8f6a; --tn-o:#2f7155; --cl:#ffffff; --net:#17132b;
  --hall:#e9e5f8; --roof:#c9bff2; --lamp:#fffdf2; --sky:#dcecfb; --ground:#d3dcc6; --tree:#7fbf95; --tree2:#5aa877;
  --sun:#ffd23f; --city:#bdb5dc; --unk:#e4e1ee; --road-ink:#8a84a3;
  --f-ui:"IBM Plex Sans Thai",system-ui,-apple-system,"Segoe UI",sans-serif;
  --f-mono:"IBM Plex Mono","IBM Plex Sans Thai",ui-monospace,Menlo,monospace;
  --top-h:64px; --tile-filter:none;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --a:#9a86ff; --dk:#b9abff; --a12:#2a2450; --a35:#4b3f8f; --seg:#241f40;
  --bg:#110e1f; --card:#1b1730; --soft:#211c39; --ink:#efecfa; --muted:#aaa4c2; --line:#2f2950; --div:#2a2546;
  --green:#6fd59c; --green-bg:#16352a; --red:#f19a9a; --red-bg:#3a1d22; --warn-bg:#2f2810; --warn-ink:#f2d982; --warn-line:#6b5a1d;
  --badge:#e2652b; --heart:#ff6b8a; --shadow:rgba(0,0,0,.4);
  --pb:#3560b4; --pb-k:#274a8e; --tn:#357a5a; --tn-o:#285f46; --cl:#e9ecf5; --net:#0b0916;
  --hall:#252040; --roof:#3a3266; --lamp:#d9d3ff; --sky:#1c2742; --ground:#24302a; --tree:#2f6a49; --tree2:#3d8058;
  --sun:#e5b92e; --city:#332d58; --unk:#2a2546; --road-ink:#8d86ad; --tile-filter:invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); color-scheme:dark}}
:root[data-theme="dark"]{
  --a:#9a86ff; --dk:#b9abff; --a12:#2a2450; --a35:#4b3f8f; --seg:#241f40;
  --bg:#110e1f; --card:#1b1730; --soft:#211c39; --ink:#efecfa; --muted:#aaa4c2; --line:#2f2950; --div:#2a2546;
  --green:#6fd59c; --green-bg:#16352a; --red:#f19a9a; --red-bg:#3a1d22; --warn-bg:#2f2810; --warn-ink:#f2d982; --warn-line:#6b5a1d;
  --badge:#e2652b; --heart:#ff6b8a; --shadow:rgba(0,0,0,.4);
  --pb:#3560b4; --pb-k:#274a8e; --tn:#357a5a; --tn-o:#285f46; --cl:#e9ecf5; --net:#0b0916;
  --hall:#252040; --roof:#3a3266; --lamp:#d9d3ff; --sky:#1c2742; --ground:#24302a; --tree:#2f6a49; --tree2:#3d8058;
  --sun:#e5b92e; --city:#332d58; --unk:#2a2546; --road-ink:#8d86ad; --tile-filter:invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); color-scheme:dark}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-padding-top:calc(var(--top-h) + 12px)}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--f-ui);font-size:15px;line-height:1.6}
body::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);z-index:40;background:var(--card)}
[hidden]{display:none!important}
img{max-width:100%}
button,input,textarea,select{font:inherit;color:inherit}
a{color:var(--dk)}
a[href],button:not(:disabled),[role="button"],label[for],summary,select,input[type="checkbox"],input[type="radio"]{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.6}
:focus-visible{outline:2px solid var(--a);outline-offset:2px}
svg{display:block}
h1{font-size:clamp(24px,4vw,30px);font-weight:700;line-height:1.35;margin:0;text-wrap:balance}
h2{font-size:19px;font-weight:700;line-height:1.45;margin:0;text-wrap:balance}
h3{font-size:16px;line-height:1.45;margin:0}
p{margin:0}
.sub{color:var(--muted);font-size:14.5px;max-width:65ch}
.eyebrow{color:var(--muted);font-size:13.5px}
.note{color:var(--muted);font-size:13.5px}
.skip{position:absolute;left:-999px;top:8px;background:var(--card);padding:8px 12px;border-radius:10px;z-index:100}
.skip:focus{left:12px}

/* top bar */
.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:30;background:var(--card);border-bottom:1px solid var(--line)}
.top::before{content:"";display:block;height:5px;background:repeating-linear-gradient(-45deg,var(--stripe1) 0 12px,var(--stripe2) 12px 24px)}
.top-in{max-width:1280px;margin:0 auto;display:flex;align-items:center;gap:12px;padding-block:9px;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.brand{font-weight:700;font-size:21px;letter-spacing:-.01em;line-height:1;text-decoration:none;color:var(--ink);display:flex;flex-direction:column}
.brand b{color:var(--a)}
.brand small{font-family:var(--f-mono);font-size:10.5px;color:var(--muted);font-weight:500;margin-top:4px}
.topnav{display:none;gap:4px;margin-left:16px}
.topnav a{text-decoration:none;color:var(--muted);font-weight:600;font-size:14.5px;padding:7px 12px;border-radius:10px}
.topnav a:hover{background:var(--soft);color:var(--ink)}
.topnav a[aria-current="page"]{background:var(--a12);color:var(--dk)}
@media (min-width:900px){.topnav{display:flex}}
.ctrls{margin-left:auto;display:flex;gap:8px;align-items:center}
.mini{display:inline-flex;background:var(--bg);border:2px solid var(--line);border-radius:12px;padding:2px}
.mini button{border:0;background:transparent;border-radius:9px;padding:4px 9px;font-weight:700;font-size:13px;color:var(--muted)}
.mini button[aria-pressed="true"]{background:var(--card);color:var(--ink);box-shadow:0 1px 3px var(--shadow)}
.iconbtn{width:40px;height:40px;border-radius:12px;border:2px solid var(--line);background:var(--bg);display:grid;place-items:center;color:var(--ink)}
.iconbtn svg{width:20px;height:20px}

main{max-width:1280px;margin:0 auto;padding-block:16px 110px;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
@media (min-width:900px){main{padding-bottom:48px}}
.view{display:flex;flex-direction:column;gap:14px;min-width:0}
.panel{background:var(--card);border:1px solid var(--line);border-radius:20px;padding:14px 16px;min-width:0}
.btn{border:0;background:var(--a);color:#fff;border-radius:12px;padding:10px 18px;font-weight:700;display:inline-flex;align-items:center;gap:8px;text-decoration:none}
.btn:hover{filter:brightness(1.07)}
.btn.ghost{background:var(--a12);color:var(--dk)}
.btn.sm{padding:6px 12px;font-size:13.5px;border-radius:10px}
.btn.ok{background:var(--green)} .btn.danger{background:var(--red)}
.btn.line{background:#06c755;color:#fff}
.btn svg{width:18px;height:18px}
.callout{background:var(--warn-bg);border:1px solid var(--warn-line);color:var(--warn-ink);border-radius:14px;padding:11px 14px;font-size:14px}
.done-box{background:var(--green-bg);color:var(--green);border-radius:14px;padding:11px 14px;font-weight:600}

/* search hero */
.hero{display:flex;flex-direction:column;gap:12px}
.searchbox{position:relative}
.search{display:flex;align-items:center;gap:10px;background:var(--card);border:2px solid var(--line);border-radius:16px;padding:10px 14px}
.search:focus-within{border-color:var(--a);box-shadow:0 0 0 4px var(--a12)}
.search input{border:0;background:transparent;outline:none;flex:1;min-width:0;font-size:16px}
.search svg{flex:none;color:var(--muted);width:20px;height:20px}
.search .clr{border:0;background:var(--soft);border-radius:8px;padding:2px 8px;color:var(--muted)}
.sugg{position:absolute;left:0;right:0;top:calc(100% + 6px);background:var(--card);border:1px solid var(--line);border-radius:16px;box-shadow:0 10px 30px var(--shadow);z-index:20;overflow:hidden;max-height:min(60vh,420px);overflow-y:auto}
.sugg button{display:flex;align-items:center;gap:10px;width:100%;border:0;background:none;padding:10px 14px;text-align:left;font-size:14.5px}
.sugg button[aria-selected="true"],.sugg button:hover{background:var(--a12)}
.sugg .k{font-size:11.5px;font-weight:700;color:var(--muted);margin-left:auto;white-space:nowrap}
.sugg .dot{width:10px;height:10px;border-radius:3px;flex:none}
.quick{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.quick::-webkit-scrollbar{display:none}
.chip{border:1px solid var(--line);background:var(--card);border-radius:999px;padding:7px 13px;font-size:14px;font-weight:500;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;flex:none}
.chip svg{width:16px;height:16px}
.chip[aria-pressed="true"]{background:var(--a12);border-color:var(--a35);color:var(--dk);font-weight:600}
.chip.strong{background:var(--a);color:#fff;border-color:var(--a)}
.chip .x{font-weight:700;opacity:.7}
.when{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.when select{border:1px solid var(--line);background:var(--card);border-radius:999px;padding:7px 12px;font-size:14px}.when .lbl{font-weight:600;font-size:14px}
.seg{display:inline-flex;background:var(--seg);border-radius:14px;padding:4px;gap:2px;max-width:100%;overflow-x:auto}
.seg button{border:0;background:transparent;border-radius:11px;padding:7px 14px;font-weight:600;color:var(--dk);white-space:nowrap;display:flex;align-items:center;gap:6px}
.seg button[aria-pressed="true"]{background:var(--card);color:var(--ink);box-shadow:0 1px 3px var(--shadow)}
.seg .ic{width:20px;height:12px;border-radius:3px}
@media (max-width:359px){.seg button{padding:7px 9px}} /* 320px phones: keep the 3 sport buttons on screen */

/* results layout */
.results{display:grid;grid-template-columns:1fr;gap:16px;align-items:start}
@media (min-width:1024px){.results{grid-template-columns:minmax(0,1fr) 420px}}
.res-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.count{font-weight:700}
.sortsel{border:1px solid var(--line);background:var(--card);border-radius:10px;padding:6px 10px;font-size:14px}
@media (pointer:coarse){.when select,.sortsel{font-size:16px}} /* iOS Safari zooms the page when a control under 16px gets focus */
.list{display:grid;grid-template-columns:1fr;gap:12px}
@media (min-width:640px){.list{grid-template-columns:1fr 1fr}}
@media (min-width:1024px){.list{grid-template-columns:1fr 1fr}}
.side-map{position:sticky;top:calc(var(--top-h) + 16px);height:calc(100vh - var(--top-h) - 40px);min-height:420px;border-radius:20px;overflow:hidden;border:1px solid var(--line);display:none}
@media (min-width:1024px){.side-map{display:block}}
.mapbox{width:100%;height:100%;background:var(--unk)}
.fab{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(82px + env(safe-area-inset-bottom,0px));z-index:25;box-shadow:0 6px 20px var(--shadow)}
@media (min-width:1024px){.fab{display:none}}

/* court card */
.court{background:var(--card);border:1px solid var(--line);border-radius:20px;overflow:hidden;display:flex;flex-direction:column;min-width:0;position:relative}
.court:hover{border-color:var(--a35)}
.court.hl{outline:3px solid var(--a);outline-offset:-1px}
.media{position:relative;aspect-ratio:8/3;background:var(--unk)}
.media>svg,.media>img{width:100%;height:100%;object-fit:cover;display:block}
.media>a{position:absolute;inset:0}
.ov{position:absolute;display:flex;gap:6px;flex-wrap:wrap;pointer-events:none}
.ov>*{pointer-events:auto}
.ov.tl{top:10px;left:10px}.ov.tr{top:8px;right:8px}.ov.bl{bottom:10px;left:10px}.ov.br{bottom:10px;right:10px}
.pill{background:var(--card);color:var(--ink);border-radius:999px;padding:2px 9px;font-size:12px;font-weight:700;box-shadow:0 1px 3px var(--shadow);display:inline-flex;align-items:center;gap:5px;line-height:1.5}
.pill svg{width:13px;height:13px}
.pill .d{width:7px;height:7px;border-radius:50%;background:var(--muted)}
.pill.open .d{background:var(--green)} .pill.closed .d{background:var(--red)}
.pill.ph{font-weight:600;color:var(--muted)}
.fav{width:34px;height:34px;border-radius:50%;border:0;background:var(--card);box-shadow:0 1px 3px var(--shadow);display:grid;place-items:center;color:var(--muted)}
.fav svg{width:18px;height:18px}
.fav[aria-pressed="true"]{color:var(--heart)}
.fav[aria-pressed="true"] path{fill:currentColor}
.body{padding:12px 16px 14px;display:flex;flex-direction:column;gap:8px;flex:1}
.c-top{display:flex;gap:12px;align-items:flex-start}
.c-name{font-weight:700;font-size:16.5px;line-height:1.35}
.c-name a{color:inherit;text-decoration:none}
.c-name a:hover{text-decoration:underline}
.c-addr{color:var(--muted);font-size:13.5px;margin-top:2px}
.c-rate{display:flex;gap:6px;align-items:center;font-size:12.5px;color:var(--muted);margin-top:2px}
.c-price{margin-left:auto;text-align:right;flex:none}
.c-price strong{display:block;font-size:19px;font-weight:700;font-variant-numeric:tabular-nums;line-height:1.15}
.c-price span{font-size:12px;color:var(--muted)}
.c-price.na strong{font-size:14px;color:var(--muted);font-weight:600}
.facts{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:13.5px;color:var(--muted)}
.facts span{display:inline-flex;align-items:center;gap:5px}
.facts svg{width:15px;height:15px;flex:none}
.dist{color:var(--dk);font-weight:700}
.amen{display:flex;flex-wrap:wrap;gap:6px}
.am{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:600;color:var(--muted);background:var(--soft);border:1px solid var(--div);border-radius:8px;padding:1px 7px}
.am svg{width:13px;height:13px}
.book{display:flex;flex-wrap:wrap;gap:8px;padding-top:10px;border-top:1px solid var(--div);margin-top:auto}
.act{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);background:var(--soft);border-radius:12px;padding:6px 10px;font-size:13.5px;font-weight:600;text-decoration:none;color:var(--ink);max-width:100%}
.act svg{width:15px;height:15px;flex:none}
a.act:hover,button.act:hover{border-color:var(--a35);background:var(--a12)}
.act.primary{background:var(--a12);border-color:var(--a35);color:var(--dk)}
.act.linebtn{background:#06c755;border-color:#06c755;color:#fff}
span.act{background:transparent;border-style:dashed;cursor:default}
.foot{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:12px;color:var(--muted)}
.q{font-weight:700;border-radius:999px;padding:1px 9px;font-size:12px}
.q.ok{background:var(--green-bg);color:var(--green)}
.q.wait{background:var(--warn-bg);color:var(--warn-ink);border:1px solid var(--warn-line)}
.q.old{background:var(--soft);color:var(--muted);border:1px solid var(--div)}
.q.bad{background:var(--red-bg);color:var(--red)}
.empty{text-align:center;color:var(--muted);padding:28px 16px;grid-column:1/-1;display:flex;flex-direction:column;align-items:center;gap:10px}
.stars{color:var(--star);letter-spacing:1px;white-space:nowrap}
.stars .off{color:var(--line)}

/* filter sheet */
.sheet-bg{position:fixed;inset:0;background:rgba(10,8,20,.45);z-index:50}
.sheet{position:fixed;z-index:51;background:var(--card);display:flex;flex-direction:column;
  left:0;right:0;bottom:0;max-height:88vh;border-radius:22px 22px 0 0;padding-bottom:env(safe-area-inset-bottom,0px)}
@media (min-width:760px){.sheet{left:auto;top:0;bottom:0;width:420px;max-height:none;border-radius:0}}
.sheet-h{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;border-bottom:1px solid var(--line)}
.sheet-b{overflow-y:auto;padding:16px 18px;display:flex;flex-direction:column;gap:18px}
.sheet-f{display:flex;gap:10px;padding:12px 18px;border-top:1px solid var(--line)}
.sheet-f .btn{flex:1;justify-content:center}
.fgroup{display:flex;flex-direction:column;gap:8px}
.fgroup>b{font-size:14.5px}
.checks{display:flex;flex-wrap:wrap;gap:8px}
.checks label{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--line);background:var(--card);border-radius:999px;padding:7px 14px 7px 12px;font-size:14px;line-height:1.3;white-space:nowrap}
.checks label:has(input:checked){background:var(--a12);border-color:var(--a35);color:var(--dk);font-weight:600}
.checks input{accent-color:var(--a);width:16px;height:16px;margin:0;flex:none}
input[type="range"]{accent-color:var(--a);width:100%}

/* court page */
.back{align-self:flex-start;border:0;background:var(--a12);color:var(--dk);font-weight:700;border-radius:12px;padding:7px 12px;text-decoration:none}
.d-head{display:flex;gap:14px;align-items:flex-start;flex-wrap:wrap}
.d-head>div:first-child{min-width:0;flex:1}
.d-head .c-price strong{font-size:26px}
.d-rating{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--muted);margin-top:4px;min-height:22px;flex-wrap:wrap}
.d-grid{display:grid;grid-template-columns:1fr;gap:14px;align-items:start}
@media (min-width:900px){.d-grid{grid-template-columns:minmax(0,1.6fr) minmax(0,1fr)}}
.d-main,.d-side{display:flex;flex-direction:column;gap:14px;min-width:0}
@media (min-width:900px){.d-side{position:sticky;top:calc(var(--top-h) + 16px)}}
.facts-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
.fact{background:var(--soft);border:1px solid var(--div);border-radius:14px;padding:10px 12px}
.fact small{display:block;color:var(--muted);font-size:12.5px;font-weight:600}
.fact b{font-size:15px}
.week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.day{border:1px solid var(--div);background:var(--soft);border-radius:12px;padding:8px 2px;text-align:center;font-size:12px;line-height:1.35;font-variant-numeric:tabular-nums;min-width:0}
.day b{display:block;font-size:13px}
.day.today{border-color:var(--a);background:var(--a12);color:var(--dk)}
.day.off{color:var(--muted)}
.bigbook{display:flex;flex-direction:column;gap:8px}
.bigbook .act{justify-content:flex-start;padding:10px 12px;font-size:14.5px;width:100%}
.bigbook .act small{margin-left:auto;font-weight:600;opacity:.8}
.minimap{height:200px;border-radius:14px;overflow:hidden;border:1px solid var(--div);margin-top:10px}
.link{border:0;background:none;color:var(--dk);font-weight:700;padding:0;text-align:left;text-decoration:none}

/* gallery */
.g-stage{position:relative;border-radius:20px;overflow:hidden;border:1px solid var(--line);aspect-ratio:16/9;background:var(--unk);touch-action:pan-y}
.g-stage .g-img{position:absolute;inset:0;border:0;padding:0;background:none;cursor:zoom-in;width:100%;height:100%}
.g-stage img,.g-stage .g-img svg{width:100%;height:100%;object-fit:cover}
.g-nav{position:absolute;top:50%;transform:translateY(-50%);width:40px;height:40px;border-radius:50%;border:0;background:var(--card);color:var(--ink);box-shadow:0 1px 4px var(--shadow);display:grid;place-items:center;z-index:2}
.g-nav svg{width:20px;height:20px}
.g-nav.l{left:10px}.g-nav.r{right:10px}
.g-thumbs{display:flex;gap:8px;overflow-x:auto;padding:6px 2px 4px}
.g-tw{position:relative;flex:none}
.g-th{width:92px;aspect-ratio:16/9;border-radius:10px;overflow:hidden;border:2px solid transparent;padding:0;background:var(--unk);display:block}
.g-th.on{border-color:var(--a)}
.g-th img,.g-th svg{width:100%;height:100%;object-fit:cover}
.g-del{position:absolute;top:-6px;right:-6px;width:22px;height:22px;border-radius:50%;border:2px solid var(--card);background:var(--red);color:#fff;font-weight:700;font-size:13px;line-height:1;display:grid;place-items:center;padding:0}
.g-add{flex:none;width:92px;aspect-ratio:16/9;border-radius:10px;border:2px dashed var(--a35);background:var(--a12);color:var(--dk);font-weight:700;font-size:13px}
.lb{position:fixed;inset:0;z-index:60;background:rgba(10,8,20,.94);color:#fff;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:8px;
  padding:max(12px,env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right,0px)) max(12px,env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px))}
.lb-top{display:flex;justify-content:space-between;align-items:center;gap:10px;font-weight:600}
.lb-body{position:relative;display:grid;place-items:center;min-height:0}
.lb-body img,.lb-body svg{max-width:100%;max-height:100%;object-fit:contain;border-radius:10px}
.lb-body svg{width:100%;height:auto}
.lb .g-nav{background:rgba(255,255,255,.15);color:#fff;box-shadow:none}
.lb-x{border:0;background:rgba(255,255,255,.15);color:#fff;border-radius:12px;padding:8px 12px;font-weight:700}
.lb-cap{font-size:13.5px;color:#d9d5ea;text-align:center}

/* reviews */
.rv-sum{display:grid;grid-template-columns:auto 1fr;gap:16px;align-items:center}
.rv-avg{text-align:center}
.rv-avg b{display:block;font-size:40px;line-height:1;font-variant-numeric:tabular-nums}
.rv-avg small{color:var(--muted);font-size:12.5px}
.distb{display:grid;gap:4px}
.distb div{display:grid;grid-template-columns:14px 1fr 26px;gap:8px;align-items:center;font-size:12.5px;color:var(--muted)}
.distb i{display:block;height:8px;border-radius:4px;background:var(--div);overflow:hidden}
.distb i span{display:block;height:100%;background:var(--star)}
.stars-in{display:flex;gap:4px}
.stars-in button{border:0;background:none;font-size:30px;line-height:1;color:var(--line);padding:2px}
.stars-in button.on{color:var(--star)}
.rv-list{display:grid;gap:10px}
.rv{border:1px solid var(--div);border-radius:16px;padding:10px 12px;display:grid;grid-template-columns:32px 1fr;gap:4px 10px}
.rv img,.rv .av{width:32px;height:32px;border-radius:50%;grid-row:span 3;background:var(--a35)}
.rv .who{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-weight:700;font-size:14px}
.rv .t{color:var(--muted);font-size:12px;font-weight:500}
.rv p{font-size:14px;overflow-wrap:anywhere}
.mine{font-size:11px;font-weight:700;background:var(--a12);color:var(--dk);border-radius:6px;padding:0 6px}

/* forms */
.form{display:grid;gap:14px}
.field{display:grid;gap:6px}
.field>span{font-weight:600;font-size:14px;line-height:1.4}
.field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),.field textarea,.field select{border:1px solid var(--line);background:var(--soft);border-radius:12px;padding:10px 12px;font-size:16px;line-height:1.5;width:100%;min-width:0}
.field input:focus,.field textarea:focus,.field select:focus{outline:none;border-color:var(--a);box-shadow:0 0 0 3px var(--a12)}
.field textarea{min-height:90px;resize:vertical}
.field ::placeholder{color:var(--muted);opacity:.75}
.two{display:grid;grid-template-columns:1fr;gap:14px}
@media (min-width:560px){.two{grid-template-columns:1fr 1fr}}
.msg{font-size:14px;font-weight:600;min-height:1.2em}
.msg.ok{color:var(--green)}.msg.err{color:var(--red)}
.hp{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}
.narrow{max-width:760px;width:100%}
.acct{display:flex;align-items:center;gap:12px;background:var(--card);border:1px solid var(--line);border-radius:18px;padding:10px 14px;flex-wrap:wrap}
.acct img,.acct .av{width:40px;height:40px;border-radius:50%;flex:none;background:var(--a35)}
.acct b{display:block}
.acct small{color:var(--muted);font-size:12.5px}
.acct .r{margin-left:auto;display:flex;gap:8px;align-items:center}
.ok-dot{font-size:12px;font-weight:700;color:var(--green);background:var(--green-bg);border-radius:999px;padding:2px 10px;white-space:nowrap}
.gate{display:grid;grid-template-columns:1fr;gap:16px;align-items:center}
@media (min-width:720px){.gate{grid-template-columns:150px 1fr}}
.gate > svg{width:150px;height:auto;justify-self:center} /* the illustration only — not icons inside the login buttons */
.gate ul{margin:6px 0 0;padding-left:18px;color:var(--muted);font-size:14px}
.hist{display:grid;gap:8px;margin-top:10px}
.hrow{display:flex;gap:10px;align-items:center;flex-wrap:wrap;border:1px solid var(--div);border-radius:12px;padding:8px 12px;font-size:14px}
.hrow .t{margin-left:auto;color:var(--muted);font-size:12.5px}
.tp{font-size:11.5px;font-weight:700;border-radius:6px;padding:1px 7px;background:var(--a12);color:var(--dk)}
.ts{min-height:65px}

/* admin */
.li{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:12px 14px;display:grid;gap:8px;min-width:0}
.li.flag{border-color:var(--red)}
.li-top{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.li-top img,.li-top .av{width:28px;height:28px;border-radius:50%;background:var(--a35)}
.li-top .t{color:var(--muted);font-size:12.5px;margin-left:auto}
.kv{display:grid;grid-template-columns:max-content 1fr;gap:3px 12px;font-size:13.5px;margin:0}
.kv dt{color:var(--muted)}
.kv dd{margin:0;overflow-wrap:anywhere;min-width:0}
.li-act{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.flagtxt{font-size:12.5px;font-weight:700;color:var(--red)}
.tbl{overflow-x:auto;border:1px solid var(--line);border-radius:16px;background:var(--card)}
.tbl table{border-collapse:collapse;width:100%;min-width:640px;font-size:13.5px}
.tbl th,.tbl td{text-align:left;padding:8px 12px;border-bottom:1px solid var(--div);vertical-align:top}
.tbl th{background:var(--soft);color:var(--muted);font-size:12.5px}
.tbl td code{font-family:var(--f-mono);font-size:12px;overflow-wrap:anywhere}

/* guide */
.guide-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px}
.step{background:var(--card);border:1px solid var(--line);border-radius:20px;padding:14px;display:flex;flex-direction:column;gap:8px}
.step .ill{height:90px;border-radius:14px;background:var(--a12);display:grid;place-items:center}
.step .ill svg{height:72px;width:auto}
.step .no{font-size:12px;font-weight:700;color:var(--dk)}
.legend{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
.lg{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--muted)}
.lg .art{border-radius:12px;overflow:hidden;border:1px solid var(--div);aspect-ratio:8/3}
.lg .art svg{width:100%;height:100%}
.lg b{color:var(--ink);font-size:13.5px}
details.faq{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:0 14px}
details.faq summary{padding:12px 0;font-weight:700;list-style:none;display:flex;justify-content:space-between;gap:10px}
details.faq summary::-webkit-details-marker{display:none}
details.faq summary::after{content:"+";color:var(--dk);font-weight:700}
details.faq[open] summary::after{content:"–"}
details.faq p{padding-bottom:12px;color:var(--muted);font-size:14.5px}
.toc{display:flex;gap:8px;flex-wrap:wrap}
.install{display:flex;gap:14px;align-items:center;flex-wrap:wrap}

/* bottom nav (phone/tablet) */
.nav{position:fixed;left:0;right:0;bottom:0;z-index:30;background:var(--card);border-top:1px solid var(--line);
  padding-bottom:env(safe-area-inset-bottom,0px);padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}
@media (min-width:900px){.nav{display:none}}
.nav-in{max-width:620px;margin:0 auto;display:grid;grid-template-columns:repeat(5,1fr);gap:4px;padding:6px 8px}
.nav a{border-radius:14px;padding:7px 2px 5px;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:11.5px;font-weight:600;color:var(--muted);text-decoration:none;position:relative}
.nav a[aria-current="page"]{background:var(--a12);color:var(--dk)}
.nav svg{width:22px;height:22px}
.cnt{position:absolute;top:2px;right:calc(50% - 22px);background:var(--heart);color:#fff;border-radius:999px;font-size:10.5px;font-weight:700;min-width:17px;height:17px;display:grid;place-items:center;padding:0 4px}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(90px + env(safe-area-inset-bottom,0px));background:var(--ink);color:var(--bg);padding:9px 16px;border-radius:12px;font-weight:600;z-index:70;box-shadow:0 6px 20px var(--shadow)}
@media (min-width:900px){.toast{bottom:24px}}

/* map pins */
.pin-ic{display:grid;place-items:center;width:30px;height:30px;border-radius:50% 50% 50% 0;transform:rotate(-45deg);border:2px solid #fff;box-shadow:0 2px 6px rgba(0,0,0,.35)}
.pin-ic span{transform:rotate(45deg);color:#fff;font-weight:700;font-size:11px;font-family:var(--f-ui)}
.pin-ic.pb{background:var(--pb)}.pin-ic.tn{background:var(--tn)}.pin-ic.both{background:var(--a)}
.pin-ic.on{outline:3px solid var(--stripe2)}
.me-ic{width:16px;height:16px;border-radius:50%;background:#1a73e8;border:3px solid #fff;box-shadow:0 0 0 6px rgba(26,115,232,.25)}
.leaflet-popup-content{font-family:var(--f-ui);margin:10px 26px 10px 12px} /* right room for the × button */
/* own stacking context: Leaflet panes use z-index 400–1000, which otherwise paint over the sticky header, bottom nav, fab and sheets */
.leaflet-container{font-family:var(--f-ui);z-index:0;isolation:isolate}
.pop b{display:block;font-size:14px}
.pop a{font-weight:700}
.ph-broken{display:grid!important;place-items:center;color:var(--muted);font-size:12.5px;background:var(--unk);width:100%;height:100%}
@media (prefers-reduced-motion:no-preference){.court{transition:border-color .15s}.act,.fav,.chip{transition:background .15s,color .15s,border-color .15s}}

.leaflet-tile-pane{filter:var(--tile-filter)}
