/* Glance: mobile-first. Dark = Exodus/Titan Ticker "Midnight"; light variant below. */
:root {
  /* Midnight, used until js/themes.js applies the user's theme. */
  --bg: #0d2238;
  --nav: #0a1c2e;
  --surface: #1b3046;
  --surface-2: #26394e;
  --border: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.68);
  --text-3: rgba(255, 255, 255, 0.45);
  --accent: #5AC8FA;
  --accent-muted: rgba(90, 200, 250, 0.18);
  --on-accent: #06243a;
  --live: #FF6961;
  --ok: #30D158;
  --warn: #FFB340;
  --danger: #FF6961;
  --precip: #4BA3FF;
  --wx-cloud: #C9D4E3;
  --skeleton: rgba(255, 255, 255, 0.07);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  --ticker-h: 0px;
  color-scheme: dark;
}
:root {
  --radius: 14px;
  --tabbar-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-size: 15px; line-height: 1.35; overscroll-behavior-y: contain; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.center { text-align: center; }
svg { flex-shrink: 0; }

/* ── boot / spinner ──────────────────────────────────────────── */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── shell ───────────────────────────────────────────────────── */
.shell { max-width: 760px; margin: 0 auto; min-height: 100dvh; }
header.top {
  position: sticky; top: var(--ticker-h); z-index: 20;
  display: flex; align-items: center; gap: 4px;
  /* The ticker (when shown) already covers the notch/status bar. */
  padding: calc(8px + max(0px, var(--safe-t) - var(--ticker-h))) 12px 8px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
header.top h1 { flex: 1; margin: 0; font-size: 26px; font-weight: 750; letter-spacing: -0.4px; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%;
  background: none; border: 0; color: var(--text-2); padding: 0;
}
.icon-btn:hover, .icon-btn:focus-visible { background: var(--surface); color: var(--text); }
.icon-btn:disabled { opacity: .3; pointer-events: none; }
.icon-btn svg { width: 22px; height: 22px; }
#refresh.spin svg { animation: spin .8s linear infinite; }
.me {
  position: relative; width: 34px; height: 34px; margin-left: 6px; border-radius: 50%; border: 0; padding: 0;
  background: var(--accent); color: var(--on-accent); font-weight: 700; display: grid; place-items: center;
}
.me img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.me .badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--live); color: #fff; font-size: 11px; font-style: normal; font-weight: 700; display: grid; place-items: center;
}

.panes { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 20px); }
.pane-body { padding: 4px 16px 0; }
.ptr {
  position: fixed; left: 50%; top: calc(var(--ticker-h) + var(--safe-t) + 50px); z-index: 25; width: 36px; height: 36px; border-radius: 50%;
  background: var(--nav); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--accent);
  transform: translate(-50%, 0); opacity: 0; pointer-events: none; transition: opacity .15s;
}
.ptr svg { width: 20px; height: 20px; }

/* bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center;
  padding: 0 8px var(--safe-b);
  background: color-mix(in srgb, var(--nav) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--border);
}
.tabbar.single { display: none; }
.tabbar button {
  flex: 1; max-width: 200px; height: var(--tabbar-h); background: none; border: 0; color: var(--text-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600;
}
.tabbar button svg { width: 25px; height: 25px; }
.tabbar button.on { color: var(--accent); }

/* ── chips ───────────────────────────────────────────────────── */
.chips {
  position: sticky; top: calc(var(--ticker-h) + 56px + max(0px, var(--safe-t) - var(--ticker-h))); z-index: 15;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 6px 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.chip svg { width: 15px; height: 15px; }
.chip.on { background: var(--text); color: var(--bg); border-color: transparent; }
.chip.add { color: var(--accent); padding: 0 11px; }

.daybar { display: flex; align-items: center; justify-content: center; gap: 4px; margin: -2px 0 2px; }
.day-label { background: none; border: 0; font-weight: 650; min-width: 120px; padding: 6px; color: var(--text); }

/* ── blocks & cards ──────────────────────────────────────────── */
.block { margin: 14px 0 22px; }
.block-title {
  display: flex; align-items: center; gap: 8px; margin: 0 2px 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--text-2);
}
.block-title .count { font-size: 12px; background: var(--surface-2); color: var(--text-2); padding: 1px 7px; border-radius: 9px; letter-spacing: 0; }
.block-title .count.alert { background: var(--live); color: #fff; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.empty { color: var(--text-3); margin: 8px 2px; font-size: 14px; }
.empty-state { text-align: center; padding: 48px 20px; display: grid; justify-items: center; gap: 12px; color: var(--text-2); }
.empty-state p { margin: 0; font-size: 16px; }

.skeleton { display: grid; gap: 10px; padding: 12px 0; }
.sk-card { height: 86px; border-radius: var(--radius); background: var(--skeleton); animation: pulse 1.2s ease-in-out infinite; }
.sk-card.tall { height: 190px; }
@keyframes pulse { 50% { opacity: .5; } }

.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin: 8px 0; background: var(--surface); }
.banner svg { width: 20px; height: 20px; margin-top: 1px; }
.banner.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); }
.banner.ok svg { color: var(--ok); }
.banner.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); }
.banner.warn svg { color: var(--warn); }

/* ── games ───────────────────────────────────────────────────── */
.games { display: grid; gap: 8px; }
.game {
  display: flex; align-items: stretch; gap: 10px; padding: 11px 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.game:active { background: var(--surface-2); }
.game.in { border-color: color-mix(in srgb, var(--live) 40%, var(--border)); }
.teams { flex: 1; min-width: 0; display: grid; gap: 7px; }
.tm { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tm .logo { width: 26px; height: 26px; object-fit: contain; }
.tm .rank { font-size: 11px; color: var(--text-3); font-weight: 700; }
.tm .nm { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm .rec { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.tm .poss { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); flex-shrink: 0; }
.tm .sc { margin-left: auto; font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.tm.lost .nm, .tm.lost .sc { color: var(--text-3); }
.tm.is-fav .nm { color: var(--accent); }
.gstat {
  width: 96px; flex-shrink: 0; border-left: 1px solid var(--border); padding-left: 10px;
  display: flex; flex-direction: column; justify-content: center; gap: 3px; font-size: 12px; color: var(--text-2);
}
.st { font-weight: 650; color: var(--text); font-size: 13px; }
.st.live { color: var(--live); display: flex; align-items: center; gap: 5px; }
.st.final { color: var(--text-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; }
.sit { color: var(--warn); font-weight: 600; }
.tv, .note { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-tag {
  align-self: flex-start; font-size: 10px; font-weight: 800; letter-spacing: .4px; padding: 1px 6px; border-radius: 5px;
  background: color-mix(in srgb, var(--lg) 55%, transparent); color: #fff;
}
.game.compact { align-items: center; padding: 10px 12px; gap: 10px; }
.game.compact .cline { flex: 1; font-variant-numeric: tabular-nums; }
.game.compact .lg-tag { align-self: center; }

/* ── news ────────────────────────────────────────────────────── */
.news-list { display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.story { display: flex; gap: 12px; padding: 13px 14px; align-items: flex-start; }
.story + .story { border-top: 1px solid var(--border); }
.story:active { background: var(--surface-2); }
.story-text { flex: 1; min-width: 0; display: grid; gap: 5px; }
.story-title { font-weight: 620; font-size: 16px; line-height: 1.3; }
.story-sum { color: var(--text-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.story-meta { color: var(--text-3); font-size: 12.5px; }
.thumb { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }

/* ── weather ─────────────────────────────────────────────────── */
.now { padding: 8px 4px 4px; }
.now-main { display: flex; align-items: center; justify-content: space-between; }
.now-temp { font-size: 84px; font-weight: 250; line-height: 1; letter-spacing: -3px; }
.now-desc { font-size: 20px; font-weight: 600; margin-top: 4px; }
.now-sub { color: var(--text-2); margin-top: 8px; }
.now-loc { color: var(--text-3); font-size: 13px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.now-loc svg, .chip svg { width: 14px; height: 14px; }
.hourly {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 10px 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.hourly::-webkit-scrollbar { display: none; }
.hour { flex: 0 0 56px; display: grid; justify-items: center; gap: 4px; font-size: 13px; }
.h-t { color: var(--text-2); font-weight: 600; }
.h-temp { font-weight: 700; font-size: 15px; }
.h-p { color: var(--precip); font-size: 11px; font-weight: 700; min-height: 14px; }
.daily { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 14px; }
.day { display: grid; grid-template-columns: 52px 60px 34px 1fr 34px; align-items: center; gap: 8px; height: 46px; }
.day + .day { border-top: 1px solid var(--border); }
.d-n { font-weight: 650; }
.d-i { display: flex; align-items: center; gap: 2px; }
.d-p { color: var(--precip); font-size: 11px; font-weight: 700; }
.d-lo { color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
.d-hi { font-weight: 700; font-variant-numeric: tabular-nums; }
.d-bar { position: relative; height: 5px; border-radius: 3px; background: var(--surface-2); }
.d-bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #5AC8FA, #FFC53D, #FF9F0A); }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 3px; }
.t-k { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); font-weight: 700; }
.t-v { font-size: 22px; font-weight: 650; }
.t-s { font-size: 12.5px; color: var(--text-2); }
.aqi { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.aqi-v { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; font-weight: 800; border: 4px solid var(--c); }
.alerts { display: grid; gap: 8px; margin: 6px 0 12px; }
.alert { border-radius: var(--radius); background: color-mix(in srgb, var(--warn) 18%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.alert.sev-severe, .alert.sev-extreme { background: color-mix(in srgb, var(--live) 18%, transparent); border-color: color-mix(in srgb, var(--live) 50%, transparent); }
.alert summary { list-style: none; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; cursor: pointer; }
.alert summary::-webkit-details-marker { display: none; }
.alert summary svg { width: 20px; height: 20px; color: var(--warn); margin-top: 1px; }
.alert.sev-severe summary svg, .alert.sev-extreme summary svg { color: var(--live); }
.alert summary span { display: grid; gap: 2px; }
.alert-body { padding: 0 14px 10px 44px; font-size: 14px; color: var(--text-2); }
.alert-body p { margin: 0 0 8px; }

/* ── buttons & forms ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 650;
  background: var(--surface-2); color: var(--text);
}
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 50%, transparent); color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 14px; }
.btn:disabled { opacity: .5; }
.link { background: none; border: 0; color: var(--accent); padding: 8px; font-weight: 600; }
label { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); }
label > input:not([type=checkbox]), label > select, label > textarea { display: block; margin-top: 6px; }
input:not([type=checkbox]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 16px; font-weight: 400; /* 16px stops iOS zoom */
}
textarea { resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.form-error { color: var(--danger); font-size: 14px; margin: 0; }
.seg { display: flex; background: var(--surface-2); border-radius: 11px; padding: 3px; gap: 3px; }
.seg button { flex: 1; min-height: 36px; border: 0; border-radius: 9px; background: none; color: var(--text-2); font-weight: 600; }
.seg button.on { background: var(--nav); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.card-form { display: grid; gap: 12px; }
.two { display: grid; gap: 12px; }
@media (min-width: 520px) { .two { grid-template-columns: 1fr 1fr; } }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }
.stack { display: grid; gap: 8px; margin-top: 14px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* switch */
.switch { position: relative; display: inline-block; width: 46px; height: 28px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); }

/* ── bottom sheet ────────────────────────────────────────────── */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 640px; max-height: 92dvh;
  display: flex; flex-direction: column; background: var(--nav); border-radius: 20px 20px 0 0; box-shadow: var(--shadow);
  transform: translateY(100%); transition: transform .22s cubic-bezier(.2,.8,.2,1);
}
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-grab { width: 38px; height: 5px; border-radius: 3px; background: var(--text-3); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; padding: 6px 10px 6px 20px; touch-action: none; }
.sheet-head h2 { flex: 1; margin: 0; font-size: 20px; }
.sheet-body { overflow-y: auto; padding: 4px 20px calc(24px + var(--safe-b)); overscroll-behavior: contain; }
@media (min-width: 700px) {
  .sheet { bottom: auto; top: 50%; border-radius: 20px; transform: translateY(-40%) scale(.97); opacity: 0; transition: transform .2s, opacity .2s; max-height: 86dvh; }
  .sheet-wrap.open .sheet { transform: translateY(-50%); opacity: 1; }
  .sheet-grab { display: none; }
}

/* settings rows */
.set-h { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); margin: 22px 0 6px; }
.set-h4 { font-size: 13px; margin: 14px 0 6px; color: var(--text-2); }
.set-list { display: grid; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 6px 0; }
.set-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; min-height: 52px; font-weight: 500; color: var(--text); }
.set-row + .set-row { border-top: 1px solid var(--border); }
.set-row.off .set-name { color: var(--text-3); }
.set-row select { width: auto; min-width: 150px; margin-left: auto; min-height: 38px; }
.set-row.toggle { justify-content: space-between; padding-right: 12px; }
.set-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.set-name svg { width: 18px; height: 18px; color: var(--text-3); }
.set-sub { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 2px 0 6px 54px; }
.set-sub select { margin-left: 0; min-width: 0; flex: 1 1 180px; }
.tick { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-weight: 500; color: var(--text-2); }
.tick input { width: 18px; height: 18px; accent-color: var(--accent); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 13px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-weight: 600; font-size: 14px;
}
.pill-btn svg { width: 14px; height: 14px; }
.pill-btn.on { background: var(--accent-muted); border-color: var(--accent); color: var(--accent); }

.fav-list { display: grid; gap: 6px; margin: 8px 0; }
.fav { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px 4px 4px 10px; }
.fav span:nth-child(2) { flex: 1; font-weight: 600; }
.fav .logo, .team-opt .logo { width: 28px; height: 28px; object-fit: contain; }
.team-search, .place-search { display: flex; gap: 8px; margin-top: 10px; }
.team-search select { flex: 0 0 42%; }
.place-search .btn { flex-shrink: 0; }
.team-results, .results { display: grid; gap: 4px; margin: 8px 0; max-height: 280px; overflow-y: auto; }
.team-opt, .result {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 0; background: none; text-align: left; color: var(--text);
}
.team-opt:hover, .result:hover { background: var(--surface); }
.team-opt span { flex: 1; }
.team-opt svg { width: 20px; height: 20px; color: var(--text-3); }
.team-opt.on svg { color: var(--warn); fill: var(--warn); }
.result svg { width: 18px; height: 18px; color: var(--accent); }

/* ── auth ────────────────────────────────────────────────────── */
.auth { min-height: 100dvh; max-width: 420px; margin: 0 auto; padding: calc(var(--safe-t) + 48px) 20px 40px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.auth h1 { margin: 6px 0 0; font-size: 30px; letter-spacing: -.5px; }
.auth > p { margin: 0 0 8px; }
.auth .banner { width: 100%; }
.auth-card { width: 100%; display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px; margin-top: 8px; }
.auth-card form { display: grid; gap: 14px; }
.gbtn { display: flex; justify-content: center; min-height: 44px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ── admin ───────────────────────────────────────────────────── */
.admin-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 13px; background: var(--surface); color: var(--text-2); }
.pill .dot { animation: none; background: var(--text-3); }
.pill.ok .dot { background: var(--ok); }
.person { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; width: 100%; text-align: left; color: var(--text); }
.person.as-btn:active { background: var(--surface-2); }
.person.pending { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); flex-wrap: wrap; }
.person.small { padding: 8px 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--accent-muted); color: var(--accent); display: grid; place-items: center; font-weight: 700; }
.avatar svg { width: 20px; height: 20px; }
.p-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.p-main > * { overflow: hidden; text-overflow: ellipsis; }
.p-note { font-size: 14px; color: var(--text-2); font-style: italic; margin-top: 3px; }
.p-act { display: flex; gap: 6px; }
@media (max-width: 480px) { .person.pending .p-act { width: 100%; } .person.pending .p-act .btn { flex: 1; } }
.tag { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: var(--accent-muted); color: var(--accent); vertical-align: 1px; }
.status { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); flex-shrink: 0; }
.status.st-approved { color: var(--ok); }
.status.st-denied, .status.st-disabled { color: var(--danger); }
.invite-link { display: flex; gap: 6px; margin-top: 12px; align-items: center; }
.invite-link input { flex: 1; min-width: 0; font-size: 13px; }
details.past summary { cursor: pointer; }

/* ── toast ───────────────────────────────────────────────────── */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: all .2s;
  max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 12px; background: var(--text); color: var(--bg);
  font-weight: 600; font-size: 14px; box-shadow: var(--shadow); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--danger); color: #fff; }

@media (min-width: 760px) {
  .pane-body { padding: 4px 20px 0; }
  .chips { padding-left: 20px; padding-right: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── ticker (Titan Ticker on the web) ────────────────────────── */
.ticker {
  position: sticky; top: 0; z-index: 22; overflow: hidden; user-select: none; cursor: pointer;
  padding-top: var(--safe-t);
  --tk-h: 34px; --tk-fs: 17px; --tk-sm: 13px;
  --c-white: #ffffff; --c-dim: #78808c; --c-gray: #a0a8b4; --c-amber: #FFB340;
  --c-green: #30D158; --c-cyan: #5AC8FA; --c-yellow: #FFD60A; --c-sep: #505660;
}
.ticker.size-s { --tk-h: 28px; --tk-fs: 14px; --tk-sm: 11px; }
.ticker.size-l { --tk-h: 44px; --tk-fs: 22px; --tk-sm: 16px; }
.ticker.led { background: #000; border-bottom: 1px solid #1a1a1a; font-family: Doto, "Courier New", monospace; font-weight: 900; letter-spacing: .5px; }
.ticker.led .tk-view span, .ticker.led .tk-view a { text-shadow: 0 0 6px currentColor; }
/* faint LED dot grid over the strip */
.ticker.led::after {
  content: ""; position: absolute; inset: var(--safe-t) 0 0 0; pointer-events: none;
  background: radial-gradient(circle, transparent 55%, rgba(0,0,0,.55) 60%) 0 0 / 3px 3px;
}
.ticker.themed {
  background: var(--nav); border-bottom: 1px solid var(--border); font-weight: 650;
  --c-white: var(--text); --c-dim: var(--text-3); --c-gray: var(--text-2); --c-amber: var(--warn);
  --c-green: var(--ok); --c-cyan: var(--accent); --c-yellow: var(--warn); --c-sep: var(--text-3);
}
.tk-view { height: var(--tk-h); overflow: hidden; display: flex; align-items: center; }
.tk-track { display: flex; width: max-content; animation: tk-scroll 60s linear infinite; will-change: transform; }
.tk-track.still { animation: none; }
.ticker.paused .tk-track { animation-play-state: paused; }
.ticker.static .tk-view { overflow-x: auto; scrollbar-width: none; }
.ticker.static .tk-track { animation: none; }
.ticker.static .tk-run + .tk-run { display: none; }
@keyframes tk-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tk-run { display: flex; align-items: center; white-space: nowrap; font-size: var(--tk-fs); line-height: 1; }
.tk-item { display: inline-flex; align-items: center; gap: .35em; padding: 0 .2em; color: var(--c-white); }
.tk-item .sm, .tk-item.sm { font-size: var(--tk-sm); }
.tk-item svg.wx { width: calc(var(--tk-h) * .7); height: calc(var(--tk-h) * .7); }
.tk-logo { height: calc(var(--tk-h) * .62); width: auto; max-width: 3em; object-fit: contain; }
.tk-logo.lg { height: calc(var(--tk-h) * .78); }
.tk-poss { display: inline-block; width: 5px; height: 5px; background: var(--c-yellow); }
.tk-sep { display: inline-block; width: 7px; height: 7px; margin: 0 1.1em; background: var(--c-sep); transform: rotate(45deg); flex-shrink: 0; }
.tk-badge { color: #fff; font-size: var(--tk-sm); padding: .3em .5em; border-radius: 3px; text-shadow: none !important; }
.tk-badge.lg { font-size: calc(var(--tk-sm) * 1.1); }
.tk-alert { display: inline-flex; align-items: center; gap: .4em; background: #be1212; color: #fff; padding: .3em .6em; border-radius: 3px; }
.tk-alert svg { width: 1em; height: 1em; }
.tk-alert .sm { color: #ffdcdc; }
.tk-day { display: inline-flex; align-items: center; gap: .3em; margin-left: .6em; }
.c-white { color: var(--c-white); } .c-dim { color: var(--c-dim); } .c-gray { color: var(--c-gray); }
.c-amber { color: var(--c-amber); } .c-green { color: var(--c-green); } .c-cyan { color: var(--c-cyan); } .c-yellow { color: var(--c-yellow); }
.tk-gear {
  position: absolute; right: 0; bottom: 0; height: var(--tk-h); width: 44px; border: 0; z-index: 2;
  display: grid; place-items: center; color: #a0a8b4;
  background: linear-gradient(90deg, transparent, #000 45%);
}
.ticker.themed .tk-gear { color: var(--text-2); background: linear-gradient(90deg, transparent, var(--nav) 45%); }
.tk-gear svg { width: 18px; height: 18px; }
.tk-paused {
  position: absolute; left: 0; bottom: 0; height: var(--tk-h); padding: 0 10px 0 8px; z-index: 2;
  display: none; align-items: center; font: 700 11px var(--font); color: #FFD60A;
  background: linear-gradient(90deg, #000 60%, transparent);
}
.ticker.themed .tk-paused { color: var(--accent); background: linear-gradient(90deg, var(--nav) 60%, transparent); }
.ticker.paused .tk-paused { display: flex; }
.ticker.paused .tk-item[href] { text-decoration: underline; text-decoration-color: rgba(255,255,255,.35); text-underline-offset: 3px; }
.tk-preview { position: relative; border-radius: 10px; margin-bottom: 8px; padding-top: 0; cursor: default; }
.tk-preview::after { inset: 0; }
.tk-preview .tk-view { justify-content: center; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatch-btn { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); padding: 0; }
.swatch-btn.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatches input[type=color] { width: 34px; min-height: 30px; height: 30px; padding: 2px; border-radius: 8px; }

/* ── theme picker ────────────────────────────────────────────── */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 6px 0; }
.theme-card {
  display: grid; gap: 6px; padding: 8px; border-radius: 12px; border: 2px solid var(--border);
  background: var(--surface); text-align: left; color: var(--text); font-size: 13px; font-weight: 600;
}
.theme-card.on { border-color: var(--accent); }
.theme-swatch { height: 44px; border-radius: 8px; position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 5px; gap: 4px; }
.theme-swatch i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.theme-swatch b { position: absolute; top: 5px; left: 7px; font-size: 15px; }
.theme-card small { color: var(--text-3); font-weight: 500; }
.color-row input[type=color] { width: 48px; min-height: 36px; height: 36px; padding: 2px; margin-left: auto; }

.block-btn { width: 100%; border: 0; background: none; text-align: left; color: var(--text); font: inherit; }
.block-btn svg { width: 18px; height: 18px; color: var(--text-3); }

/* ── fantasy ─────────────────────────────────────────────────── */
.fx-prov { font-size: 10px; font-weight: 800; letter-spacing: .4px; padding: 2px 6px; border-radius: 5px; color: #fff; background: #555; }
.fx-prov.espn { background: #c8102e; } .fx-prov.fleaflicker { background: #2b7a3d; } .fx-prov.yahoo { background: #6001d2; }
.fx-mine, .fx-match { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; }
.fx-mine { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); padding: 14px; }
.fx-mine .fx-score { font-size: 26px; }
.fx-list { display: grid; gap: 8px; }
.fx-match.mine { border-color: var(--accent); }
.fx-side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fx-logo { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; color: var(--text-2); }
.fx-name { flex: 1; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-name small { color: var(--text-3); font-weight: 500; }
.fx-score { font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; display: grid; justify-items: end; line-height: 1.1; }
.fx-score small { font-size: 11px; font-weight: 600; color: var(--text-3); }
.fx-side.lose .fx-name, .fx-side.lose .fx-score { color: var(--text-3); }
.fx-side.bye { opacity: .6; }
.fx-final { position: absolute; top: 8px; right: 12px; font-size: 11px; font-weight: 700; color: var(--text-3); }
.fx-mine .fx-final { position: static; justify-self: end; }
.empty-state svg { width: 48px; height: 48px; color: var(--accent); }
