* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0f1117;
  color: #e1e4e8;
  min-height: 100vh;
}

.header {
  background: #161b22;
  border-bottom: 1px solid #30363d;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header h1 {
  font-size: 18px;
  font-weight: 600;
  color: #f0f6fc;
}

.header .badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-control { background: #1f6feb33; color: #58a6ff; border: 1px solid #1f6feb; }
.badge-view { background: #23863633; color: #3fb950; border: 1px solid #238636; }

.container {
  max-width: 900px;
  margin: 24px auto;
  padding: 0 24px;
}

/* Status Cards */
.card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

/* Status Indicators */
.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-green { background: #3fb950; box-shadow: 0 0 6px #3fb95066; }
.dot-red { background: #f85149; box-shadow: 0 0 6px #f8514966; }
.dot-yellow { background: #d29922; box-shadow: 0 0 6px #d2992266; }
.dot-blue { background: #58a6ff; box-shadow: 0 0 6px #58a6ff66; animation: pulse 1.5s infinite; }
.dot-gray { background: #484f58; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-label { font-size: 14px; color: #c9d1d9; }
.status-value { font-size: 14px; color: #8b949e; margin-left: auto; }

/* Script Display */
.script-box {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #c9d1d9;
  margin-top: 8px;
  white-space: pre-wrap;
}

.script-box.empty {
  color: #484f58;
  font-style: italic;
}

/* Audio Player */
.audio-section {
  margin-top: 12px;
}

.audio-section audio {
  width: 100%;
  height: 40px;
  margin-top: 8px;
}

/* Buttons (control panel only) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid #30363d;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: #238636;
  border-color: #238636;
  color: #fff;
}

.btn-primary:hover { background: #2ea043; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: #21262d;
  color: #c9d1d9;
}

.btn-secondary:hover { background: #30363d; }

/* Timestamp */
.timestamp {
  font-size: 12px;
  color: #484f58;
  margin-top: 4px;
}

/* Error box */
.error-box {
  background: #f8514911;
  border: 1px solid #f8514933;
  border-radius: 6px;
  padding: 12px;
  color: #f85149;
  font-size: 13px;
  margin-top: 8px;
}

/* Grid for status items */
.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.status-grid .stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label { font-size: 12px; color: #8b949e; }
.stat-value { font-size: 16px; font-weight: 500; color: #f0f6fc; }

/* Tab Bar */
.tab-bar {
  background: #161b22;
  border-bottom: 1px solid #30363d;
  display: flex;
  gap: 0;
  padding: 0 24px;
  overflow-x: auto;
}

.tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: #8b949e;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  color: #c9d1d9;
}

.tab.active {
  color: #f0f6fc;
  border-bottom-color: #58a6ff;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* History Items */
.history-item {
  padding: 16px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  margin-bottom: 12px;
}

.history-item.latest {
  border-color: #58a6ff44;
}

.history-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.history-num {
  font-size: 12px;
  font-weight: 600;
  color: #58a6ff;
}

.history-item.latest .history-num {
  color: #3fb950;
}

.history-time {
  font-size: 12px;
  color: #8b949e;
}

.history-size {
  font-size: 12px;
  color: #484f58;
  margin-left: auto;
}

.history-item .script-box {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 13px;
  border: none;
  padding: 12px;
  background: #161b22;
}

.history-item audio {
  width: 100%;
  height: 36px;
}

/* Weather Header Card */
.wx-header-card {
  border-color: #1f6feb55;
  background: #0d1929;
  padding: 20px 24px;
}

.wx-header-title {
  font-size: 12px;
  font-weight: 600;
  color: #58a6ff;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

.wx-header-grid {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.wx-col {
  flex: 1;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wx-col:first-child {
  padding-left: 0;
}

.wx-col:last-child {
  padding-right: 0;
}

.wx-col-label {
  font-size: 11px;
  font-weight: 700;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

.wx-temp-big {
  font-size: 36px;
  font-weight: 700;
  color: #f0f6fc;
  line-height: 1;
  margin-bottom: 4px;
}

.wx-hi-lo {
  display: flex;
  gap: 16px;
  margin-bottom: 4px;
}

.wx-hi {
  font-size: 16px;
  color: #f85149;
}

.wx-lo {
  font-size: 16px;
  color: #58a6ff;
}

.wx-hi strong, .wx-lo strong {
  font-size: 18px;
}

.wx-detail {
  font-size: 13px;
  color: #8b949e;
  line-height: 1.4;
}

.wx-precip {
  font-size: 12px;
  color: #3fb950;
  margin-top: 2px;
}

.wx-divider {
  width: 1px;
  background: #30363d;
  align-self: stretch;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .wx-header-grid {
    flex-direction: column;
    gap: 16px;
  }
  .wx-divider {
    width: auto;
    height: 1px;
    align-self: auto;
  }
  .wx-col {
    padding: 0;
  }
  .status-grid {
    grid-template-columns: 1fr;
  }
}

/* Auth Overlay */
#auth-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: #0f1117;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#auth-box {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 40px 36px;
  width: 90%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#auth-title {
  font-size: 18px;
  font-weight: 700;
  color: #f0f6fc;
  text-align: center;
}

#auth-subtitle {
  font-size: 13px;
  color: #8b949e;
  text-align: center;
  margin-bottom: 4px;
}

#auth-input {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 15px;
  color: #f0f6fc;
  outline: none;
  font-family: inherit;
  letter-spacing: 2px;
}

#auth-input:focus {
  border-color: #58a6ff;
}

#auth-error {
  font-size: 13px;
  color: #f85149;
  min-height: 18px;
  text-align: center;
}

#auth-btn {
  background: #238636;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
}

#auth-btn:hover { background: #2ea043; }

/* Nav links */
.nav-link {
  color: #58a6ff;
  text-decoration: none;
  font-size: 13px;
}
.nav-link:hover { text-decoration: underline; }

/* ============================================================================
   MASTER CONTROL — OBS Dashboard Components
   ============================================================================ */

/* Mode Badge */
.mode-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 12px;
  letter-spacing: 1px;
  margin-left: auto;
}

.mode-radio {
  background: #23863633;
  color: #3fb950;
  border: 1px solid #238636;
}

.mode-video {
  background: #1f6feb33;
  color: #58a6ff;
  border: 1px solid #1f6feb;
}

/* Now Playing */
.now-playing {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.np-filename {
  font-size: 16px;
  font-weight: 500;
  color: #8b949e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.np-filename.playing {
  color: #58a6ff;
}

.np-countdown-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.np-countdown-label {
  font-size: 12px;
  color: #8b949e;
}

.np-countdown {
  font-size: 28px;
  font-weight: 700;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  color: #f0f6fc;
  letter-spacing: 2px;
}

.np-progress-bar {
  width: 100%;
  height: 4px;
  background: #30363d;
  border-radius: 2px;
  overflow: hidden;
}

.np-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #238636, #3fb950);
  border-radius: 2px;
  transition: width 1s linear;
  width: 0%;
}

/* Volume Mixer */
.volume-mixer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mixer-channel {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mixer-label {
  font-size: 13px;
  color: #c9d1d9;
  min-width: 110px;
}

.volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #30363d;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #58a6ff;
  cursor: pointer;
  border: 2px solid #0d1117;
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #58a6ff;
  cursor: pointer;
  border: 2px solid #0d1117;
}

.mixer-value {
  font-size: 13px;
  color: #8b949e;
  min-width: 40px;
  text-align: right;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
}

/* Action Grid */
.action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Danger Button */
.btn-danger {
  background: #da3633;
  border-color: #da3633;
  color: #fff;
}

.btn-danger:hover {
  background: #f85149;
  border-color: #f85149;
}

/* Banner List */
.banner-list {
  margin-top: 8px;
  max-height: 120px;
  overflow-y: auto;
}

.banner-item {
  font-size: 12px;
  color: #8b949e;
  padding: 3px 0;
  border-bottom: 1px solid #21262d;
}

/* ===== Lower Third Controls ===== */

.lt-section {
  margin-bottom: 12px;
}

.lt-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.lt-label-blue { color: #58a6ff; }
.lt-label-red { color: #f85149; }

.lt-input-row {
  display: flex;
  gap: 8px;
}

.lt-input {
  flex: 1;
  padding: 8px 12px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #f0f6fc;
  font-size: 14px;
  outline: none;
}

.lt-input:focus {
  border-color: #58a6ff;
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.15);
}

.btn-lt-blue {
  background: #1a5276;
  color: #fff;
  border: 1px solid #2980b9;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-lt-blue:hover { background: #2980b9; }

.btn-lt-red {
  background: #8b1a1a;
  color: #fff;
  border: 1px solid #e74c3c;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-lt-red:hover { background: #c0392b; }

.lt-active {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  background: #161b22;
  border: 1px solid #30363d;
}

.lt-active-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lt-dot-blue {
  background: #58a6ff;
  box-shadow: 0 0 6px #58a6ff;
  animation: lt-blink 1.5s infinite;
}

.lt-dot-red {
  background: #f85149;
  box-shadow: 0 0 6px #f85149;
  animation: lt-blink 1s infinite;
}

@keyframes lt-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.lt-active-text {
  font-size: 13px;
  color: #c9d1d9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Scene Rotation Controls ===== */

.scene-rotation-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #21262d;
}

.sr-row:last-child { border-bottom: none; }

.sr-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #f0f6fc;
}

.sr-duration {
  padding: 4px 8px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #f0f6fc;
  font-size: 13px;
  cursor: pointer;
}

.sr-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  width: 30px;
  text-align: center;
}

.sr-on { color: #3fb950; }
.sr-off { color: #484f58; }

/* Toggle switch */
.sr-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.sr-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.sr-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #30363d;
  border-radius: 11px;
  transition: 0.3s;
}

.sr-slider:before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: #8b949e;
  border-radius: 50%;
  transition: 0.3s;
}

.sr-toggle input:checked + .sr-slider {
  background: #238636;
}

.sr-toggle input:checked + .sr-slider:before {
  transform: translateX(18px);
  background: #fff;
}

/* ===== Audio Sources ===== */

.audio-sources {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audio-source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.as-name {
  font-size: 14px;
  color: #c9d1d9;
}

.btn-mute {
  padding: 4px 14px;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #c9d1d9;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-mute:hover { background: #30363d; }

/* ============================================================================
   MASTER CONTROL — Two-Column Layout + Scene Preview
   ============================================================================ */

/* ============================================================================
   BROADCAST BAR — top of master control
   ============================================================================ */

.mc-broadcast-bar {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  background: #0d1117;
  border-bottom: 1px solid #21262d;
  padding: 10px 24px;
  flex-wrap: wrap;
  gap: 4px;
}

.mcb-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}

.mcb-divider {
  width: 1px;
  height: 36px;
  background: #21262d;
  flex-shrink: 0;
}

.mcb-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  border: 1px solid;
  white-space: nowrap;
}

.mcb-btn-stream {
  background: rgba(63, 185, 80, 0.1);
  color: #3fb950;
  border-color: rgba(63, 185, 80, 0.35);
}
.mcb-btn-stream:hover { background: rgba(63, 185, 80, 0.2); }
.mcb-btn-stream.active {
  background: rgba(63, 185, 80, 0.2);
  border-color: #3fb950;
  box-shadow: 0 0 12px rgba(63, 185, 80, 0.25);
}

.mcb-btn-rec {
  background: rgba(248, 81, 73, 0.1);
  color: #ff6b5b;
  border-color: rgba(248, 81, 73, 0.35);
}
.mcb-btn-rec:hover { background: rgba(248, 81, 73, 0.2); }
.mcb-btn-rec.active {
  background: rgba(248, 81, 73, 0.2);
  border-color: #ff6b5b;
  box-shadow: 0 0 12px rgba(248, 81, 73, 0.25);
}

.mcb-btn-vdo {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
  border-color: rgba(168, 85, 247, 0.35);
}
.mcb-btn-vdo:hover { background: rgba(168, 85, 247, 0.2); }
.mcb-btn-vdo.active {
  background: rgba(168, 85, 247, 0.25);
  border-color: #a855f7;
  color: #c084fc;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}

.mcb-btn-remote {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.35);
}
.mcb-btn-remote:hover { background: rgba(245, 158, 11, 0.2); }
.mcb-btn-remote.active {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
  animation: remote-pulse 1.5s ease-in-out infinite;
}
@keyframes remote-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.5); }
}

.mcb-icon { font-size: 12px; }

.mcb-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #484f58;
}

.mcb-mics-label {
  font-size: 11px;
  font-weight: 700;
  color: #8b949e;
  letter-spacing: 1px;
  white-space: nowrap;
}

.mcb-mics-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mcb-mic-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  border: 1px solid;
  white-space: nowrap;
}
.mcb-mic-live {
  background: rgba(63, 185, 80, 0.1);
  color: #3fb950;
  border-color: rgba(63, 185, 80, 0.3);
}
.mcb-mic-live:hover { background: rgba(63, 185, 80, 0.2); }
.mcb-mic-muted {
  background: rgba(248, 81, 73, 0.15);
  color: #ff6b5b;
  border-color: rgba(248, 81, 73, 0.4);
}
.mcb-mic-muted:hover { background: rgba(248, 81, 73, 0.25); }

.mcb-sched-live {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.3);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #3fb950;
  letter-spacing: 1px;
  white-space: nowrap;
}

.mcb-sched-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3fb950;
  animation: rec-blink-anim 1.2s ease-in-out infinite;
  flex-shrink: 0;
}

.mcb-sched-name {
  font-weight: 400;
  font-size: 11px;
  opacity: 0.8;
}

.mc-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
  align-items: flex-start;
}

.mc-main {
  flex: 1;
  min-width: 0;
}

.mc-sidebar {
  width: 380px;
  flex-shrink: 0;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #30363d transparent;
}

.mc-sidebar::-webkit-scrollbar { width: 6px; }
.mc-sidebar::-webkit-scrollbar-track { background: transparent; }
.mc-sidebar::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }

/* --- Scene Indicator Bar --- */

.scene-indicator-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 16px;
}

.scene-indicator-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #3fb950;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.scene-indicator-tabs {
  display: flex;
  gap: 4px;
  flex: 1;
}

.scene-tab {
  padding: 6px 16px;
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #0d1117;
  color: #8b949e;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.scene-tab:hover {
  border-color: #484f58;
  color: #c9d1d9;
}

.scene-tab.active {
  background: #1f6feb22;
  border-color: #58a6ff;
  color: #58a6ff;
}

.scene-tab-off {
  opacity: 0.35;
}

.scene-tab.live {
  background: #23863622;
  border-color: #3fb950;
  color: #3fb950;
  box-shadow: 0 0 8px rgba(63, 185, 80, 0.15);
}

.scene-auto-btn {
  padding: 5px 12px;
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #0d1117;
  color: #484f58;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  flex-shrink: 0;
}

.scene-auto-btn.active {
  background: #23863622;
  border-color: #3fb950;
  color: #3fb950;
}

/* --- Live Scene Display (compact) --- */

.mc-live-scene {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 28px 32px;
}

.mc-ls-icon {
  font-size: 48px;
  line-height: 1;
  flex-shrink: 0;
}

.mc-ls-name {
  font-size: 22px;
  font-weight: 700;
  color: #f0f6fc;
  margin-bottom: 4px;
}

.mc-ls-status {
  font-size: 13px;
  color: #3fb950;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* --- Scene Preview Panels (legacy) --- */

.scene-preview {
  display: none;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 10px;
  overflow: hidden;
  min-height: 420px;
  animation: sceneFadeIn 0.4s ease;
}

.scene-preview.active {
  display: block;
}

@keyframes sceneFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Weather Scene Preview --- */

.sp-weather {
  padding: 28px;
}

.sp-wx-top {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.sp-wx-current {
  text-align: center;
  min-width: 200px;
}

.sp-wx-icon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 8px rgba(88, 166, 255, 0.3));
}

.sp-wx-temp {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  color: #f0f6fc;
  background: linear-gradient(180deg, #f0f6fc 40%, #58a6ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sp-wx-desc {
  font-size: 18px;
  font-weight: 500;
  color: #58a6ff;
  margin-top: 6px;
}

.sp-wx-location {
  font-size: 12px;
  font-weight: 600;
  color: #484f58;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 8px;
}

.sp-wx-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
}

.sp-wx-detail {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 12px 16px;
}

.sp-wx-detail-icon {
  font-size: 24px;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}

.sp-wx-detail-label {
  font-size: 11px;
  font-weight: 600;
  color: #484f58;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sp-wx-detail-val {
  font-size: 16px;
  font-weight: 600;
  color: #f0f6fc;
}

/* Forecast Cards */

.sp-wx-forecast {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.sp-wx-fc-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
  transition: border-color 0.2s;
}

.sp-wx-fc-card:hover {
  border-color: #30363d;
}

.sp-wx-fc-label {
  font-size: 11px;
  font-weight: 700;
  color: #58a6ff;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 10px;
}

.sp-wx-fc-icon {
  font-size: 32px;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 4px rgba(88, 166, 255, 0.2));
}

.sp-wx-fc-hi {
  font-size: 28px;
  font-weight: 700;
  color: #f85149;
  line-height: 1.1;
}

.sp-wx-fc-lo {
  font-size: 18px;
  font-weight: 600;
  color: #58a6ff;
  margin-top: 2px;
}

.sp-wx-fc-desc {
  font-size: 12px;
  color: #8b949e;
  margin-top: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sp-wx-fc-precip {
  font-size: 11px;
  font-weight: 600;
  color: #3fb950;
  margin-top: 6px;
}

/* --- News Headlines Preview --- */

.sp-news {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.sp-news-loading, .sp-events-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #484f58;
  font-size: 14px;
}

.sp-news-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.sp-news-card:hover {
  border-color: #58a6ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sp-news-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: #0d1117;
}

.sp-news-img-placeholder {
  width: 100%;
  height: 120px;
  background: linear-gradient(135deg, #161b22, #21262d);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #30363d;
  font-size: 28px;
}

.sp-news-body {
  padding: 12px;
}

.sp-news-cat {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 7px;
  border-radius: 3px;
  background: #1f6feb22;
  color: #58a6ff;
  margin-bottom: 6px;
}

.sp-news-cat.sports { background: #23863622; color: #3fb950; }
.sp-news-cat.swap { background: #f8514922; color: #f85149; }
.sp-news-cat.digital { background: #d2992222; color: #d29922; }

.sp-news-title {
  font-size: 13px;
  font-weight: 600;
  color: #e1e4e8;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.sp-news-meta {
  font-size: 11px;
  color: #484f58;
  display: flex;
  justify-content: space-between;
}

/* --- Events Preview --- */

.sp-events {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sp-event-item {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid #21262d;
  align-items: flex-start;
}

.sp-event-item:last-child {
  border-bottom: none;
}

.sp-event-date-badge {
  width: 64px;
  background: #1f6feb18;
  border: 1px solid #1f6feb44;
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
  flex-shrink: 0;
}

.sp-event-date-month {
  font-size: 10px;
  font-weight: 700;
  color: #58a6ff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sp-event-date-day {
  font-size: 26px;
  font-weight: 800;
  color: #f0f6fc;
  line-height: 1.1;
}

.sp-event-content {
  flex: 1;
  min-width: 0;
}

.sp-event-title {
  font-size: 16px;
  font-weight: 600;
  color: #f0f6fc;
  line-height: 1.3;
  margin-bottom: 4px;
}

.sp-event-desc {
  font-size: 13px;
  color: #8b949e;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sp-event-empty {
  text-align: center;
  padding: 60px 20px;
  color: #484f58;
  font-size: 14px;
}

/* --- Responsive --- */

@media (max-width: 1100px) {
  .mc-layout {
    flex-direction: column;
  }
  .mc-sidebar {
    width: 100%;
    max-height: none;
  }
  .sp-news {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .mc-layout {
    padding: 12px;
    gap: 12px;
  }
  .sp-wx-top {
    flex-direction: column;
    gap: 20px;
  }
  .sp-wx-forecast {
    grid-template-columns: 1fr;
  }
  .sp-weather { padding: 16px; }
  .sp-news { padding: 12px; gap: 10px; }
  .sp-events { padding: 16px; }
  .scene-indicator-bar { padding: 8px 10px; gap: 8px; flex-wrap: wrap; }
  .scene-indicator-label { font-size: 10px; }
  .scene-tab { padding: 5px 10px; font-size: 11px; }
}

/* ============================================================================
   MODERNIZED MASTER CONTROL — Premium Look
   ============================================================================ */

/* Sidebar cards get subtle gradient borders on hover */
.mc-sidebar .card {
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mc-sidebar .card:hover {
  border-color: #484f58;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* Accent stripe on card titles */
.mc-sidebar .card-title {
  padding-bottom: 8px;
  border-bottom: 1px solid #21262d;
  margin-bottom: 14px;
}

/* Volume slider accent colors */
.mc-sidebar .volume-slider::-webkit-slider-thumb {
  box-shadow: 0 0 6px rgba(88, 166, 255, 0.3);
}

/* Action buttons modernized */
.mc-sidebar .action-grid {
  gap: 8px;
}

.mc-sidebar .btn {
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 6px;
}

/* Now Playing card glow when playing */
.mc-sidebar .np-filename.playing {
  text-shadow: 0 0 8px rgba(88, 166, 255, 0.3);
}

/* Scene rotation compact */
.mc-sidebar .sr-row {
  padding: 6px 0;
}

/* Lower third inputs tighter */
.mc-sidebar .lt-input {
  font-size: 13px;
  padding: 7px 10px;
}

/* Compact mixer for sidebar */
.mc-sidebar .mixer-label {
  min-width: 90px;
  font-size: 12px;
}

.mc-sidebar .mixer-value {
  min-width: 36px;
  font-size: 12px;
}

/* Mobile: full-width header */
@media (max-width: 600px) {
  .header {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 12px 16px;
  }
  .header h1 { font-size: 15px; }
  .tab-bar { padding: 0 12px; }
  .tab { padding: 8px 14px; font-size: 12px; }
  .container { padding: 0 12px; margin: 16px auto; }

  /* Scene preview compact */
  .sp-wx-current { min-width: auto; }
  .sp-wx-temp { font-size: 48px; }
  .sp-wx-icon { font-size: 40px; }
  .sp-news-card .sp-news-img,
  .sp-news-card .sp-news-img-placeholder { height: 90px; }
  .sp-news-title { font-size: 12px; }
  .sp-event-title { font-size: 14px; }
}

/* ============================================================================
   SCHEDULER TAB
   ============================================================================ */

.sched-container {
  max-width: 1100px;
}

/* Active block banner */
.sched-active-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.35);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
  animation: activePulse 2s ease-in-out infinite;
}

@keyframes activePulse {
  0%, 100% { border-color: rgba(231, 76, 60, 0.35); }
  50% { border-color: rgba(231, 76, 60, 0.7); }
}

.sched-active-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e74c3c;
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.8);
  flex-shrink: 0;
  animation: activePulse 1.5s ease-in-out infinite;
}

.sched-active-label {
  font-size: 11px;
  font-weight: 800;
  color: #ff6b5b;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.sched-active-name {
  font-size: 16px;
  font-weight: 700;
  color: #f0f6fc;
}

.sched-active-time {
  font-size: 13px;
  color: #8b949e;
  margin-left: auto;
}

/* Video folders grid */
.sched-folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.sched-folder-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 16px;
  transition: border-color 0.2s;
}

.sched-folder-on {
  border-color: #1f6feb;
}

.sfd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sfd-name {
  font-size: 14px;
  font-weight: 700;
  color: #f0f6fc;
}

.sfd-folder-path {
  font-size: 11px;
  color: #484f58;
  margin-bottom: 6px;
  font-family: monospace;
}

.sfd-files {
  font-size: 12px;
  color: #8b949e;
  margin-bottom: 12px;
}

.sfd-interval-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sfd-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #30363d;
  background: #21262d;
  color: #e1e4e8;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.sfd-btn:hover {
  border-color: #58a6ff;
  background: #1f6feb22;
  color: #58a6ff;
}

.sfd-interval-val {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #58a6ff;
  white-space: nowrap;
}

.sfd-mode-row select {
  font-size: 12px;
  padding: 4px 8px;
}

.sfd-next {
  font-size: 11px;
  color: #3fb950;
  margin-top: 8px;
  font-weight: 600;
}

/* Scheduled blocks list */
.sched-block-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

.sched-block-row:hover {
  border-color: #484f58;
}

.sbd-disabled {
  opacity: 0.5;
}

.sbd-type {
  font-size: 24px;
  flex-shrink: 0;
}

.sbd-content {
  flex: 1;
  min-width: 0;
}

.sbd-name {
  font-size: 15px;
  font-weight: 700;
  color: #f0f6fc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.broadcast-btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.broadcast-status-col {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.broadcast-label {
  font-size: 13px;
  font-weight: 600;
  color: #f0f6fc;
  white-space: nowrap;
}

.broadcast-since {
  font-size: 11px;
  color: #484f58;
  margin-top: 2px;
}

.btn-broadcast-stream {
  background: rgba(63, 185, 80, 0.12);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.35);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-broadcast-stream:hover {
  background: rgba(63, 185, 80, 0.22);
  border-color: rgba(63, 185, 80, 0.6);
}

.sbd-tag-live {
  font-size: 10px;
  background: rgba(63, 185, 80, 0.12);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 1px;
}

.sbd-tag-off {
  font-size: 10px;
  background: #484f58;
  color: #8b949e;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 1px;
}

.sbd-tag-rec {
  font-size: 10px;
  background: rgba(248, 81, 73, 0.15);
  color: #ff6b5b;
  border: 1px solid rgba(248, 81, 73, 0.4);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 1px;
}

.sbd-tag-playback {
  font-size: 10px;
  background: rgba(88, 166, 255, 0.12);
  color: #58a6ff;
  border: 1px solid rgba(88, 166, 255, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 1px;
}

.btn-record {
  background: rgba(248, 81, 73, 0.12);
  color: #ff6b5b;
  border: 1px solid rgba(248, 81, 73, 0.35);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.mic-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #21262d;
}
.mic-row:last-child { border-bottom: none; }

.mic-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.mic-name {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: #f0f6fc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mic-mute-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
}

.mic-live {
  background: rgba(63, 185, 80, 0.1);
  color: #3fb950;
  border-color: rgba(63, 185, 80, 0.35);
}
.mic-live:hover {
  background: rgba(63, 185, 80, 0.2);
}

.mic-muted {
  background: rgba(248, 81, 73, 0.15);
  color: #ff6b5b;
  border-color: rgba(248, 81, 73, 0.4);
}
.mic-muted:hover {
  background: rgba(248, 81, 73, 0.25);
}

.btn-record:hover {
  background: rgba(248, 81, 73, 0.22);
  border-color: rgba(248, 81, 73, 0.6);
}

@keyframes rec-blink-anim {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.rec-blink {
  animation: rec-blink-anim 1.2s ease-in-out infinite;
}

.sbd-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.sbd-time {
  font-size: 13px;
  font-weight: 700;
  color: #58a6ff;
}

.sbd-days {
  display: flex;
  gap: 4px;
}

.sbd-day {
  font-size: 11px;
  font-weight: 700;
  color: #8b949e;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 1px 5px;
}

.sbd-desc {
  font-size: 12px;
  color: #484f58;
  font-style: italic;
}

.sbd-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Scheduler form helpers */
.sched-empty {
  color: #484f58;
  font-style: italic;
  font-size: 14px;
  padding: 8px 0;
}

.sched-field {
  margin-bottom: 16px;
}

.sched-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.sched-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.sched-input {
  width: 100%;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 9px 13px;
  color: #e1e4e8;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
}

.sched-input:focus {
  outline: none;
  border-color: #1f6feb;
  background: #1c2128;
}

.sched-input option { background: #161b22; }

/* Day buttons */
.sched-days {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sched-day-btn {
  cursor: pointer;
  user-select: none;
}

.sched-day-btn input {
  display: none;
}

.sched-day-btn span {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid #30363d;
  background: #21262d;
  color: #8b949e;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s;
  cursor: pointer;
}

.sched-day-btn input:checked + span {
  background: #1f6feb;
  border-color: #1f6feb;
  color: #ffffff;
}

.sched-day-btn span:hover {
  border-color: #58a6ff;
  color: #58a6ff;
}

.sched-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

/* Modal overlay */
.sched-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.sched-modal {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 16px;
  width: 560px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.sched-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #30363d;
  font-size: 18px;
  font-weight: 700;
  color: #f0f6fc;
}

.sched-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #21262d;
  color: #8b949e;
  font-size: 20px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.sched-modal-close:hover {
  background: #30363d;
  color: #f0f6fc;
}

.sched-modal-body {
  padding: 20px 24px;
}

.sched-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid #30363d;
}

.sched-modal-error {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.4);
  border-radius: 8px;
  padding: 10px 14px;
  color: #ff6b5b;
  font-size: 13px;
  margin-top: 8px;
}

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE / PHONE LAYER  (added 2026-07-29)
   Makes the control panel, VOD library and recordings pages usable on a
   phone: single-column grids, wrapping toolbars, 16px inputs so iOS doesn't
   zoom on focus, and comfortable tap targets.
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 820px) {
  .container { max-width: 100%; padding: 0 12px; margin: 14px auto; }
  .card { padding: 15px; border-radius: 10px; }

  /* Any 2/3-up grid collapses */
  .stats-bar, .sp-news, .mc-grid { grid-template-columns: 1fr !important; }

  /* Toolbars wrap instead of overflowing */
  .header, .content-head, .search-row, .cal-nav { flex-wrap: wrap; }

  /* Media/file card grids go single-column-ish */
  #rec-grid, .folder-grid, .file-grid, .vod-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 700px) {
  body { -webkit-text-size-adjust: 100%; }

  /* iOS zooms any input under 16px — stop that */
  input, select, textarea, button { font-size: 16px; }

  .header { padding: 11px 14px; gap: 8px; }
  .header h1 { font-size: 15px; }
  .tab-bar { padding: 0 8px; -webkit-overflow-scrolling: touch; }
  .tab { padding: 11px 13px; font-size: 13px; }

  .card-title { font-size: 13px; flex-wrap: wrap; gap: 6px; }

  /* Buttons: full-width-friendly and easy to hit */
  .btn, .btn-primary, .btn-secondary, .refresh-btn, .dl-btn { min-height: 42px; padding: 10px 15px; }

  /* Tables scroll sideways rather than squashing the page */
  table { display: block; overflow-x: auto; white-space: nowrap; }

  /* Long file names / paths shouldn't blow out the layout */
  code, .mono, .fcard-name, .rec-name { word-break: break-word; }

  /* Video players fill the width */
  video, iframe { max-width: 100%; height: auto; }

  /* Modals become sheets */
  .sched-modal, .modal { width: 96vw !important; max-width: 96vw !important; max-height: 92vh; overflow-y: auto; }
}

/* Touch devices: no hover-lift, bigger targets */
@media (hover: none) {
  .card:hover, .rec-card:hover, .tcard:hover, .fcard:hover { transform: none; }
  a, button, .tab, .nav-link { min-height: 40px; }
}
