/* MOTO Cloud dashboard. One stylesheet, no framework. Tokens first, then layout,
   components, charts and views. Light and dark are both designed, not inverted. */

:root {
  color-scheme: light;
  --bg: #f2f5f8;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, #e3f4f3 0%, rgba(227, 244, 243, 0) 60%),
             radial-gradient(900px 500px at -10% 110%, #e8eefb 0%, rgba(232, 238, 251, 0) 55%);
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --surface-3: #eef2f6;
  --line: #e3e8ee;
  --line-strong: #cfd7e1;
  --ink: #0e1a2b;
  --ink-2: #45546a;
  --muted: #7d8a9c;
  --grid: #edf0f4;
  --axis: #c7cfd9;

  /* From the MOTO logo: #3cb671 (green) → #4cbed8 (cyan) */
  --moto-green: #3cb671;
  --moto-cyan: #4cbed8;
  --moto-grad: linear-gradient(120deg, #3cb671, #4cbed8);
  --brand: #22a37f;
  --brand-strong: #1b8c6d;
  --brand-ink: #11745c;
  --brand-soft: #e4f6ef;
  --brand-glow: rgba(34, 163, 127, 0.18);

  /* Categorical series (validated, fixed order) */
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --s7: #4a3aa7;

  /* Sequential (blue) */
  --q0: #f1f5fa;
  --q1: #cde2fb;
  --q2: #9ec5f4;
  --q3: #6da7ec;
  --q4: #3987e5;
  --q5: #256abf;
  --q6: #184f95;

  /* Status: always with an icon or a word */
  --good: #0ca30c;
  --good-ink: #067a06;
  --good-soft: #e5f6e5;
  --warn: #fab219;
  --warn-ink: #8a5a00;
  --warn-soft: #fff5dc;
  --serious: #ec835a;
  --bad: #d03b3b;
  --bad-ink: #b42727;
  --bad-soft: #fdeaea;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 1px 2px rgba(16, 32, 56, 0.04), 0 4px 16px rgba(16, 32, 56, 0.05);
  --shadow-lg: 0 8px 40px rgba(16, 32, 56, 0.12);
  --focus: 0 0 0 3px rgba(34, 163, 127, 0.35);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sidebar: 252px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a111c;
    --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(20, 184, 166, 0.10) 0%, rgba(20, 184, 166, 0) 60%),
               radial-gradient(900px 500px at -10% 110%, rgba(57, 135, 229, 0.08) 0%, rgba(57, 135, 229, 0) 55%);
    --surface: #111b29;
    --surface-2: #0e1723;
    --surface-3: #18243a;
    --line: #1e2b3e;
    --line-strong: #2b3b52;
    --ink: #e9eff7;
    --ink-2: #b2bfd0;
    --muted: #7c8aa0;
    --grid: #1a2638;
    --axis: #33445c;
    --brand: #4fd1a5;
    --brand-strong: #7ee3c2;
    --brand-ink: #6ee0bb;
    --brand-soft: rgba(79, 209, 165, 0.12);
    --brand-glow: rgba(79, 209, 165, 0.22);
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #d55181;
    --s7: #9085e9;
    --q0: #142033;
    --q1: #0d366b;
    --q2: #104281;
    --q3: #1c5cab;
    --q4: #2a78d6;
    --q5: #5598e7;
    --q6: #9ec5f4;
    --good-ink: #3ccf3c;
    --good-soft: rgba(12, 163, 12, 0.14);
    --warn-ink: #fab219;
    --warn-soft: rgba(250, 178, 25, 0.12);
    --bad-ink: #f07171;
    --bad-soft: rgba(208, 59, 59, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 18px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a111c;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(20, 184, 166, 0.10) 0%, rgba(20, 184, 166, 0) 60%),
             radial-gradient(900px 500px at -10% 110%, rgba(57, 135, 229, 0.08) 0%, rgba(57, 135, 229, 0) 55%);
  --surface: #111b29;
  --surface-2: #0e1723;
  --surface-3: #18243a;
  --line: #1e2b3e;
  --line-strong: #2b3b52;
  --ink: #e9eff7;
  --ink-2: #b2bfd0;
  --muted: #7c8aa0;
  --grid: #1a2638;
  --axis: #33445c;
  --brand: #4fd1a5;
  --brand-strong: #7ee3c2;
  --brand-ink: #6ee0bb;
  --brand-soft: rgba(79, 209, 165, 0.12);
  --brand-glow: rgba(79, 209, 165, 0.22);
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --s7: #9085e9;
  --q0: #142033;
  --q1: #0d366b;
  --q2: #104281;
  --q3: #1c5cab;
  --q4: #2a78d6;
  --q5: #5598e7;
  --q6: #9ec5f4;
  --good-ink: #3ccf3c;
  --good-soft: rgba(12, 163, 12, 0.14);
  --warn-ink: #fab219;
  --warn-soft: rgba(250, 178, 25, 0.12);
  --bad-ink: #f07171;
  --bad-soft: rgba(208, 59, 59, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 18px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* ---------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--font);
  color: var(--ink);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
input, select { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- boot */

.boot { position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; }
.dot-spinner { width: 56px; height: 56px; }
.dot-spinner circle { fill: #c9d9ea; animation: led-chase 1.2s linear infinite; }
.dot-spinner circle:nth-child(2) { animation-delay: 0.15s; }
.dot-spinner circle:nth-child(3) { animation-delay: 0.3s; }
.dot-spinner circle:nth-child(4) { animation-delay: 0.45s; }
.dot-spinner circle:nth-child(5) { animation-delay: 0.6s; }
.dot-spinner circle:nth-child(6) { animation-delay: 0.75s; }
.dot-spinner circle:nth-child(7) { animation-delay: 0.9s; }
.dot-spinner circle:nth-child(8) { animation-delay: 1.05s; }
@keyframes led-chase {
  0% { fill: #3cb671; opacity: 1; }
  45% { fill: #4cbed8; opacity: 0.9; }
  70%, 100% { fill: #c9d9ea; opacity: 0.45; }
}

/* MOTO logo lockup */
.brand-lockup { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.brand-lockup .moto-logo { height: 34px; width: auto; display: block; }
.brand-lockup span { font-size: 11px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-left: 2px; }

/* MOTO tile graphic: LEDs chase like a game in progress */
.moto-tile { display: block; filter: drop-shadow(0 6px 14px rgba(20, 60, 110, 0.25)); }
.spin-leds circle:nth-of-type(n+4) { animation: led-chase 1.6s linear infinite; }
.spin-leds circle:nth-of-type(5) { animation-delay: 0.2s; }
.spin-leds circle:nth-of-type(6) { animation-delay: 0.4s; }
.spin-leds circle:nth-of-type(7) { animation-delay: 0.6s; }
.spin-leds circle:nth-of-type(8) { animation-delay: 0.8s; }
.spin-leds circle:nth-of-type(9) { animation-delay: 1s; }
.spin-leds circle:nth-of-type(10) { animation-delay: 1.2s; }
.spin-leds circle:nth-of-type(11) { animation-delay: 1.4s; }

/* ---------------------------------------------------------------- login */

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
}
.login-hero {
  position: relative;
  overflow: hidden;
  color: #eafaf6;
  padding: 44px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #0b2b3a;
  isolation: isolate;
}
.hero-photo {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -1;
  background:
    linear-gradient(100deg, rgba(5, 30, 38, 0.94) 0%, rgba(6, 38, 52, 0.82) 38%, rgba(8, 44, 66, 0.35) 75%, rgba(8, 44, 66, 0.15) 100%),
    linear-gradient(0deg, rgba(5, 26, 36, 0.85) 0%, rgba(5, 26, 36, 0) 45%),
    url("img/moto-tiles.webp") 70% 40% / cover no-repeat;
  transform: scale(1.04);
  animation: hero-drift 24s ease-in-out infinite alternate;
}
@keyframes hero-drift { to { transform: scale(1.12) translate(-1.5%, 1%); } }
.login-hero .brand-lockup .moto-logo { height: 58px; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35)); }
.login-hero .brand-lockup span { color: rgba(234, 250, 246, 0.75); }
.login-hero h1 { font-size: 46px; font-size: clamp(34px, 4vw, 56px); line-height: 1.04; letter-spacing: -0.03em; font-weight: 700; max-width: 12ch; }
.login-hero h1 em { font-style: normal; background: var(--moto-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero p.lead { max-width: 44ch; font-size: 16px; opacity: 0.85; margin: 18px 0 28px; }
.login-hero .facts { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.login-hero .facts div {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.login-tile { margin-bottom: 18px; }
/* The MOTO claim, as on the brochure: light italic */
.login-hero .claim {
  margin: 0 0 14px; font-size: 23px; font-size: clamp(20px, 2vw, 26px); font-style: italic; font-weight: 400; letter-spacing: 0.01em;
  background: var(--moto-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.side-claim { font-style: italic; font-size: 13px; padding: 0 10px; background: var(--moto-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.login-panel { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-size: 26px; letter-spacing: -0.02em; }
.login-card p.sub { color: var(--ink-2); margin: 6px 0 26px; }
.seg {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  background: var(--surface-3);
  border-radius: 12px;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 7px 14px;
  border-radius: 9px;
  font-weight: 560;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 32, 56, 0.12); }
/* A picker with many choices (Auto list: the people) wraps instead of overflowing */
.seg.wrap { display: flex; flex-wrap: wrap; }
.seg.wrap button { display: inline-flex; align-items: center; gap: 8px; }
.login-card .seg { width: 100%; margin-bottom: 22px; }
.login-card .seg button { flex: 1; padding: 9px 12px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 0 14px;
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.input.code {
  height: 64px;
  text-align: center;
  font: 600 28px/1 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; display: flex; gap: 8px; align-items: flex-start; }
.hint svg { margin-top: 2px; width: 15px; height: 15px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(120deg, #23995f, #2192a6);
  border-color: #1d8a6c;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 6px 16px var(--brand-glow);
}
.btn.primary:hover { background: linear-gradient(120deg, #1e8a55, #1c8396); }
.btn.big { height: 50px; width: 100%; font-size: 15px; border-radius: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn.icon { width: 38px; padding: 0; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.form-error { min-height: 20px; color: var(--bad-ink); font-size: 13px; margin: 6px 0 10px; display: flex; gap: 6px; align-items: center; }
.login-foot { margin-top: 28px; font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------- shell */

.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 30;
}
.logo { display: block; padding: 6px 10px 22px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
/* The menu scrolls when it is taller than the screen; logo and footer stay in place */
.sidebar .nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -6px;
  padding: 0 6px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.sidebar .logo, .sidebar .side-foot { flex-shrink: 0; }
.nav .label { font-size: 11px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 6px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 11px;
  color: var(--ink-2);
  font-weight: 560;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand-ink); }
.nav a.on svg { stroke: var(--brand); }
.nav a .count { margin-left: auto; font-size: 11.5px; font-weight: 650; background: var(--surface-3); color: var(--ink-2); padding: 1px 7px; border-radius: 99px; }
.nav a .live-dot { margin-left: auto; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.me .who { min-width: 0; flex: 1; }
.me .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who small { color: var(--muted); font-size: 11.5px; }
.privacy { font-size: 11px; color: var(--muted); padding: 0 8px; display: flex; gap: 6px; align-items: center; }
.privacy svg { width: 13px; height: 13px; }

.main { min-width: 0; display: flex; flex-direction: column; overflow-x: clip; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .title { min-width: 0; flex: 1; }
.topbar .crumbs { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; }
.topbar .crumbs a:hover { color: var(--ink); }
.topbar h1 { font-size: 21px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .tools { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }
.select {
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 0 32px 0 12px;
  font-weight: 560;
  font-size: 13px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d8a9c' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  max-width: 220px;
  cursor: pointer;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}
.live-pill.on { color: var(--good-ink); border-color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, var(--line)); background: var(--good-soft); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; position: relative; }
.on > .live-dot, .live-dot.on { background: var(--good); }
.on > .live-dot::after, .live-dot.on::after {
  content: "";
  position: absolute;
  top: -4px; right: -4px; bottom: -4px; left: -4px;
  border-radius: 50%;
  border: 2px solid var(--good);
  animation: ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.8); opacity: 0; } }

.content { padding: 8px 28px 48px; max-width: 1480px; width: 100%; }
.view { animation: rise 0.35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.loading-bar { position: fixed; top: 0; left: 0; height: 2px; background: var(--brand); z-index: 100; width: 0; transition: width 0.3s ease, opacity 0.3s; }

.bottom-nav { display: none; }
.scrim { display: none; }

/* ---------------------------------------------------------------- cards & grid */

.grid { display: grid; gap: 18px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mt { margin-top: 18px; }
.mt-xs { margin-top: 5px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
  position: relative;
}
.card.flat { box-shadow: none; }
.card.pad0 { padding: 0; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-height: 32px; flex-wrap: wrap; }
.card-h h3 { font-size: 15px; }
.card-h .sub { color: var(--muted); font-size: 12.5px; }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.card-h .ic {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  flex: none;
}
.card-h .ic svg { width: 17px; height: 17px; }
.card-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--brand-ink); }
.card-link svg { width: 14px; height: 14px; }
.card-link:hover { text-decoration: underline; }

/* hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  margin-bottom: 18px;
}
.hello { padding: 26px 28px; overflow: hidden; }
.hello .date { color: var(--muted); font-weight: 560; font-size: 13px; }
.hello h2 { font-size: 28px; letter-spacing: -0.03em; margin: 4px 0 10px; }
.hello p { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 64ch; }
.hello p b { color: var(--ink); }
.hello .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.hello::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--brand-glow), transparent);
  pointer-events: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.chip svg { width: 14px; height: 14px; }
.chip.good { background: var(--good-soft); color: var(--good-ink); }
.chip.warn { background: var(--warn-soft); color: var(--warn-ink); }
.chip.bad { background: var(--bad-soft); color: var(--bad-ink); }
.chip.brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip.outline { background: transparent; border: 1px solid var(--line-strong); }

.live-card {
  color: #e8fbf7;
  background: radial-gradient(500px 300px at 100% 0%, rgba(94, 234, 212, 0.25), transparent 60%),
              linear-gradient(150deg, #073b3a 0%, #0b3550 100%);
  border-color: transparent;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.live-card .card-h h3 { color: #fff; }
.live-card .card-h .ic { background: rgba(255, 255, 255, 0.12); color: #7ee3c2; }
.live-card .card-h .right .moto-tile { margin: -8px -6px -8px 0; }
.live-card .big { font-size: 44px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.live-card .big small { font-size: 14px; font-weight: 550; opacity: 0.75; letter-spacing: 0; margin-left: 6px; }
.live-card .ecg { display: block; width: calc(100% + 40px); margin: auto -20px -20px; height: 74px; }
.live-card #ov-ecg { margin-top: auto; }
.live-card .who { font-size: 13px; opacity: 0.85; margin-top: 8px; min-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-card a.more { color: #99f6e4; }
.ecg path.trace { fill: none; stroke: #5eead4; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(94, 234, 212, 0.8)); }
.ecg path.trace.anim { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: trace 3.2s linear infinite; }
.ecg path.flat { stroke: rgba(255, 255, 255, 0.25); stroke-width: 1.5; fill: none; }
@keyframes trace { to { stroke-dashoffset: 0; } }

/* KPI */
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 14px; overflow: hidden; }
.kpi .top { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.kpi .top .ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.kpi .top .ic svg { width: 15px; height: 15px; }
.kpi .value { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.kpi .value small { font-size: 14px; color: var(--muted); font-weight: 600; letter-spacing: 0; margin-left: 4px; }
.kpi .foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); min-height: 22px; }
.kpi .spark { position: absolute; right: 16px; top: 52px; width: 40%; max-width: 150px; height: 38px; opacity: 0.9; }
.kpi .spark svg { width: 100%; height: 100%; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 650; font-size: 12px; padding: 2px 7px; border-radius: 99px; }
.delta svg { width: 12px; height: 12px; stroke-width: 2.4; }
.delta.up { color: var(--good-ink); background: var(--good-soft); }
.delta.down { color: var(--bad-ink); background: var(--bad-soft); }
.delta.flat { color: var(--ink-2); background: var(--surface-3); }

/* stat rows */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stat { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.stat .l { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.stat .l svg { width: 14px; height: 14px; }
.stat .v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.stat .v small { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 3px; letter-spacing: 0; }

/* lists */
.list { display: flex; flex-direction: column; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.row:first-child { border-top: 0; }
a.row { border-radius: 10px; transition: background 0.15s; padding-left: 8px; padding-right: 8px; margin: 0 -8px; }
a.row:hover { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .end { text-align: right; flex: none; }
.row .end .t { font-variant-numeric: tabular-nums; }
.row.new { animation: flash 2.4s ease; }
@keyframes flash { 0% { background: var(--brand-soft); } 100% { background: transparent; } }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex: none;
  letter-spacing: 0.02em;
}
.avatar.lg { width: 68px; height: 68px; border-radius: 22px; font-size: 24px; }
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; border-top: 1px solid var(--line); }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  background: var(--surface-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
table.t th.r, table.t td.r { text-align: right; }
table.t th button.sort { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
table.t th button.sort:hover { color: var(--ink); }
table.t td { padding: 11px 14px; border-top: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.t td:first-child, table.t th:first-child { padding-left: 20px; }
table.t td:last-child, table.t th:last-child { padding-right: 20px; }
table.t tr.click { cursor: pointer; transition: background 0.12s; }
table.t tr.click:hover td { background: var(--surface-2); }
table.t tr.click[aria-selected="true"] td { background: var(--brand-soft); }
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person b { display: block; font-weight: 620; }
.person small { display: block; color: var(--muted); font-size: 12px; }

/* toolbar */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }
.search input { padding-left: 40px; height: 40px; }

/* empty states */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .em-ic { width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.empty p { margin: 0 auto; max-width: 46ch; }

/* ---------------------------------------------------------------- charts */

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .base-line { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.thin { stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .cross { stroke: var(--ink-2); stroke-width: 1; opacity: 0; transition: opacity 0.1s; }
.chart .hover-dot { opacity: 0; transition: opacity 0.1s; }
.chart.hovering .cross, .chart.hovering .hover-dot { opacity: 1; }
.chart .bar { transition: opacity 0.15s; }
.chart .bar:hover { opacity: 0.8; }
.chart .best-line { stroke: var(--good); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .best-label { fill: var(--good-ink); font-size: 11px; font-weight: 650; }
.chart.refetch { opacity: 0.5; transition: opacity 0.2s; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); font-weight: 560; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.ln { height: 2px; width: 14px; border-radius: 2px; }
.legend i.ring { background: transparent !important; border: 2px solid; border-radius: 50%; width: 9px; height: 9px; }

.tip {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 9px 12px;
  font-size: 12.5px;
  min-width: 130px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s, transform 0.12s;
}
.tip.on { opacity: 1; transform: none; }
.tip .h { color: var(--muted); font-weight: 600; font-size: 11.5px; margin-bottom: 4px; }
.tip .r { display: flex; align-items: center; gap: 8px; }
.tip .r i { width: 12px; height: 2px; border-radius: 2px; flex: none; }
.tip .r b { font-size: 14px; font-variant-numeric: tabular-nums; }
.tip .r span { color: var(--ink-2); }

/* horizontal bars */
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.hbar .n { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .v { font-weight: 650; font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.hbar .v small { color: var(--muted); font-weight: 550; }
.hbar .track { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 99px; background: var(--s1); transform-origin: left; animation: grow 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes grow { from { transform: scaleX(0); } }

/* heatmap */
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; align-items: center; }
.heat .hl { font-size: 11px; color: var(--muted); font-weight: 600; }
.heat .hh { font-size: 10.5px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.heat .c { aspect-ratio: 1.25; border-radius: 4px; background: var(--q0); transition: transform 0.1s; min-height: 10px; }
.heat .c:hover { transform: scale(1.25); outline: 2px solid var(--surface); box-shadow: 0 0 0 3px var(--ink-2); position: relative; z-index: 2; }
.scale { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); margin-top: 12px; justify-content: flex-end; }
.scale i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }

/* calendar */
.cal-wrap { overflow-x: auto; padding-bottom: 4px; }
.cal { display: grid; grid-auto-flow: column; grid-template-rows: 16px repeat(7, 13px); grid-auto-columns: 13px; gap: 3px; width: max-content; }
.cal .m { font-size: 10.5px; color: var(--muted); grid-row: 1; white-space: nowrap; }
.cal .d { width: 13px; height: 13px; border-radius: 3px; background: var(--q0); }
.cal .d:hover { outline: 2px solid var(--ink-2); outline-offset: 1px; }
.cal .d.out { background: transparent; }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { width: 128px; height: 128px; flex: none; position: relative; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .c { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; text-align: center; }
.donut .c b { display: block; font-size: 22px; letter-spacing: -0.02em; line-height: 1.1; }
.donut .c small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.donut circle { transition: stroke-dasharray 0.8s ease; }

/* bands (age) */
.bands { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 6px; }
.band { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.band .stack { width: 100%; max-width: 38px; display: flex; flex-direction: column-reverse; gap: 2px; flex: 1; justify-content: flex-start; }
.band .stack i { display: block; width: 100%; border-radius: 4px; animation: up 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; transform-origin: bottom; }
.band .stack i:last-child { border-radius: 4px 4px 4px 4px; }
@keyframes up { from { transform: scaleY(0); } }
.band span { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }

/* progress ring (live) */
.ring { width: 76px; height: 76px; position: relative; flex: none; }
.ring.led-ring { width: 88px; height: 88px; }
.ring.led-ring .c { font-size: 13px; letter-spacing: -0.02em; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.led-ring circle:not([fill]) { fill: var(--line-strong); transition: fill 0.4s; }
.led-ring circle.on { filter: drop-shadow(0 0 4px var(--good)); }
.led-ring circle.chase { animation: led-pulse 1.2s ease-in-out infinite; }
@keyframes led-pulse { 50% { opacity: 0.35; } }
.ring .c { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- views */

.live-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.lg-card { display: flex; flex-direction: column; gap: 14px; border-color: var(--good); border-color: color-mix(in srgb, var(--good) 30%, var(--line)); }
.lg-card .head { display: flex; gap: 14px; align-items: center; }
.lg-card .head .grow { min-width: 0; flex: 1; }
.lg-card .head b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-card .players { display: flex; flex-direction: column; gap: 8px; }
.lg-card .pl { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.lg-card .pl .score { margin-left: auto; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.score.bump { animation: bump 0.5s ease; }
@keyframes bump { 40% { transform: scale(1.25); color: var(--good-ink); } }

.profile { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile .grow { min-width: 200px; flex: 1; }
.profile h2 { font-size: 26px; letter-spacing: -0.03em; }
.profile .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.game-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gcard {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 14px;
  padding: 13px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.gcard:hover { border-color: var(--line-strong); }
.gcard[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.gcard .n { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard .ty { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard .vals { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 6px; gap: 8px; }
.gcard .vals b { font-size: 20px; letter-spacing: -0.02em; }
.gcard .vals small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }

.record { display: flex; gap: 8px; }
.record div { flex: 1; text-align: center; padding: 10px 6px; border-radius: 12px; background: var(--surface-2); }
.record b { display: block; font-size: 22px; letter-spacing: -0.02em; }
.record small { font-size: 11.5px; font-weight: 600; color: var(--muted); }

.vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.vs .side { min-width: 0; }
.vs .side.r { text-align: right; }
.vs .side b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 620; }
.vs .side small { color: var(--muted); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs .side.win b { color: var(--good-ink); }
.vs .mid { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 16px; padding: 4px 10px; border-radius: 10px; background: var(--surface-3); white-space: nowrap; }
.crown { width: 14px; height: 14px; color: var(--s4); vertical-align: -2px; }

.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.tcard { display: flex; flex-direction: column; gap: 12px; transition: transform 0.15s, box-shadow 0.15s; }
.tcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tcard h3 { font-size: 17px; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--s1)); }

.bracket { display: flex; gap: 34px; overflow-x: auto; padding: 6px 2px 14px; }
.round { display: flex; flex-direction: column; min-width: 220px; flex: none; }
.round h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 12px; }
.round .slots { display: flex; flex-direction: column; justify-content: space-around; flex: 1; gap: 14px; }
.match {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  position: relative;
  box-shadow: var(--shadow);
}
.match .p:first-of-type { border-radius: 11px 11px 0 0; }
.match .p:last-of-type { border-radius: 0 0 11px 11px; }
.match .p { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 13px; min-height: 36px; }
.match .p + .p { border-top: 1px solid var(--line); }
.match .p .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 560; }
.match .p .sc { font-weight: 700; font-variant-numeric: tabular-nums; }
.match .p.w { background: var(--good-soft); }
.match .p.w .nm { font-weight: 700; color: var(--good-ink); }
.match .p.l .nm { color: var(--muted); }
.match .p.tbd .nm { color: var(--muted); font-style: italic; font-weight: 500; }
.match .seed { font-size: 10.5px; color: var(--muted); font-weight: 650; width: 16px; text-align: center; }
.match .st { position: absolute; top: -9px; right: 8px; font-size: 10px; padding: 1px 7px; border-radius: 99px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.match.playing { border-color: var(--s1); border-color: color-mix(in srgb, var(--s1) 50%, var(--line)); }
.champion { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(237, 161, 0, 0.16), rgba(237, 161, 0, 0.04)); border: 1px solid rgba(237, 161, 0, 0.4); }

.code-box { display: flex; align-items: center; gap: 8px; }
.code-box code { white-space: nowrap; font: 600 15px/1 var(--mono); letter-spacing: 0.14em; padding: 8px 10px; border-radius: 9px; background: var(--surface-3); }
.dev-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.dev-card { display: flex; flex-direction: column; gap: 14px; transition: transform 0.15s, box-shadow 0.15s; }
.dev-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.dev-card .head { display: flex; gap: 12px; align-items: center; }
.dev-card .head .grow { min-width: 0; flex: 1; }
.dev-card .head b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.dev-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--s1) 14%, transparent)); color: var(--brand); flex: none; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-stats div { background: var(--surface-2); border-radius: 11px; padding: 8px 10px; }
.mini-stats b { display: block; font-size: 17px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mini-stats small { font-size: 11px; color: var(--muted); font-weight: 600; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--surface);
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13.5px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.err-card { border-color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }

/* ---------------------------------------------------------------- responsive */

.range-mobile { display: none; margin-bottom: 12px; }
.range-mobile .seg { width: 100%; }
.range-mobile .seg button { flex: 1; }


@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr) 280px; }
  .g-21, .g-12 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-hero { padding: 26px 22px; }
  .login-hero h1 { font-size: 32px; }
  .login-hero .brand-lockup .moto-logo { height: 36px; }
  .login-hero .facts { display: none; }
  .login-hero { min-height: 300px; gap: 28px; }

  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 86vw; max-width: 300px;
    width: min(300px, 86vw);
    transform: translateX(-102%);
    transition: transform 0.25s ease;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    z-index: 60;
  }
  .shell.drawer .sidebar { transform: none; }
  .shell.drawer .scrim { display: block; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(5, 12, 22, 0.45); z-index: 50; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 4px 16px calc(88px + env(safe-area-inset-bottom)); }
  .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 10.5px; font-weight: 600; color: var(--muted); border-radius: 12px; }
  .bottom-nav a.on { color: var(--brand-ink); }
  .bottom-nav a svg { width: 21px; height: 21px; }
  .topbar .tools .select.dev { display: none; }
}
@media (max-width: 640px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 14px; }
  .kpi .value { font-size: 25px; }
  .kpi .spark { display: none; }
  .card { padding: 16px; border-radius: 16px; }
  .table-wrap { margin: 0 -16px -16px; }
  .hello { padding: 20px; }
  .hello h2 { font-size: 22px; }
  .topbar h1 { font-size: 18px; }
  .topbar .seg button { padding: 6px 9px; }
  .live-pill .txt { display: none; }
  .live-pill { padding: 0 12px; }
  .hide-sm { display: none !important; }
  .heat { grid-template-columns: 28px repeat(24, minmax(0, 1fr)); gap: 2px; }
  .heat .hh:nth-child(odd) { visibility: hidden; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut { margin: 0 auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar .range-seg { display: none; }
  .range-mobile { display: flex; }
  .kpi .foot .ft { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (forced-colors: active) {
  .hbar .fill, .heat .c, .cal .d { forced-color-adjust: none; }
}

/* ---------------------------------------------------------------- coming soon (features.js) */

.nav a.soon { color: var(--muted); }
.nav a.soon svg { opacity: 0.6; }
.soon-chip { margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; background: var(--surface-3); color: var(--muted); }
.card.soon { text-align: center; padding: 44px 24px 40px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.card.soon h2 { font-size: 28px; letter-spacing: -0.02em; }
.card.soon p { margin: 0; max-width: 52ch; color: var(--ink-2); font-size: 15px; }
.card.soon p.muted { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.soon-tiles { display: flex; gap: 16px; margin-bottom: 10px; }
.soon-links { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

/* ---------------------------------------------------------------- live bracket */

.match.is-live { border-color: var(--good); box-shadow: 0 0 0 3px var(--good-soft), var(--shadow); }
.match .st.live { background: var(--good); color: #fff; animation: live-tag 1.4s ease-in-out infinite; }
@keyframes live-tag { 50% { opacity: 0.55; } }
.match .p.lv .sc { color: var(--good-ink); }
.match .p .live-dot { width: 7px; height: 7px; }
.match.changed { animation: match-flash 2.4s ease; }
@keyframes match-flash { 0%, 30% { box-shadow: 0 0 0 4px var(--brand-glow), var(--shadow); border-color: var(--brand); } 100% { box-shadow: var(--shadow); } }

/* ---- Store: package editor (admin) */
.store-t td.pkg-cell { white-space: normal; min-width: 220px; max-width: 420px; }
.store-t .pkg-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px; }
.modal-wrap {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(10, 20, 35, 0.45);
  animation: fade-in 0.15s ease;
}
@keyframes fade-in { from { opacity: 0; } }
.modal { width: 100%; max-width: 880px; max-height: 100%; display: flex; flex-direction: column; padding: 0; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-head, .modal-foot { display: flex; align-items: center; gap: 10px; padding: 16px 20px; }
.modal-head { justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; margin: 0 0 2px; }
.modal-foot { border-top: 1px solid var(--line); }
.modal-body { display: flex; gap: 24px; padding: 20px; overflow-y: auto; }
.pe-form { flex: 1 1 0; min-width: 0; }
.pe-side { flex: 0 0 300px; min-width: 0; }
.field .count { float: right; font-style: normal; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.field .count.over { color: var(--bad-ink); font-weight: 700; }
.input.area { height: auto; min-height: 140px; padding: 11px 14px; line-height: 1.45; resize: vertical; font-family: inherit; }
.small { font-size: 12.5px; }
p.small svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; }
.pe-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.pe-label svg { width: 14px; height: 14px; }
/* The tablet's store_item: 3-line title, 4-line description */
.pe-preview { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px; background: var(--surface-2); margin-bottom: 6px; }
.pe-top { display: flex; gap: 10px; align-items: flex-start; }
.pe-img { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand-ink); }
.pe-top b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: 15px; line-height: 1.3; word-break: break-word; }
.pe-top small { display: block; color: #6a9e40; font-size: 12px; margin-top: 3px; }
.pe-preview p { margin: 10px 0 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; font-size: 13px; line-height: 1.4; white-space: pre-line; word-break: break-word; }
.pe-history { max-height: 220px; overflow-y: auto; }
.pe-h { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.pe-h:first-child { border-top: 0; }
.pe-h > div:first-child { flex: 0 0 auto; }
.pe-h > div:first-child small { display: block; }
.pe-h-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-h .was { text-decoration: line-through; color: var(--muted); }
@media (max-width: 760px) {
  .modal-wrap { padding: 0; align-items: stretch; }
  .modal { max-width: none; border-radius: 0; }
  .modal-body { flex-direction: column; }
  .pe-side { flex-basis: auto; }
  .store-t .pkg-desc { max-width: 200px; }
}
.store-note { margin: 10px 2px 0; }
.store-note svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; }
.mono { font-family: var(--mono); font-size: 11.5px; }

/* ---- Centers + Highscore */
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; flex: 1 1 320px; max-width: 720px; }
.page-head > .btn { margin-left: auto; }
.kind-ic { flex: none; width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--ink-2); }
.kind-ic svg { width: 18px; height: 18px; }
.kind-ic.lg { width: 52px; height: 52px; border-radius: 15px; }
.kind-ic.lg svg { width: 26px; height: 26px; }
.kind-ic[data-kind="gym"] { color: var(--s2); }
.kind-ic[data-kind="sports_club"] { color: var(--s4); }
.kind-ic[data-kind="rehab"] { color: var(--s3); }
.kind-ic[data-kind="senior_care"] { color: var(--s5); }
.kind-ic[data-kind="hospital"] { color: var(--s1); }
.kind-ic[data-kind="school"] { color: var(--s7); }
.center-card { display: flex; flex-direction: column; gap: 14px; transition: border-color 0.15s, transform 0.15s; }
.center-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.cc-head { display: flex; align-items: center; gap: 12px; }
.cc-head .grow { flex: 1; min-width: 0; }
.cc-head b { display: block; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-head small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-head > svg { width: 16px; height: 16px; color: var(--muted); }
.cc-foot { display: flex; align-items: center; gap: 10px; font-size: 12.5px; justify-content: space-between; }
table.t td.wrap { white-space: normal; }
.person .chip { padding: 1px 8px; font-size: 11px; vertical-align: 1px; }
.person .chip svg { width: 11px; height: 11px; }
.select.sm { height: 32px; font-size: 12.5px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { flex: 1 1 150px; min-width: 0; }
select.input { padding-right: 32px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d8a9c' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.form-actions { display: flex; align-items: center; gap: 10px; }
.btn.danger { color: var(--bad-ink); }
.btn.danger:hover { background: var(--bad-soft); }
.dev-list .row { padding-left: 18px; padding-right: 12px; }
.dev-list .row .t .chip { padding: 1px 8px; font-size: 11px; margin-left: 4px; }
.modal.narrow { max-width: 620px; }
.modal-body.col { display: block; }
.pick-list { margin-top: 12px; max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pick-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.pick-row:first-child { border-top: 0; }
.pick-row:hover { background: var(--surface-2); }
.pick-row input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand); flex: none; }
.pick-row .grow { flex: 1; min-width: 0; }
.pick-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.pick-row .chip { padding: 1px 8px; font-size: 11px; }
.pick-row small.moves { color: var(--warn-ink); }
.pick-row small.moves svg { width: 12px; height: 12px; vertical-align: -1px; margin-right: 4px; }
/* Podium: 2nd, 1st, 3rd */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 14px; margin: 8px 0 22px; }
.pod { flex: 0 1 220px; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; color: inherit; }
.pod b { font-size: 14.5px; max-width: 100%; overflow: hidden; line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; word-break: break-word; }
.pod small { color: var(--muted); font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .pts { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pod .pts small { display: inline; margin-left: 4px; font-weight: 600; }
.pod .block { width: 100%; border-radius: 12px 12px 4px 4px; background: linear-gradient(180deg, var(--brand-soft), transparent); border: 1px solid var(--line); border-bottom: 0; }
.pod.p1 .block { height: 86px; background: linear-gradient(180deg, rgba(237, 161, 0, 0.28), transparent); }
.pod.p2 .block { height: 58px; background: linear-gradient(180deg, rgba(125, 138, 156, 0.28), transparent); }
.pod.p3 .block { height: 40px; background: linear-gradient(180deg, rgba(205, 127, 50, 0.28), transparent); }
.pod[href]:hover b { text-decoration: underline; }
.pod.mine b { color: var(--brand-ink); }
.medal { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); }
.medal.m1 { background: linear-gradient(135deg, #f6c445, #d99a00); }
.medal.m2 { background: linear-gradient(135deg, #c4ccd6, #8b96a5); }
.medal.m3 { background: linear-gradient(135deg, #e0a36a, #b5702f); }
.rank-t tr.go { cursor: pointer; }
.rank-t tr.go:hover td { background: var(--surface-2); }
.rank-t tr.mine td { background: var(--brand-soft); }
.rank-t tr.on td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.rank { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; border-radius: 8px; font-weight: 700; background: var(--surface-3); }
.rank.r1 { background: linear-gradient(135deg, #f6c445, #d99a00); color: #fff; }
.rank.r2 { background: linear-gradient(135deg, #c4ccd6, #8b96a5); color: #fff; }
.rank.r3 { background: linear-gradient(135deg, #e0a36a, #b5702f); color: #fff; }
.big-n { font-size: 15px; }
.center-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.center-hero .grow { flex: 1; min-width: 180px; }
.center-hero h2 { font-size: 21px; margin: 0 0 2px; }
.rank-badge { display: flex; align-items: center; gap: 10px; }
.rank-badge span { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; color: var(--brand-ink); }
.rank-badge small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.period-seg { flex-wrap: wrap; }
@media (max-width: 760px) {
  .podium { gap: 8px; }
  .pod .pts { font-size: 17px; }
  .kind-ic.lg { width: 42px; height: 42px; }
  .page-head > .btn { margin-left: 0; }
  .rank-t .kind-ic { display: none; }
  .rank-t td, .rank-t th { padding-left: 10px; padding-right: 10px; }
  .pod .pts small { display: none; }
}
.card > .hint { margin-top: 14px; }

/* ---- Senior Olympics */
.oly-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.oly-hero .grow { flex: 1 1 320px; min-width: 0; }
.oly-hero h2 { font-size: 26px; letter-spacing: -0.02em; margin: 2px 0 4px; }
.oly-hero p { margin: 0 0 12px; }
.oly-hero .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.oly-kicker { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #d63aa0; }
.olympic-rings { flex: none; }
.oly-progress { margin-top: 14px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; max-width: 520px; }
.oly-progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #3f9be0, #6cbf3f, #f2c500, #d63aa0); }
.oly-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; margin-left: auto; }
.oly-admin { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.oly-scope { flex-wrap: wrap; }
.oly-scope svg { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.oly-dis { border-top: 4px solid var(--dis); display: flex; flex-direction: column; }
.oly-dis-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.oly-dis-h h3 { font-size: 16px; }
.oly-dis-h .sub { font-size: 12.5px; color: var(--muted); }
.oly-dis-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--dis); color: #fff; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--dis); }
.oly-dis-ic svg { width: 19px; height: 19px; }
.oly-list { list-style: none; margin: 0; padding: 0; flex: 1; }
.oly-list li { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-top: 1px solid var(--line); border-radius: 8px; }
.oly-list li:first-child { border-top: 0; }
.oly-list li.mine { background: var(--brand-soft); }
.oly-list .grow { flex: 1; min-width: 0; }
.oly-list b { display: block; font-size: 13.5px; }
.oly-list small { display: block; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oly-list .res { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.medal-n { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 800; background: var(--surface-3); color: var(--ink-2); }
.medal-n.m1 { background: linear-gradient(135deg, #f6c445, #d99a00); color: #fff; }
.medal-n.m2 { background: linear-gradient(135deg, #c4ccd6, #8b96a5); color: #fff; }
.medal-n.m3 { background: linear-gradient(135deg, #e0a36a, #b5702f); color: #fff; }
.oly-none { padding: 14px 4px; }
.oly-dis-f { margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.aa-t tr.qualified td { background: var(--brand-soft); }
.aa-t tr.mine td { box-shadow: inset 3px 0 0 var(--brand); }
.oly-q { margin-top: 5px; padding: 2px 9px; font-size: 11px; }
.oly-q svg { width: 12px; height: 12px; }
.oly-flag { background: var(--surface-3); color: var(--ink-2); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; }
.oly-finalist.mine { background: var(--brand-soft); border-radius: 10px; }
.medal-t td, .medal-t th { white-space: nowrap; }
.oly-empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 20px; }
.oly-empty h2 { font-size: 22px; margin: 0; }
.oly-empty p { margin: 0; max-width: 460px; }
@media (max-width: 760px) {
  .oly-hero { gap: 14px; }
  .oly-hero h2 { font-size: 21px; }
  .oly-side { align-items: stretch; margin-left: 0; width: 100%; }
  .oly-admin { justify-content: flex-start; }
}
.oly-ages { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 8px; }
.oly-age-hint { margin: 0 0 14px; }
.oly-age-hint svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; }
/* MOTO Olympics edition form: disciplines and centres (sql/032) */
.oly-fsec { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 6px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.oly-fsec h4 { margin: 0; font-size: 14px; }
.oly-warn { margin: 0 0 10px; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn-ink); font-size: 12.5px; }
.oly-warn svg, .oly-out svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.oly-dlist { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.oly-drow { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--dis); border-radius: var(--radius-sm); }
.oly-drow .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.oly-drow .select { width: 100%; max-width: none; }
.oly-drow small { font-size: 12px; }
.oly-dnum { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--dis); color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center; margin-top: 6px; }
.oly-dbtn { display: flex; flex-direction: column; gap: 2px; }
.oly-centres { margin-top: 0; max-height: 34vh; }
.oly-out { margin-top: 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- integration (API keys) */

.nav a .ext { width: 13px; height: 13px; margin-left: auto; opacity: 0.55; transform: rotate(-45deg); }
.int-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 26px; padding: 26px 28px; overflow: hidden; }
.int-hero::after { content: ""; position: absolute; left: -80px; bottom: -120px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(closest-side, var(--brand-glow), transparent); pointer-events: none; }
.int-hero h2 { font-size: 26px; letter-spacing: -0.03em; margin: 12px 0 8px; }
.int-hero p { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 60ch; }
.int-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.int-base { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; min-width: 0; align-self: start; }
.int-base .l { font-size: 11.5px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.int-base .code-line + .l { margin-top: 12px; }
.code-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.code-line code { flex: 1; min-width: 0; font: 500 13px/1.4 var(--mono); padding: 8px 10px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); overflow-x: auto; white-space: nowrap; }
.int-facts { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.int-facts span { display: flex; align-items: center; gap: 8px; }
.int-facts svg { width: 15px; height: 15px; color: var(--brand); }
.kpi .value.int-small { font-size: 24px; }
.int-av { background: var(--brand-soft); color: var(--brand-ink); }
.int-av.off { background: var(--surface-3); color: var(--muted); }
.int-av svg { width: 15px; height: 15px; }
.int-perms { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.int-perms .perm { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.int-perms .perm svg { width: 14px; height: 14px; }
.chip.sm-chip { padding: 2px 8px; font-size: 11.5px; }
.int-pre { margin: 0; padding: 14px 16px; border-radius: var(--radius-sm); background: #0e1a2b; color: #d9e6f5; overflow-x: auto; font: 500 12.5px/1.6 var(--mono); }
:root[data-theme="dark"] .int-pre { background: #070d16; border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .int-pre { background: #070d16; border: 1px solid var(--line); } }
.int-examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.int-ex { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); min-width: 0; }
.int-ex code { display: block; font: 600 12px/1.5 var(--mono); color: var(--brand-ink); overflow-wrap: anywhere; }
.int-ex span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.int-scope { display: flex; flex-wrap: wrap; width: 100%; }
.int-scope button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; }
.int-scope button svg { width: 15px; height: 15px; }
.int-scope button[disabled] { opacity: 0.45; pointer-events: none; }
.int-hint { display: block; color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.int-fixed { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.int-fixed svg { width: 16px; height: 16px; color: var(--brand); }
.int-perm-list { margin-top: 0; max-height: none; }
.int-perm-list b { display: inline-flex; align-items: center; gap: 6px; }
.int-perm-list b svg { width: 15px; height: 15px; color: var(--brand); }
.int-pii { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.field.grow { flex: 1 1 240px; }
.modal .field-row .field:first-child { flex: 0 0 170px; }
.int-secret-warn { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn-ink); font-size: 13.5px; line-height: 1.45; }
.int-secret-warn svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.int-secret-warn b { color: inherit; }
.int-secret { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); border: 2px dashed var(--brand); background: var(--brand-soft); }
.int-secret code { flex: 1; min-width: 0; font: 650 14px/1.4 var(--mono); overflow-wrap: anywhere; user-select: all; cursor: text; }
.int-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13.5px; }
.int-dl dt { color: var(--muted); font-weight: 600; }
.int-dl dd { margin: 0; min-width: 0; }
.int-usage { width: 100%; height: 150px; display: block; }
.int-path .mono { font-size: 12px; overflow-wrap: anywhere; }
.chip.mono-chip { font-family: var(--mono); font-size: 11.5px; padding: 2px 8px; }
@media (max-width: 980px) {
  .int-hero { grid-template-columns: minmax(0, 1fr); padding: 22px 20px; }
  .int-examples { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .modal .field-row .field:first-child { flex: 1 1 100%; }
}

/* ---------------------------------------------------------------- Control room (sql/036) */
.kind-ic.sm { width: 30px; height: 30px; border-radius: 9px; }
.kind-ic.sm svg { width: 15px; height: 15px; }

.cr-head { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; margin-bottom: 18px; }
.cr-title { display: flex; align-items: center; gap: 16px; min-width: 0; }
.cr-title small { display: flex; align-items: center; gap: 6px; color: var(--brand-ink); font-weight: 650; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.cr-title small svg { width: 15px; height: 15px; }
.cr-title h2 { font-size: 24px; letter-spacing: -0.02em; margin: 2px 0 0; }
.cr-title .moto-logo { height: 34px; width: auto; }
.cr-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cr-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cr-clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.cr-clock b { font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.cr-clock small { color: var(--muted); font-size: 11.5px; }

.cr-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 18px; margin-top: 18px; }
.cr-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* The map: always dark, like a control-room wall */
.cr-map {
  position: relative; padding: 0; overflow: hidden; min-height: 460px; border-color: transparent;
  background: radial-gradient(900px 500px at 70% 0%, rgba(76, 190, 216, 0.16), transparent 60%),
              linear-gradient(160deg, #06202b 0%, #0a1830 100%);
  color: #e8fbf7;
}
.cr-map-host, .cr-map-svg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; }
.cr-map-svg { display: block; }
.cr-map-svg .grat { fill: none; stroke: rgba(126, 227, 194, 0.07); stroke-width: 1; }
/* Borders stay a hairline at any zoom */
.cr-map-svg .land path { fill: #16334a; stroke: #0a1830; stroke-width: 0.6; vector-effect: non-scaling-stroke; }
.cr-map-svg .land path.has { fill: #1d5a63; stroke: rgba(126, 227, 194, 0.5); }
.cr-site { cursor: pointer; }
.cr-site .dot { fill: #9fb3c8; stroke: #06202b; stroke-width: 2; }
.cr-site .halo { fill: #9fb3c8; opacity: 0.18; }
.cr-site .ping { fill: none; stroke: #5eead4; stroke-width: 2; }
.cr-site.st-live .dot { fill: #5eead4; }
.cr-site.st-live .halo { fill: #5eead4; opacity: 0.35; }
.cr-site.st-active .dot { fill: #38d27a; }
.cr-site.st-active .halo { fill: #38d27a; opacity: 0.25; }
.cr-site.st-alert .dot { fill: #ffb347; }
.cr-site.st-alert .halo { fill: #ff7a59; opacity: 0.3; animation: cr-blink 1.6s ease-in-out infinite; }
.cr-site:hover .halo { opacity: 0.55; }
.cr-pin .dot { fill: #ff5a6a; stroke: #fff; stroke-width: 2.5; }
.cr-pin .halo { fill: #ff5a6a; opacity: 0.3; }
@keyframes cr-blink { 50% { opacity: 0.05; } }
.cr-scan {
  position: absolute; top: 0; bottom: 0; left: -30%; width: 30%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(94, 234, 212, 0.06) 70%, rgba(94, 234, 212, 0.14) 98%, transparent);
  animation: cr-scan 9s linear infinite;
}
@keyframes cr-scan { to { left: 100%; } }
.cr-map-top { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; align-items: center; gap: 12px; pointer-events: none; }
.cr-map-top > * { pointer-events: auto; }
.cr-map-top .seg { margin-left: auto; }
/* Several regions: the buttons scroll sideways on a narrow map */
.cr-views { max-width: calc(100% - 160px); overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.cr-views::-webkit-scrollbar { display: none; }
.cr-views button { white-space: nowrap; }
/* Zoom by hand */
.cr-map-host { cursor: grab; touch-action: none; }
.cr-map.dragging .cr-map-host, .cr-map.dragging .cr-site { cursor: grabbing; }
.cr-zoom { position: absolute; right: 16px; top: 64px; display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; background: rgba(6, 32, 43, 0.75); }
.cr-zoom button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: none; color: rgba(232, 251, 247, 0.8); cursor: pointer; }
.cr-zoom button + button { border-top: 1px solid rgba(126, 227, 194, 0.12); }
.cr-zoom button:hover { background: rgba(126, 227, 194, 0.14); color: #fff; }
.cr-zoom svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.cr-zoom-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 10px 16px; border-radius: 10px; background: rgba(6, 32, 43, 0.85); font-size: 13.5px; pointer-events: none; opacity: 0; transition: opacity 0.25s; }
.cr-zoom-hint.on { opacity: 1; }
.cr-live-n { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: rgba(6, 32, 43, 0.75); font-size: 13px; }
.cr-live-n b { font-size: 16px; }
.seg.dark { background: rgba(6, 32, 43, 0.75); }
.seg.dark button { color: rgba(232, 251, 247, 0.7); }
.seg.dark button[aria-pressed="true"] { background: rgba(126, 227, 194, 0.18); color: #fff; box-shadow: none; }
.cr-legend { position: absolute; left: 16px; bottom: 14px; display: flex; gap: 14px; flex-wrap: wrap; padding: 7px 12px; border-radius: 10px; background: rgba(6, 32, 43, 0.7); font-size: 12px; }
.cr-missing { position: absolute; right: 16px; bottom: 14px; display: flex; align-items: center; gap: 6px; font-size: 12px; color: #ffcf3d; padding: 7px 10px; border-radius: 10px; background: rgba(6, 32, 43, 0.7); }
.cr-missing svg { width: 14px; height: 14px; }
.cr-empty { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; opacity: 0.8; max-width: 320px; }

/* Status dot + label */
.cr-st { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 560; white-space: nowrap; }
.cr-st i { width: 9px; height: 9px; border-radius: 50%; background: #9fb3c8; flex: none; }
.cr-st.st-live i { background: #5eead4; box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.7); animation: cr-pulse 1.6s infinite; }
.cr-st.st-live.off i { background: #9fb3c8; animation: none; }
.cr-st.st-active i { background: #38d27a; }
.cr-st.st-alert i { background: #ff9447; }
.cr-st.st-new i, .cr-st.st-empty i { background: transparent; border: 2px solid #9fb3c8; width: 7px; height: 7px; }
@keyframes cr-pulse { 70% { box-shadow: 0 0 0 7px rgba(94, 234, 212, 0); } 100% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0); } }

/* Needs attention */
.cr-alerts { display: flex; flex-direction: column; }
.cr-alert { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.cr-alert:first-child { border-top: 0; padding-top: 0; }
.cr-alert .grow { min-width: 0; flex: 1; }
.cr-alert b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-alert small { color: var(--muted); font-size: 12.5px; }
.cr-al-ic { background: var(--surface-3); color: var(--ink-2); }
.cr-alert.lv-high .cr-al-ic { background: var(--bad-soft); color: var(--bad-ink); }
.cr-alert.lv-medium .cr-al-ic { background: var(--warn-soft); color: var(--warn-ink); }
.cr-alert.lv-high small { color: var(--bad-ink); }
.cr-nudge { flex: none; }
.cr-more { padding-top: 8px; font-size: 12.5px; }
.cr-allgood { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.cr-allgood > svg { width: 34px; height: 34px; padding: 7px; border-radius: 11px; background: var(--good-soft); color: var(--good-ink); flex: none; }
.cr-allgood small { display: block; color: var(--muted); }

/* Live now */
.cr-live { min-height: 0; }
.cr-live-list { display: flex; flex-direction: column; gap: 10px; }
.cr-live-row { display: flex; align-items: center; gap: 10px; }
.cr-live-row .grow { flex: 1; min-width: 0; }
.cr-live-row b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-live-row small { display: block; font-size: 12px; opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-live-row .end { text-align: right; flex: none; }
.cr-live-row .end .mono { font-size: 17px; font-weight: 650; color: #5eead4; }
.cr-quiet { display: flex; align-items: center; gap: 12px; opacity: 0.8; font-size: 13px; }

/* Sites table, ranking */
.cr-table tr.flash td { animation: cr-flash 1.6s ease; }
@keyframes cr-flash { 0%, 40% { background: var(--brand-soft); } }
.cr-spark svg { width: 120px; height: 28px; display: block; }
.cr-rank { display: flex; flex-direction: column; gap: 12px; }
.cr-rank-row { display: flex; align-items: center; gap: 12px; }
.cr-rank-row .grow { flex: 1; min-width: 0; }
.cr-rank-row small { color: var(--muted); font-size: 12px; margin-left: 6px; }
.cr-rank-row .num { font-weight: 650; flex: none; }
.cr-rank-n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); font-weight: 700; font-size: 13px; flex: none; }
.cr-rank-row:first-child .cr-rank-n { background: var(--moto-grad); color: #fff; }
.cr-bar { height: 6px; border-radius: 3px; background: var(--surface-3); margin-top: 6px; overflow: hidden; }
.cr-bar i { display: block; height: 100%; border-radius: 3px; background: var(--moto-grad); }

/* Wall mode: the whole screen, no menu, dark */
body.cr-walled .sidebar, body.cr-walled .topbar, body.cr-walled .bottom-nav { display: none; }
body.cr-walled .shell { grid-template-columns: minmax(0, 1fr); }
body.cr-walled .content { max-width: none; padding: 20px 26px; }
body.cr-walled .view { animation: none; }
.cr.wall { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; height: calc(100vh - 40px); min-height: 640px; }
.cr.wall .cr-head { margin-bottom: 14px; }
.cr.wall .cr-title h2 { font-size: 30px; }
.cr.wall .cr-clock b { font-size: 34px; }
.cr.wall .cr-main { min-height: 0; margin-top: 14px; }
.cr.wall .cr-map { min-height: 0; }
.cr.wall .cr-side { min-height: 0; }
.cr.wall .cr-attn { flex: 1 1 auto; overflow: hidden; }
.cr.wall .cr-live { flex: 0 1 auto; max-height: 45%; overflow: hidden; }
.cr.wall .kpi .value { font-size: 40px; }
.cr-strip { margin-top: 14px; }
.cr-strip-in { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; animation: fade-in 0.5s ease; }
.cr-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 10px; border-top: 3px solid #9fb3c8; }
.cr-card.st-live { border-top-color: #5eead4; }
.cr-card.st-active { border-top-color: #38d27a; }
.cr-card.st-alert { border-top-color: #ff9447; }
.cr-card-h { display: flex; align-items: center; gap: 10px; }
.cr-card-h .grow { flex: 1; min-width: 0; }
.cr-card-h b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-card-h small { color: var(--muted); font-size: 12px; }
.cr-card-h .cr-st { font-size: 0; }
.cr-card-n { display: flex; gap: 16px; margin-top: 10px; }
.cr-card-n span { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cr-card-n small { color: var(--muted); font-size: 11.5px; }
.cr-card-spark svg { width: 100%; height: 34px; display: block; margin-top: 4px; }
.cr-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.cr-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.cr-dots i.on { background: var(--brand); }

@media (max-width: 1180px) {
  .cr-main { grid-template-columns: minmax(0, 1fr); }
  .cr-map { min-height: 380px; }
}
@media (max-width: 640px) {
  .cr-tools { margin-left: 0; width: 100%; }
  .cr-tools .select { flex: 1; }
  .cr-map { min-height: 300px; }
  .cr-legend { display: none; }
  .cr-title h2 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .cr-scan, .cr-site.st-alert .halo, .cr-st.st-live i { animation: none; }
}

/* Operators: a password shown once */
.op-secret { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.op-secret small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.op-secret code { font-family: var(--mono); font-size: 16px; user-select: all; word-break: break-all; }

/* Centre editor: map picker */
.map-pick-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -4px 0 14px; font-size: 12.5px; }
.picker-layer { z-index: 70; }
.picker-layer .modal { width: min(920px, 100%); }
.map-pick { position: relative; height: min(56vh, 520px); border-radius: var(--radius-sm); overflow: hidden; cursor: crosshair;
  background: linear-gradient(160deg, #06202b 0%, #0a1830 100%); }
.map-pick .cr-map-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
