:root {
  --bg: #070a0f;
  --bg-soft: #0a0f16;
  --panel: #0d131c;
  --panel-2: #111925;
  --panel-3: #16202e;
  --border: #1d2836;
  --border-soft: #16202c;
  --text: #e8eef7;
  --muted: #8997aa;
  --muted-2: #617086;
  --teal: #4fe3c1;
  --teal-dim: #123c37;
  --violet: #a78bfa;
  --amber: #f5b84b;
  --rose: #fb7185;
  --blue: #60a5fa;
  --green: #34d399;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --display: "Sora", "IBM Plex Sans", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(640px 320px at 88% -10%, rgba(79, 227, 193, 0.08), transparent 70%),
    radial-gradient(520px 280px at 0% 100%, rgba(167, 139, 250, 0.05), transparent 70%);
  z-index: 0;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: rgba(79, 227, 193, 0.25); }

/* login */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}
.login-card {
  width: min(430px, 100%);
  background: linear-gradient(180deg, rgba(18, 25, 37, 0.92), rgba(11, 16, 24, 0.96));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 10px 0 8px; font-size: 30px; }
.login-card .muted { margin-bottom: 24px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: #0c1a18; border: 1px solid #1d4d44;
  display: flex; align-items: flex-end; justify-content: center; gap: 3px;
  padding: 7px;
}
.brand-mark span { width: 4px; border-radius: 2px; background: var(--teal); display: block; }
.brand-mark span:nth-child(1) { height: 8px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 13px; opacity: .8; }
.brand-mark span:nth-child(3) { height: 18px; }
.brand-mark.large { width: 48px; height: 48px; border-radius: 14px; padding: 10px; margin-bottom: 14px; }
.brand-mark.large span { width: 5px; }
.brand-mark.large span:nth-child(1) { height: 11px; }
.brand-mark.large span:nth-child(2) { height: 18px; }
.brand-mark.large span:nth-child(3) { height: 25px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0;
}
.muted { color: var(--muted); }
.error-text { color: var(--rose); font-size: 13px; margin-top: 10px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > span { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #2c5a53;
  box-shadow: 0 0 0 3px rgba(79, 227, 193, 0.09);
}
.field small { color: var(--muted-2); font-size: 11px; }

/* shell */
.app-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.rail {
  width: 248px;
  flex: 0 0 248px;
  border-right: 1px solid var(--border-soft);
  background: rgba(8, 12, 18, 0.72);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  backdrop-filter: blur(14px);
}
.rail-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.rail-brand strong { font-family: var(--display); font-size: 15px; letter-spacing: .06em; display: block; }
.rail-brand small { color: var(--muted-2); font-size: 9px; letter-spacing: .22em; display: block; margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav a svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.active { background: rgba(79, 227, 193, 0.08); color: var(--teal); }
.rail-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.rail-status { display: flex; align-items: center; gap: 9px; padding: 6px 8px 12px; }
.rail-status strong { display: block; font-size: 12px; font-weight: 500; }
.rail-status small { display: block; color: var(--muted-2); font-size: 10px; font-family: var(--mono); }
.rail-link { display: block; color: var(--muted); font-size: 12px; padding: 7px 8px; border-radius: 8px; }
.rail-link:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); display: inline-block; flex: none; }
.dot.healthy { background: var(--green); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12); }
.dot.failing { background: var(--rose); box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.12); }
.dot.unknown { background: var(--amber); box-shadow: 0 0 0 3px rgba(245, 184, 75, 0.1); }
.dot.live { background: var(--teal); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 72px;
  flex: 0 0 72px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(7, 10, 15, 0.6);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title h1 { font-size: 20px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0 11px;
  height: 36px;
  width: 260px;
}
.search svg { width: 15px; height: 15px; fill: none; stroke: var(--muted-2); stroke-width: 1.7; }
.search input { background: none; border: 0; outline: none; width: 100%; font-size: 13px; }
.search input::placeholder { color: var(--muted-2); }
.view { padding: 26px 28px 60px; max-width: 1580px; width: 100%; margin: 0 auto; min-width: 0; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--panel-2); border-color: #2a384a; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #041411; font-weight: 600; }
.btn.primary:hover { background: #6aebcf; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--rose); border-color: rgba(251, 113, 133, .25); }
.btn.small { height: 29px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; }
.btn.wide { width: 100%; }
.icon-btn {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  border-radius: 9px; border: 1px solid var(--border);
  background: var(--panel); color: var(--muted); cursor: pointer;
  transition: color .15s, background .15s;
}
.icon-btn:hover { color: var(--text); background: var(--panel-2); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menu-btn { display: none; }

/* layout bits */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 21px; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.grid.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.sidebar { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); }
.card {
  background: linear-gradient(180deg, rgba(15, 21, 31, 0.95), rgba(11, 16, 24, 0.95));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
}
.card.tight { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font-size: 14px; }
.card-head .eyebrow { margin-top: 2px; }
.card-link { font-size: 12px; color: var(--muted); }
.card-link:hover { color: var(--teal); }

.kpi { padding: 20px; position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; }
.kpi .value { font-family: var(--display); font-size: 32px; font-weight: 600; letter-spacing: -0.04em; margin-top: 10px; line-height: 1.05; }
.kpi .sub { color: var(--muted-2); font-size: 11.5px; margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.kpi .spark { position: absolute; right: 16px; bottom: 16px; width: 64px; height: 24px; opacity: .8; }
.kpi.teal .value { color: var(--teal); }
.kpi.violet .value { color: var(--violet); }
.kpi.amber .value { color: var(--amber); }
.kpi.rose .value { color: var(--rose); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 500;
  background: var(--panel-3);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.pill.ok { color: var(--green); background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.2); }
.pill.warn { color: var(--amber); background: rgba(245, 184, 75, 0.08); border-color: rgba(245, 184, 75, 0.2); }
.pill.bad { color: var(--rose); background: rgba(251, 113, 133, 0.08); border-color: rgba(251, 113, 133, 0.2); }
.pill.info { color: var(--blue); background: rgba(96, 165, 250, 0.08); border-color: rgba(96, 165, 250, 0.2); }
.pill.violet { color: var(--violet); background: rgba(167, 139, 250, 0.08); border-color: rgba(167, 139, 250, 0.2); }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 6px; padding: 2px 7px; font-size: 10.5px;
  background: var(--bg-soft); border: 1px solid var(--border-soft); color: var(--muted);
  white-space: nowrap;
}
.chip.strong { color: var(--text); border-color: var(--border); }

/* source rows */
.source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 90px 84px;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--border-soft);
}
.source-row:first-of-type { border-top: 0; }
.source-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.source-name strong { font-weight: 500; font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source-name small { color: var(--muted-2); font-size: 10.5px; display: block; }
.source-num { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--muted); }
.source-num strong { color: var(--text); font-weight: 500; }

/* tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th {
  text-align: left;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 500;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 14, 21, 0.6);
  white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; vertical-align: middle; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.015); }
tbody tr:last-child td { border-bottom: 0; }
.ch-name { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.ch-logo {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  background: var(--panel-3); border: 1px solid var(--border);
  display: grid; place-items: center; overflow: hidden;
  font-family: var(--display); font-size: 12px; color: var(--muted);
}
.ch-logo img { width: 100%; height: 100%; object-fit: contain; }
.ch-name strong { display: block; font-weight: 500; font-size: 12.8px; line-height: 1.25; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-name small { display: block; color: var(--muted-2); font-size: 10.5px; font-family: var(--mono); margin-top: 2px; }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; }
.right { text-align: right; }
.center { text-align: center; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .field { margin: 0; flex-direction: row; align-items: center; gap: 6px; }
.toolbar select, .toolbar input {
  height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel); padding: 0 10px; font-size: 12px; outline: none;
}
.toolbar input { width: 220px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 12px; }

/* playlist cards */
.playlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.playlist-card { display: flex; flex-direction: column; gap: 12px; }
.playlist-card .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.playlist-card h3 { font-size: 15px; }
.playlist-card .statline { display: flex; gap: 14px; color: var(--muted); font-size: 11.5px; }
.playlist-card .statline strong { color: var(--text); font-family: var(--mono); font-weight: 500; }
.copy-row { display: flex; align-items: center; gap: 6px; background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: 8px; padding: 7px 8px; }
.copy-row code { flex: 1; font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-row .icon-btn { width: 26px; height: 26px; border: 0; background: transparent; }
.copy-row .icon-btn svg { width: 14px; height: 14px; }

/* drawer/modal */
.drawer { position: fixed; inset: 0; z-index: 100; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(2, 5, 9, 0.66); backdrop-filter: blur(3px); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(720px, 94vw);
  background: #0b1018;
  border-left: 1px solid var(--border);
  box-shadow: -30px 0 80px rgba(0, 0, 0, .5);
  overflow-y: auto;
  padding: 26px 26px 60px;
  animation: slide-in .22s ease-out;
}
@keyframes slide-in { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-close { position: absolute; top: 16px; right: 16px; z-index: 2; }
.modal { position: fixed; inset: 0; z-index: 110; }
.modal-scrim { position: absolute; inset: 0; background: rgba(2, 5, 9, 0.7); backdrop-filter: blur(3px); }
.modal-card {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(620px, 94vw); max-height: 88vh; overflow-y: auto;
  background: #0c121b; border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); padding: 26px;
}
.modal-close { position: absolute; top: 14px; right: 14px; }
.drawer h2, .modal h2 { font-size: 20px; padding-right: 40px; }
.detail-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.detail-logo { width: 62px; height: 62px; border-radius: 14px; background: var(--panel-3); border: 1px solid var(--border); overflow: hidden; display: grid; place-items: center; flex: none; font-family: var(--display); }
.detail-logo img { width: 100%; height: 100%; object-fit: contain; }
.detail-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 7px; }
.section { margin-top: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-head h3 { font-size: 13px; letter-spacing: .02em; }
.variant {
  border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px;
  margin-bottom: 8px; background: var(--bg-soft);
}
.variant.pinned { border-color: rgba(79, 227, 193, 0.35); background: rgba(79, 227, 193, 0.035); }
.variant-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.variant-name { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; }
.variant-url { font-family: var(--mono); font-size: 10px; color: var(--muted-2); margin-top: 6px; word-break: break-all; max-height: 30px; overflow: hidden; }
.variant-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; color: var(--muted); font-size: 10.5px; }
.variant-stats b { color: var(--text); font-weight: 500; font-family: var(--mono); }
.score-bar { width: 54px; height: 4px; border-radius: 3px; background: var(--panel-3); overflow: hidden; display: inline-block; vertical-align: middle; margin-left: 5px; }
.score-bar i { display: block; height: 100%; background: var(--teal); }
.track-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.track { border: 1px solid var(--border-soft); border-radius: 7px; padding: 7px 9px; background: var(--bg-soft); font-size: 11px; }
.track b { display: block; font-weight: 500; font-size: 11.5px; }
.track span { color: var(--muted-2); font-family: var(--mono); font-size: 10px; }

/* empty/skeleton */
.empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.skeleton { height: 110px; border-radius: var(--radius); background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton.tall { height: 260px; grid-column: span 2; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* toast */
.toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 200;
  background: #101a17; border: 1px solid #24574d; color: var(--text);
  border-radius: 10px; padding: 11px 15px; font-size: 12.5px;
  box-shadow: var(--shadow); max-width: 420px;
}
.toast.bad { background: #1c1114; border-color: #5a2630; }

/* AI */
.provider-card { display: flex; flex-direction: column; gap: 10px; }
.provider-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.provider-name { display: flex; align-items: center; gap: 9px; font-weight: 500; }
.provider-key { font-family: var(--mono); font-size: 10px; color: var(--muted-2); }
.model-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.model-toolbar input, .model-toolbar select { height: 34px; border: 1px solid var(--border); background: var(--panel); border-radius: 8px; padding: 0 10px; font-size: 12px; outline: none; }
.model-toolbar input { width: 280px; }
.model-name { display: flex; flex-direction: column; gap: 1px; }
.model-name strong { font-weight: 500; font-size: 12.5px; }
.model-name code { color: var(--muted-2); font-size: 10px; }
.model-table-wrap { max-height: 640px; overflow: auto; }
.model-table-wrap thead th { position: sticky; top: 0; z-index: 1; }
.default-banner { border: 1px solid rgba(79, 227, 193, .25); background: rgba(79, 227, 193, .045); border-radius: 12px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.default-banner strong { color: var(--teal); }
.analysis-output { white-space: pre-wrap; font-size: 12.5px; line-height: 1.7; color: #c8d4e2; background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: 10px; padding: 14px; max-height: 420px; overflow-y: auto; }

/* watch */
.watch-shell { min-height: 100vh; display: flex; flex-direction: column; background: #05080c; }
.watch-top { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--border-soft); }
.watch-brand { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-size: 13px; letter-spacing: .05em; }
.watch-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 330px; min-height: 0; }
.watch-stage { display: flex; flex-direction: column; min-width: 0; background: #000; }
.video-wrap { position: relative; flex: 1; display: grid; place-items: center; min-height: 0; background: #000; }
.video-wrap video { width: 100%; height: 100%; max-height: calc(100vh - 58px); object-fit: contain; background: #000; }
.watch-info { padding: 14px 18px; background: var(--bg-soft); border-top: 1px solid var(--border-soft); }
.watch-info h1 { font-size: 17px; }
.watch-info .meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 7px; }
.watch-side { border-left: 1px solid var(--border-soft); background: var(--bg-soft); padding: 18px; overflow-y: auto; }
.watch-side h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-2); margin: 18px 0 8px; font-family: var(--mono); font-weight: 500; }
.watch-side h3:first-child { margin-top: 0; }
.watch-side label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.watch-side select { width: 100%; height: 36px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 0 9px; font-size: 12px; }
.stats-box { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.stat-cell { background: var(--panel); border: 1px solid var(--border-soft); border-radius: 8px; padding: 8px; }
.stat-cell span { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); }
.stat-cell strong { display: block; font-family: var(--mono); font-size: 12px; font-weight: 500; margin-top: 3px; }
.player-error { color: var(--rose); font-size: 12px; padding: 10px 0; }
.watch-loading { color: var(--muted); font-size: 12px; }

@media (max-width: 1180px) {
  .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.sidebar { grid-template-columns: 1fr; }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .rail { width: 72px; flex-basis: 72px; padding: 16px 10px; }
  .rail-brand div:last-child, .nav a span, .rail-status div, .rail-link { display: none; }
  .rail-brand { padding: 4px 8px 20px; }
  .nav a { justify-content: center; padding: 11px; }
  .rail-status { justify-content: center; }
  .search { width: 190px; }
  .view { padding: 20px 16px 50px; }
  .topbar { padding: 0 16px; }
  .watch-body { grid-template-columns: 1fr; }
  .watch-side { border-left: 0; border-top: 1px solid var(--border-soft); }
}
@media (max-width: 640px) {
  .grid.kpis, .grid.two, .grid.three { grid-template-columns: 1fr; }
  .topbar-actions .search { display: none; }
  .page-head { align-items: flex-start; }
  .skeleton-grid { grid-template-columns: 1fr; }
  .skeleton.tall { grid-column: auto; }
  .source-row { grid-template-columns: 1fr 70px 70px; }
  .source-row > :last-child { display: none; }
}
