/* BTD Turf. Field UI: dark chrome so the map and the colored circles carry the
   color, big tap targets for one-handed use on a sidewalk.
   Tokens follow the BTD brand (cyan #00D4FF, sand #E8CA9B, dark #0F0F0F). */
:root {
  --bg: #0d0f10;
  --panel: #15181a;
  --panel-2: #1d2124;
  --panel-3: #262b2f;
  --line: rgba(255, 255, 255, 0.09);
  --fg: #f2f4f5;
  --muted: #98a2a8;
  --cyan: #00d4ff;
  --sand: #e8ca9b;
  --warn: #ffb020;
  --danger: #e5484d;
  --ok: #22c55e;
  --head: 'Syne', 'DM Sans', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --nav-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--cyan); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--head); letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.warn { color: var(--warn); }
.eyebrow { font: 700 11px/1 var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--sand); }

/* ---------- layout ---------- */
#app { position: fixed; inset: 0; display: grid; grid-template-rows: 1fr auto; }
#views { position: relative; overflow: hidden; }
.view { position: absolute; inset: 0; }
.view.scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-t) + 14px) max(16px, var(--safe-r)) 28px max(16px, var(--safe-l));
}
.tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: #0a0b0c;
  border-top: 1px solid var(--line);
  z-index: 30;
}
.tabs button {
  background: none; border: 0; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 500;
}
.tabs svg { width: 23px; height: 23px; }
.tabs button.on { color: var(--cyan); }

/* ---------- map ---------- */
/* z-index 0 gives the map its own stacking context, so Leaflet's panes (z 400+) stay under the overlays */
#map { position: absolute; inset: 0; z-index: 0; background: #d9dcd6; }
.dark-map #map { background: #1b1e20; }
.dark-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.6); }
.leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, 0.75) !important; }
.map-top {
  position: absolute; z-index: 20;
  top: calc(var(--safe-t) + 10px);
  left: max(10px, var(--safe-l)); right: max(10px, var(--safe-r));
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.map-top > * { pointer-events: auto; }
.searchbar {
  display: flex; align-items: center; gap: 8px;
  background: rgba(13, 15, 16, 0.92);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px 6px 6px 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.searchbar input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 16px; padding: 6px 0; }
.pill-btn { background: var(--panel-3); border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 700; font-size: 13px; }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.sync-dot.ok { background: var(--ok); }
.sync-dot.pending { background: var(--warn); }
.sync-dot.off { background: var(--danger); }
.search-results {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.sr { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; padding: 10px 14px; background: none; border: 0; border-bottom: 1px solid var(--line); }
.sr:last-child { border-bottom: 0; }
.session-bar, .here {
  display: flex; align-items: center; gap: 10px;
  background: rgba(13, 15, 16, 0.94);
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 14px; padding: 8px 8px 8px 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.sb-main, .here-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sb-main b, .here-main b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-main span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sb-btn { background: var(--panel-3); border: 0; border-radius: 10px; padding: 10px 12px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.sb-btn.primary { background: var(--cyan); color: #04161c; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.25); flex: none; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(255, 59, 48, 0.06); } }
.here {
  position: absolute; z-index: 20;
  left: max(10px, var(--safe-l)); right: max(10px, var(--safe-r));
  bottom: 12px;
  border-color: rgba(232, 202, 155, 0.45);
}
.fab-col {
  position: absolute; z-index: 20; right: max(10px, var(--safe-r)); bottom: 84px;
  display: flex; flex-direction: column; gap: 10px;
}
.fab {
  width: 50px; min-height: 50px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(13, 15, 16, 0.92); color: var(--fg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); font-size: 10px; font-weight: 700;
}
#btn-locate { color: #4aa3ff; }
.turf-label {
  background: rgba(13, 15, 16, 0.82) !important; color: var(--cyan) !important;
  border: 0 !important; box-shadow: none !important; border-radius: 6px !important;
  font: 700 11px var(--head) !important; padding: 3px 7px !important; white-space: nowrap;
}
.turf-label::before { display: none; }

/* ---------- sheet ---------- */
.sheet {
  position: fixed; z-index: 40;
  left: 0; right: 0;
  bottom: calc(var(--nav-h) + var(--safe-b));
  max-height: 80%;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  transform: translateY(105%);
  transition: transform 0.22s ease;
  display: flex; flex-direction: column;
}
.sheet.open { transform: translateY(0); }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--panel-3); margin: 8px auto 2px; flex: none; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px max(16px, var(--safe-r)) 22px max(16px, var(--safe-l)); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: var(--bg); }
.modal-body {
  position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-t) + 16px) max(18px, var(--safe-r)) calc(var(--safe-b) + 28px) max(18px, var(--safe-l));
}
.modal-x { position: absolute; top: calc(var(--safe-t) + 10px); right: max(12px, var(--safe-r)); }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 80;
  left: max(12px, var(--safe-l)); right: max(12px, var(--safe-r));
  bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  background: #f2f4f5; color: #0d0f10;
  border-radius: 14px; padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  font-weight: 500;
}
.toast-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.toast .chip { background: #0d0f10; color: #f2f4f5; border-color: #0d0f10; }

/* ---------- shared controls ---------- */
.icon-btn { background: var(--panel-3); border: 0; width: 38px; height: 38px; border-radius: 12px; font-size: 15px; flex: none; }
.btn {
  background: var(--panel-3); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; font-weight: 700; font-size: 14px;
}
.btn.primary { background: var(--cyan); color: #04161c; border-color: transparent; }
.btn.danger { color: #ff8a8d; }
.btn.go {
  width: 100%; background: var(--cyan); color: #04161c; border: 0;
  font: 800 19px var(--head); padding: 18px; border-radius: 16px; margin-top: 18px;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 12px; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.chip.on { background: var(--cyan); color: #04161c; border-color: transparent; }
.chip.danger { color: #ff8a8d; }
.chip:disabled { opacity: 0.35; }
.link-btn { background: none; border: 0; color: var(--cyan); padding: 0; font-size: 13px; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 700; }
.pill-line { border: 1px solid var(--sand); color: var(--sand); }
.pill-ghost { background: var(--panel-3); color: var(--muted); }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; }
.seg { display: flex; background: var(--panel-2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg.small { max-width: 260px; margin-bottom: 10px; }
.seg-btn { flex: 1; background: none; border: 0; border-radius: 9px; padding: 9px 6px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg-btn.on { background: var(--panel-3); color: var(--fg); }
.bar { height: 6px; background: var(--panel-3); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--cyan); border-radius: 3px; }
input:not([type=checkbox]):not([type=search]), select, textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px; font-size: 16px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); }
textarea { resize: vertical; }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--cyan); flex: none; }
input[type=date] { width: auto; min-width: 150px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.field.inline input[type=number] { width: 96px; text-align: right; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two .field { margin: 6px 0; }
.form { max-width: 560px; margin: 0 auto; }
.form h2 { font-size: 24px; margin: 4px 0 12px; padding-right: 44px; }
.empty { color: var(--muted); padding: 28px 4px; text-align: center; }

/* ---------- lead sheet ---------- */
.ls-head { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0 4px; }
.ls-head-main { flex: 1; min-width: 0; }
.ls-head h2 { font-size: 22px; line-height: 1.15; }
.ls-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.ls-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ls { padding: 12px 0; border-top: 1px solid var(--line); }
.ls:first-of-type { border-top: 0; }
.ls-title { font: 700 11px var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 9px; }
.chip-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 10px; }
.status-chip {
  display: flex; align-items: center; gap: 8px; text-align: left;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px;
  padding: 9px 10px; font-size: 13.5px; font-weight: 500;
}
.status-chip .dot { background: var(--c); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25); }
.status-chip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, var(--panel-2)); font-weight: 700; }
.log-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.log-btn {
  flex: none; border: 0; border-left: 4px solid var(--c); background: var(--panel-2);
  border-radius: 10px; padding: 9px 11px; font-size: 13px; font-weight: 700;
}
.brief { display: flex; flex-direction: column; gap: 6px; }
.brief-line { font-size: 14px; padding-left: 12px; border-left: 3px solid var(--panel-3); }
.brief-line.good { border-left-color: var(--sand); }
.brief-line.warn { border-left-color: var(--warn); color: var(--warn); }
.brief-line.hours.open { border-left-color: var(--ok); }
.brief-line.hours.closed { border-left-color: var(--danger); }
.brief-line.hook { color: var(--muted); font-size: 13px; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.action {
  display: flex; flex-direction: column; gap: 1px; text-decoration: none; color: var(--fg);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0;
}
.action b { font-size: 14px; }
.action span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.disclosure { background: none; border: 0; color: var(--fg); font-weight: 700; padding: 0; font-size: 14px; }
.script { padding-left: 20px; margin: 10px 0; }
.script li { margin-bottom: 10px; }
.script b { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sand); }
.script p { margin: 2px 0 0; }
.objections dt { font-weight: 700; margin-top: 10px; }
.objections dd { margin: 3px 0 0; color: #d6dbde; }
.linkbox { display: flex; flex-direction: column; gap: 3px; background: var(--panel-2); border-radius: 10px; padding: 9px 11px; margin-bottom: 8px; }
.linkbox code { font-family: var(--mono); font-size: 13px; word-break: break-all; color: var(--cyan); }
.qr svg { width: 220px; max-width: 100%; height: auto; background: #fff; border-radius: 10px; margin-top: 10px; display: block; }
.qr svg path { fill: #000; }
.notes { list-style: none; padding: 0; margin: 10px 0 0; }
.notes li { background: var(--panel-2); border-radius: 10px; padding: 9px 11px; margin-bottom: 6px; }
.notes p { margin: 3px 0 0; white-space: pre-wrap; }
.note-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.ls textarea { margin-bottom: 8px; }
.enrich { display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 6px 12px; margin: 0 0 10px; }
.enrich dt { color: var(--muted); font-size: 13px; }
.enrich dd { margin: 0; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.history { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.history li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.ls-foot { padding: 14px 0 4px; border-top: 1px solid var(--line); }

/* ---------- tracker (David's Vivint tally layout) ---------- */
.view.tracker {
  display: flex; flex-direction: column; gap: 8px;
  padding: calc(var(--safe-t) + 10px) max(6px, var(--safe-r)) 10px max(6px, var(--safe-l));
  background: #000;
}
.tr-top { display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.tr-actions { display: flex; gap: 8px; }
.round-btn {
  background: #1f2224; border: 0; border-radius: 999px; height: 46px; min-width: 46px; padding: 0 18px;
  font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 8px;
}
.round-btn.wide { flex: 1; justify-content: center; }
.round-btn.live { background: #2a1213; color: #ffd6d4; font-variant-numeric: tabular-nums; }
.segmented { display: flex; background: #1f2224; border-radius: 12px; padding: 3px; }
.segmented-btn { flex: 1; background: none; border: 0; border-radius: 9px; padding: 8px 4px; font-size: 14px; font-weight: 500; color: #d7dadc; }
.segmented-btn.on { background: #5b5f62; color: #fff; }
.segmented-btn:disabled { opacity: 0.35; }
.tr-rows { flex: 1; display: flex; flex-direction: column; gap: 5px; min-height: 0; }
.tr-row {
  flex: 1; min-height: 54px; display: flex; border-radius: 5px; overflow: hidden;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
  transition: filter 0.08s;
}
.tr-row:active { filter: brightness(1.18); }
.tr-label { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 7px 10px 2px; min-width: 0; }
.tr-label span { font-weight: 700; font-size: 18px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-minus { background: none; border: 0; padding: 4px 18px 12px 2px; align-self: flex-start; color: inherit; }
.chev { display: block; width: 11px; height: 11px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg); }
.tr-count {
  width: 42%; display: flex; align-items: center; justify-content: flex-end; padding: 0 14px;
  font: 500 clamp(34px, 9vw, 54px) var(--body); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; border-radius: 5px;
}
.tr-foot { display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 2px 6px; }
.tr-total { background: #1f2224; border-radius: 999px; padding: 9px 18px; font-size: 14px; color: #c9cdd0; font-variant-numeric: tabular-nums; }
.tr-week { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.tr-week-text { font-size: 12px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.tr-editor { flex: 1; overflow-y: auto; padding: 4px; }
.ed-row { background: var(--panel); border-radius: 12px; padding: 10px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; }
.swatch.on { border-color: #fff; }
.ed-btns { display: flex; gap: 6px; }

/* ---------- pre-session / debrief ---------- */
.pre { max-width: 620px; margin: 0 auto; }
.truth { padding: 26px 0 10px; }
.truth h1 { font-size: clamp(30px, 8vw, 44px); line-height: 1.02; margin: 12px 0 16px; font-weight: 800; }
.truth p { font-size: 17px; margin: 0 0 10px; color: #dde1e3; }
.truth .rotating { color: var(--cyan); font-weight: 700; font-size: 18px; margin-top: 16px; }
.why { margin: 16px 0; padding: 14px 16px; border-left: 4px solid var(--sand); background: var(--panel); border-radius: 0 12px 12px 0; }
.why p { margin: 6px 0 0; font-size: 17px; white-space: pre-wrap; }
.scoreboard, .stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.score, .stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.score b, .stat b { font: 700 24px var(--mono); font-variant-numeric: tabular-nums; }
.score span, .stat span { font-size: 12px; color: var(--muted); }
.pre-sec { border-top: 1px solid var(--line); padding: 16px 0 6px; }
.pre-sec h3 { font-size: 18px; margin-bottom: 6px; }
.first-doors { padding-left: 22px; margin: 10px 0 4px; }
.first-doors li { margin: 6px 0; }
.first-doors .dot { margin-right: 8px; vertical-align: -1px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist label { display: flex; gap: 12px; align-items: center; padding: 9px 0; font-size: 15px; }
details summary { cursor: pointer; font-weight: 700; margin: 8px 0; }
.deb-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 16px 0; }
.deb-cell { background: var(--panel); border-radius: 10px; border-top: 4px solid; padding: 8px; display: flex; flex-direction: column; min-width: 0; }
.deb-cell b { font: 700 22px var(--mono); }
.deb-cell span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deb-cell small { font-size: 11px; color: var(--sand); }
.fu-list { list-style: none; padding: 0; margin: 0; }
.fu-list li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

/* ---------- lists ---------- */
.view-head { margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.view-head h1 { font-size: 28px; font-weight: 800; }
.view-head input[type=search] { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font-size: 16px; outline: none; }
.chip-scroll { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.chip-scroll.wrap { flex-wrap: wrap; }
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line); padding: 11px 2px;
}
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-side { flex: none; font-variant-numeric: tabular-nums; }
.ordered { display: flex; align-items: center; gap: 8px; }
.ordered .num { width: 24px; flex: none; text-align: right; font: 500 12px var(--mono); color: var(--muted); }
.list-title { font: 700 12px var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 20px 0 6px; }
.cards { display: flex; flex-direction: column; gap: 10px; }
.turf-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.turf-main { background: none; border: 0; text-align: left; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.turf-main h2 { font-size: 19px; }
.turf-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.turf-meta b { color: var(--fg); font-family: var(--mono); }
.turf-meta .hot b { color: var(--warn); }
.pick-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.pick { text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.pick.on { border-color: var(--cyan); }
.legend { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.legend li { display: flex; gap: 10px; align-items: center; }
.ring { width: 16px; height: 16px; border-radius: 50%; border: 3px solid; background: #8a939b; flex: none; }
.ring.visited { border-color: #fff; background: radial-gradient(circle, #fff 30%, #8a939b 32%); }
.ring.dashed { border: 2px dashed #fff; background: rgba(138, 147, 155, 0.5); }

/* stats */
.wk-bars { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; height: 150px; padding-top: 10px; }
.wk-min { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--sand); margin-bottom: 34px; }
.wk { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.wk-col { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--panel); border-radius: 6px; overflow: hidden; }
.wk-col i { display: block; width: 100%; border-radius: 6px 6px 0 0; min-height: 2px; }
.wk-v { font: 500 12px var(--mono); }
.wk-l { font-size: 10px; color: var(--muted); white-space: nowrap; }
.funnel { display: flex; flex-direction: column; gap: 7px; }
.f-row { display: grid; grid-template-columns: 112px 1fr 40px 38px; gap: 8px; align-items: center; font-size: 13px; }
.f-row b { font-family: var(--mono); text-align: right; }
.f-bar { height: 10px; background: var(--panel); border-radius: 5px; overflow: hidden; }
.f-bar i { display: block; height: 100%; }
.niche { width: 100%; border-collapse: collapse; font-size: 13px; }
.niche th, .niche td { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.niche td:not(:first-child), .niche th:not(:first-child) { text-align: right; font-family: var(--mono); }
.settings .btn-row { margin: 14px 0; }

/* login */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 30%, #0f2a33, var(--bg) 60%); }
.login-card { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; }
.login-card img { align-self: center; border-radius: 16px; }
.login-card h1 { font-size: 30px; font-weight: 800; }
.login-card p { margin: 0; }

@media (min-width: 760px) {
  .sheet { left: auto; right: 12px; width: 430px; bottom: calc(var(--nav-h) + 12px); border-radius: 20px; border: 1px solid var(--line); max-height: 82%; }
  .chip-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .sheet { transition: none; }
  .live-dot { animation: none; }
}
