/* Themes: Paper (light), Midnight (dark), Neon. "Auto" follows the system. */
:root {
  --bg: #f3f5fa; --card: #ffffff; --fg: #151a26; --muted: #687186; --line: #e1e5ee; --grid: #eceff5;
  --ok: #12a150; --warn: #c27803; --bad: #dc2638; --accent: #3b5bfd; --bar: #e7eaf2;
  --c1: #3b5bfd; --c2: #0ea5a4; --c3: #e8590c; --c4: #a24bd6;
  --fx: radial-gradient(900px 500px at 0% -10%, #3b5bfd14, transparent 70%), radial-gradient(800px 500px at 100% 0%, #0ea5a412, transparent 70%);
  --glow: none; --shadow: 0 1px 2px #0000000a, 0 8px 28px #1b2a5010; --tip: #ffffffee; --onaccent: #fff;
  color-scheme: light;
}
:root[data-theme="midnight"] {
  --bg: #080d1a; --card: #10182bd9; --fg: #e8edf8; --muted: #8995b0; --line: #1e2944; --grid: #18223a;
  --ok: #34d399; --warn: #fbbf24; --bad: #fb7185; --accent: #60a5fa; --bar: #1a2440;
  --c1: #60a5fa; --c2: #a78bfa; --c3: #34d399; --c4: #f472b6;
  --fx: radial-gradient(1100px 600px at 5% -15%, #2f4fd640, transparent 70%), radial-gradient(900px 600px at 105% 5%, #7c3aed30, transparent 70%);
  --glow: drop-shadow(0 0 3px currentColor); --shadow: 0 10px 40px #00000050; --tip: #0e1628f0; --onaccent: #06101f;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #080d1a; --card: #10182bd9; --fg: #e8edf8; --muted: #8995b0; --line: #1e2944; --grid: #18223a;
    --ok: #34d399; --warn: #fbbf24; --bad: #fb7185; --accent: #60a5fa; --bar: #1a2440;
    --c1: #60a5fa; --c2: #a78bfa; --c3: #34d399; --c4: #f472b6;
    --fx: radial-gradient(1100px 600px at 5% -15%, #2f4fd640, transparent 70%), radial-gradient(900px 600px at 105% 5%, #7c3aed30, transparent 70%);
    --glow: drop-shadow(0 0 3px currentColor); --shadow: 0 10px 40px #00000050; --tip: #0e1628f0; --onaccent: #06101f;
    color-scheme: dark;
  }
}
:root[data-theme="paper"] { color-scheme: light; }
:root[data-theme="neon"] {
  --bg: #06050c; --card: #0e0b1ce0; --fg: #f3eeff; --muted: #9d92c4; --line: #2a2152; --grid: #1b1538;
  --ok: #39ff88; --warn: #ffd23f; --bad: #ff3b6b; --accent: #ff2bd6; --bar: #211a42;
  --c1: #00e5ff; --c2: #ff2bd6; --c3: #a3ff12; --c4: #ffd23f;
  --fx: radial-gradient(1000px 600px at 0% -10%, #ff2bd630, transparent 70%), radial-gradient(1000px 700px at 100% 10%, #00e5ff26, transparent 70%),
        repeating-linear-gradient(0deg, #ffffff05 0 1px, transparent 1px 44px), repeating-linear-gradient(90deg, #ffffff05 0 1px, transparent 1px 44px);
  --glow: drop-shadow(0 0 5px currentColor); --shadow: 0 0 0 1px #ff2bd614, 0 12px 44px #00000080; --tip: #0e0b1cf2; --onaccent: #06050c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--fg); background-color: var(--bg); background-image: var(--fx); background-attachment: fixed;
       font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.muted { color: var(--muted); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.grow { flex: 1; }
.small { font-size: 12px; }

header { position: sticky; top: 0; z-index: 20; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
         padding: 12px max(16px, calc(50% - 574px)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
         background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
button, select { font: inherit; font-size: 14px; background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: 9px; padding: 5px 12px; cursor: pointer; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--card); }
.seg button { border: 0; border-radius: 0; padding: 5px 11px; background: transparent; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--onaccent); font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px; border-radius: 99px; font-size: 12px; font-weight: 600;
        border: 1px solid color-mix(in srgb, currentColor 35%, transparent); background: color-mix(in srgb, currentColor 10%, transparent); }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

main { max-width: 1180px; margin: 0 auto; padding: 16px 16px 48px; display: grid; gap: 14px;
       grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-width: 0; box-shadow: var(--shadow);
        backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.wide { grid-column: 1 / -1; }
@media (min-width: 760px) { .span2 { grid-column: span 2; } }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.hero .right { text-align: right; }
.big { font-size: 38px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums;
       background: linear-gradient(90deg, var(--c1), var(--c2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mid { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.row > * { min-width: 0; overflow-wrap: anywhere; }
.row > :last-child { text-align: right; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(110px, 45%), 1fr)); gap: 12px; }
.stat .v { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; background: var(--muted); }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); } .dot.degraded { background: var(--warn); } .dot.down { background: var(--bad); box-shadow: 0 0 8px var(--bad); }

/* Gauges */
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 6px 10px; }
.g { text-align: center; min-width: 0; }
.gauge { display: block; width: 100%; max-width: 150px; margin: 0 auto; overflow: visible; }
.gauge circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.gauge .track { stroke: var(--bar); }
.gauge .fill { color: var(--lvl); filter: var(--glow); transition: stroke-dasharray .8s cubic-bezier(.2, .8, .2, 1); }
.gauge.ok { --lvl: var(--ok); } .gauge.warn { --lvl: var(--warn); } .gauge.bad { --lvl: var(--bad); }
.gauge.accent, .gauge.none { --lvl: var(--c2); }
.gauge .tick { stroke: var(--bad); stroke-width: 2.5; stroke-linecap: round; }
.gauge text { text-anchor: middle; fill: var(--fg); font-variant-numeric: tabular-nums; }
.gauge .gv { font-size: 21px; font-weight: 750; }
.gauge .gs { font-size: 10px; fill: var(--muted); }
.gl { font-size: 12px; color: var(--muted); margin-top: -10px; }
.intro .gauge .fill { animation: sweep 1.2s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes sweep { from { stroke-dasharray: 0 400; } }

/* Charts */
.chartwrap { margin: 6px 0 10px; }
.plotbox { position: relative; touch-action: pan-y; cursor: crosshair; }
.plotbox.compact { margin: 2px 0 0; }
.plot { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.plot .grid { stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plot .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; filter: var(--glow); }
.compact .plot .line { stroke-width: 1.5; }
.plot .dash { stroke-dasharray: 6 5; opacity: .85; }
.plot .mark { stroke-width: 1.5; stroke-dasharray: 3 4; }
.plot .bar { opacity: .8; }
.intro .plot path, .intro .plot rect { animation: rise .9s ease-out both; transform-origin: 50% 100%; }
@keyframes rise { from { transform: scaleY(0); opacity: 0; } }
.ylab, .mlabel { position: absolute; font-size: 10px; line-height: 1; pointer-events: none; }
.ylab { left: 2px; color: var(--muted); margin-top: 2px; }
.mlabel { right: 2px; transform: translateY(-130%); font-weight: 600; }
.cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted); opacity: .6; display: none; pointer-events: none; }
.hdot { position: absolute; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--bg); display: none; pointer-events: none; }
.tip { position: absolute; top: 0; z-index: 5; display: none; pointer-events: none; background: var(--tip); border: 1px solid var(--line); border-radius: 10px;
       padding: 7px 10px; font-size: 12px; white-space: nowrap; box-shadow: var(--shadow); }
.tip i, .legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.tip b { font-variant-numeric: tabular-nums; }
.xlabs { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--muted); }
.legend b { color: var(--fg); font-weight: 650; margin-left: 5px; font-variant-numeric: tabular-nums; }
.spark { text-align: right; margin: 1px 0 6px; }
.empty { padding: 28px 8px; text-align: center; color: var(--muted); font-size: 13px; border: 1px dashed var(--line); border-radius: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.gone td { color: var(--muted); }
.scroll { overflow-x: auto; }
ul.events { list-style: none; margin: 0; padding: 0; font-size: 14px; }
ul.events li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.cap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.cap input { width: 90px; padding: 4px 6px; font: inherit; background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; }

/* Header nav */
nav { display: inline-flex; gap: 2px; }
nav a { color: var(--muted); text-decoration: none; font-size: 14px; padding: 4px 10px; border-radius: 8px; }
nav a.on { color: var(--fg); background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 600; }
nav a:hover { color: var(--fg); }

/* People page */
.sub { display: contents; }
main > *, .sub > * { min-width: 0; }
.tools > * { max-width: 100%; }
.chips { overflow-x: auto; }
.sectionhead { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.sectionhead h2 { margin: 0; font-size: 13px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.tools input[type=search] { flex: 1 1 220px; min-width: 0; font: inherit; font-size: 14px; padding: 5px 10px; background: var(--card); color: var(--fg);
                            border: 1px solid var(--line); border-radius: 9px; }
.chips { flex-wrap: wrap; }
.chips button b { margin-left: 6px; font-weight: 650; font-variant-numeric: tabular-nums; opacity: .8; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.pager button:disabled { opacity: .4; cursor: default; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badge { font-size: 12px; padding: 1px 8px; border-radius: 99px; white-space: nowrap; border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
         background: color-mix(in srgb, currentColor 10%, transparent); }
.badge.game { color: var(--c1); } .badge.wait { color: var(--muted); } .badge.call { color: var(--c3); } .badge.huddle { color: var(--c2); }
.share { display: flex; align-items: center; gap: 6px; min-width: 110px; }
.share i { display: block; height: 7px; border-radius: 4px; background: var(--c1); flex: 0 0 auto; max-width: 70%; }
svg.bars { display: block; width: 100%; height: 150px; }
svg.bars .app { fill: var(--bar); } svg.bars .gm { fill: var(--c1); } svg.bars .cl { fill: var(--c3); }
svg.bars g:hover rect { opacity: .75; }
.legend i.k-app { background: var(--bar); height: 8px; } .legend i.k-gm { background: var(--c1); height: 8px; } .legend i.k-cl { background: var(--c3); height: 8px; }
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 2px; min-width: 480px; }
.heat .hl { font-size: 10px; color: var(--muted); line-height: 16px; }
.heat .cell { aspect-ratio: 1; min-height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--c2) calc(var(--a) * 100%), var(--bar)); }

/* BZ Huddle: sub-nav, users, signup rules */
nav.subnav { flex-basis: 100%; overflow-x: auto; }
nav.subnav a { font-size: 13px; padding: 3px 10px; }
.badge.banned { color: var(--bad); }
button.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
button.primary { background: var(--accent); color: var(--onaccent); border-color: var(--accent); font-weight: 600; }
button:disabled { opacity: .45; cursor: default; }
button.small { font-size: 12px; padding: 2px 9px; }
.acts { display: inline-flex; gap: 4px; }
.email { overflow-wrap: anywhere; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.bulk { display: flex; flex-direction: column; gap: 0; }
.bulk .tools { margin-bottom: 8px; }
.bulk b { font-weight: 650; }
.rules { display: grid; gap: 10px; margin-bottom: 12px; }
.rule { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 6px; }
.rule .tools { margin: 0; }
.rule input[type=text], .card input[type=search] { width: 100%; min-width: 0; font: inherit; font-size: 14px; padding: 5px 10px; background: var(--card);
                                                   color: var(--fg); border: 1px solid var(--line); border-radius: 9px; }
.rule input.id { width: auto; flex: 0 1 200px; }
.rule input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
input.invalid { border-color: var(--bad) !important; }
.count a { color: var(--accent); }
.rule input.num { width: 76px; font: inherit; font-size: 14px; padding: 5px 8px; background: var(--card);
                  color: var(--fg); border: 1px solid var(--line); border-radius: 9px; }
.steps { margin: 0 0 10px; padding-left: 22px; display: grid; gap: 8px; line-height: 1.5; }
.steps a { color: var(--accent); }

body.login main { display: block; max-width: 360px; margin: 18vh auto; text-align: center; }
body.login h1 { font-size: 28px; margin-bottom: 6px; }
body.login .g_id_signin { display: flex; justify-content: center; margin-top: 24px; }
@media (max-width: 420px) { main { grid-template-columns: 1fr; } .big { font-size: 30px; } header h1 { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
