/* ============================================================
   LiveTok app UI – shared stylesheet (admin + platform)
   Dark brand redesign, matching livetok.hu marketing site.
   Class names & functional hooks preserved 1:1 from the
   original markup/JS — only the visual layer changed.
   ============================================================ */

:root {
  /* brand */
  --cyan: #00E5C7;
  --blue: #5B7CFF;
  --violet: #B14CFF;
  --live: #FF2D55;
  --green: #16C784;   /* "on" / success */
  --red: #FF5470;     /* danger / error */
  --grad: linear-gradient(120deg, #00E5C7 0%, #5B7CFF 50%, #B14CFF 100%);
  --grad-soft: linear-gradient(120deg, rgba(0,229,199,.16), rgba(91,124,255,.16), rgba(177,76,255,.16));

  /* surfaces */
  --bg: #0a0a10;
  --bg-2: #0e0e16;
  --panel: rgba(255,255,255,.045);
  --surface: rgba(255,255,255,.04);
  --surface-2: rgba(255,255,255,.07);
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.16);

  /* text */
  --text: #F4F5FA;
  --muted: #9aa0b6;
  --muted-2: #6b7186;

  --shadow: 0 30px 80px rgba(0,0,0,.45);
  --shadow-glow: 0 18px 50px rgba(91,124,255,.28);
  --ease: cubic-bezier(.22,.61,.36,1);

  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, Arial, sans-serif;

  color-scheme: dark;
  font-family: var(--font-body);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 520px at 85% -8%, rgba(177,76,255,.16), transparent 60%),
    radial-gradient(820px 540px at 0% 0%, rgba(0,229,199,.13), transparent 55%),
    radial-gradient(760px 760px at 50% 120%, rgba(91,124,255,.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

button, input, select {
  font: inherit;
}

a { color: var(--blue); }

/* ============== LAYOUT SHELL ============== */
.shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.sidebar, .panel, .topbar {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  overflow: hidden;
}

/* ============== BRAND / LOGO MARK ============== */
.brand {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  flex-shrink: 0;
}

.logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  font-size: 0;              /* hide the literal "L" */
  background: var(--grad);
  box-shadow: 0 12px 30px rgba(91,124,255,.35);
  overflow: hidden;
}
/* play triangle */
.logo::before {
  content: "";
  width: 0; height: 0;
  margin-left: 4px;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
}
/* live dot */
.logo::after {
  content: "";
  position: absolute;
  top: 9px; right: 9px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--live);
  border: 2px solid #0b0b12;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font); letter-spacing: -0.01em; }

.brand h1 {
  font-size: 24px;
  font-weight: 800;
}

.brand p, .hint, .feed-item span {
  color: var(--muted);
  font-weight: 400;
}

/* ============== SIDEBAR NAV ============== */
nav {
  display: grid;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

nav::-webkit-scrollbar {
  width: 6px;
}

nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
}

nav a {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-family: var(--font);
  font-weight: 600;
  text-decoration: none;
  background: var(--surface);
  transition: color .2s, background .2s, border-color .2s, box-shadow .2s;
}

nav a:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line-strong);
}

nav a.active {
  color: var(--text);
  border-color: transparent;
  background: var(--grad-soft);
  box-shadow: inset 3px 0 0 var(--cyan);
}

.sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.status-card {
  display: grid;
  gap: 7px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.status-card strong { font-family: var(--font); }
.status-card small { color: var(--muted); }

.listener-card {
  gap: 10px;
}

.listener-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4a4f63;
  flex-shrink: 0;
}

.listener-dot.active,
.listener-dot.connected {
  background: var(--green);
  box-shadow: 0 0 12px rgba(22, 199, 132, .45);
}

.listener-dot.connecting,
.listener-dot.retry {
  background: #ffb020;
  box-shadow: 0 0 10px rgba(255, 176, 32, .35);
}

.listener-status-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.listener-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  width: auto;
  height: auto;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}

.listener-detail {
  display: block;
  line-height: 1.4;
  max-height: 3.2em;
  overflow: hidden;
}

.listener-status-pill.is-off {
  color: var(--muted);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
}

.listener-status-pill.is-pending {
  color: #ffd27a;
  background: rgba(255, 176, 32, .12);
  border: 1px solid rgba(255, 176, 32, .35);
}

.listener-status-pill.is-on {
  color: #8dffd0;
  background: rgba(22, 199, 132, .16);
  border: 1px solid rgba(22, 199, 132, .45);
  box-shadow: 0 0 18px rgba(22, 199, 132, .18);
}

.listener-card.is-connected {
  border-color: rgba(22, 199, 132, .45);
  background: linear-gradient(180deg, rgba(22, 199, 132, .08), var(--surface));
  box-shadow: inset 0 0 0 1px rgba(22, 199, 132, .08);
}

.listener-card.is-live {
  border-color: rgba(255, 64, 96, .45);
  box-shadow: 0 0 24px rgba(255, 64, 96, .12);
}

.listener-card .listener-actions {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.listener-card .listener-actions button {
  width: 100%;
  font-size: 0.82rem;
  padding: 10px 12px;
}

.listener-card .listener-stop-btn {
  background: rgba(255, 88, 88, .14);
  border-color: rgba(255, 88, 88, .45);
  color: #ffb4b4;
  font-weight: 700;
}

.listener-card .listener-stop-btn:hover {
  background: rgba(255, 88, 88, .22);
  border-color: rgba(255, 88, 88, .6);
}

.listener-card.is-connected .listener-start-btn {
  display: none;
}

.listener-card.is-busy .listener-actions button {
  opacity: .72;
  pointer-events: none;
}

.listener-card.is-busy .listener-status-pill.is-pending {
  animation: listener-pulse 1.2s ease-in-out infinite;
}

@keyframes listener-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .72; }
}

.listener-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 176, 32, .35);
  background: rgba(255, 176, 32, .08);
}

.listener-alert[hidden] {
  display: none !important;
}

.listener-alert-copy {
  display: grid;
  gap: 4px;
}

.listener-alert-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.listener-alert button {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ============== WORKSPACE / PAGES ============== */
.workspace { display: grid; gap: 18px; }

.page { display: none !important; }
.page.active { display: block !important; }
.page.grid.active { display: grid !important; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
}

.topbar h2 {
  margin-top: 4px;
  font-size: 32px;
  font-weight: 800;
}

.kicker {
  color: var(--cyan);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.channel-test-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 196, 46, .18);
  border: 1px solid rgba(255, 196, 46, .45);
  color: #ffd978;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.dashboard-side-panel.is-channel-admin {
  border-color: rgba(255, 196, 46, .35);
  box-shadow: inset 0 0 0 1px rgba(255, 196, 46, .12);
}

.dashboard-side-panel.is-channel-admin #tiktokInput:not(:disabled) {
  border-color: rgba(255, 196, 46, .55);
  background: rgba(255, 196, 46, .06);
}

h3 { font-weight: 700; }

.top-actions, .panel-head, .row-actions, .link-card div, .inline-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel { padding: 20px; }

.mini-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.mini-panel.wide { grid-column: span 2; }
.compact { margin-bottom: 12px; }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.projector-layout { display: grid; gap: 18px; }

.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }

.form-grid, .upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.upload-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
}

.upload-grid label { grid-column: span 2; }
.upload-grid .file-field { grid-column: span 3; }

.projector-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 14px;
  align-items: end;
}

/* ============== FORMS ============== */
label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

input, select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  font-weight: 400;
  background: var(--surface);
  transition: border-color .18s, box-shadow .18s, background .18s;
}

input::placeholder { color: var(--muted-2); }

input:focus, select:focus {
  outline: none;
  border-color: rgba(0,229,199,.6);
  box-shadow: 0 0 0 3px rgba(0,229,199,.14);
  background: rgba(255,255,255,.06);
}

select option { background: #15151f; color: var(--text); }

input[type="file"] {
  padding: 10px 12px;
  min-height: 46px;
}
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

/* ============== BUTTONS ============== */
button, .primary, .secondary, .danger {
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 700;
  text-decoration: none;
  transition: transform .16s var(--ease), box-shadow .2s var(--ease), border-color .2s, background .2s, opacity .2s;
}

button:hover, .primary:hover, .secondary:hover, .danger:hover {
  transform: translateY(-1px);
}

.primary {
  color: #06060b;
  background: var(--grad);
  box-shadow: var(--shadow-glow);
}
.primary:hover { box-shadow: 0 22px 60px rgba(91,124,255,.42); }

.secondary {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.secondary:hover { background: rgba(255,255,255,.12); }

.danger {
  color: #ffd9e0;
  border-color: rgba(255, 84, 112, .35);
  background: rgba(255, 84, 112, .12);
}
.danger:hover { background: rgba(255, 84, 112, .2); }

.full {
  width: 100%;
  margin-top: 16px;
}

/* ============== DASHBOARD STATS ============== */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.dashboard-hero-panel { display: grid; align-content: start; gap: 0; }

.dashboard-hero {
  margin-bottom: 14px;
}

.dashboard-hero-avatar {
  width: 92px;
  height: 92px;
  font-size: 36px;
  border-radius: 26px;
}

.dashboard-live-pill { margin-bottom: 16px; }

.dashboard-quick-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.dashboard-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.dashboard-details {
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.dashboard-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  list-style: none;
}

.dashboard-details summary::-webkit-details-marker { display: none; }

.dashboard-details-grid { margin-top: 12px; }

.dashboard-side-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.dashboard-side-panel > label { margin-top: 4px; }

.dashboard-plan-info { margin-top: 8px; }

.dashboard-stat-row {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 8px;
}

.dashboard-storage {
  margin-top: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.channel-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.channel-avatar {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 22px;
  color: #06060b;
  font-family: var(--font);
  font-size: 31px;
  font-weight: 800;
  background: var(--grad);
  box-shadow: 0 12px 30px rgba(91,124,255,.3);
}

.channel-avatar img { width: 100%; height: 100%; object-fit: cover; }

.channel-card-copy { min-width: 0; }

.channel-card h3, .channel-card p {
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-card h3 { white-space: nowrap; }

.channel-card p, .mini-hint { color: var(--muted); }

.channel-bio {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

.channel-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.channel-live-pill.is-live {
  color: #fecaca;
  border-color: rgba(248, 113, 113, .35);
  background: rgba(127, 29, 29, .28);
}

.channel-live-pill.is-offline {
  color: var(--muted);
}

.channel-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.channel-info-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  min-width: 0;
}

.channel-info-item.wide {
  grid-column: 1 / -1;
}

.channel-info-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.channel-info-item strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.stat-row div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.stat-row strong {
  display: block;
  font-family: var(--font);
  font-size: 28px;
  font-weight: 800;
}

.stat-row span { color: var(--muted); font-weight: 450; }

/* ============== TOGGLE CARDS / SWITCHES ============== */
.toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.toggle-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.toggle-card:hover { border-color: var(--line-strong); }

.toggle-card input {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  transition: .16s ease;
  cursor: pointer;
}

.toggle-card input::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  transition: .16s ease;
}

.toggle-card input:checked {
  border-color: transparent;
  background: var(--green);
}

.toggle-card input:checked::after { transform: translateX(20px); }

.toggle-card span {
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
}

.toggle-card small {
  grid-column: 2;
  color: var(--muted);
  line-height: 1.35;
}

.toggle-expand-card {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.toggle-expand-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.toggle-card.compact {
  flex: 1;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: default;
}

.expand-toggle-btn {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
}
.expand-toggle-btn:hover { background: rgba(255,255,255,.12); }

.toggle-expand-body {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}

.toggle-expand-body label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .85rem;
}

.battle-card-actions { display: flex; gap: 10px; }

#projectorMirrorToggle.active {
  border-color: rgba(22, 199, 132, .5);
  background: rgba(22, 199, 132, .14);
  color: #67e0ad;
}

/* ============== EARNING CARDS ============== */
.earning-cards {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.earning-card {
  min-height: 126px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.earning-card span { color: var(--muted); font-size: 12px; }

.earning-card strong {
  font-family: var(--font);
  font-size: 21px;
  font-weight: 800;
}

.earning-card em {
  color: var(--cyan);
  font-style: normal;
  font-weight: 700;
}

.earning-card small { color: var(--muted); line-height: 1.35; }

.earning-card.highlight {
  grid-column: 1 / -1;
  background: var(--grad-soft);
  border: 1px solid var(--line-strong);
}

.gift-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.panel-lead {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  max-width: 52ch;
}

.video-upload-wizard {
  display: grid;
  gap: 22px;
  margin-top: 8px;
}

.video-wizard-step {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.video-wizard-step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.video-wizard-step-title span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--grad);
  color: #081018;
  font-size: 13px;
  font-weight: 800;
}

.video-type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.video-type-card {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}

.video-type-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.video-type-card.is-active {
  border-color: rgba(0,229,199,.55);
  background: linear-gradient(145deg, rgba(0,229,199,.12), rgba(91,124,255,.10));
  box-shadow: 0 12px 30px rgba(0,229,199,.12);
}

.video-type-emoji {
  font-size: 22px;
  line-height: 1;
}

.video-type-card strong {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 800;
}

.video-type-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.video-type-hint {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--grad-soft);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.video-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.video-details-grid label em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted-2);
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 400;
}

.cooldown-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.cooldown-unit {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.video-sound-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
}

.video-sound-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.video-sound-toggle > span {
  font-weight: 600;
}

.video-sound-toggle .field-hint {
  flex: 1 1 100%;
  margin: 0;
}

.video-file-drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 20px;
  border: 2px dashed rgba(0,229,199,.35);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(0,229,199,.06), rgba(91,124,255,.04));
  text-align: center;
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}

.video-file-drop:hover,
.video-file-drop.is-dragover {
  border-color: rgba(0,229,199,.75);
  background: linear-gradient(180deg, rgba(0,229,199,.10), rgba(177,76,255,.08));
  transform: translateY(-1px);
}

.video-file-drop.has-file {
  border-style: solid;
  border-color: rgba(22,199,132,.45);
}

.video-file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.video-file-drop strong {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
}

.video-file-drop small,
.video-file-drop #videoFileName {
  color: var(--muted);
  font-size: 13px;
}

.video-file-icon {
  font-size: 34px;
  line-height: 1;
}

.video-upload-btn {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 800;
}

.video-help-card {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.video-help-card summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
  list-style: none;
}

.video-help-card summary::-webkit-details-marker { display: none; }

.video-help-card summary::after {
  content: " ˅";
  color: var(--cyan);
}

.video-help-card[open] summary::after { content: " ˄"; }

.video-help-card p { margin: 10px 0 0; }

.video-groups { display: grid; gap: 14px; margin-top: 18px; }

.table.auto-disabled {
  opacity: 0.72;
}

.table.auto-disabled .video-row {
  border-style: dashed;
}

/* ============== OVERLAY TEXT CARDS ============== */
.overlay-text-panel { margin-top: 18px; }
.overlay-text-list { display: grid; gap: 14px; }

.overlay-text-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.overlay-text-card.is-disabled {
  opacity: .6;
  border-style: dashed;
}

.overlay-text-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.02);
}

.overlay-text-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.overlay-text-title {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .02em;
}

.overlay-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.overlay-status::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.overlay-status.is-on { color: #5fe3ad; background: rgba(22, 199, 132, .14); }
.overlay-status.is-off { color: #ff8aa0; background: rgba(255, 84, 112, .12); }

.overlay-power-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  cursor: pointer;
  flex: none;
}

.overlay-power-track {
  position: relative;
  width: 42px; height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  transition: background .2s ease;
}

.overlay-power-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
  transition: transform .2s ease;
}

.overlay-power-btn.is-on .overlay-power-track { background: var(--green); }
.overlay-power-btn.is-on .overlay-power-thumb { transform: translateX(18px); }

.overlay-power-label {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  min-width: 18px;
  text-align: center;
  color: var(--text);
}

.overlay-text-body { display: grid; gap: 12px; padding: 16px; }

.overlay-text-type-wrap,
.overlay-text-namepos,
.overlay-text-duration { display: grid; gap: 6px; }

.overlay-text-type-wrap span,
.overlay-text-namepos span,
.overlay-text-duration > span:first-child {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.overlay-text-card input,
.overlay-text-card select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  min-width: 0;
}

.overlay-text-name { font-weight: 700; color: var(--text); }
.overlay-text-content { min-width: 0; }

.overlay-text-preview {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-size: 13px;
}

.overlay-text-preview strong { color: var(--text); }

.overlay-text-duration {
  grid-template-columns: auto 72px auto;
  align-items: center;
  width: fit-content;
}

.overlay-text-unit { font-size: 12px; color: var(--muted); }

.overlay-text-file { display: grid; gap: 4px; min-width: 0; }
.overlay-text-file input { width: 100%; }

.overlay-text-foot { padding: 0 16px 16px; }
.overlay-text-foot .row-actions { flex-wrap: wrap; gap: 8px; }
.overlay-text-foot .danger { font-size: 18px; line-height: 1; padding: 0 14px; }

@media (max-width: 860px) {
  .overlay-text-head { align-items: flex-start; flex-direction: column; }
}

/* ============== TREND BARS ============== */
.trend-bars {
  min-height: 190px;
  display: grid;
  grid-template-columns: repeat(14, minmax(22px, 1fr));
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.02);
}

.trend-day {
  height: 160px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  align-items: end;
  text-align: center;
}

.trend-day span {
  display: block;
  width: 100%;
  min-height: 7px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
}

.trend-day small { color: var(--muted); font-size: 11px; }

/* ============== STAT / GIFT LISTS ============== */
.stat-list, .gift-log {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 3px;
}

.stat-row-item, .gift-log-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.gift-log-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.gift-type-row { grid-template-columns: auto minmax(0, 1fr) auto; }

.stat-row-item b { width: 22px; color: var(--cyan); font-weight: 700; }

.stat-row-item span,
.gift-log-row span,
.gift-feed-item span { min-width: 0; }

.stat-row-item strong,
.gift-log-row strong,
.gift-feed-item strong {
  display: block;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-row-item small,
.gift-log-row small,
.gift-feed-item small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-row-item em,
.gift-log-row em {
  color: var(--cyan);
  font-style: normal;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.avatar, .gift-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-2);
}

.avatar { border-radius: 50%; }
.avatar img, .gift-icon img { width: 100%; height: 100%; object-fit: cover; }
.avatar.fallback, .gift-icon.fallback { color: var(--cyan); font-weight: 700; }

/* ============== TABLES / VIDEO ROWS ============== */
.table { display: grid; gap: 10px; margin-top: 18px; }

.video-item.is-disabled {
  opacity: 0.62;
}

.video-item.is-disabled .video-row video {
  filter: grayscale(0.35);
}

.video-row-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.video-row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.video-row-actions {
  flex-wrap: wrap;
}

.video-item {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}

.video-item.is-editing {
  border-color: rgba(0, 212, 255, .35);
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, .08);
}

.video-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.video-edit-form {
  display: grid;
  gap: 14px;
  padding: 14px 12px 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
}

.video-edit-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-edit-grid label {
  display: grid;
  gap: 6px;
}

.video-edit-grid label span {
  color: var(--muted);
  font-size: 0.82rem;
}

.video-edit-grid .video-edit-file {
  grid-column: 1 / -1;
}

.video-edit-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.video-row strong, .video-row span { display: block; }
.video-row strong { font-weight: 600; }
.video-row span { margin-top: 4px; color: var(--muted); }

.video-row video {
  width: 140px;
  height: 78px;
  border-radius: 12px;
  object-fit: cover;
  background: #000;
}

.video-row.background-row { grid-template-columns: minmax(0, 1fr) 190px auto; }
.video-row.background-row video { width: 190px; height: 106px; }

/* ============== LINK GRID ============== */
.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.link-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.link-card span { color: var(--cyan); font-family: var(--font); font-weight: 700; }

.link-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.link-card-emoji {
  font-size: 28px;
  line-height: 1;
  flex: none;
}

.link-card-head strong {
  display: block;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.link-card-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.link-card.is-preview {
  border-style: dashed;
  opacity: 0.88;
}

.link-card .muted-code {
  color: var(--muted);
  background: rgba(255,255,255,.04);
  border-color: var(--line);
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.link-card code {
  overflow: hidden;
  padding: 10px;
  border-radius: 12px;
  color: #b9f4ee;
  background: rgba(0, 229, 199, .08);
  border: 1px solid rgba(0, 229, 199, .14);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ============== FEED ============== */
.feed { display: grid; gap: 9px; margin-top: 14px; }

.feed-item, .empty {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.empty { color: var(--muted); }

.gift-feed-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.feed-item strong, .feed-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============== TOAST ============== */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  padding: 14px 16px;
  border-radius: 16px;
  color: var(--text);
  font-weight: 600;
  background: #15151f;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  transition: .18s ease;
  z-index: 200;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.good { background: rgba(22, 199, 132, .95); color: #06120c; border-color: transparent; }
.toast.bad { background: rgba(255, 84, 112, .95); color: #1a0408; border-color: transparent; }

/* ============== RESPONSIVE (shell) ============== */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .grid, .link-grid, .widget-grid, .form-grid, .upload-grid { grid-template-columns: 1fr; }
  .video-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-details-grid { grid-template-columns: 1fr; }
  .projector-upload { grid-template-columns: 1fr; }
  .earning-cards, .gift-dashboard, .trend-bars, .toggle-grid { grid-template-columns: 1fr; }
  .dashboard-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-7, .span-5 { grid-column: 1 / -1; }
  .mini-panel.wide { grid-column: auto; }
  .span-7, .span-6, .span-5, .upload-grid label, .upload-grid .file-field { grid-column: auto; }
  .video-row { grid-template-columns: 1fr; }
  .video-edit-grid { grid-template-columns: 1fr; }
}

/* ============== UTILITY ============== */
.hidden { display: none !important; }

/* ============== LOGIN / AUTH SCREENS ============== */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border-radius: 24px;
  background: var(--bg-2);
  box-shadow: var(--shadow);
  border: 1px solid var(--line-strong);
}

.auth-card { width: min(460px, 100%); }

.app-lang {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 4px;
  font-size: .82rem;
  color: var(--muted);
}

.app-lang-label {
  white-space: nowrap;
}

.app-lang-select {
  min-width: 118px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.sidebar .app-lang {
  margin: 0 0 12px;
  justify-content: stretch;
  flex-shrink: 0;
}

.sidebar .app-lang-select {
  flex: 1;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.auth-tab {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--grad);
  color: #06060b;
}

.auth-lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: .95rem;
}

.pw-hint { margin: -4px 0 0; font-size: .82rem; color: var(--muted); }

.auth-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 84, 112, .18);
  border: 1px solid rgba(255, 84, 112, .5);
}

.auth-error.hidden { display: none; }

.pw-hint.bad { color: var(--red); }
.pw-hint.good { color: var(--green); }

.link-button {
  border: 0;
  background: none;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
  font-size: .9rem;
  padding: 0;
}

/* ============== PLAN SELECTION ============== */
.plan-card {
  width: min(1040px, 100%);
  display: grid;
  gap: 18px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.plan-option {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.plan-option.is-selected {
  border-color: rgba(0, 229, 199, .45);
  background: rgba(0, 229, 199, .05);
}

.plan-option-head {
  display: grid;
  gap: 4px;
}

.plan-option h3 {
  margin: 0;
  font-size: 1.35rem;
}

.plan-option-tagline {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
}

.plan-option .price {
  margin: 0;
  font-family: var(--font);
  font-size: 1.5rem;
  font-weight: 800;
}

.plan-detail-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: .9rem;
  line-height: 1.45;
}

.plan-detail-list li + li {
  margin-top: 6px;
}

.plan-pricing {
  display: grid;
  gap: 4px;
  margin: 0;
  font-family: var(--font);
}

.plan-pricing p {
  margin: 0;
  font-size: 1rem;
}

.plan-pricing strong {
  color: var(--cyan);
}

.plan-pricing-note {
  color: var(--muted);
  font-size: .82rem;
  font-family: var(--font-body);
  font-weight: 400;
}

.revolut-email-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: .92rem;
  line-height: 1.45;
}

.revolut-email-note strong {
  color: var(--cyan);
}

.plan-option ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: .92rem;
}

.plan-billing-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.plan-billing-toggle button {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.plan-billing-toggle button.active {
  border-color: transparent;
  background: var(--grad);
  color: #06060b;
  font-weight: 700;
}

.pending-plan {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(245, 200, 80, .1);
  border: 1px solid rgba(245, 200, 80, .35);
  color: #f1cf6b;
}

.revolut-payment {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(0, 229, 199, .28);
  background: rgba(0, 229, 199, .06);
}

.revolut-payment.is-awaiting {
  border-color: var(--line);
  background: var(--surface);
}

.revolut-payment-head h2 {
  margin: 0 0 6px;
  font-family: var(--font);
  font-size: 1.05rem;
}

.revolut-amount {
  margin: 0;
  color: var(--text);
  font-size: .98rem;
}

.revolut-amount strong {
  color: var(--cyan);
  font-size: 1.15rem;
}

.revolut-steps {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.5;
  font-size: .92rem;
}

.revolut-steps li + li {
  margin-top: 6px;
}

.revolut-pay-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  width: 100%;
}

.revolut-reference {
  display: grid;
  gap: 8px;
}

.revolut-reference-label {
  font-size: .82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.revolut-reference-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.revolut-reference-row code {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: .88rem;
  overflow-wrap: anywhere;
}

.payment-disclaimer {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}

.plan-hint { margin: 0; }

@media (max-width: 760px) {
  .plan-grid { grid-template-columns: 1fr; }
}

.brand.compact {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.account-card { display: grid; gap: 8px; }
.account-card button { width: 100%; }

/* ============== PLAN FEATURE LOCK (Pro preview blur) ============== */
.plan-locked-wrap { position: relative; }

.plan-locked-wrap.is-locked > :not(.plan-lock-banner) {
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
}

.plan-lock-banner {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  border-radius: inherit;
  background: rgba(10, 10, 16, .55);
  backdrop-filter: blur(2px);
}

.plan-lock-banner strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font);
  font-size: 1.1rem;
  color: var(--text);
}

.plan-lock-banner p { color: var(--muted); }

.plan-lock-banner::before {
  content: "🔒";
  display: block;
  font-size: 2rem;
  margin-bottom: 8px;
}

/* ============== STORAGE METER ============== */
.storage-meter { display: grid; gap: 6px; margin-top: 10px; }

.storage-meter span {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  overflow: hidden;
}

.storage-meter span em {
  display: block;
  height: 100%;
  background: var(--grad);
}

/* ============== CHANNEL SWITCH / LIVE BADGE ============== */
.channel-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.channel-switch select {
  min-height: 0;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  max-width: 220px;
}

.channel-switch button { white-space: nowrap; }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
}

.live-badge.is-live {
  background: rgba(22, 199, 132, .12);
  border-color: rgba(22, 199, 132, .4);
  color: #5fe3ad;
}

.live-badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4a4f63;
}

.live-badge-dot.active {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 199, 132, 0.18);
  animation: livePulse 1.6s infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 199, 132, 0.32); }
  70% { box-shadow: 0 0 0 6px rgba(22, 199, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 199, 132, 0); }
}

/* ============== PLAN INFO ============== */
.plan-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.plan-info-row { display: flex; flex-direction: column; gap: 4px; }
.plan-info-row strong { font-size: 14px; color: var(--text); }

@media (max-width: 640px) {
  .plan-info { grid-template-columns: 1fr; }
}

/* ============== INLINE CONTROLS ============== */
.inline-controls select {
  min-height: 0;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  color: var(--text);
  min-width: 150px;
}

/* ============== PROJECTOR LINK ============== */
.projector-link-panel { margin-bottom: 18px; }

.projector-link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.projector-link-row code {
  flex: 1 1 320px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 229, 199, .08);
  border: 1px solid rgba(0, 229, 199, .14);
  color: #b9f4ee;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.projector-link-actions { display: flex; gap: 8px; flex-shrink: 0; }
.projector-link-actions .primary { display: inline-flex; align-items: center; text-decoration: none; }

/* ============== TRIGGERS (legacy/aux) ============== */
.trigger-panel { margin-top: 18px; }

.trigger-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.trigger-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.trigger-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.trigger-form input,
.trigger-form select {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  color: var(--text);
}

.trigger-form-actions { display: flex; gap: 10px; }

.trigger-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.trigger-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trigger-card.is-disabled { opacity: 0.55; }

.trigger-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.trigger-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(91,124,255,.16);
  color: #aab8ff;
}

.trigger-thumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
}

.trigger-meta { color: var(--muted); }

.trigger-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}

.trigger-card-actions button { padding: 6px 10px; font-size: 12px; }

/* ===== Statisztika oldal – Fázis 1 ===== */
.stat-toolbar {
  display: flex;
  gap: 14px;
  align-items: stretch;
  flex-wrap: wrap;
  margin-top: 4px;
}
.stat-toolbar .seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
  flex: none;
  height: fit-content;
}
.stat-toolbar .seg button {
  all: unset;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 9px;
  color: var(--muted);
}
.stat-toolbar .seg button.on {
  background: var(--grad);
  color: #06121a;
  font-weight: 700;
}
.earning-cards.slim {
  display: block;
  flex: 1 1 300px;
}
.earning-cards.slim .earning-card.highlight {
  min-height: 0;
  padding: 12px 16px;
}

.stat-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 20px 2px 10px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.stat-section-title::before {
  content: "";
  width: 4px;
  height: 15px;
  border-radius: 3px;
  background: var(--grad);
}

.scorecard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.sc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
}
.sc-top {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 9px;
}
.sc-ico { font-size: 15px; line-height: 1; }
.sc-val {
  font-family: var(--font);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.sc-sub { color: var(--muted-2); font-size: 11px; margin-top: 3px; }
.sc-delta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  margin-top: 10px;
}
.sc-delta.up { background: rgba(22, 199, 132, 0.14); color: #3fe0a6; }
.sc-delta.down { background: rgba(255, 84, 112, 0.16); color: #ff7d95; }
.sc-soon {
  align-self: flex-start;
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 999px;
}
.sc-card.is-soon .sc-val { color: var(--muted-2); }

.stat-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.sc-mini {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sc-mini .mini-label { color: var(--muted); font-size: 12px; }
.sc-mini .mini-val { font-family: var(--font); font-size: 19px; font-weight: 800; }
.sc-mini.is-soon .mini-val { color: var(--muted-2); }
.sc-mini .sc-soon { margin-top: 0; }

.split-bar {
  display: flex;
  height: 12px;
  border-radius: 7px;
  overflow: hidden;
  margin: 6px 0 12px;
  background: var(--surface-2);
}
.split-bar span { display: block; }
.split-bar .seg-ret { background: var(--blue); }
.split-bar .seg-new { background: var(--cyan); }
.split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}
.split-legend strong { color: var(--text); font-weight: 700; }
.split-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: -1px;
}
.split-legend .dot.ret { background: var(--blue); }
.split-legend .dot.new { background: var(--cyan); }

.heatmap {
  display: grid;
  grid-template-columns: 62px repeat(5, minmax(0, 1fr));
  gap: 5px;
  align-items: center;
}
.hm-col { font-size: 11px; color: var(--muted-2); text-align: center; }
.hm-row { font-size: 12px; color: var(--muted); }
.hm-cell {
  height: 30px;
  border-radius: 7px;
  background: var(--surface-2);
  position: relative;
}
.hm-cell.best { box-shadow: inset 0 0 0 2px var(--cyan); }
.hm-cell.best::after {
  content: "★";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #06121a;
}

.stat-soon-host { min-height: 120px; display: flex; }
.stat-soon-box {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 120px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
  background: var(--surface);
}
.stat-soon-box.wide { min-height: 90px; }

@media (max-width: 720px) {
  .stat-toolbar { flex-direction: column; }
  .stat-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Nézőszám-görbe (Fázis 2) */
#statViewerCurve { flex-direction: column; align-items: stretch; gap: 8px; }
.viewer-curve-svg { width: 100%; height: 132px; display: block; }
.viewer-curve-svg .vc-line { fill: none; stroke: var(--cyan); stroke-width: 2; vector-effect: non-scaling-stroke; }
.viewer-curve-svg .vc-area { fill: rgba(0, 229, 199, 0.12); stroke: none; }
.vc-meta { display: flex; gap: 16px; justify-content: flex-end; color: var(--muted); font-size: 12px; }
.vc-meta strong { color: var(--text); font-weight: 700; }
