/* MeowDoku admin workspace — light violet theme.
   Design language adapted from the CraftyBlox admin (violet theme, grouped
   sidebar, overview hero, stat cards, clean panels). */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f6f7fb;
  --surface: #fff;
  --surface-soft: #f3f0fc;
  --ink: #252938;
  --muted: #848895;
  --line: #e9eaf0;
  --primary: #7956d6;
  --primary-dark: #6542c2;
  --primary-soft: #f0eafa;
  --shadow: 0 4px 24px rgba(35, 38, 61, 0.05);
  --radius: 14px;
  --radius-sm: 9px;
  --green: #1f8f5f;
  --amber: #d99a2b;
  --red: #cf4b5a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ── Shell ─────────────────────────────────────────────────────────── */
.app-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column;
  padding: 26px 16px 20px;
  background: var(--surface); border-right: 1px solid var(--line);
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 28px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px;
  background: linear-gradient(135deg, #7c5cfc, #a78bfa); font-size: 20px; }
.brand strong { font-size: 19px; letter-spacing: -0.5px; font-weight: 750; color: var(--ink); display: block; }
.brand span { color: #9b9da8; font-size: 10px; font-weight: 500; }

.nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; min-height: 0; flex: 1; }
.nav-group { margin-top: 16px; }
.nav-group-label { padding: 8px 12px; font-size: 10px; font-weight: 700; letter-spacing: 1px;
  color: #aaa9b5; text-transform: uppercase; }
.nav-button {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 9px;
  color: #707485; font-size: 13.5px; font-weight: 500; background: transparent;
  cursor: pointer; text-decoration: none; text-align: left; min-height: 40px;
}
.nav-button .ic { width: 20px; text-align: center; font-size: 15px; }
.nav-button:hover { background: #f8f7fc; color: var(--primary); }
.nav-button.active { background: var(--primary-soft); color: var(--primary); font-weight: 650; }

.sidebar-footer { margin-top: 14px; padding: 16px 10px 0; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; }
.sf-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-footer .ava { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-soft); color: var(--primary); font-weight: 700; }
.sf-meta { min-width: 0; }
.sf-meta strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-meta span { display: block; font-size: 10px; color: var(--muted); }
.sidebar-footer #logout-button { width: 100%; }

/* ── Main / topbar ─────────────────────────────────────────────────── */
.main { padding: 26px 32px 44px; max-width: 1400px; width: 100%; margin: 0 auto; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 15px; margin-bottom: 24px; }
.breadcrumb { font-size: 11px; letter-spacing: 0.4px; color: #9a97a6; margin-bottom: 7px; }
h1 { font-size: 27px; font-weight: 750; letter-spacing: -0.7px; color: var(--ink); margin: 0; }
.subtitle { font-size: 13px; color: #999aaa; margin-top: 6px; }
.top-tools { display: flex; align-items: center; gap: 9px; }

/* ── Buttons & controls ────────────────────────────────────────────── */
.button, .pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 37px; border-radius: 8px; padding: 8px 14px;
  font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.button.primary { background: var(--primary); color: #fff; border: 1px solid var(--primary); box-shadow: 0 3px 7px rgba(121, 86, 214, 0.18); }
.button.primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.button.secondary { background: #fff; color: #777a89; border: 1px solid var(--line); }
.button.secondary:hover { border-color: #cfc4e3; background: #faf8ff; }
select, input, textarea {
  border: 1px solid #e3e4ed; background: #fbfbfd; border-radius: 8px;
  min-height: 38px; color: var(--ink); font-size: 13px; padding: 8px 10px; font-family: inherit;
}
select:focus, input:focus, textarea:focus { outline: 2px solid #bcb0ed; outline-offset: 1px; border-color: transparent; }

/* ── Panels ────────────────────────────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.panel-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.panel-header h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; margin: 0; margin-right: auto; }
.panel-header .controls { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.panel-header .controls select { min-height: 32px; font-size: 12px; padding: 4px 8px; }

/* ── Overview hero ─────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; border-radius: var(--radius);
  background: linear-gradient(115deg, #7c5ccf 0%, #9274df 55%, #b095e9 100%);
  box-shadow: 0 6px 18px rgba(121, 86, 214, 0.16); padding: 28px 32px; margin-bottom: 20px; }
.hero .eyebrow { display: block; color: #e5d9fc; font-size: 10px; font-weight: 700; letter-spacing: 1.6px; margin-bottom: 10px; }
.hero h2 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -0.5px; color: #fff; margin: 0 0 10px; }
.hero p { font-size: 13px; line-height: 1.7; color: #e9dffc; margin: 0; max-width: 520px; }
.hero .orbit { position: absolute; border: 1px solid rgba(255,255,255,0.14); border-radius: 50%; }
.hero .orbit.o1 { width: 330px; height: 330px; right: -20px; top: -60px; }
.hero .orbit.o2 { width: 430px; height: 430px; right: -70px; top: -110px; }
.hero .cat { position: absolute; right: 36px; top: 20px; font-size: 90px; opacity: 0.9; filter: drop-shadow(0 16px 14px rgba(89,49,144,0.25)); }

/* ── Stat cards ────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  border-radius: 13px; padding: 18px 20px; transition: border-color 0.15s, transform 0.15s; }
.stat:hover { border-color: #c9b8ea; transform: translateY(-2px); }
.stat-top { display: flex; align-items: center; gap: 9px; font-size: 12px; color: #7c7f90; }
.stat-ic { display: grid; place-items: center; background: #f2eafa; color: #9068d5; border-radius: 9px; width: 31px; height: 31px; font-size: 15px; }
.stat-ic.a2 { background: #fdf0e3; color: #d89b58; } .stat-ic.a3 { background: #e8f4f1; color: #58a898; } .stat-ic.a4 { background: #eaf0fc; color: #7a9bcf; }
.stat strong { display: block; font-size: 30px; letter-spacing: -1px; font-weight: 700; color: #353748; margin: 12px 0 3px; }
.stat strong.warn { color: var(--amber); }
.stat .note { color: #a0a0ad; font-size: 11px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── Bars / funnel / spark ─────────────────────────────────────────── */
.barrow { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; font-size: 12px; }
.barrow .label { width: 150px; color: #7f7f91; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barrow .track { flex: 1; background: #efeaf9; border-radius: 6px; height: 16px; overflow: hidden; }
.barrow .fill { height: 100%; background: linear-gradient(90deg, #7c5cfc, #a78bfa); border-radius: 6px; }
.barrow .num { width: 64px; text-align: right; font-variant-numeric: tabular-nums; color: #6a677d; font-weight: 600; }
.funnel .step { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.funnel .step .label { width: 150px; font-size: 12.5px; color: #656979; }
.funnel .step .track { flex: 1; background: #efeaf9; border-radius: 6px; height: 22px; }
.funnel .step .fill { height: 100%; background: linear-gradient(90deg, #7c5cfc, #a78bfa); border-radius: 6px; }
.funnel .step .num { width: 110px; text-align: right; font-size: 12px; color: #6a677d; font-variant-numeric: tabular-nums; }
svg.spark { width: 100%; height: 120px; display: block; }
.note { color: #a0a0ad; font-size: 11.5px; margin-top: 6px; }

/* ── Table ─────────────────────────────────────────────────────────── */
.table-wrap { max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table.lv { width: 100%; border-collapse: collapse; font-size: 13px; }
table.lv th, table.lv td { padding: 9px 12px; text-align: right; }
table.lv th:first-child, table.lv td:first-child { text-align: left; }
table.lv th { position: sticky; top: 0; background: #faf9fd; color: #8a8799; font-size: 11px; font-weight: 700;
  letter-spacing: 0.4px; text-transform: uppercase; border-bottom: 1px solid var(--line); }
table.lv td { border-bottom: 1px solid #f1eff7; }
table.lv tbody tr:last-child td { border-bottom: 0; }
table.lv tbody tr:hover { background: #faf8ff; }
.pass { font-weight: 700; }
.pass.lo { color: var(--red); } .pass.mid { color: var(--amber); } .pass.hi { color: var(--green); }
.empty { color: var(--muted); font-size: 13px; padding: 24px; text-align: center; }

/* chips/badges */
.chip { font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 6px; background: var(--surface-soft); color: var(--primary); }
.version-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 5px 10px; }

/* ── Users (per-device) page ─────────────────────────────────────── */
.panel-header .controls input { min-height: 32px; font-size: 12px; padding: 4px 8px; }
.users-pager { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.users-pager .spacer { flex: 1; }
table.lv tbody tr.users-row { cursor: pointer; }
table.lv td .u-device { display: block; font-weight: 600; color: #353748; }
table.lv td .u-id { display: block; font-size: 10.5px; color: #9a97a8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.up-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 20px; padding: 14px 16px;
  background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; }
.up-kv div { font-size: 12.5px; color: #4b4d5e; word-break: break-all; }
.up-kv span { display: block; font-size: 10.5px; letter-spacing: 0.5px; text-transform: uppercase; color: #9a97a8; margin-bottom: 3px; }
.up-section { margin-top: 20px; }
.up-section h3 { font-size: 13px; font-weight: 700; color: #656979; margin: 0 0 10px; }
.up-params { font-size: 11px; color: #7f7f91; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat.clickable { cursor: pointer; }
.stat.clickable:hover { border-color: #b7a4ee; box-shadow: 0 8px 20px rgba(121, 86, 214, 0.12); }
.more-names { margin-top: 8px; background: none; border: 0; padding: 0; font: inherit; font-size: 12px;
  color: var(--primary); cursor: pointer; }
.more-names:hover { text-decoration: underline; }
table.lv tr.sess-row { cursor: pointer; }
table.lv tr.sess-row.sel td { background: #f1ebff; }
.sess-filter { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.sess-filter-label { font-size: 12px; font-weight: 600; color: #656979; }
.up-ev-search { margin-left: auto; min-height: 34px; width: 260px; max-width: 100%; padding: 6px 12px; font-size: 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.up-ev-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.up-ev-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
table.lv tr.sess-detail td { background: #faf8ff; text-align: left; }
table.lv tr.sess-detail .sess-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: #6a677d; word-break: break-all; }
table.lv tr.sess-detail .note { margin-top: 2px; }
.sess-names { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* toast */
.toast-container { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }
.toast { padding: 11px 16px; border-radius: 10px; font-size: 13px; color: #fff; box-shadow: 0 8px 24px rgba(40,30,100,0.18); }
.toast-success { background: var(--green); } .toast-error { background: var(--red); } .toast-warn { background: var(--amber); }

/* ── Login screen ──────────────────────────────────────────────────── */
.login-screen { position: fixed; inset: 0; z-index: 20000; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse at 60% 15%, #e8defb, transparent 60%), var(--bg); }
.login-screen[hidden] { display: none; }
body.is-locked { overflow: hidden; }
.login-card { width: min(380px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 20px 70px rgba(102, 72, 143, 0.15); padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.login-brand .brand-mark { width: 44px; height: 44px; font-size: 24px; }
.login-brand h1 { font-size: 20px; margin: 0; letter-spacing: -0.4px; }
.login-brand span { font-size: 11px; color: var(--muted); }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: #656979; }
.login-card input { min-height: 40px; }
.login-card .button { margin-top: 6px; }
.login-notice { background: #fdeef0; color: #b23b48; border: 1px solid #f5d6db; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; margin: 0; }
.login-notice[hidden] { display: none; }

/* mobile */
.menu-btn { display: none; }
@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 250px; transform: translateX(-100%); z-index: 200; transition: transform 0.18s; }
  body.nav-open .sidebar { transform: none; }
  .menu-btn { display: inline-flex; }
}
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .main { padding: 20px 16px 30px; } h1 { font-size: 23px; } .stats { grid-template-columns: 1fr 1fr; } }

/* ════ User Activity ════ */
.ac-range-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.ac-inline { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.ac-inline > select, .ac-inline > input { min-height: 36px; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-weight: 500; text-transform: none; letter-spacing: 0; }
.ac-inline > input:disabled { opacity: .5; }
.ac-seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.ac-seg-btn { border: 0; background: transparent; padding: 8px 13px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-right: 1px solid var(--line); }
.ac-seg-btn:last-child { border-right: 0; }
.ac-seg-btn.active { background: var(--primary); color: #fff; }
#acTzNote { margin-top: 12px; }

.ac-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.ac-card-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.ac-card-value { display: block; font-size: 30px; letter-spacing: -1px; font-weight: 700; color: #353748; margin: 10px 0 3px; }

.ac-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
@media (max-width: 900px) { .ac-grid { grid-template-columns: minmax(0, 1fr); } }
.ac-grid > .panel { min-width: 0; }

.ac-chart { height: 200px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.ac-chart::-webkit-scrollbar { height: 8px; }
.ac-chart::-webkit-scrollbar-track { background: transparent; }
.ac-chart::-webkit-scrollbar-thumb { background: #d9d6e4; border-radius: 4px; }
.ac-chart::-webkit-scrollbar-thumb:hover { background: #c4bfd6; }
.ac-bars { display: flex; align-items: flex-end; gap: 5px; height: 172px; padding-top: 8px; width: max-content; min-width: 100%; }
.ac-bar-col { flex: 1 0 26px; display: flex; flex-direction: column; align-items: stretch; gap: 7px; height: 100%; }
.ac-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--primary-soft); border-radius: 5px; overflow: hidden; }
.ac-bar { width: 100%; background: linear-gradient(180deg, #8f6fe0, var(--primary)); border-radius: 5px 5px 0 0; transition: height .25s; }
.ac-bar-lbl { font-size: 9.5px; color: var(--muted); white-space: nowrap; text-align: center; overflow: visible; }

.ac-barrow { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.ac-barrow-lbl { width: 150px; flex: 0 0 150px; font-size: 12px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-barrow-track { flex: 1; height: 16px; background: var(--primary-soft); border-radius: 8px; overflow: hidden; }
.ac-barrow-fill { height: 100%; background: linear-gradient(90deg, #9b7ee6, var(--primary)); border-radius: 8px; }
.ac-barrow-num { width: 56px; flex: 0 0 56px; text-align: right; font-size: 12px; font-weight: 700; color: var(--ink); }

.ac-subhead { font-size: 13px; font-weight: 700; margin: 18px 0 10px; color: var(--ink); }
.ac-platforms { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-chip { background: var(--primary-soft); color: var(--primary-dark); border-radius: 8px; padding: 6px 11px; font-size: 12px; }

.ac-health-line { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ac-health-line:last-child { border-bottom: 0; }
.ac-health-k { color: var(--muted); flex: 0 0 140px; }
.ac-health-v { color: var(--ink); }
.ac-health-ok .ac-health-v strong { color: var(--green); font-weight: 600; }

.ac-ctable-wrap { max-height: 520px; overflow-y: auto; overflow-x: hidden; border: 1px solid var(--line); border-radius: 12px; }
.ac-ctable { width: 100%; border-collapse: collapse; border-spacing: 0; font-size: 13.5px; }
.ac-ctable th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; padding: 12px 16px; background: var(--surface-soft); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.ac-ctable th.ac-right { text-align: right; }
.ac-ctable th:nth-child(2), .ac-ctable td:nth-child(2) { width: 96px; }
.ac-ctable th:nth-child(3), .ac-ctable td:nth-child(3) { width: 96px; }
.ac-ctable td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ac-ctable tbody tr:last-child td { border-bottom: 0; }
.ac-ctable tbody tr:hover td { background: var(--surface-soft); }
.ac-ctry { white-space: nowrap; }
.ac-ctry-badge { display: inline-block; min-width: 26px; text-align: center; padding: 2px 6px; margin-right: 10px; background: var(--primary-soft); color: var(--primary-dark); font-size: 10.5px; font-weight: 700; letter-spacing: .3px; border-radius: 6px; vertical-align: middle; }
.ac-ctry-name { color: var(--ink); vertical-align: middle; }
.ac-right { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.ac-ctry-bar { width: 46%; padding-left: 20px; }
.ac-ctry-bar .ac-barrow-track { height: 14px; border-radius: 7px; }
.ac-ctry-bar .ac-barrow-fill { min-width: 14px; border-radius: 7px; }

/* ════ Level attempts drill-down (user profile) ════ */
.lv .lvl-row { cursor: pointer; }
.lv .lvl-row:hover td { background: var(--surface-soft); }
.lv .lvl-row.open td { background: var(--primary-soft); }
.lvl-caret { color: var(--muted); width: 26px; text-align: center; font-size: 11px; }
.lvl-row.open .lvl-caret { color: var(--primary); }
.lvl-detail > td { background: #faf9fe; padding: 14px 16px !important; }
.lvl-attempts { }
.lvl-att-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; color: var(--muted); font-weight: 600; }
.lvl-att-chip { padding: 3px 9px; border-radius: 6px; font-size: 11px; }
.lvl-att-chip.win { background: #e5f4ee; color: var(--green); }
.lvl-att-chip.lose { background: #fdecee; color: var(--red); }
.lvl-att-table { width: 100%; }
.lvl-att-table th { font-size: 10.5px; }
.lvl-att-time { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.lvl-res { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; text-transform: capitalize; }
.lvl-res.win { background: #e5f4ee; color: var(--green); }
.lvl-res.lose { background: #fdecee; color: var(--red); }
.lvl-res.abandon { background: #fdf2e3; color: var(--amber); }
.lvl-res.na { background: var(--surface-soft); color: var(--muted); }

/* The playable preview (MeowPreview) injects its own styles; see level-preview.js. */
.btn[hidden] { display: none !important; }

/* ── Cohort grid ───────────────────────────────────────────────── */
.cohort-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 4px 0 16px; font-size: 12px; color: var(--muted); }
.cohort-controls label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.cohort-controls select, .cohort-controls input { min-height: 32px; font-size: 12px; padding: 4px 8px; }
table.lv.cohort th, table.lv.cohort td { padding: 8px 10px; white-space: nowrap; }
table.lv.cohort td.cohort-name { text-align: left; }
table.lv.cohort td.cohort-all { font-weight: 700; color: #353748; }
table.lv.cohort td.cohort-cell { font-variant-numeric: tabular-nums; }
#cohortCards { margin-bottom: 16px; }

/* ════ Level-funnel → players drill-down ════ */
.lvl-players > td { background: #faf9fe; padding: 12px 14px !important; }
.lvl-players-box { }
.lvl-players-head { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.lvl-player-row { cursor: pointer; }
.lvl-player-row:hover td { background: var(--primary-soft); }
.lvl-player-id { color: var(--muted); font-size: 11px; font-family: ui-monospace, monospace; }

/* ════ Level funnel — search + sortable columns ════ */
.lvl-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lvl-search { min-height: 34px; width: 240px; max-width: 60%; padding: 6px 12px; font-size: 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.lvl-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.lvl-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lv th.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.lv th.th-sort:hover { color: var(--primary); }
.lv th.th-sort.sorted { color: var(--primary); }
.lv th .sort-ind { font-size: 9px; margin-left: 4px; }

/* ════ Users — install-date filter ════ */
.panel-header .controls .u-date { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.panel-header .controls .u-date input[type="date"] { min-height: 32px; font-size: 12px; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
#uDateClear { padding: 4px 8px; }
