:root { --navy:#0b1b33; --navy2:#13294b; --brand-blue:#295378; --brand-blue-left:#224c72; --brand-blue-right:#396184; --accent:#2563eb; --ink:#0f172a; --muted:#64748b; --line:#e2e8f0; --top:168px; }
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { margin:0; height:100%; height:100dvh; overflow:hidden; background:#e5e7eb; color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif; }
button, input, select, textarea { font-family:inherit; font-size:16px; }
button { cursor:pointer; min-height:44px; }
#top { position:absolute; top:0; left:0; right:0; z-index:1000; color:#fff;
  background:linear-gradient(180deg,var(--brand-blue-left),var(--brand-blue));
  padding:calc(8px + env(safe-area-inset-top)) 12px 10px; box-shadow:0 2px 12px rgba(2,8,23,.35); }
.row1 { display:flex; align-items:center; gap:10px; }
.logo { width:36px; height:36px; border-radius:10px; overflow:hidden; flex:none; }
.logo img { width:100%; height:100%; display:block; }
.ttl { flex:1; min-width:0; }
.ttl h1 { font-size:16px; margin:0; font-weight:700; }
.area { display:flex; align-items:center; gap:4px; color:#cbd5e1; font-size:13px; font-weight:650; max-width:100%; }
.area select { max-width:100%; background:transparent; color:#e2e8f0; border:0; font-weight:650; }
#repBtn { display:flex; align-items:center; gap:7px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.14); color:#fff;
  border-radius:22px; padding:3px 12px 3px 3px; font-weight:650; max-width:46%; min-height:44px; }
.av { width:28px; height:28px; border-radius:14px; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:800; color:#fff; flex:none; }
#stats, #goals { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; margin-top:8px; }
#goals { grid-template-columns:repeat(3,minmax(0,1fr)); }
.stat, .gbar { background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.08); border-radius:10px; padding:6px 8px; min-width:0; }
.stat b { display:block; font-size:18px; font-variant-numeric:tabular-nums; }
.stat span, .gbar .gt { display:block; font-size:10px; letter-spacing:.04em; text-transform:uppercase; color:rgba(255,255,255,.78); font-weight:650; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.stat.win b, .gbar.done b { color:#4ade80; }
.tr { height:5px; background:rgba(255,255,255,.14); border-radius:3px; margin-top:4px; overflow:hidden; }
.tr i { display:block; height:100%; background:#60a5fa; }
#filters, #chips { display:flex; gap:6px; margin-top:8px; overflow:auto; }
.fsel { flex:1; min-width:0; position:relative; }
.fsel select, .panel input, .panel select, .panel textarea { width:100%; border:0; border-radius:10px; padding:10px 12px; min-height:44px; background:#fff; color:var(--ink); }
.chip { flex:none; border:0; border-radius:16px; padding:8px 12px; min-height:36px; background:rgba(255,255,255,.1); color:#e2e8f0; font-weight:650; }
#map { position:absolute; left:0; right:0; bottom:0; top:var(--top); background:#dbe4ee; }
.leaflet-container { font:inherit; background:#dbe4ee; }
.pin-canvas { position:absolute; left:0; top:0; pointer-events:none; }
.fabs { position:absolute; right:12px; bottom:calc(16px + env(safe-area-inset-bottom)); z-index:1100; display:flex; flex-direction:column; gap:10px; }
.fab { width:48px; height:48px; min-height:48px; border-radius:24px; border:0; background:#fff; box-shadow:0 4px 14px rgba(15,23,42,.2); font-size:18px; }
.fab.primary { width:56px; height:56px; min-height:56px; border-radius:28px; background:var(--accent); color:#fff; }
#sheet, .dlg .card, .panel { background:#fff; }
#sheet { position:absolute; left:0; right:0; bottom:0; z-index:2000; border-radius:20px 20px 0 0; max-height:86dvh;
  transform:translateY(110%); transition:transform .25s; display:flex; flex-direction:column; box-shadow:0 -8px 30px rgba(15,23,42,.22); }
#sheet.open { transform:none; }
#sBody { overflow:auto; padding:0 16px calc(16px + env(safe-area-inset-bottom)); }
.grab { width:38px; height:5px; background:#cbd5e1; border-radius:3px; margin:8px auto; }
.hdr { display:flex; gap:8px; align-items:flex-start; }
.hdr h2 { margin:0; font-size:20px; }
.sub { color:var(--muted); font-size:13px; margin:2px 0 0; }
.closeX { width:44px; height:44px; border:0; border-radius:22px; background:#f1f5f9; }
.badges { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.badge { font-size:12px; font-weight:700; padding:4px 9px; border-radius:20px; background:#f1f5f9; }
.plans { margin-top:10px; background:#f8fafc; border:1px solid var(--line); border-radius:12px; padding:10px 12px; }
.plans span { display:inline-block; margin:4px 6px 0 0; background:#fff; border:1px solid var(--line); border-radius:8px; padding:4px 8px; font-weight:650; }
#sPrimary { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; }
.pbtn { background:none; border:0; min-height:76px; padding:4px 0; display:flex; flex-direction:column; align-items:center; gap:4px; color:#334155; }
.pbtn i { width:48px; height:48px; border-radius:24px; display:flex; align-items:center; justify-content:center; color:#fff; font-style:normal; font-weight:800; }
.pbtn.on i { box-shadow:0 0 0 3px #fff, 0 0 0 6px var(--c); }
.pbtn small { font-size:11px; font-weight:700; text-align:center; }
.more { display:flex; gap:8px; overflow:auto; margin-top:8px; }
.more button { flex:none; }
#sNote { width:100%; min-height:72px; border:1.5px solid var(--line); border-radius:12px; padding:10px; background:#f8fafc; }
.lbl { font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); margin:14px 0 6px; }
#login { position:absolute; inset:0; z-index:5000; display:none; flex-direction:column; align-items:center; justify-content:center; justify-content:safe center;
  padding:calc(12px + env(safe-area-inset-top)) 0 calc(24px + env(safe-area-inset-bottom));
  background:linear-gradient(100deg,#244e73 0%,#224c72 16%,var(--brand-blue) 50%,#396184 84%,#355d81 100%); color:#fff; overflow:auto; }
#login.show { display:flex; }
.brand-banner-wrap { width:100%; display:flex; justify-content:center; }
.brand-banner { display:block; width:86%; max-width:520px; height:auto; margin:0 auto; object-fit:contain; object-position:center;
  -webkit-mask-image:linear-gradient(to right,transparent,#000 4px,#000 calc(100% - 4px),transparent),linear-gradient(to bottom,transparent,#000 6px,#000 calc(100% - 6px),transparent);
  -webkit-mask-composite:source-in;
  mask-image:linear-gradient(to right,transparent,#000 4px,#000 calc(100% - 4px),transparent),linear-gradient(to bottom,transparent,#000 6px,#000 calc(100% - 6px),transparent);
  mask-composite:intersect; }
.login-copy { width:min(100% - 32px, 400px); display:flex; flex-direction:column; align-items:center; text-align:center; margin-top:18px; }
#login h1 { margin:0; font-size:28px; font-weight:750; letter-spacing:-.02em; }
#login .lede { margin:6px 0 0; color:rgba(255,255,255,.9); font-size:15px; }
#login .card { width:100%; margin-top:18px; text-align:left; }
.card { background:#fff; color:var(--ink); border-radius:20px; padding:22px 18px; width:min(100%,380px); box-shadow:0 24px 60px rgba(0,0,0,.35); }
.card h2 { margin:0 0 4px; }
.google-btn { display:flex; align-items:center; justify-content:center; gap:12px; width:100%; margin-top:16px; min-height:44px;
  padding:10px 16px; background:#fff; color:#1f1f1f; border:1px solid #747775; border-radius:4px; font-weight:500; font-size:15px;
  text-decoration:none; box-shadow:0 1px 2px rgba(60,64,67,.18); }
.google-btn svg { flex:none; display:block; }
.google-btn:hover { background:#f8f9fa; }
.google-btn:focus-visible { outline:2px solid var(--brand-blue); outline-offset:2px; }
.go { width:100%; margin-top:14px; background:var(--accent); color:#fff; border:0; border-radius:12px; padding:14px; font-weight:750; min-height:48px; }
.link { background:none; border:0; color:var(--accent); font-weight:700; width:100%; }
.msg { min-height:18px; font-size:13px; margin-top:8px; }
.msg.err { color:#dc2626; font-weight:650; }
.foot { color:rgba(255,255,255,.88); font-size:12px; text-align:center; max-width:340px; margin-top:16px; }
.foot a { color:#fff; font-weight:700; }
#toast { position:absolute; left:50%; top:calc(var(--top) + 8px); transform:translateX(-50%); z-index:4000; background:#0f172a; color:#fff;
  padding:9px 14px; border-radius:20px; font-weight:650; display:none; max-width:90vw; }
#meMenu, #legend, .dlg { position:absolute; z-index:3500; }
#meMenu, #legend { right:10px; background:#fff; border-radius:14px; box-shadow:0 12px 34px rgba(15,23,42,.28); padding:12px; display:none; max-width:min(280px, calc(100vw - 24px)); }
#meMenu.open, #legend.open { display:block; }
#legend { max-height:70dvh; overflow:auto; }
#legend b { display:block; margin:8px 0 4px; font-size:12px; letter-spacing:.04em; text-transform:uppercase; color:#64748b; }
#legend .key { display:flex; align-items:center; gap:8px; font-size:13px; margin:3px 0; }
.swatch, .ring { width:14px; height:14px; border-radius:50%; display:inline-block; flex:none; box-sizing:border-box; }
.swatch { border:1px solid #e2e8f0; }
.ring { border:3px solid #e5e7eb; background:#fff; }
.dlg { inset:0; background:rgba(2,8,23,.38); display:none; align-items:flex-end; justify-content:center; }
.dlg.open { display:flex; }
.dlg .card { width:100%; max-width:560px; border-radius:20px 20px 0 0; max-height:90dvh; overflow:auto; padding-bottom:calc(16px + env(safe-area-inset-bottom)); }
.pick { width:100%; text-align:left; border:1.5px solid var(--line); background:#fff; border-radius:12px; padding:10px 12px; margin-top:8px; font-weight:750; }
.pick.on { border-color:var(--accent); background:#eff6ff; color:#1d4ed8; }
.rowbtns { display:flex; gap:8px; margin-top:12px; }
.rowbtns button { flex:1; border:0; border-radius:12px; font-weight:750; }
.ghost { background:#f1f5f9; }
.green { background:#16a34a; color:#fff; }
@media (min-width:800px) {
  #sheet, .dlg .card { left:auto; right:16px; width:min(440px, 100%); bottom:16px; border-radius:20px; }
  #stats { grid-template-columns:repeat(5,minmax(0,1fr)); }
}
.panel { min-height:100dvh; background:#f1f5f9; }
.panel header { background:linear-gradient(180deg,var(--brand-blue-left),var(--brand-blue)); color:#fff; padding:calc(12px + env(safe-area-inset-top)) 14px 12px; }
.tabs { display:flex; gap:4px; overflow:auto; margin-top:10px; }
.tabs button { flex:none; border:0; border-radius:9px; background:transparent; color:#cbd5e1; font-weight:700; }
.tabs button.on { background:#fff; color:#0f172a; }
.pane { padding:12px 12px calc(20px + env(safe-area-inset-bottom)); }
.box { background:#fff; border-radius:14px; padding:12px; margin-bottom:12px; }
.box h3 { margin:0 0 8px; font-size:15px; }
.person { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:12px; }
.person .who { flex:1; min-width:140px; }
.person-actions { display:flex; flex-wrap:wrap; gap:6px; }
.person-actions .ghost { padding:8px 12px; }
.warn { background:#dc2626; color:#fff; }
#lasso { position:absolute; inset:0; z-index:1500; display:none; touch-action:none; }
#lasso.on { display:block; }
