/* Map-first like LUUP / ChargeSPOT: full-screen map, pins carry the seat count, one bottom sheet.
   Hourly crowd bars like Google Maps. System Japanese font like a real iOS/Android app. */
:root{
  --desk:#E9ECEF; --bg:#FFFFFF; --ink:#111418; --sub:#5E6670; --faint:#9AA1A9; --rule:#E3E6EA; --fill:#F2F4F6;
  --brand:#1B44C8; --brand-ink:#FFFFFF; --brand-tint:#E8EEFC;
  --few:#D9822B; --full:#9AA1A9; --danger:#D23B33;
  --land:#EEF0EC; --tiles:none;
  --frame:#15181C;
  --font:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans JP","Yu Gothic UI","Meiryo",sans-serif;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --desk:#0E1013; --bg:#17191D; --ink:#EEF0F2; --sub:#A3AAB2; --faint:#6E7680; --rule:#2A2E34; --fill:#22262B;
  --brand:#7C9BFF; --brand-ink:#0B1433; --brand-tint:#1E2846;
  --few:#F0A050; --full:#6E7680; --danger:#F06A62;
  --land:#1D2024; --tiles:invert(1) hue-rotate(180deg) brightness(.9) contrast(.85) saturate(.6);
  --frame:#000000; color-scheme:dark}}
:root[data-theme="dark"]{
  --desk:#0E1013; --bg:#17191D; --ink:#EEF0F2; --sub:#A3AAB2; --faint:#6E7680; --rule:#2A2E34; --fill:#22262B;
  --brand:#7C9BFF; --brand-ink:#0B1433; --brand-tint:#1E2846;
  --few:#F0A050; --full:#6E7680; --danger:#F06A62;
  --land:#1D2024; --tiles:invert(1) hue-rotate(180deg) brightness(.9) contrast(.85) saturate(.6);
  --frame:#000000; color-scheme:dark}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{height:100%}
body{background:var(--desk);color:var(--ink);font-family:var(--font);font-size:15px;line-height:1.55;font-feature-settings:"palt";
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
button,select,input{font:inherit;color:inherit}
button{cursor:pointer;-webkit-tap-highlight-color:transparent}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.tn{font-variant-numeric:tabular-nums}

/* page chrome (desktop) */
.topbar{max-width:1100px;margin:0 auto;padding-block:16px 12px;display:flex;flex-wrap:wrap;gap:10px 24px;align-items:center;justify-content:space-between}
.topbar b{font-size:15px}
.topbar small{color:var(--sub);font-size:12px;margin-left:8px}
.switch{display:inline-flex;gap:4px}
.switch button{border:0;background:none;padding:6px 12px;border-radius:8px;font-size:13px;color:var(--sub)}
.switch button[aria-pressed="true"]{background:var(--bg);color:var(--ink);font-weight:600}

.stage{max-width:1100px;margin:0 auto;display:grid;grid-template-columns:auto minmax(0,1fr);gap:48px;align-items:start;padding-block:4px 48px}
.phone{width:393px;height:812px;border-radius:54px;background:var(--frame);padding:11px}
.screen{position:relative;height:100%;border-radius:44px;overflow:hidden;background:var(--bg);display:flex;flex-direction:column}
.sbar{position:absolute;inset:0 0 auto 0;height:48px;z-index:30;display:flex;align-items:center;justify-content:space-between;padding:0 30px 0 34px;font-size:14px;font-weight:600;pointer-events:none}
.sbar i{width:120px;height:32px;border-radius:20px;background:var(--frame)}
.app{position:relative;flex:1;min-height:0}

/* ---------- map screen ---------- */
/* Leaflet: the map element is created once and stays under every screen */
.map{position:absolute;inset:0;z-index:0;overflow:hidden;touch-action:none}
.map.leaflet-container{background:var(--land);font:inherit}
.map .leaflet-tile-pane{filter:var(--tiles)}
.map .leaflet-bottom{bottom:var(--sheet-h,236px)}
.map .leaflet-control-attribution{font-size:10px;line-height:1.4;background:color-mix(in srgb,var(--bg) 75%,transparent);color:var(--sub)}
.map .leaflet-control-attribution a{color:var(--sub)}
.pin-wrap{width:0;height:0}
.pin{position:absolute;left:0;top:0;transform:translate(-50%,calc(-100% - 6px));pointer-events:auto;border:0;padding:0;background:none}
.pin span{display:block;min-width:44px;padding:4px 9px;border-radius:10px;background:var(--brand);color:var(--brand-ink);font-weight:700;font-size:13px;line-height:1.2;text-align:center;white-space:nowrap;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.pin span small{font-size:10px;font-weight:600;margin-left:1px}
.pin::after{content:"";position:absolute;left:50%;bottom:-6px;transform:translateX(-50%);border:6px solid transparent;border-top-color:var(--brand);border-bottom:0}
.pin.few span{background:var(--few)} .pin.few::after{border-top-color:var(--few)}
.pin.full span{background:var(--full)} .pin.full::after{border-top-color:var(--full)}
.pin.closed span{background:var(--bg);color:var(--sub);font-weight:600;font-size:11px;box-shadow:0 0 0 1px var(--rule),0 1px 3px rgba(0,0,0,.15)}
.pin.closed::after{border-top-color:var(--bg)}
.pin.sel{z-index:5}
.pin.sel span{transform:scale(1.18);transform-origin:50% 120%;outline:3px solid var(--bg)}
.me-dot{position:absolute;left:0;top:0;width:18px;height:18px;border-radius:50%;background:#2F7BF6;border:3px solid #fff;transform:translate(-50%,-50%);box-shadow:0 0 0 10px rgba(47,123,246,.18);pointer-events:none}

.searchbar{position:absolute;left:14px;right:14px;top:56px;z-index:10;display:flex;gap:8px}
.search{flex:1;min-width:0;display:flex;align-items:center;gap:8px;height:46px;padding:0 14px;border-radius:14px;background:var(--bg);box-shadow:0 2px 8px rgba(0,0,0,.14);font-size:14px}
.search svg{width:18px;height:18px;color:var(--sub);flex:none}
.search .q{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.search .t{color:var(--sub);font-size:13px}
.round{width:46px;height:46px;flex:none;border:0;border-radius:14px;background:var(--bg);box-shadow:0 2px 8px rgba(0,0,0,.14);display:grid;place-items:center}
.round svg{width:22px;height:22px}
.fab-col{position:absolute;right:14px;z-index:10;display:flex;flex-direction:column;gap:8px}
.fab{width:42px;height:42px;border:0;border-radius:12px;background:var(--bg);box-shadow:0 2px 8px rgba(0,0,0,.14);display:grid;place-items:center;font-size:20px;font-weight:600}
.fab svg{width:20px;height:20px;color:var(--brand)}

.sheet{position:absolute;left:0;right:0;bottom:0;z-index:20;background:var(--bg);border-radius:20px 20px 0 0;box-shadow:0 -2px 14px rgba(0,0,0,.12);padding:8px 18px max(20px,env(safe-area-inset-bottom,0px))}
.grab{width:36px;height:5px;border-radius:3px;background:var(--rule);margin:0 auto 10px}
.sheet h2{margin:0;font-size:18px;line-height:1.35}
.sheet .where{font-size:13px;color:var(--sub);margin-top:2px}
.now-row{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin:14px 0 14px}
.seatnum{display:flex;align-items:baseline;gap:4px}
.seatnum b{font-size:34px;line-height:1;font-weight:700}
.seatnum span{font-size:13px;color:var(--sub)}
.state{font-size:13px;font-weight:600}
.state.ok{color:var(--brand)} .state.few{color:var(--few)} .state.full{color:var(--danger)} .state.closed{color:var(--sub)}
.badge{display:inline-block;font-size:11px;padding:1px 7px;border-radius:5px;background:var(--fill);color:var(--sub);margin-left:6px;vertical-align:2px;font-weight:500}
.badge.live{background:var(--brand-tint);color:var(--brand)}
.btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;height:50px;border:0;border-radius:14px;background:var(--brand);color:var(--brand-ink);font-weight:700;font-size:16px}
.btn svg{width:20px;height:20px}
.btn.sub{background:var(--fill);color:var(--ink)}
.btn.warn{background:var(--fill);color:var(--danger)}
.btn[disabled]{opacity:.4;cursor:not-allowed}
.btn-row{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px}
.btn-row .btn.sub{width:auto;padding:0 18px}
.riding{display:flex;align-items:center;gap:12px;width:100%;border:0;text-align:left;background:var(--brand);color:var(--brand-ink);border-radius:14px;padding:12px 14px}
.riding .pulse{width:10px;height:10px;border-radius:50%;background:var(--brand-ink);flex:none}
.riding div{flex:1;min-width:0}
.riding small{display:block;font-size:12px;opacity:.85}
.riding b{display:block;font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.riding .tm{font-size:20px;font-weight:700}
.riding.hold{background:var(--brand-tint);color:var(--brand)}
.riding.hold .pulse{background:var(--brand)}
.riding.ask{background:var(--few)}

/* ---------- full screens ---------- */
.page{position:absolute;inset:0;background:var(--bg);display:flex;flex-direction:column;z-index:25}
.nav{flex:none;height:96px;padding:52px 8px 0;display:flex;align-items:center;gap:4px;border-bottom:1px solid var(--rule)}
.nav button{border:0;background:none;width:40px;height:40px;display:grid;place-items:center;color:var(--brand)}
.nav button svg{width:24px;height:24px}
.nav .ttl{font-size:16px;font-weight:600;flex:1;text-align:center;margin-right:44px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.scroll{flex:1;overflow-y:auto;min-height:0}
.pad{padding:18px}
.foot{flex:none;padding:12px 18px max(20px,env(safe-area-inset-bottom,0px));border-top:1px solid var(--rule);background:var(--bg)}
.foot p{margin:0 0 10px;font-size:12px;color:var(--sub);text-align:center}
.foot.stack{display:flex;flex-direction:column;gap:8px}
.foot.stack p{margin:0 0 2px}
.foot p b{color:var(--brand)}

.d-title{font-size:22px;font-weight:700;line-height:1.35;margin:0}
.d-where{font-size:14px;color:var(--sub);margin-top:4px}
.d-now{display:flex;align-items:baseline;gap:6px;margin-top:18px}
.d-now b{font-size:44px;line-height:1;font-weight:700}
.d-now span{font-size:14px;color:var(--sub)}
.d-state{margin-top:6px;font-size:14px}
hr.r{border:0;border-top:8px solid var(--fill);margin:20px -18px}
.h3{font-size:15px;font-weight:700;margin:0 0 4px}
.cap{font-size:12px;color:var(--sub)}
.hist{display:grid;grid-template-columns:repeat(13,1fr);gap:4px;align-items:end;height:96px;margin-top:14px;border-bottom:1px solid var(--rule)}
.hist div{background:var(--brand-tint);border-radius:4px 4px 0 0;min-height:3px}
.hist div.cur{background:var(--brand)}
.hist div.off{background:repeating-linear-gradient(135deg,var(--fill) 0 4px,transparent 4px 8px);height:100%!important;border-radius:0}
.hlab{display:grid;grid-template-columns:repeat(13,1fr);gap:4px;font-size:10px;color:var(--faint);text-align:center;margin-top:4px}
.hours{margin-top:12px;font-size:14px}
.rows{display:flex;flex-direction:column}
.rows .r{display:grid;grid-template-columns:4.5em minmax(0,1fr);gap:12px;padding:12px 0;border-bottom:1px solid var(--rule);font-size:14px}
.rows .r:last-child{border-bottom:0}
.rows .k{color:var(--sub)}
.rules{margin:6px 0 0;padding-left:1.1em;font-size:14px}
.rules li{margin:4px 0}
.fine{font-size:12px;color:var(--sub);margin-top:16px}

.list-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 12px;width:100%;border:0;border-bottom:1px solid var(--rule);background:none;text-align:left;padding:14px 18px}
.list-item .n{font-size:15px;font-weight:600;line-height:1.4}
.list-item .w{font-size:12px;color:var(--sub)}
.list-item .s{grid-row:1 / span 2;grid-column:2;text-align:right;align-self:center}
.list-item .s b{display:block;font-size:20px;line-height:1.1}
.list-item .s small{font-size:11px;color:var(--sub)}
.list-item.closed .n,.list-item.closed .s b{color:var(--faint)}
.group{font-size:13px;font-weight:600;color:var(--sub);padding:16px 18px 6px;background:var(--fill)}

.timer-page{display:flex;flex-direction:column;align-items:center;text-align:center;padding:48px 24px 0}
.timer-page .lbl{font-size:13px;font-weight:700;color:var(--brand);background:var(--brand-tint);padding:3px 12px;border-radius:999px}
.timer-page h2{font-size:18px;margin:14px 0 0;line-height:1.4}
.timer-page .big{font-size:60px;font-weight:700;margin-top:28px;letter-spacing:.01em;line-height:1}
.timer-page .ask-q{font-size:24px;font-weight:700;margin-top:28px}
.timer-page .until{font-size:14px;color:var(--sub);margin-top:14px}
.done-mark{width:64px;height:64px;border-radius:50%;background:var(--brand-tint);color:var(--brand);display:grid;place-items:center}
.done-mark svg{width:32px;height:32px}

.form{display:flex;flex-direction:column;gap:22px}
.birth{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.terms{font-size:13px;color:var(--sub);margin-bottom:10px}
.terms summary{cursor:pointer;color:var(--brand);font-weight:600}
.terms ul{margin:8px 0 0;padding-left:1.1em}
.agree{display:flex;align-items:center;gap:10px;font-size:15px;font-weight:600}
.agree input{width:22px;height:22px;margin:0;accent-color:var(--brand)}
.fl{font-size:14px;font-weight:600;margin-bottom:8px;display:block}
.grades{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.grades button{height:44px;border:1px solid var(--rule);background:var(--bg);border-radius:10px;font-size:15px}
.grades button[aria-pressed="true"]{border:2px solid var(--brand);color:var(--brand);font-weight:700;background:var(--brand-tint)}
select.sel{width:100%;height:46px;border:1px solid var(--rule);border-radius:10px;background:var(--bg);padding:0 12px;font-size:15px}

/* ---------- desktop side ---------- */
.side{min-width:0;display:flex;flex-direction:column;gap:28px;padding-top:8px}
.side h2{font-size:15px;margin:0 0 4px}
.side p{margin:0;font-size:13px;color:var(--sub);max-width:60ch}
.ctrls{display:grid;grid-template-columns:repeat(2,minmax(0,200px));gap:12px;margin-top:12px}
.ctrls label{font-size:12px;color:var(--sub);display:flex;flex-direction:column;gap:4px}
.qrs{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:20px 16px;margin-top:14px}
.qr{display:flex;flex-direction:column;gap:6px;min-width:0}
.qr .img{background:#fff;padding:8px;border-radius:6px;width:112px;height:112px}
.qr .img canvas,.qr .img img{width:96px!important;height:96px!important}
.qr .n{font-size:12px;font-weight:600;line-height:1.35}
.qr .m{font-size:11px;color:var(--sub)}
.qr button{align-self:flex-start;border:0;background:none;color:var(--brand);font-size:12px;font-weight:600;padding:0;text-decoration:underline;text-underline-offset:3px}
.linkbtn{border:0;background:none;color:var(--sub);font-size:12px;padding:0;text-decoration:underline;text-underline-offset:3px;align-self:flex-start}
.linkbtn[disabled]{opacity:.4;cursor:not-allowed}

/* ---------- hero（公開用の版だけ） ---------- */
html:not(.has-hero) .hero{display:none}
.hero{max-width:1100px;margin:0 auto;min-height:min(100svh,760px);display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:56px;align-items:center;padding-block:48px}
.hero-anim{min-width:0}
.hero-anim canvas{display:block;width:100%;height:auto;aspect-ratio:4/3;image-rendering:pixelated;border-radius:14px;background:var(--bg)}
.hero-cap{margin:14px 0 0;font-size:14px;min-height:3em;color:var(--ink)}
.hero-steps{display:flex;gap:6px;margin-top:4px}
.hero-steps button{border:0;background:none;padding:8px 0;width:32px}
.hero-steps button::before{content:"";display:block;height:4px;border-radius:2px;background:var(--rule)}
.hero-steps button[aria-current="step"]::before{background:var(--brand)}
.hero-text h1{font-size:clamp(28px,4.2vw,44px);line-height:1.3;margin:0 0 20px;letter-spacing:.01em}
.hero-text p{margin:0 0 12px;font-size:16px;color:var(--sub);max-width:30em}
.hero-down{display:inline-flex;align-items:center;gap:6px;margin-top:16px;color:var(--brand);font-weight:700;text-decoration:none}
.hero-down svg{width:20px;height:20px}
#demo{scroll-margin-top:8px}

/* ---------- dashboard ---------- */
.dash{max-width:1100px;margin:0 auto;padding-block:4px 48px}
.dash-in{background:var(--bg);border-radius:14px;padding:24px 28px}
.dhead{display:flex;flex-wrap:wrap;gap:12px 24px;align-items:flex-end;justify-content:space-between;padding-bottom:18px;border-bottom:1px solid var(--rule)}
.dhead h2{margin:0;font-size:20px}
.dhead p{margin:4px 0 0;font-size:13px;color:var(--sub)}
.dhead label{font-size:12px;color:var(--sub);display:flex;flex-direction:column;gap:4px}
.flag{color:var(--few);font-weight:600}
.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
.kpis div{padding:18px 20px 18px 0}
.kpis div+div{padding-left:20px;border-left:1px solid var(--rule)}
.kpis small{display:block;font-size:12px;color:var(--sub)}
.kpis b{display:block;font-size:30px;font-weight:700;line-height:1.25}
.kpis span{font-size:12px;color:var(--sub)}
.dgrid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:40px;padding:22px 0;border-top:1px solid var(--rule)}
.dgrid h3,.tsec h3{font-size:15px;margin:0}
.dgrid p,.tsec p{font-size:12px;color:var(--sub);margin:2px 0 10px}
.chart svg{display:block;width:100%;height:auto}
.chart text{fill:var(--sub);font-size:11px;font-family:var(--font)}
.tsec{padding-top:22px;border-top:1px solid var(--rule)}
.tw{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:13px;min-width:700px}
th{font-weight:500;color:var(--sub);font-size:12px;text-align:left;padding:8px 10px;border-bottom:1px solid var(--rule);white-space:nowrap}
td{padding:10px;border-bottom:1px solid var(--rule)}
.num{text-align:right;font-variant-numeric:tabular-nums}
.minibar{display:inline-block;height:6px;border-radius:3px;background:var(--brand);vertical-align:middle;margin-right:8px;opacity:.8}

@media (max-width:840px){
  .stage{grid-template-columns:minmax(0,1fr);gap:28px;padding-top:0}
  .phone{width:auto;height:min(812px,calc(100svh - 70px));border-radius:0;padding:0;background:none;margin:0 calc(-1 * max(16px,env(safe-area-inset-left,0px)))}
  .screen{border-radius:0}
  .sbar{display:none}
  .searchbar{top:12px}
  .nav{height:56px;padding-top:12px}
  .timer-page{padding-top:32px}
  .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .kpis div:nth-child(3){padding-left:0;border-left:0}
  .dgrid{grid-template-columns:minmax(0,1fr)}
  .dash-in{padding:18px 16px}
  .hero{grid-template-columns:minmax(0,1fr);gap:24px;min-height:0;padding-block:28px 36px}
  .hero-text{order:-1}
  select.sel,input{font-size:16px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
