:root {
  --bg: #0f1419;
  --panel: #171d25;
  --card: #1c2430;
  --border: #2a3441;
  --text: #e8edf3;
  --muted: #93a1b3;
  --accent: #4f8cff;
  --accent-2: #36c28a;
  --warn: #f0a500;
  --danger: #ef5b5b;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
html.admin-room, body.admin-room { height: 100%; overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
code { background: #0b1016; padding: 2px 6px; border-radius: 6px; }

.topbar, .client-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border); background: rgba(15,20,25,0.9);
}
.brand { font-weight: 700; letter-spacing: 0.02em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.balance-pill {
  border: 1px solid #2d6f52; background: #163528; color: #9ef0c8;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.small-link { display: inline-block; margin-bottom: 8px; text-decoration: none; }
.trial-box {
  text-align: center; padding: 20px; margin: 16px 0;
  border-radius: 12px; background: #132018; border: 1px solid #28553f;
}
.trial-amount { font-size: 36px; font-weight: 700; color: #9ef0c8; }
.feature-list { margin: 0; padding-left: 20px; color: var(--muted); }
.balance-card .balance-main { font-size: 28px; font-weight: 700; }
.balance-row { display: flex; align-items: baseline; gap: 12px; margin: 8px 0; }
.warn-text { color: #ffd27a; font-size: 14px; }
.ledger-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ledger-table th, .ledger-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.brand.small { font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.container { max-width: 920px; margin: 24px auto; padding: 0 16px 40px; }
.container.narrow { max-width: 560px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card.center { text-align: center; }
.stack { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
input, textarea {
  width: 100%; border: 1px solid var(--border); background: #11161d; color: var(--text);
  border-radius: 10px; padding: 10px 12px; font: inherit;
}
textarea { resize: vertical; min-height: 100px; }

.btn {
  border: 1px solid var(--border); background: #222b36; color: var(--text);
  border-radius: 10px; padding: 10px 14px; cursor: pointer; font: inherit;
}
.btn:hover { border-color: #3d4b5d; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.warn { background: #3a2d10; border-color: #6d5418; color: #ffd27a; }
.btn.danger { background: #3a1717; border-color: #7a2b2b; color: #ffb4b4; }
.btn.ghost { background: transparent; }
.btn.round { border-radius: 999px; min-width: 72px; }
.btn.wide { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px;
  background: #243041; border: 1px solid var(--border);
}
.pill.ok { background: #163528; border-color: #2d6f52; color: #9ef0c8; }
.pill.bad { background: #3a1717; border-color: #7a2b2b; color: #ffb4b4; }

.room-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.room-list li {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: #151b23;
}
.room-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.create-result { margin-top: 14px; padding: 12px; border-radius: 10px; background: #132018; border: 1px solid #28553f; }
.hidden { display: none !important; }
.link-box { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

.admin-layout {
  display: grid; grid-template-columns: 300px 1fr;
  height: 100vh; max-height: 100vh; overflow: hidden;
}
.sidebar {
  border-right: 1px solid var(--border); background: var(--panel);
  padding: 12px; overflow-y: auto; display: grid; gap: 10px; align-content: start;
  max-height: 100vh;
}
.sidebar-compact .sidebar-head h1 { font-size: 17px; }
.sidebar-head h1 { margin: 8px 0 10px; font-size: 20px; }
.back-link { font-size: 13px; }
.status-row { display: flex; flex-wrap: wrap; gap: 8px; }
.panel {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: #151b23;
}
.panel h2 { margin: 0 0 10px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.checklist { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; }
.checklist label { display: flex; gap: 8px; align-items: center; color: var(--text); }
.hints-box, .transcript-box {
  font-size: 13px; line-height: 1.45;
}
.panel-compact { padding: 10px; }
.checklist-compact { gap: 4px; font-size: 13px; }
.transcript-box {
  overflow-y: auto; max-height: 100%; min-height: 0;
}
.transcript-line { margin-bottom: 6px; }
.transcript-line .who {
  color: var(--accent-2); font-weight: 600; margin-right: 6px;
}
.transcript-live { opacity: 0.75; }
.transcript-live .live-text { font-style: italic; }
.hints-box p { margin: 6px 0 0; }
.spin-hint { margin: 0 0 8px; flex-shrink: 0; }
.spin-columns {
  display: flex; gap: 8px; align-items: flex-end;
  margin-bottom: 8px; flex-shrink: 0; min-height: 130px;
}
.spin-col {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.spin-col-track {
  width: 100%; height: 100px; border-radius: 8px 8px 4px 4px;
  border: 1px solid var(--border); background: #0d1117;
  display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
}
.spin-col-fill {
  width: 100%; min-height: 4px;
  background: linear-gradient(180deg, #3d8bfd, #1f6feb);
  transition: height 0.45s ease;
}
.spin-col.active .spin-col-track { border-color: var(--accent-2); box-shadow: 0 0 0 1px #1f6feb55; }
.spin-col.active .spin-col-fill {
  background: linear-gradient(180deg, #58d0ff, #1f6feb);
}
.spin-col.complete .spin-col-fill {
  background: linear-gradient(180deg, #3dd68c, #238636);
}
.spin-col-code { font-size: 12px; font-weight: 700; color: var(--muted); }
.spin-col.active .spin-col-code { color: #fff; }
.spin-col-count { font-size: 11px; color: var(--muted); }
.spin-label { margin: 0 0 8px; flex-shrink: 0; }
.coach-questions { margin: 6px 0 0; padding-left: 18px; }
.coach-questions li { margin-bottom: 4px; }

.stage {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px; min-height: 0; height: 100vh; overflow: hidden;
}
.video-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  height: 34vh; min-height: 150px; max-height: 280px; flex-shrink: 0;
}
.video-card {
  position: relative; background: #000; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); min-height: 0;
}
.video-card video { width: 100%; height: 100%; object-fit: cover; background: #000; display: block; }
.video-label {
  position: absolute; left: 10px; bottom: 10px; padding: 3px 8px; border-radius: 999px;
  background: rgba(0,0,0,0.55); font-size: 11px;
}
.copilot-dock {
  flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.copilot-panel {
  display: flex; flex-direction: column; min-height: 0; margin: 0;
}
.copilot-panel h2 { flex-shrink: 0; }
.copilot-panel .transcript-box,
.copilot-panel .hints-box {
  flex: 1; min-height: 0; overflow-y: auto;
}

.client-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.client-main { display: grid; place-items: center; padding: 16px; }
.join-panel { width: min(480px, 100%); }
.call-panel { width: min(960px, 100%); display: grid; gap: 12px; }
.client-video-wrap {
  position: relative; aspect-ratio: 16/10; background: #000; border-radius: 18px;
  overflow: hidden; border: 1px solid var(--border);
}
.client-video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.client-video-wrap .pip {
  position: absolute; right: 12px; bottom: 12px; width: 160px; height: 100px;
  border-radius: 12px; border: 2px solid rgba(255,255,255,0.25); object-fit: cover;
}
.client-controls { display: flex; justify-content: center; gap: 10px; }

@media (max-width: 960px) {
  html.admin-room, body.admin-room { overflow: auto; }
  .admin-layout { grid-template-columns: 1fr; height: auto; max-height: none; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); max-height: none; }
  .stage { height: auto; overflow: visible; }
  .video-row { max-height: 220px; }
  .copilot-dock { grid-template-columns: 1fr; min-height: 240px; }
}

/* Landing (tokoom.ru) */
body.landing { background: radial-gradient(1200px 600px at 20% -10%, #1a2740 0%, var(--bg) 55%); }
.landing-wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.landing-header {
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--border); background: rgba(15, 20, 25, 0.92); backdrop-filter: blur(8px);
}
.landing-header .landing-wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px;
}
.landing-logo { font-weight: 800; font-size: 20px; color: var(--text); letter-spacing: 0.03em; }
.landing-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.landing-nav a:not(.btn) { color: var(--muted); font-size: 14px; padding: 6px 4px; }
.landing-hero { padding: 72px 0 48px; }
.landing-hero h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.1; margin: 16px 0; max-width: 760px; }
.landing-lead { font-size: 18px; line-height: 1.55; color: var(--muted); max-width: 680px; margin: 0 0 24px; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.wide-btn { min-width: 180px; text-align: center; }
.landing-note { max-width: 560px; }
.landing-section { padding: 48px 0; }
.landing-section h2 { margin: 0 0 20px; font-size: 28px; }
.landing-alt { background: rgba(23, 29, 37, 0.55); border-block: 1px solid var(--border); }
.landing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.landing-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.landing-card.highlight { border-color: #2d6f52; box-shadow: 0 0 0 1px #2d6f5244; }
.landing-card h3 { margin: 0 0 8px; font-size: 18px; }
.landing-price { font-size: 28px; font-weight: 700; margin: 4px 0 12px; color: #9ef0c8; }
.landing-cta { text-align: center; }
.landing-cta .landing-actions { justify-content: center; }
.landing-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; }
.landing-footer p { margin: 4px 0; }
@media (max-width: 720px) {
  .landing-nav a:not(.btn) { display: none; }
  .landing-hero { padding-top: 48px; }
}
