/* KiidsTube Portal. Colours from the app (PRD v2 §16); Baloo 2 is the app's own font, served from here. */
@font-face {
  font-family: "Baloo 2";
  src: url("/admin/baloo2.ttf") format("truetype");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --ink: #2b2440;
  --ink-2: #5a4f78;
  --ink-3: #8b84a3;
  --bg: #f6f3fb;
  --card: #ffffff;
  --card-2: #faf8fe;
  --line: #e7e1f2;
  --amber: #ffb547;
  --amber-deep: #e8890c;
  --coral: #ff7a6b;
  --sky: #4ea8f5;
  --indigo: #5b7cfa;
  --violet: #a98bf5;
  --green: #3fbf7f;
  --pink: #ff8fc1;
  --danger: #e2574a;
  --ok: #2fa56d;
  --changed: #fff4dc;
  --shadow: 0 1px 2px rgba(43, 36, 64, 0.06), 0 8px 24px rgba(43, 36, 64, 0.07);
  --shadow-lift: 0 2px 4px rgba(43, 36, 64, 0.08), 0 18px 40px rgba(43, 36, 64, 0.14);
  --radius: 20px;
  --font: "Baloo 2", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #f2eefc;
  --ink-2: #c3bbdc;
  --ink-3: #8f87ab;
  --bg: #13111d;
  --card: #1d1a2b;
  --card-2: #242036;
  --line: #322d48;
  --changed: #3a3020;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f2eefc;
    --ink-2: #c3bbdc;
    --ink-3: #8f87ab;
    --bg: #13111d;
    --card: #1d1a2b;
    --card-2: #242036;
    --line: #322d48;
    --changed: #3a3020;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2 { margin: 0; line-height: 1.15; }

button, select, input, textarea {
  font: inherit;
  color: inherit;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, .drop:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--indigo) 45%, transparent);
  outline-offset: 1px;
}
button { cursor: pointer; transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease; }
button:active { transform: scale(0.97); }

.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; border-radius: 14px; padding: 9px 16px; }
.btn:hover { box-shadow: var(--shadow); }
.btn.primary {
  background: linear-gradient(135deg, var(--amber), var(--amber-deep));
  border-color: transparent;
  color: #2b2440;
}
.btn.danger, button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.btn.danger:hover, button.danger:hover { background: color-mix(in srgb, var(--danger) 10%, var(--card)); }
.link { background: none; border: 0; padding: 4px; color: var(--indigo); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.hint { color: var(--ink-3); font-size: 13.5px; }
.error { color: var(--danger); font-weight: 600; min-height: 1.4em; }

/* ======================= Landing / sign-in ======================= */
.landing {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: linear-gradient(170deg, #7dd8ff 0%, #6aa8ff 45%, #5b7cfa 100%);
  color: #2b2440;
}
.sky { position: absolute; inset: 0; pointer-events: none; }
.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.12) 70%);
  animation: float 14s ease-in-out infinite;
}
.b1 { width: 140px; height: 140px; left: 6%; top: 12%; }
.b2 { width: 70px; height: 70px; left: 42%; top: 6%; animation-delay: -3s; animation-duration: 11s; }
.b3 { width: 200px; height: 200px; right: -40px; top: 30%; animation-delay: -6s; animation-duration: 18s; }
.b4 { width: 46px; height: 46px; left: 24%; bottom: 26%; animation-delay: -2s; }
.b5 { width: 90px; height: 90px; right: 30%; bottom: 14%; animation-delay: -8s; animation-duration: 16s; }
.b6 { width: 30px; height: 30px; left: 60%; top: 40%; animation-delay: -5s; animation-duration: 9s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(18px, -26px); }
  66% { transform: translate(-14px, 14px); }
}
.star { position: absolute; width: 26px; height: 26px; fill: #fff3b0; stroke: none; animation: twinkle 3.2s ease-in-out infinite; }
.s1 { left: 4%; top: 64%; }
.s2 { right: 18%; top: 14%; width: 18px; height: 18px; animation-delay: -1.2s; }
.s3 { left: 52%; bottom: 34%; width: 20px; height: 20px; animation-delay: -2.1s; }
@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(20deg); }
}
.hills {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -60px;
  height: 220px;
  background:
    radial-gradient(60% 120% at 25% 100%, #8fdc8a 60%, transparent 61%),
    radial-gradient(55% 110% at 80% 100%, #6fcf7c 60%, transparent 61%);
  opacity: 0.9;
}

.landing-inner {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 24px 120px;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 40px;
  align-items: center;
  min-height: 100vh;
}
.hero { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.hero-logo {
  width: 108px;
  height: auto;
  filter: drop-shadow(0 14px 22px rgba(43, 36, 64, 0.28));
  animation: bob 4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}
.wordmark { font-size: clamp(48px, 7vw, 84px); font-weight: 800; letter-spacing: -1px; line-height: 0.95; text-shadow: 0 4px 0 rgba(43, 36, 64, 0.12); }
.wordmark span { display: inline-block; animation: hop 2.8s ease-in-out infinite; }
.k1 { color: #ff6f61; }
.k2 { color: #ffb547; animation-delay: 0.1s !important; }
.k3 { color: #3fbf7f; animation-delay: 0.2s !important; }
.k4 { color: #ff8fc1; animation-delay: 0.3s !important; }
.k5 { color: #fff3b0; animation-delay: 0.4s !important; }
.k6 { color: #ffffff; animation-delay: 0.5s !important; }
@keyframes hop {
  0%, 70%, 100% { transform: translateY(0); }
  80% { transform: translateY(-10px); }
}
.tagline { margin: 0 0 12px; font-size: 19px; font-weight: 600; color: #fff; max-width: 34ch; text-shadow: 0 1px 2px rgba(43, 36, 64, 0.2); }

.download-card {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 22px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 60px rgba(43, 36, 64, 0.25);
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
.dl-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dl-head { display: flex; align-items: center; gap: 12px; }
.badge-android {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #3fbf7f, #2fa56d);
  color: #fff;
}
.badge-android svg { width: 28px; height: 28px; }
.dl-title { font-weight: 800; font-size: 20px; }
.dl-meta { color: #5a4f78; font-size: 14px; }
.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 18px;
  font-size: 19px;
  font-weight: 800;
  text-decoration: none;
  color: #2b2440;
  background: linear-gradient(135deg, #ffd166, #ffb547 45%, #ff8a3d);
  box-shadow: 0 10px 0 #d9761f, 0 18px 30px rgba(232, 137, 12, 0.35);
  transform: translateY(0);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.2s;
  position: relative;
  overflow: hidden;
}
.btn-download svg { width: 24px; height: 24px; stroke-width: 2.6; }
.btn-download::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: shine 3.4s ease-in-out infinite 1s;
}
@keyframes shine { 40%, 100% { transform: translateX(120%); } }
.btn-download:hover { transform: translateY(-2px); filter: saturate(1.1); }
.btn-download:active { transform: translateY(6px); box-shadow: 0 4px 0 #d9761f, 0 8px 16px rgba(232, 137, 12, 0.3); }
.btn-download[aria-disabled="true"] { pointer-events: none; filter: grayscale(0.7); opacity: 0.6; box-shadow: none; }
.dl-notes { background: rgba(255, 255, 255, 0.7); border-radius: 14px; padding: 8px 14px; }
.dl-notes summary { cursor: pointer; font-weight: 700; }
.dl-notes p { margin: 6px 0 2px; white-space: pre-line; color: #5a4f78; }
.dl-help { margin: 0; font-size: 13.5px; color: #5a4f78; }
.dl-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #5a4f78; }
.qr {
  width: 148px;
  height: 148px;
  padding: 10px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #efe9fb;
  display: grid;
  place-items: center;
}
.qr svg { width: 100%; height: 100%; stroke: none; }

.signin-card {
  justify-self: center;
  width: min(400px, 100%);
  padding: 34px 30px 26px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 30px 70px rgba(43, 36, 64, 0.3);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s both;
  color: #2b2440;
}
.signin-card h2 { font-size: 28px; font-weight: 800; }
.signin-card p { margin: 0; color: #5a4f78; }
.lock-orb {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-top: -70px;
  background: linear-gradient(135deg, #a98bf5, #5b7cfa);
  color: #fff;
  box-shadow: 0 12px 26px rgba(91, 124, 250, 0.45);
  border: 5px solid #fff;
}
.lock-orb svg { width: 32px; height: 32px; }
.btn-google {
  margin-top: 10px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 18px;
  font-weight: 700;
  font-size: 16px;
  border-radius: 16px;
  background: #fff;
  color: #2b2440;
  border: 1.5px solid #e2dcef;
  box-shadow: 0 2px 0 #e2dcef;
}
.btn-google:hover { box-shadow: 0 6px 18px rgba(43, 36, 64, 0.14); transform: translateY(-1px); }
.btn-google svg { width: 22px; height: 22px; stroke: none; }
.signin-card .link { color: #5b7cfa; font-size: 14px; }
.link-form { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.link-form input { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1.5px solid #e2dcef; background: #faf8fe; color: #2b2440; font-size: 16px; }
.btn-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  border: 0;
  border-radius: 16px;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  background: linear-gradient(135deg, #a98bf5, #5b7cfa);
  box-shadow: 0 8px 20px rgba(91, 124, 250, 0.35);
}
.btn-link:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(91, 124, 250, 0.45); }
.link-sent { width: 100%; padding: 10px 12px; border-radius: 12px; background: #e9f8f0; color: #1f7a4f !important; font-weight: 600; font-size: 14px; }
.or { width: 100%; display: flex; align-items: center; gap: 10px; color: #8b84a3; font-size: 13px; margin: 4px 0 -6px; }
.or::before, .or::after { content: ""; flex: 1; height: 1.5px; background: #ece6f6; }
.fine { font-size: 12.5px; color: #8b84a3 !important; }

/* ======================= Portal shell ======================= */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px;
  background: var(--card);
  border-right: 1.5px solid var(--line);
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; }
.side-brand img { width: 36px; height: auto; }
.side-brand b { display: block; font-size: 19px; font-weight: 800; line-height: 1; }
.side-brand span { font-size: 12.5px; color: var(--ink-3); font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: left;
  position: relative;
}
.nav button:hover { background: var(--card-2); color: var(--ink); }
.nav button[aria-selected="true"] {
  color: var(--ink);
  background: linear-gradient(135deg, color-mix(in srgb, var(--amber) 28%, transparent), color-mix(in srgb, var(--pink) 18%, transparent));
}
.nav button[aria-selected="true"] svg { color: var(--amber-deep); }
.nav button[aria-selected="true"]::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--amber-deep);
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 6px; }
.icon-btn { align-self: flex-start; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 12px; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.who .avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--coral), var(--violet));
}
.who .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who button { font-size: 12.5px; padding: 2px 8px; border-radius: 8px; margin-top: 2px; }

.main { min-width: 0; padding: 22px 28px 60px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.top h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; }
.sub { margin: 2px 0 0; color: var(--ink-3); }
.top-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  background: color-mix(in srgb, var(--ok) 14%, var(--card));
  color: var(--ok);
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 2s infinite; }
.pill.dirty { background: color-mix(in srgb, var(--amber-deep) 16%, var(--card)); color: var(--amber-deep); }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } }

.tab { animation: fade 0.35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card.flush { padding: 0; overflow: auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { font-size: 17px; font-weight: 800; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.span-2 { grid-column: span 2; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1400px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi .value { font-size: 24px; } }
.kpi {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--card);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.kpi .icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  margin-bottom: 10px;
  background: var(--tint, var(--indigo));
}
.kpi .label { color: var(--ink-3); font-size: 13.5px; font-weight: 600; }
.kpi .value { font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -0.5px; }
.kpi .foot { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.kpi::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--tint, var(--indigo));
  opacity: 0.09;
}

/* Charts */
.chart { position: relative; height: 240px; }
.chart.small { height: 150px; }
.chart svg { width: 100%; height: 100%; stroke: none; overflow: visible; }
.chart .bar { transition: opacity 0.2s, transform 0.2s; transform-box: fill-box; transform-origin: bottom; animation: grow 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.chart .bar:hover { opacity: 0.8; }
@keyframes grow { from { transform: scaleY(0); } }
.chart text { fill: var(--ink-3); font: 600 11px var(--font); }
.chart .gridline { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.empty { display: grid; place-items: center; height: 100%; min-height: 120px; color: var(--ink-3); text-align: center; font-weight: 600; padding: 12px; }
.empty svg { width: 34px; height: 34px; margin: 0 auto 6px; display: block; color: var(--violet); }

.seg { display: inline-flex; background: var(--card-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 4px 12px; border-radius: 9px; font-weight: 700; font-size: 13.5px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.donut-wrap { display: flex; align-items: center; gap: 18px; min-height: 180px; flex-wrap: wrap; }
.donut-wrap svg { width: 160px; height: 160px; stroke: none; }
.donut-wrap .seg-arc { transition: transform 0.2s; transform-origin: 50% 50%; cursor: default; }
.donut-wrap .seg-arc:hover { transform: scale(1.04); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.legend li { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.legend span { color: var(--ink-3); font-weight: 500; }

.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: 96px 1fr 52px; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.hbar .track { height: 12px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 999px; background: var(--c, var(--indigo)); width: 0; transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.hbar .n { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hbar .tag { display: inline-block; font-size: 11px; padding: 0 6px; margin-left: 4px; border-radius: 6px; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }

.top-picks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.top-picks li { position: relative; border-radius: 16px; overflow: hidden; background: var(--card-2); border: 1.5px solid var(--line); transition: transform 0.2s, box-shadow 0.2s; }
.top-picks li:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.top-picks img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--line); }
.top-picks .rank {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--amber);
  color: #2b2440;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.top-picks .meta { padding: 8px 10px 10px; }
.top-picks .t { font-weight: 700; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.top-picks .p { font-size: 12.5px; color: var(--ink-3); }

/* Releases */
.live-release { display: flex; flex-direction: column; gap: 14px; }
.live-top { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.version-big {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--coral), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.live-release .qr { width: 120px; height: 120px; padding: 8px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink-2); }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  padding: 22px 16px;
  border: 2px dashed color-mix(in srgb, var(--indigo) 40%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--indigo) 5%, var(--card));
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.drop svg { width: 36px; height: 36px; color: var(--indigo); }
.drop.over { background: color-mix(in srgb, var(--indigo) 14%, var(--card)); border-color: var(--indigo); transform: scale(1.01); }
.drop.has-file { border-style: solid; border-color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, var(--card)); }
.drop.has-file svg { color: var(--ok); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.fields label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.fields .wide { grid-column: span 2; }
.fields textarea { resize: vertical; }
.toggle { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 10px !important; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle span { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--line); transition: background 0.2s; flex: none; }
.toggle span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.6, 1); }
.toggle input:checked + span { background: var(--ok); }
.toggle input:checked + span::after { transform: translateX(18px); }
.toggle input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--indigo) 45%, transparent); }
.progress { height: 10px; border-radius: 999px; background: var(--card-2); overflow: hidden; margin-bottom: 12px; }
.progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--sky), var(--indigo), var(--violet)); background-size: 200% 100%; animation: flow 1.2s linear infinite; transition: width 0.2s; }
@keyframes flow { to { background-position: -200% 0; } }

.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 4px 0 18px 16px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 10px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--ink-3);
}
.timeline li.current::before { border-color: var(--ok); background: var(--ok); box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok) 22%, transparent); }
.rel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rel-head b { font-size: 19px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card-2); color: var(--ink-2); border: 1px solid var(--line); }
.chip.live { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); border-color: transparent; }
.chip.must { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); border-color: transparent; }
.rel-meta { color: var(--ink-3); font-size: 13px; margin: 2px 0 6px; }
.rel-notes { white-space: pre-line; margin: 0 0 8px; color: var(--ink-2); }
.rel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rel-actions button, .rel-actions a { font-size: 13px; padding: 5px 12px; border-radius: 10px; text-decoration: none; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; }

/* Tables (channels, videos, blocks, watching) */
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.bar input[type="search"], .bar input:not([type]) { flex: 1; min-width: 200px; }
.form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.form .wide { grid-column: span 2; }
.form .actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.ages { display: inline-flex; align-items: center; gap: 4px; }
input.age, .ages input { width: 64px; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-3); padding: 12px 12px; border-bottom: 1.5px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 1; }
.grid td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid tbody tr { transition: background 0.15s; }
.grid tbody tr:hover { background: var(--card-2); }
.grid tr.off { opacity: 0.5; }
.grid tr.changed { background: var(--changed); }
.grid .id { font-size: 12px; color: var(--ink-3); }
.grid .note { max-width: 260px; color: var(--ink-2); }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid img { border-radius: 10px; display: block; }
.grid a { text-decoration: none; font-weight: 600; }
.grid a:hover { text-decoration: underline; }
.row-actions { white-space: nowrap; display: flex; gap: 6px; }
.row-actions button { font-size: 13px; padding: 4px 10px; border-radius: 10px; }
.world-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.world-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }

/* Toast and chart tip */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 16px;
  font-weight: 700;
  color: #fff;
  background: #2b2440;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  animation: toast-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.toast::before { content: "✓"; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ok); flex: none; }
.toast.bad::before { content: "!"; background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 20px) scale(0.95); } }
.tip {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #2b2440;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, calc(-100% - 10px));
  white-space: nowrap;
}

.mobile-only { display: none !important; }
@media (max-width: 760px) { .mobile-only { display: inline-flex !important; } }

.skeleton { border-radius: 12px; background: linear-gradient(90deg, var(--card-2), var(--line), var(--card-2)); background-size: 200% 100%; animation: flow 1.4s linear infinite; }

/* ======================= Small screens ======================= */
@media (max-width: 980px) {
  .landing-inner { grid-template-columns: 1fr; padding-top: 36px; gap: 56px; }
  .signin-card { justify-self: stretch; width: 100%; }
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    z-index: 20;
    flex-direction: row;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1.5px solid var(--line);
  }
  .side-brand, .side-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-between; overflow-x: auto; }
  .nav button { flex-direction: column; gap: 2px; padding: 6px 8px; font-size: 11px; min-width: 56px; align-items: center; }
  .nav button[aria-selected="true"]::before { display: none; }
  .main { padding: 16px 16px 96px; }
  .top h1 { font-size: 26px; }
  .download-card { grid-template-columns: 1fr; }
  .dl-qr { display: none; }
  .fields, .form { grid-template-columns: 1fr; }
  .fields .wide, .form .wide { grid-column: auto; }
  .landing-inner { padding: 28px 16px 120px; }
  .hero { align-items: center; text-align: center; }
  .tagline { margin-inline: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
