:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-2: #243044;
  --text: #e8eef7;
  --muted: #93a4bd;
  --primary: #3b82f6;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --border: #2d3a4f;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(180deg, #0b1017 0%, #121a26 100%);
  color: var(--text);
}

body {
  display: flex;
}

.sidebar {
  width: 240px;
  min-height: 100vh;
  background: rgba(15, 20, 25, 0.95);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  align-self: flex-start;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  margin-bottom: 24px;
  padding: 8px 10px;
}

.brand-icon { font-size: 1.4rem; }

.nav-link {
  display: block;
  color: var(--muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  background: var(--surface-2);
  color: var(--text);
}

.nav-link.logout { margin-top: 20px; color: #fca5a5; }

.content {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
}

.content.full {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-header h1 { margin: 0; font-size: 1.8rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.stats-grid { margin-bottom: 24px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.stat-label { color: var(--muted); font-size: 0.9rem; }
.stat-value { font-size: 2rem; font-weight: 700; margin-top: 8px; }

.section { margin-top: 28px; }
.section h2 { margin: 0 0 14px; }

.toolbar, .toolbar-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

input, select, textarea, button {
  font: inherit;
}

input, select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 160px;
}

textarea {
  width: 100%;
  font-family: Consolas, monospace;
  font-size: 0.85rem;
}

.btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
}

.btn:hover { filter: brightness(1.08); }
.btn.primary { background: var(--primary); border-color: #2563eb; }
.btn.success { background: var(--success); border-color: #16a34a; color: #052e16; }
.btn.danger { background: var(--danger); border-color: #dc2626; }

.video-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 12px;
}

.stream-frame {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  position: relative;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.stream-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.stream-frame .stream-image {
  position: absolute;
  inset: 0;
  max-height: none;
  border-radius: 0;
}

.placeholder {
  color: var(--muted);
  text-align: center;
  padding: 40px;
}

.stream-frame .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.split-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
}

@media (max-width: 960px) {
  body { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-height: auto;
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .split-layout { grid-template-columns: 1fr; }
}

.recordings-list {
  max-height: 520px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recording-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--surface-2);
}

.recording-item.selected {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.15);
}

.device-card h3 { margin: 0 0 8px; }
.device-meta { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge.online { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.badge.offline { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.badge.pending { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.badge.configured { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.badge.unconfigured { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.monitor-cell {
  position: relative;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 10px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: zoom-in;
}

.monitor-cell .monitor-media {
  position: absolute;
  inset: 0;
  background: #000;
}

.monitor-grid.has-focus .monitor-cell:not(.focused) {
  opacity: 0.22;
  pointer-events: none;
}

.monitor-cell.focused {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  width: min(calc(100vw - 40px), calc((100vh - 40px) * 16 / 9));
  aspect-ratio: 16 / 9;
  border: 2px solid #3b82f6;
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.75);
  cursor: zoom-out;
}

.monitor-cell .monitor-focus-hint {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 3;
  background: rgba(0, 0, 0, 0.55);
  color: #cbd5e1;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.monitor-cell:hover .monitor-focus-hint {
  opacity: 1;
}

.live-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.live-monitor-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.live-pager-info {
  color: var(--muted);
  font-size: 0.88rem;
}

.live-pager-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-pager-page {
  font-size: 0.9rem;
  color: var(--text);
  min-width: 4.5rem;
  text-align: center;
}

.toolbar-sep {
  width: 1px;
  height: 28px;
  background: var(--border);
  align-self: center;
}

.monitor-cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.monitor-cell .monitor-label {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.65);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
}

.monitor-cell .monitor-placeholder {
  position: absolute;
  inset: 0;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  background: #000;
  z-index: 1;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.channel-slot {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-2);
}

.channel-slot.configured {
  border-color: rgba(59, 130, 246, 0.45);
}

.channel-slot.unconfigured {
  opacity: 0.85;
}

.channel-slot-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.channel-slot-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.channel-slot-actions .btn {
  padding: 6px 10px;
  font-size: 0.78rem;
}

button.channel-pick {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

button.channel-pick.active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

button.channel-pick:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.section-inline-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.live-picker-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

#live-channel-picker-wrap {
  margin-bottom: 16px;
}

.section-subtitle {
  color: var(--muted);
  font-size: 0.92rem;
  margin: -8px 0 12px;
}

.progress {
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
}

.login-wrap { width: min(420px, 92vw); }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-card h1 { margin: 0 0 8px; }
.login-card label { margin-top: 14px; }
.login-card .btn { width: 100%; margin-top: 18px; }

.alert.error, .banner.error { background: rgba(239, 68, 68, 0.15); color: #fecaca; }
.banner.success { background: rgba(34, 197, 94, 0.15); color: #bbf7d0; }
.banner {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }

.settings-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
}

.settings-layout .full-width { grid-column: 1 / -1; }

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

.data-table th { color: var(--muted); font-weight: 600; }

.disk-card .disk-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.nav-link.nav-highlight {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px dashed rgba(59, 130, 246, 0.4);
  margin-bottom: 10px;
}

.page-subtitle { margin: 6px 0 0; }

.wizard-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}

.wizard-progress-title {
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--muted);
}

.wizard-steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wizard-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  color: var(--muted);
  font-size: 0.9rem;
  border-left: 2px solid transparent;
}

.wizard-step-item.active {
  color: var(--text);
  border-left-color: var(--primary);
  font-weight: 600;
}

.wizard-step-item.done {
  color: #86efac;
}

.wizard-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.wizard-step-item.active .wizard-step-num {
  background: var(--primary);
  color: white;
}

.wizard-step-indicator {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.wizard-content h2 { margin-top: 0; }

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.wizard-hero {
  text-align: center;
  padding: 12px 0 20px;
}

.wizard-hero-icon { font-size: 3rem; margin-bottom: 8px; }

.info-box, .tip-box {
  padding: 14px 16px;
  border-radius: 10px;
  margin: 16px 0;
  border: 1px solid var(--border);
  background: var(--surface-2);
  line-height: 1.5;
}

.tip-box { border-color: rgba(245, 158, 11, 0.35); }

.checklist, .step-list {
  line-height: 1.7;
  padding-left: 20px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.choice-card {
  text-align: left;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-card:hover, .choice-card.selected {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.1);
}

.choice-icon { font-size: 2rem; }

.checkbox-line {
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
  margin-top: 16px;
  color: var(--text) !important;
}

.method-cards {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.method-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.scan-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.scan-item {
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scan-item.selected { border-color: var(--primary); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.success-panel {
  text-align: center;
  padding: 20px;
}

.success-panel.large { padding: 32px 16px; }

.success-icon { font-size: 3rem; margin-bottom: 8px; }

.done-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.diagram-box {
  text-align: center;
  padding: 16px;
  background: var(--surface-2);
  border-radius: 10px;
  margin: 16px 0;
  line-height: 2;
}

.code-block {
  background: #0a0f16;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
}

.data-table.compact td, .data-table.compact th {
  padding: 6px 8px;
}

.rtsp-list {
  list-style: none;
  padding: 0;
}

.rtsp-pick {
  width: 100%;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  cursor: pointer;
  font-family: Consolas, monospace;
  font-size: 0.85rem;
}

.port-table { margin: 12px 0; }
.port-table th { white-space: nowrap; }

.diagram-pre { font-size: 0.8rem; line-height: 1.5; text-align: left; }

.topology-details summary {
  cursor: pointer;
  padding: 8px 0;
}

.topology-details[open] summary { margin-bottom: 4px; }

/* ——— Прямой эфир: мобильное приложение ——— */
.live-mobile-app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
  max-width: 100%;
  margin: 0;
  background: #000;
  overflow: hidden;
}

.live-mobile-channels-top {
  flex-shrink: 0;
  background: rgba(15, 20, 25, 0.98);
  border-bottom: 1px solid var(--border);
  padding: max(8px, env(safe-area-inset-top)) 8px 10px;
}

.live-mobile-channels-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.live-tv-channel {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-width: 88px;
  max-width: 108px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.live-tv-thumb-wrap {
  position: relative;
  width: 80px;
  height: 45px;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(145deg, #1a2332 0%, #0f1419 100%);
  flex-shrink: 0;
}

.live-tv-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.live-tv-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}

.live-tv-channel.active .live-tv-thumb-wrap {
  box-shadow: 0 0 0 2px var(--primary);
}

.live-tv-channel.active {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.22);
}

.live-tv-channel:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.live-tv-num {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--primary);
}

.live-tv-name {
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.2;
  margin-top: 0;
  max-width: 88px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-tv-live {
  display: none;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fca5a5;
  margin-top: 2px;
}

.live-tv-channel.active .live-tv-live {
  display: block;
}

.live-mobile-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

.live-mobile-frame {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  flex-shrink: 0;
  transform-origin: center center;
  will-change: transform;
}

.live-mobile-video {
  display: block;
  width: 100%;
  height: 100%;
  vertical-align: top;
}

.live-mobile-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: 24px;
  text-align: center;
  font-size: 0.95rem;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.live-mobile-video-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
}

.live-mobile-channel-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-mobile-live-badge {
  flex-shrink: 0;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
}

.live-res-field,
.live-mobile-res-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-res-label,
.live-mobile-res-label,
.live-mobile-controls-label {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.live-mobile-controls-card {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 4px;
  background: rgba(15, 20, 25, 0.98);
  border-top: 1px solid var(--border);
}

.live-mobile-recorder-row,
.live-mobile-quality-row {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.live-mobile-recorder-row.hidden {
  display: none;
}

.live-mobile-controls-label {
  text-align: center;
  width: 100%;
}

.live-mobile-recorder-toggle {
  display: inline-flex;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
}

.live-mobile-recorder-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
}

.live-mobile-recorder-btn + .live-mobile-recorder-btn {
  border-left: 1px solid var(--border);
}

.live-mobile-recorder-btn.active {
  background: var(--accent);
  color: #fff;
}

.live-mobile-recorder-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.live-mobile-quality-row {
  flex-direction: column;
  align-items: center;
}

.live-res-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
}

.live-res-btn {
  min-width: 44px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.live-res-btn + .live-res-btn {
  border-left: 1px solid var(--border);
}

.live-res-btn.active {
  background: var(--accent);
  color: #fff;
}

.live-mobile-dock {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px 10px max(12px, env(safe-area-inset-bottom));
  background: rgba(15, 20, 25, 0.98);
  border-top: 1px solid var(--border);
}

.live-mobile-dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.72rem;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.live-mobile-dock-btn:active {
  background: rgba(59, 130, 246, 0.2);
}

.live-mobile-dock-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.live-mobile-dock-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.live-mobile-dock-label {
  line-height: 1.1;
  text-align: center;
}

.live-mobile-frame:fullscreen,
.live-mobile-frame:-webkit-full-screen,
.live-mobile-stage:fullscreen,
.live-mobile-stage:-webkit-full-screen {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.stream-frame:fullscreen,
.stream-frame:-webkit-full-screen {
  border-radius: 0;
  max-width: none;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
}

@media (max-width: 768px) {
  .live-page .live-page-header {
    display: none;
  }

  body.live-mobile-mode .sidebar {
    display: none;
  }

  body.live-mobile-mode .content {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  body.live-mobile-mode {
    flex-direction: column;
  }

  body.live-mobile-mode .live-page {
    margin: 0;
    padding: 0;
  }
}

@media (max-width: 960px) {
  .wizard-layout { grid-template-columns: 1fr; }
  .wizard-progress { order: 2; }
}

.download-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 20, 0.72);
  backdrop-filter: blur(4px);
}

.download-progress-card {
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 16px;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.download-progress-card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.download-progress-message {
  margin: 0 0 16px;
  color: #94a3b8;
  min-height: 1.4em;
}

.download-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.download-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  transition: width 0.35s ease;
}

.download-progress-percent {
  margin-top: 10px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #cbd5e1;
}

.download-progress-close {
  width: 100%;
  margin-top: 16px;
}

.download-progress-card.is-error .download-progress-bar {
  background: linear-gradient(90deg, #dc2626, #f87171);
}

.download-progress-card.is-error .download-progress-message {
  color: #fecaca;
}
