/* Linear-style light UI. One theme on purpose: the team asked for light mode.
   Type and targets are large on purpose: many reps are older and read at arm's length. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --side: #f7f7f8;
  --surface: #ffffff;
  --hover: #f3f3f5;
  --active: #ececf0;
  --border: #ebebee;
  --border-2: #dfdfe4;
  --text: #1c1d21;
  --text-2: #55575f;
  --muted: #8b8d96;
  --faint: #b4b6bd;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-soft: #eff5ff;
  --good: #26a269;
  --good-soft: #e9f6ef;
  --bad: #e5484d;
  --bad-soft: #fdeeee;
  --warn: #e0912b;
  --yellow: #d9a514;
  --shadow-sm: 0 1px 2px rgba(16, 17, 26, .05);
  --shadow: 0 1px 2px rgba(16, 17, 26, .04), 0 4px 12px rgba(16, 17, 26, .05);
  --shadow-lg: 0 2px 4px rgba(16, 17, 26, .04), 0 12px 32px rgba(16, 17, 26, .10);
  --r: 6px;
  --r-lg: 10px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.006em;
}
a { color: inherit; text-decoration: none; }
::selection { background: #d3e3fd; }
svg { flex: none; }

/* ── shell ─────────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); height: 100vh; }
.side {
  background: var(--side); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 10px 8px; gap: 2px; min-height: 0;
}
.ws { display: flex; align-items: center; gap: 10px; padding: 8px 10px 18px; font-weight: 600; font-size: 17px; }
.logo {
  width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; box-shadow: var(--shadow-sm);
}
.nav-label { font-size: 14.5px; font-weight: 500; color: var(--muted); padding: 12px 8px 4px; }
.nav {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r);
  color: var(--text-2); font-weight: 500; cursor: pointer; user-select: none;
}
.nav:hover { background: var(--hover); color: var(--text); }
.nav.on { background: var(--active); color: var(--text); }
.nav svg { color: var(--muted); }
.nav.on svg { color: var(--text-2); }
.nav kbd { margin-left: auto; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.bar {
  height: 56px; flex: none; display: flex; align-items: center; gap: 10px;
  padding: 0 16px 0 20px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 500; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--faint); }
.crumbs span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { flex: 1; overflow: auto; min-height: 0; }
.page { max-width: 1120px; margin: 0 auto; padding: 32px 28px 72px; }
.page.wide { max-width: none; padding: 16px; }

/* ── type ──────────────────────────────────────────────────────────────── */
h1 { font-size: 25px; font-weight: 600; letter-spacing: -0.018em; margin: 0; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
.lede { color: var(--text-2); margin: 4px 0 0; font-size: 17px; max-width: 64ch; }
.muted { color: var(--muted); }
.err { color: var(--bad); }
.num { font-variant-numeric: tabular-nums; }

kbd {
  font: 500 14px/1 "Inter", sans-serif; color: var(--muted);
  min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center;
  border: 1px solid var(--border-2); border-bottom-width: 1.5px; border-radius: 4px; background: var(--bg);
}
.btn.primary kbd { color: rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .22); }

/* ── controls ──────────────────────────────────────────────────────────── */
.btn {
  font: 500 16px/1 "Inter", sans-serif; letter-spacing: -0.006em;
  height: 40px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border-2); border-radius: var(--r); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-sm); cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--hover); }
.btn:focus-visible, .row-item:focus-visible, .nav:focus-visible { outline: 2px solid #bfd6fe; outline-offset: 1px; }
.btn.primary { background: var(--accent); border-color: var(--accent-2); color: #fff; box-shadow: 0 1px 2px rgba(29, 78, 216, .3), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: #f4c7c8; }
.btn.lg { height: 56px; padding: 0 20px; font-size: 17px; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: default; }

.input {
  width: 100%; height: 48px; padding: 0 14px; font: 17px "Inter", sans-serif;
  border: 1px solid var(--border-2); border-radius: var(--r); background: var(--bg); color: var(--text);
  box-shadow: var(--shadow-sm); outline: none; transition: border-color .12s, box-shadow .12s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #dbe8fe; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 999px; font-size: 14.5px; font-weight: 500;
  color: var(--text-2); background: var(--bg); white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.chip.accent { color: var(--accent-2); background: var(--accent-soft); border-color: #d6e4fd; }

.notice {
  display: flex; gap: 9px; align-items: flex-start; padding: 9px 12px; margin-bottom: 20px;
  border: 1px solid #f3e2c3; background: #fdf8ef; color: #7a5a1d; border-radius: var(--r); font-size: 15.5px;
}
.notice svg { color: var(--warn); margin-top: 1px; }

/* ── panels and lists ──────────────────────────────────────────────────── */
.panel { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-h {
  display: flex; align-items: center; gap: 8px; padding: 0 18px; height: 50px;
  border-bottom: 1px solid var(--border); background: #fbfbfc; border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.panel-h .count { color: var(--muted); font-weight: 500; }
.panel-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 15px; }
.panel-b { padding: 18px; }

.list { display: flex; flex-direction: column; }
.row-item {
  display: flex; align-items: center; gap: 16px; padding: 0 18px; min-height: 64px;
  border-bottom: 1px solid var(--border); cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0;
  font: inherit; color: inherit; text-align: left; width: 100%;
}
.row-item:last-child { border-bottom: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.row-item:hover { background: var(--hover); }
.row-item.sel { background: var(--accent-soft); }
.row-item.sel .radio { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 4px #fff; }
.radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-2); flex: none; transition: all .12s; }
.row-main { min-width: 0; flex: 1; display: flex; flex-direction: column; padding: 8px 0; line-height: 1.4; }
.row-title { font-weight: 500; color: var(--text); }
.row-sub { color: var(--muted); font-size: 15.5px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 13px; font-weight: 600; color: #fff; letter-spacing: 0;
}

.avatar.mini { width: 20px; height: 20px; font-size: 10px; }

/* ── new roleplay page ─────────────────────────────────────────────────── */
[hidden] { display: none !important; }
.page h1 { font-size: 32px; }
.how {
  list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.how li {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: var(--r-lg);
  background: var(--accent-soft); border: 1px solid #d6e4fd; font-size: 18px; line-height: 1.45; color: var(--text);
}
.how b { font-weight: 600; }
.how-n {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 18px;
}
.pick-sec { margin-top: 36px; }
.sec-h { font-size: 22px; font-weight: 600; margin: 0 0 14px; letter-spacing: -0.012em; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px; min-height: 84px; text-align: left;
  border: 1.5px solid var(--border-2); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm);
  font: inherit; color: inherit; cursor: pointer; transition: border-color .12s, background .12s;
}
.card:hover { background: var(--hover); }
.card.sel { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1.5px var(--accent); }
.card.sel .radio { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 4px #fff; }
.card .avatar { width: 44px; height: 44px; font-size: 19px; }
.card-main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.card-title { font-size: 20px; font-weight: 600; }
.card-sub { font-size: 16.5px; color: var(--text-2); }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.seg-opt {
  display: flex; align-items: center; justify-content: center; gap: 10px; height: 64px;
  border: 1.5px solid var(--border-2); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm);
  font: 600 19px "Inter", sans-serif; color: var(--text-2); cursor: pointer;
}
.seg-opt:hover { background: var(--hover); color: var(--text); }
.seg-opt.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); box-shadow: 0 0 0 1.5px var(--accent); }
.lvl-desc { color: var(--text-2); font-size: 18px; margin: 14px 2px 0; line-height: 1.5; min-height: 27px; }
.go-bar { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border); }
.btn.xl { height: 68px; padding: 0 32px; font-size: 21px; font-weight: 600; width: 100%; justify-content: center; border-radius: var(--r-lg); }
.start-msg { margin-top: 12px; font-size: 17px; color: var(--text-2); text-align: center; min-height: 26px; }
.call-tip { font-size: 17px; line-height: 1.45; padding: 12px 16px; border-radius: var(--r-lg); background: var(--accent-soft); border: 1px solid #d6e4fd; }
.card:focus-visible, .seg-opt:focus-visible { outline: 3px solid #bfd6fe; outline-offset: 2px; }

/* ── admin ─────────────────────────────────────────────────────────────── */
.admin { padding: 16px 12px 96px; max-width: 1320px; margin: 0 auto; }
.admin h1 { font-size: 28px; }
.tabs { display: flex; gap: 4px; margin: 20px 0 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab { padding: 12px 16px; font-size: 17px; font-weight: 500; color: var(--text-2); border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.admin-cols { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; align-items: start; }
.admin-cols.single { grid-template-columns: 1fr; }
.admin-cols.single .admin-list { display: none; }
.admin-list { position: sticky; top: 0; max-height: calc(100vh - 120px); overflow: auto; padding: 6px; }
.admin-list .add { margin: 4px 0 8px; height: 46px; }
.ai { display: flex; align-items: center; gap: 14px; padding: 14px 14px; border-radius: var(--r); border-bottom: 1px solid var(--border); }
.ai:last-child { border-bottom: 0; }
.ai-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ai-kicker { display: block; font-size: 15px; font-weight: 500; color: var(--text-2); margin-top: 1px; }
.ai-stat { flex: none; width: 58px; text-align: right; font-size: 12.5px; color: var(--muted); line-height: 1.25; }
.ai-stat b { display: block; font-size: 17px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ai:hover { background: var(--hover); }
.ai.sel { background: var(--accent-soft); }
.ai-title { font-size: 17px; font-weight: 600; }
.ai-sub { font-size: 14px; color: var(--muted); line-height: 1.45; }
.admin-form { padding: 6px 24px 18px; }
.fs { padding: 18px 0; border-bottom: 1px solid var(--border); }
.fs:last-child { border-bottom: 0; }
.fs h3 { font-size: 19px; font-weight: 600; color: var(--text); margin: 0 0 16px; letter-spacing: -0.01em; }
.fs h3 .muted { font-size: 15px; font-weight: 500; }
.f { margin-bottom: 20px; }
.f:last-child { margin-bottom: 0; }
.f-label { display: block; font-size: 17px; font-weight: 600; }
.f-help { font-size: 15px; color: var(--muted); margin: 2px 0 8px; line-height: 1.45; }
.f-sub { display: block; font-size: 14.5px; color: var(--text-2); margin: 10px 0 4px; }
textarea.input { height: auto; min-height: 48px; padding: 11px 14px; line-height: 1.45; resize: none; overflow: hidden; font: 17px/1.45 "Inter", sans-serif; }
.select { position: relative; display: block; min-width: 0; }
.select select.input { appearance: none; -webkit-appearance: none; padding-right: 48px; cursor: pointer; font-size: 17px; }
.select-chev { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; display: grid; }
.input.num { max-width: 180px; }
.pct-in { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.lines, .points { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.line-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.ln { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; padding-top: 13px; }
.row-tools { display: flex; gap: 6px; padding-top: 3px; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 1px solid var(--border-2); border-radius: var(--r); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.del:hover { background: var(--bad-soft); color: var(--bad); border-color: #f4c7c8; }
.icon-btn:focus-visible { outline: 2px solid #bfd6fe; outline-offset: 1px; }
.point { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 16px 16px; background: #fbfbfc; }
.point-h { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.point-h .ln { padding-top: 0; }
.point-h .row-tools { margin-left: auto; padding-top: 0; }
.point-h b { font-size: 16px; }
.btn.sm { height: 42px; font-size: 16px; padding: 0 16px 0 12px; }
.danger-zone { padding-top: 24px; }
.radio-row { display: flex; gap: 10px; align-items: center; font-size: 17px; padding: 6px 0; cursor: pointer; }
.radio-row input { width: 18px; height: 18px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 16px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 14.5px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.notes summary { cursor: pointer; font-size: 16px; font-weight: 500; color: var(--text-2); }
.notes ul { margin: 12px 0 0; padding-left: 20px; font-size: 15px; color: var(--text-2); line-height: 1.5; }
.notes li { margin-bottom: 8px; }
.savebar {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%); transition: transform .2s;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 20px; font-size: 16px;
  background: var(--text); color: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 10; max-width: calc(100vw - 32px);
}
.savebar:not(.on) { visibility: hidden; }
.savebar.on { transform: translate(-50%, 0); }
.savebar .btn:not(.primary) { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 20; padding: 12px 20px; font-size: 16px;
  background: var(--good-soft); color: #17663f; border: 1px solid #bfe3cf; border-radius: 10px; box-shadow: var(--shadow-lg);
}
.toast.bad { background: var(--bad-soft); color: #9b2226; border-color: #f4c7c8; }

/* priority-style difficulty bars */
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; width: 18px; }
.bars i { width: 4px; border-radius: 1px; background: #d6d7dd; }
.bars i:nth-child(1) { height: 6px; } .bars i:nth-child(2) { height: 11px; } .bars i:nth-child(3) { height: 16px; }
.bars[data-n="1"] i:nth-child(-n+1), .bars[data-n="2"] i:nth-child(-n+2), .bars[data-n="3"] i:nth-child(-n+3) { background: var(--text-2); }

/* ── live call ─────────────────────────────────────────────────────────── */
.live { display: grid; grid-template-columns: minmax(0, 1fr) 520px; gap: 16px; height: 100%; }
.stage { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.video-wrap {
  position: relative; border-radius: var(--r-lg); overflow: hidden; background: #0f1014;
  box-shadow: var(--shadow-lg); aspect-ratio: 16 / 10; width: 100%;
}
.video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stage-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 15.5px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(229, 72, 77, .08); } }
.prices { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.price { padding: 10px 14px; border-right: 1px solid var(--border); }
.price:last-child { border-right: 0; }
.price .k { font-size: 14.5px; color: var(--muted); font-weight: 500; }
.price .v { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.price .m { font-size: 15px; color: var(--text-2); font-variant-numeric: tabular-nums; }

.tele { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 56px - 32px); }
.tele .panel-b { overflow: auto; padding: 6px; flex: 1; }
.step { border-radius: 8px; padding: 12px 12px; cursor: pointer; display: grid; grid-template-columns: 30px 1fr; gap: 0 10px; }
.step:hover { background: var(--hover); }
.step .n {
  width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border-2); color: var(--muted);
  display: grid; place-items: center; font-size: 13px; font-weight: 600; margin-top: 0;
}
.step .h { font-weight: 500; font-size: 18px; line-height: 28px; }
.step .goal { grid-column: 2; color: var(--muted); font-size: 15px; line-height: 1.45; display: none; }
.step .say, .step .mh { grid-column: 2; display: none; }
.step.done .n { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.step.on { background: var(--accent-soft); cursor: default; }
.step.on .n { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.on .h { font-weight: 600; }
.step.on .goal, .step.on .say, .step.on .mh { display: block; }
.say { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: l; }
.say li {
  font-size: 19.5px; line-height: 1.55; letter-spacing: -0.012em; color: var(--text);
  padding: 9px 12px; background: var(--bg); border: 1px solid #d9e5fb; border-radius: 8px; margin-bottom: 6px;
}
.mh { margin-top: 8px; font-size: 15px; color: var(--text-2); }
.mh b { font-weight: 600; color: var(--accent-2); }
.mh span { display: block; padding-left: 12px; position: relative; margin-top: 2px; }
.mh span::before { content: ""; position: absolute; left: 2px; top: 7px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.section-h { font-size: 14.5px; font-weight: 500; color: var(--muted); padding: 14px 10px 6px; display: flex; align-items: center; gap: 6px; }
details.obj { border-radius: 8px; }
details.obj summary {
  list-style: none; cursor: pointer; padding: 7px 10px; border-radius: 8px; font-weight: 500;
  display: flex; align-items: center; gap: 8px; color: var(--text-2);
}
details.obj summary::-webkit-details-marker { display: none; }
details.obj summary:hover { background: var(--hover); color: var(--text); }
details.obj summary .chev { color: var(--faint); transition: transform .15s; }
details.obj[open] summary { color: var(--text); }
details.obj[open] summary .chev { transform: rotate(90deg); }
details.obj .say { margin: 2px 10px 10px 32px; }
details.obj .say li { font-size: 17.5px; }

/* ── results ───────────────────────────────────────────────────────────── */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: var(--r-lg); margin: 20px 0; background: var(--surface); box-shadow: var(--shadow-sm); }
.stat { padding: 14px 16px; border-right: 1px solid var(--border); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat .k { font-size: 15px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; margin-top: 4px; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; }
.stat .v.sm { font-size: 20px; letter-spacing: -0.015em; height: 44px; }
.meter { height: 4px; border-radius: 2px; background: var(--active); margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cols > div { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.group-h { display: flex; align-items: center; gap: 8px; padding: 0 18px; height: 44px; background: #fbfbfc; border-bottom: 1px solid var(--border); font-weight: 500; color: var(--text-2); font-size: 15.5px; }
.group-h:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.group-h .count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.res { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.panel > .res:last-child { border-bottom: 0; }
.res .ic { margin-top: 1px; }
.res .t { flex: 1; line-height: 1.45; }
.res.miss .t { color: var(--text-2); }
.res .p { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; margin-top: 1px; }
.tip { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.tip:last-child { border-bottom: 0; }
.tip .pt { font-weight: 500; font-size: 15.5px; display: flex; gap: 8px; align-items: flex-start; }
.tip q { display: block; margin: 6px 0 0 22px; padding: 7px 11px; border-left: 2px solid var(--accent); background: var(--accent-soft); border-radius: 0 6px 6px 0; color: var(--text); quotes: none; font-size: 16px; }
.tx { max-height: 640px; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: grid; grid-template-columns: 36px 1fr; gap: 12px; }
.msg .who { font-weight: 600; font-size: 15.5px; }
.msg p { margin: 1px 0 0; color: var(--text-2); }
.empty { padding: 28px 14px; text-align: center; color: var(--muted); }
.empty svg { color: var(--faint); margin-bottom: 8px; }

/* ── history ───────────────────────────────────────────────────────────── */
.hist-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) 110px 160px 70px 160px; gap: 12px; align-items: center; }
.hist-row .lvl { display: flex; align-items: center; gap: 7px; color: var(--text-2); text-transform: capitalize; }
.hist-row .out { display: flex; align-items: center; gap: 7px; color: var(--text-2); white-space: nowrap; }
.hist-row .score { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.hist-row .when { text-align: right; color: var(--muted); font-size: 15.5px; font-variant-numeric: tabular-nums; }
.hist-head { color: var(--muted); font-size: 15px; font-weight: 500; min-height: 44px !important; cursor: default !important; background: #fbfbfc !important; border-radius: var(--r-lg) var(--r-lg) 0 0; }

/* ── loading / login ───────────────────────────────────────────────────── */
.skel { height: 64px; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, #fff 0, #f5f5f7 50%, #fff 100%); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }
.spinner { width: 14px; height: 14px; border: 2px solid var(--border-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.grading { max-width: 520px; margin: 12vh auto 0; text-align: center; }
.grading .spinner { width: 22px; height: 22px; margin: 0 auto 14px; }
.grading ol { text-align: left; margin: 18px auto 0; padding: 0; list-style: none; display: inline-flex; flex-direction: column; gap: 6px; color: var(--muted); }
.grading li { display: flex; gap: 8px; align-items: center; }
.grading li.done { color: var(--text-2); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 500px at 50% -10%, #eaf2ff, transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 420px; text-align: center; }
.login-card .logo { width: 40px; height: 40px; border-radius: 11px; margin: 0 auto 18px; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 27.5px; }
.login-card p { color: var(--text-2); margin: 6px 0 24px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; }

.fade { animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } }

/* ── narrow screens ────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .live { grid-template-columns: 1fr; height: auto; }
  .tele { max-height: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 100vh; }
  .ws { white-space: nowrap; }
  .nav { white-space: nowrap; padding: 8px 10px; }
  .card { min-width: 0; }
  .card-sub { overflow-wrap: anywhere; }
  .side { flex-direction: row; align-items: center; padding: 6px 10px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
  .ws { padding: 0 8px 0 0; }
  .nav-label, .nav kbd { display: none; }
  .cols, .how, .cards, .admin-cols { grid-template-columns: 1fr; }
  .seg { grid-template-columns: repeat(2, 1fr); }
  .admin-list { position: static; max-height: 320px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .page { padding: 16px 16px 48px; }
  .hist-row { grid-template-columns: 18px minmax(0, 1fr) 56px; }
  .hist-row .lvl, .hist-row .out, .hist-row .when { display: none; }
  .bar { padding: 0 12px 0 16px; }
  .bar kbd { display: none; }
}
