:root {
  --red: #c8102e; --green: #146b3a; --ink: #1b1d21; --muted: #6b7078;
  --bg: #ffffff; --line: #e6e7ea; --stale: #9aa0a6; --blue: #1a73e8;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: var(--font); color: var(--ink); background: var(--bg); }
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------- Map page ---------- */
.app { display: flex; flex-direction: column; height: 100dvh; }
header.top {
  background: var(--red); color: #fff; padding: 10px 14px;
  display: flex; align-items: center; gap: 12px;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.07) 0 10px, transparent 10px 20px);
}
header.top .t { flex: 1; min-width: 0; }
header.top h1 { margin: 0; font-size: 18px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header.top .sub { font-size: 13px; opacity: .92; margin-top: 2px; }
.donate { background: #fff; color: var(--red); border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 700; text-decoration: none; font-size: 14px; white-space: nowrap; }
.notice { background: #fff4c2; color: #5c4600; padding: 8px 14px; font-size: 14px; font-weight: 600; border-bottom: 1px solid #f0dd8a; }
.banner { background: #fde8e8; color: #7a1010; padding: 8px 14px; font-size: 13px; }

.body { flex: 1; display: flex; min-height: 0; position: relative; }
.mapwrap { flex: 1; min-height: 0; position: relative; display: flex; }
#map { flex: 1; min-height: 0; }
aside.panel { width: 320px; border-left: 1px solid var(--line); display: flex; flex-direction: column; background: #fff; }
.panel .stats { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.panel .stats b { display: block; color: var(--ink); font-size: 16px; }
.panel .list { overflow-y: auto; flex: 1; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.row:hover { background: #fafafa; }
.row .name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }
.row .st { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.row .st.live { color: var(--green); }
.num { width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); flex: none; }
.num.stale { background: var(--stale); }
.num.off { background: #fff; color: var(--muted); border: 2px solid var(--line); box-shadow: none; }
.fab { position: absolute; right: 12px; bottom: 20px; z-index: 500; background: #fff; border: 0; border-radius: 999px;
  padding: 11px 16px; font-weight: 700; box-shadow: 0 2px 10px rgba(0,0,0,.25); display: flex; align-items: center; gap: 8px; }
.fab .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px rgba(26,115,232,.25); }
.fab.second { bottom: 72px; }
.me { width: 16px; height: 16px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(26,115,232,.25); }
.pin { font-size: 11px; font-weight: 800; color: #fff; padding: 3px 7px; border-radius: 6px; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.pin.start { background: var(--green); } .pin.end { background: var(--ink); }
.leaflet-div-icon { background: none; border: 0; }

@media (max-width: 760px) {
  .body { flex-direction: column; }
  aside.panel { width: auto; border-left: 0; border-top: 1px solid var(--line); height: 38dvh; }
  aside.panel.collapsed { height: auto; }
  aside.panel.collapsed .list { display: none; }
}
.toggle { display: none; }
@media (max-width: 760px) { .toggle { display: block; background: none; border: 0; color: var(--blue); font-weight: 600; font-size: 13px; padding: 0; text-align: left; grid-column: 1 / -1; } }

/* ---------- Tracker / admin pages ---------- */
.card { max-width: 460px; margin: 0 auto; padding: 22px 18px 40px; }
.card h1 { font-size: 22px; margin: 6px 0 4px; }
.card p { color: var(--muted); line-height: 1.45; }
label { font-weight: 600; font-size: 14px; display: block; margin: 18px 0 6px; }
input[type=text], textarea { width: 100%; font: inherit; font-size: 18px; padding: 12px; border: 2px solid var(--line); border-radius: 10px; }
textarea { font-size: 15px; min-height: 70px; }
input:focus, textarea:focus { outline: none; border-color: var(--blue); }
.big { width: 100%; border: 0; border-radius: 12px; padding: 16px; font-size: 18px; font-weight: 700; color: #fff; background: var(--green); margin-top: 16px; }
.big.stop { background: #fff; color: var(--red); border: 2px solid var(--red); }
.big:disabled { opacity: .5; }
.err { color: var(--red); font-weight: 600; margin-top: 10px; }
.status { border-radius: 16px; padding: 22px 18px; text-align: center; background: #eef7f1; border: 2px solid #bfe0cb; margin-top: 14px; }
.status.warn { background: #fff4e5; border-color: #ffd59a; }
.status.bad { background: #fde8e8; border-color: #f5b5b5; }
.status .huge { font-size: 26px; font-weight: 800; }
.status .float { font-size: 18px; font-weight: 700; margin-top: 6px; }
.status .meta { color: var(--muted); font-size: 14px; margin-top: 8px; }
.tips { background: #f5f6f7; border-radius: 12px; padding: 12px 16px; margin-top: 18px; font-size: 14px; line-height: 1.6; }
.tips .h { display: block; margin-bottom: 4px; font-weight: 700; }
.pulse { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--green); margin-right: 8px; animation: p 1.6s infinite; vertical-align: middle; }
@keyframes p { 0% { box-shadow: 0 0 0 0 rgba(20,107,58,.6); } 100% { box-shadow: 0 0 0 14px rgba(20,107,58,0); } }

.admin { display: flex; height: 100dvh; }
.admin .side { width: 340px; padding: 16px; overflow-y: auto; border-right: 1px solid var(--line); }
.admin #map { flex: 1; }
.admin .btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.admin .btns button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 12px; font-weight: 600; }
.admin .btns button.primary { background: var(--green); color: #fff; border-color: var(--green); }
.admin small { color: var(--muted); display: block; margin-top: 6px; line-height: 1.4; }
.ok { color: var(--green); font-weight: 600; margin-top: 8px; }
@media (max-width: 760px) { .admin { flex-direction: column; } .admin .side { width: auto; max-height: 45dvh; border-right: 0; border-bottom: 1px solid var(--line); } }

/* ---------- Santa additions ---------- */
.fab.third { bottom: 124px; }
@media (max-width: 760px) {
}
.stats .wide { grid-column: 1 / -1; }
#sSanta.live { color: var(--green); } #sSanta.stale { color: #b26a00; }
.info { padding: 12px 14px; font-size: 13px; line-height: 1.45; background: #f3faf5; border-bottom: 1px solid var(--line); }
.info:empty { display: none; }
.sect { padding: 10px 14px 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.row .ic { width: 28px; text-align: center; font-size: 18px; flex: none; }
.row.done .name { color: var(--muted); font-weight: 500; }
.row.done .ic { color: var(--green); font-weight: 800; }
.row.muted { color: var(--muted); font-size: 14px; }
.stop { display: inline-flex; align-items: center; gap: 4px; background: #fff; color: var(--red); border: 2px solid var(--red);
  border-radius: 999px; padding: 2px 9px 2px 4px; font-size: 12px; font-weight: 800; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.santa { width: 44px; height: 44px; border-radius: 50%; background: #fff; border: 3px solid var(--red); font-size: 26px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.santa.live { animation: sp 1.8s infinite; }
.santa.stale { border-color: var(--stale); filter: grayscale(.6); }
@keyframes sp { 0% { box-shadow: 0 0 0 0 rgba(200,16,46,.55); } 100% { box-shadow: 0 0 0 18px rgba(200,16,46,0); } }
.arrow { color: #fff; font-size: 9px; line-height: 12px; text-align: center; width: 12px; height: 12px; }

/* ---------- FALALA branding ---------- */
:root { --f1: #1e6b45; --f2: #e2b13c; --f3: #4f7d9c; --f4: #cc2b2b; --f5: #9fb6cc; --f6: #b5607f; }
.brand { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; flex: none; }
.falala { font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif; font-weight: 900; font-size: 30px; letter-spacing: .02em; display: flex; }
.falala span { -webkit-text-stroke: 1px rgba(0,0,0,.08); }
.falala .c1 { color: var(--f1); } .falala .c2 { color: var(--f2); } .falala .c3 { color: var(--f3); }
.falala .c4 { color: var(--f4); } .falala .c5 { color: var(--f5); } .falala .c6 { color: var(--f6); }
.brand .lw { font-size: 10.5px; font-weight: 800; letter-spacing: .32em; color: var(--f1); margin-top: 2px; padding-left: 2px; }
.brand.sm .falala { font-size: 22px; } .brand.sm .lw { font-size: 8px; }
.stripe { height: 5px; background: linear-gradient(90deg, var(--f1) 0 16.6%, var(--f2) 0 33.3%, var(--f3) 0 50%, var(--f4) 0 66.6%, var(--f5) 0 83.3%, var(--f6) 0); }
header.brandbar { background: #fff; color: var(--ink); padding: 10px 14px; display: flex; align-items: center; gap: 14px; }
header.brandbar .t { flex: 1; min-width: 0; }
header.brandbar h1 { margin: 0; font-size: 19px; color: var(--red); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header.brandbar .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
header.brandbar .donate { background: var(--red); color: #fff; }
.benefit { font-size: 12px; color: var(--muted); }
.benefit b { color: var(--f3); }
.chip { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .05em; padding: 3px 8px; border-radius: 999px; background: var(--f1); color: #fff; text-transform: uppercase; }
.chip.lead { background: var(--red); }
@media (max-width: 760px) { header.brandbar h1 { font-size: 16px; } .falala { font-size: 24px; } }

/* ---------- pace ---------- */
.pace { display: inline-block; font-weight: 800; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; }
.pace.ok { background: #e3f3e8; color: var(--green); } .pace.ahead { background: #e3f3e8; color: var(--green); } .pace.behind { background: #fde8e8; color: #9b1c1c; }
