
/* Layout: one phone-width column, viewfinder-corner motif, bottom tab bar. Ink + sunlit amber. */
:root{
  --bg:#F6F5F9; --surface:#FFFFFF; --surface-2:#ECEAF2; --ink:#1A1730; --muted:#5F5B74; --line:#DDDAE6;
  --accent:#FF6B52; --accent-ink:#1A1730; --accent-soft:#FFE2DB;
  --sea:#2A6F7A; --ok:#2C7D52; --ok-soft:#DDF0E5; --warn:#A86200; --warn-soft:#FBEBD3; --bad:#B53A33; --bad-soft:#F7DEDC;
  --map-land:#E9E4D8; --map-street:#FFFFFF; --map-park:#CFE0C3; --map-sea:#BFD8DC; --map-ring:#2A6F7A;
  --f-display:"Lexend",system-ui,-apple-system,"Segoe UI","Hiragino Sans","Noto Sans JP","Yu Gothic",sans-serif;
  --f-body:"Figtree",system-ui,-apple-system,"Segoe UI","Hiragino Sans","Noto Sans JP","Yu Gothic",sans-serif;
  --f-mono:"JetBrains Mono",ui-monospace,Menlo,monospace;
  --r:14px;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#18162B; --surface:#221F38; --surface-2:#2B2844; --ink:#F1EFF7; --muted:#A9A4C0; --line:#38344F;
  --accent:#FF6F55; --accent-ink:#1A1730; --accent-soft:#4A2B33;
  --sea:#5BAAB4; --ok:#5CC08A; --ok-soft:#173326; --warn:#E5A44A; --warn-soft:#3A2A12; --bad:#EF7B72; --bad-soft:#3E1F1D;
  --map-land:#211E36; --map-street:#34304D; --map-park:#24362F; --map-sea:#1D3045; --map-ring:#5BAAB4;
  color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#18162B; --surface:#221F38; --surface-2:#2B2844; --ink:#F1EFF7; --muted:#A9A4C0; --line:#38344F;
  --accent:#FF6F55; --accent-ink:#1A1730; --accent-soft:#4A2B33;
  --sea:#5BAAB4; --ok:#5CC08A; --ok-soft:#173326; --warn:#E5A44A; --warn-soft:#3A2A12; --bad:#EF7B72; --bad-soft:#3E1F1D;
  --map-land:#211E36; --map-street:#34304D; --map-park:#24362F; --map-sea:#1D3045; --map-ring:#5BAAB4;
  color-scheme:dark}
html,body{height:100%}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:16px;line-height:1.45}
*{box-sizing:border-box}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
#app{max-width:480px;margin:0 auto;min-height:100%;padding-inline:16px;padding-block:0 96px}
h1,h2,h3{font-family:var(--f-display);margin:0;text-wrap:balance;letter-spacing:.005em}
h1{font-size:2rem;font-weight:800;line-height:1.05}
h2{font-size:1.45rem;font-weight:750}
h3{font-size:1.1rem;font-weight:700}
p{margin:0}
.muted{color:var(--muted)}
.small{font-size:.86rem}
.mono{font-family:var(--f-mono);font-variant-numeric:tabular-nums;font-size:.85rem}
.label{font-size:.72rem;text-transform:uppercase;letter-spacing:.09em;font-weight:700;color:var(--muted)}
.stack{display:flex;flex-direction:column;gap:12px}
.stack-lg{display:flex;flex-direction:column;gap:20px}
.row{display:flex;align-items:center;gap:10px}
.between{justify-content:space-between}
.wrap{flex-wrap:wrap}
.grow{flex:1;min-width:0}

/* top bar */
.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:5;background:var(--bg);display:flex;align-items:center;gap:10px;padding-block:14px 10px}
.top h2{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.iconbtn{width:44px;height:44px;border-radius:12px;border:1px solid var(--line);background:var(--surface);display:grid;place-items:center;position:relative;flex:none}
.iconbtn svg{width:22px;height:22px}
.dot{position:absolute;top:6px;right:6px;min-width:18px;height:18px;border-radius:9px;background:var(--bad);color:#fff;font-size:.7rem;font-weight:700;display:grid;place-items:center;padding:0 5px}

/* brand mark: coral rounded square with aperture, like the Scattu logo */
.brand{display:inline-flex;align-items:center;gap:10px;font-family:var(--f-display);font-weight:700;font-size:1.35rem;letter-spacing:-.01em}
.brand-ic{width:36px;height:36px;border-radius:10px;background:var(--accent);color:#fff;display:grid;place-items:center;flex:none}
.brand-ic svg{width:22px;height:22px}
.brand.lg{flex-direction:column;font-size:2.6rem;gap:14px}
.brand.lg .brand-ic{width:84px;height:84px;border-radius:24px}
.brand.lg .brand-ic svg{width:46px;height:46px}
.btn.google{background:var(--surface);border-color:var(--line);color:var(--ink);font-weight:600}
.btn.google svg{width:20px;height:20px}
.tagline{font-family:var(--f-display);color:var(--accent);font-size:1.2rem;font-weight:500}
.vf{position:relative}
.vf>.c{position:absolute;width:16px;height:16px;border:3px solid var(--accent);pointer-events:none}
.vf>.c.tl{left:-1px;top:-1px;border-right:0;border-bottom:0;border-top-left-radius:6px}
.vf>.c.tr{right:-1px;top:-1px;border-left:0;border-bottom:0;border-top-right-radius:6px}
.vf>.c.bl{left:-1px;bottom:-1px;border-right:0;border-top:0;border-bottom-left-radius:6px}
.vf>.c.br{right:-1px;bottom:-1px;border-left:0;border-top:0;border-bottom-right-radius:6px}

/* surfaces */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px}
.note{background:var(--surface-2);border-radius:12px;padding:12px 14px;font-size:.9rem;display:flex;gap:10px;align-items:flex-start}
.note svg{flex:none;width:20px;height:20px;margin-top:1px;color:var(--sea)}
.note.warn{background:var(--warn-soft)} .note.warn svg{color:var(--warn)}

/* buttons */
.btn{min-height:48px;border-radius:12px;border:1px solid var(--line);background:var(--surface);padding:0 18px;font-weight:650;display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.btn.dark{background:var(--ink);border-color:var(--ink);color:var(--bg)}
.btn.danger{color:var(--bad);border-color:var(--bad-soft)}
.btn.ghost{background:transparent;border-color:transparent;color:var(--muted)}
.btn.block{width:100%}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.sm{min-height:38px;padding:0 12px;font-size:.88rem;border-radius:10px}
.linkbtn{background:none;border:0;padding:6px 0;color:var(--sea);font-weight:600;text-decoration:underline;text-underline-offset:3px}

/* forms */
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-weight:600;font-size:.92rem}
.input{min-height:48px;border-radius:12px;border:1px solid var(--line);background:var(--surface);padding:10px 14px;width:100%}
textarea.input{min-height:90px;resize:vertical}
.err{color:var(--bad);font-size:.86rem;font-weight:600}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{min-height:38px;padding:0 14px;border-radius:19px;border:1px solid var(--line);background:var(--surface);font-weight:600;font-size:.88rem}
.chip[aria-pressed="true"]{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.seg{display:grid;grid-template-columns:1fr 1fr;background:var(--surface-2);border-radius:12px;padding:4px;gap:4px}
.seg button{min-height:40px;border:0;border-radius:9px;background:transparent;font-weight:650;color:var(--muted)}
.seg button[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px rgb(0 0 0 / .12)}

/* switch */
.switch{position:relative;width:56px;height:32px;border-radius:16px;border:0;background:var(--line);flex:none;transition:background .2s}
.switch::after{content:"";position:absolute;top:4px;left:4px;width:24px;height:24px;border-radius:50%;background:var(--surface);box-shadow:0 1px 3px rgb(0 0 0 / .25);transition:transform .2s}
.switch[aria-checked="true"]{background:var(--ok)}
.switch[aria-checked="true"]::after{transform:translateX(24px)}

/* availability */
.avail{display:flex;flex-direction:column;gap:14px}
.avail.on{border-color:var(--ok);box-shadow:inset 0 0 0 1px var(--ok)}
.pulse{width:10px;height:10px;border-radius:50%;background:var(--muted);flex:none}
.on .pulse{background:var(--ok);box-shadow:0 0 0 0 var(--ok);animation:pulse 2s infinite}
@keyframes pulse{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--ok) 60%,transparent)}70%{box-shadow:0 0 0 10px transparent}100%{box-shadow:0 0 0 0 transparent}}

/* avatar */
.av{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;font-weight:700;color:#fff;flex:none;font-size:.95rem;letter-spacing:.02em}
.av.lg{width:88px;height:88px;font-size:1.8rem}
.av.sm{width:32px;height:32px;font-size:.75rem}

/* map */
.map{position:relative;aspect-ratio:1/1;max-width:100%;border-radius:var(--r);overflow:hidden;background:var(--map-land);border:1px solid var(--line)}
.map svg.base{position:absolute;inset:0;width:100%;height:100%}
.m-street{stroke:var(--map-street);fill:none;stroke-linecap:round}
.m-park{fill:var(--map-park)} .m-sea{fill:var(--map-sea)}
.m-ring{fill:none;stroke:var(--map-ring);stroke-width:.4;stroke-dasharray:1.4 1.2}
.m-text{fill:var(--muted);font:600 2.6px var(--f-body)}
.zone{position:absolute;transform:translate(-50%,-50%);border:0;background:none;padding:0;display:flex;flex-direction:column;align-items:center;gap:3px}
.zone .halo{position:absolute;left:50%;top:22px;width:64px;height:64px;transform:translate(-50%,-50%);border-radius:50%;background:color-mix(in srgb,var(--accent) 28%,transparent);filter:blur(4px)}
.zone .av{position:relative;width:38px;height:38px;font-size:.8rem;border:3px solid var(--surface)}
.zone .tag{position:relative;background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:1px 7px;font-size:.72rem;font-weight:650;white-space:nowrap;max-width:110px;overflow:hidden;text-overflow:ellipsis}
.me-dot{position:absolute;left:50%;top:50%;width:18px;height:18px;transform:translate(-50%,-50%);border-radius:50%;background:var(--sea);border:3px solid var(--surface);box-shadow:0 0 0 6px color-mix(in srgb,var(--sea) 25%,transparent)}
.map-legend{position:absolute;left:10px;bottom:10px;right:10px;display:flex;justify-content:space-between;gap:8px;font-size:.72rem}
.map-legend span{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:3px 8px}

/* list items */
.person{display:flex;gap:12px;align-items:center;padding:14px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);width:100%;text-align:left}
.stars{color:var(--accent);letter-spacing:1px;font-size:.9rem}
.pill{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:3px 10px;font-size:.76rem;font-weight:700;white-space:nowrap}
.pill::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.p-wait{background:var(--warn-soft);color:var(--warn)}
.p-go{background:var(--accent-soft);color:var(--ink)}
.p-ok{background:var(--ok-soft);color:var(--ok)}
.p-bad{background:var(--bad-soft);color:var(--bad)}
.p-off{background:var(--surface-2);color:var(--muted)}

/* session timeline */
.steps{display:grid;grid-template-columns:repeat(5,1fr);gap:4px}
.steps div{height:6px;border-radius:3px;background:var(--line)}
.steps div.done{background:var(--ok)}
.steps div.now{background:var(--accent)}
.steps-l{display:grid;grid-template-columns:repeat(5,1fr);gap:4px;font-size:.66rem;color:var(--muted);font-weight:600}
.kv{display:grid;grid-template-columns:auto 1fr;gap:8px 14px;font-size:.95rem}
.kv dt{color:var(--muted)} .kv dd{margin:0;font-weight:600;min-width:0;overflow-wrap:anywhere}

/* shot counter */
.counter{display:flex;gap:8px;flex-wrap:wrap}
.counter button{width:44px;height:44px;border-radius:10px;border:2px dashed var(--line);background:var(--surface);font-family:var(--f-mono);font-weight:500}
.counter button.shot{border-style:solid;border-color:var(--accent);background:var(--accent-soft)}

/* chat */
.chat{display:flex;flex-direction:column;gap:8px}
.msg{max-width:82%;padding:9px 13px;border-radius:16px;font-size:.95rem;overflow-wrap:anywhere}
.msg.them{background:var(--surface);border:1px solid var(--line);align-self:flex-start;border-bottom-left-radius:4px}
.msg.mine{background:var(--ink);color:var(--bg);align-self:flex-end;border-bottom-right-radius:4px}
.msg.sys{align-self:center;background:transparent;color:var(--muted);font-size:.8rem;text-align:center;padding:2px 8px}
.msg time{display:block;font-size:.68rem;opacity:.65;margin-top:2px;font-family:var(--f-mono)}
.composer{display:flex;gap:8px}
.composer .input{min-height:46px}

/* stepper */
.fmts{display:flex;flex-direction:column;gap:10px}
.fmt{display:flex;align-items:center;gap:14px;padding:14px;border-radius:var(--r);border:2px solid var(--line);background:var(--surface);text-align:left;width:100%}
.fmt .fi{width:46px;height:46px;border-radius:12px;background:var(--surface-2);display:grid;place-items:center;font-family:var(--f-display);font-size:1.4rem;font-weight:700;flex:none}
.fmt b{font-family:var(--f-display);font-size:1.1rem;font-weight:600}
.fmt[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
.fmt[aria-pressed="true"] .fi{background:var(--accent);color:#fff}
.timer{font-family:var(--f-display);font-size:2.6rem;font-weight:700;font-variant-numeric:tabular-nums;text-align:center}
.stepper{display:flex;align-items:center;gap:14px}
.stepper button{width:48px;height:48px;border-radius:12px;border:1px solid var(--line);background:var(--surface);font-size:1.4rem;font-weight:600}
.stepper output{font-family:var(--f-display);font-size:2.2rem;font-weight:800;min-width:2ch;text-align:center;font-variant-numeric:tabular-nums}

/* bottom nav */
.nav{position:fixed;left:0;right:0;bottom:0;z-index:8;background:var(--surface);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom,0px)}
.nav-in{max-width:480px;margin:0 auto;display:grid;grid-template-columns:repeat(3,1fr)}
.nav button{min-height:62px;border:0;background:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:.74rem;font-weight:650;color:var(--muted);position:relative}
.nav button svg{width:24px;height:24px}
.nav button[aria-current="page"]{color:var(--ink)}
.nav button[aria-current="page"] svg{color:var(--accent)}
.nav .dot{top:8px;right:calc(50% - 22px)}

/* sheet / modal */
.scrim{position:fixed;inset:0;background:rgb(8 12 16 / .5);z-index:20;display:flex;align-items:flex-end;justify-content:center}
.sheet{background:var(--surface);width:100%;max-width:480px;border-radius:20px 20px 0 0;padding:20px 16px calc(20px + env(safe-area-inset-bottom,0px));max-height:88%;overflow:auto;display:flex;flex-direction:column;gap:14px}
.sheet .grab{width:40px;height:5px;border-radius:3px;background:var(--line);align-self:center}
.rate{display:flex;gap:6px}
.rate button{width:48px;height:48px;border-radius:12px;border:1px solid var(--line);background:var(--surface);font-size:1.5rem;color:var(--line)}
.rate button.on{color:var(--accent);border-color:var(--accent)}

/* toast */
.toast{position:fixed;left:50%;bottom:calc(84px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:30;background:var(--ink);color:var(--bg);padding:11px 16px;border-radius:12px;font-weight:600;font-size:.9rem;max-width:calc(100% - 32px);box-shadow:0 6px 20px rgb(0 0 0 / .25)}

/* auth */
.hero{padding-block:36px 8px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:16px}
.hero h1{font-size:2.6rem}
.hero h1 em{font-style:normal;color:var(--accent)}
.how{width:100%;text-align:left;display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.how div{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px;font-size:.82rem;display:flex;flex-direction:column;gap:6px}
.how b{font-family:var(--f-mono);color:var(--sea);font-weight:500}
.demo-ribbon{font-size:.75rem;text-align:center;color:var(--muted);padding-block:10px}
.notif{display:flex;gap:12px;padding:14px;border-bottom:1px solid var(--line);background:none;border-left:0;border-right:0;border-top:0;width:100%;text-align:left}
.notif.unread{background:var(--accent-soft);border-radius:10px;border-bottom-color:transparent}
.hr{height:1px;background:var(--line)}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.langsel{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:0 4px 0 10px;min-height:40px;color:var(--muted)}
.langsel svg{width:18px;height:18px;flex:none}
.langsel select{border:0;background:transparent;color:var(--ink);font-weight:600;min-height:38px;padding-right:4px;cursor:pointer}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* mappa vera */
.mapbox{position:relative;aspect-ratio:1/1;max-width:100%;border-radius:var(--r);overflow:hidden;border:1px solid var(--line);background:var(--map-land)}
.mapbox .maplibregl-map{position:absolute;inset:0}
.mk{border:0;background:none;padding:0;display:flex;flex-direction:column;align-items:center;gap:2px;cursor:pointer}
.mk .av{width:36px;height:36px;font-size:.78rem;border:3px solid var(--surface);box-shadow:0 2px 6px rgb(0 0 0 / .3)}
.mk .tag{background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:8px;padding:0 6px;font-size:.7rem;font-weight:650;white-space:nowrap}
.mk-me{width:18px;height:18px;border-radius:50%;background:var(--sea);border:3px solid #fff;box-shadow:0 0 0 6px color-mix(in srgb,var(--sea) 30%,transparent)}
.center{display:grid;place-items:center;min-height:60vh;text-align:center;gap:12px}
.spin{width:28px;height:28px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--accent);animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
#gbtn{min-height:44px;display:flex;justify-content:center}
.proposal{border:2px solid var(--accent);background:var(--accent-soft)}

/* avviso in tempo reale */
.banner{position:fixed;left:50%;top:calc(10px + env(safe-area-inset-top,0px));transform:translateX(-50%);z-index:40;width:min(460px,calc(100% - 24px));display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:16px;border:1px solid var(--line);background:var(--surface);color:var(--ink);box-shadow:0 10px 30px rgb(0 0 0 / .25);text-align:left;font:inherit;cursor:pointer;animation:drop .3s ease-out}
.banner .brand-ic{width:34px;height:34px;border-radius:10px}.banner .brand-ic svg{width:20px;height:20px}
.banner b{color:var(--accent);font-size:.9rem;white-space:nowrap}
@keyframes drop{from{transform:translate(-50%,-120%)}to{transform:translate(-50%,0)}}
/* donazioni */
.don-ic{font-size:2.2rem;align-self:center}
.don-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.don-grid .btn{padding:0 6px;font-family:var(--f-display);font-weight:700}
.don-grid .btn[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
@media (max-width:380px){.don-grid{grid-template-columns:repeat(2,1fr)}}
