/* ─── Reset & Tokens ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:      #0B0B0C;
  --bg2:     #0E0E10;
  --bg3:     #141416;
  --bg4:     #18181B;
  --accent:  #E8422B;
  --border:  #232326;
  --border2: #1A1A1D;
  --border3: #2E2E33;
  --text:    #EDEDEA;
  --dim:     #A9A9B0;
  --muted:   #85858C;
  --faint:   #5E5E66;
  --hdr:     54px;
}
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: Archivo, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
input, button, select { font-family: inherit; }
a { color: var(--text); text-decoration: none; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); }

/* ─── Header ─────────────────────────────────────────────────────── */
#app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--hdr);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  flex-shrink: 0;
}
.hdr-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.hdr-logo {
  width: 28px; height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}
.hdr-brand {
  font-family: 'Archivo Narrow', Archivo, sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .14em;
  white-space: nowrap;
  color: var(--text);
}
.hdr-brand span { color: var(--accent); }
.hdr-divider { width: 1px; height: 18px; background: var(--border); flex-shrink: 0; }
.hdr-clock {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--muted);
  white-space: nowrap;
}
.hdr-right { display: flex; align-items: center; gap: 12px; }
.hdr-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .14em;
  cursor: pointer;
  transition: border-color 150ms, color 150ms;
  text-transform: uppercase;
}
.hdr-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── View base ──────────────────────────────────────────────────── */
.view { min-height: calc(100vh - var(--hdr)); }

/* ─── Typography helpers ─────────────────────────────────────────── */
.mono-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.accent-tag { color: var(--accent); }
.muted-tag  { color: var(--muted); }

.display-h1 {
  font-family: 'Archivo Narrow', Archivo, sans-serif;
  font-weight: 700;
  font-size: clamp(38px, 7vw, 72px);
  line-height: .96;
  letter-spacing: -.02em;
  margin: 0 0 18px;
}
.body-muted { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0; }
.narrow-h2 {
  font-family: 'Archivo Narrow', Archivo, sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 2.2vw, 32px);
  line-height: 1.08;
  letter-spacing: -.01em;
}
.narrow-big {
  font-family: 'Archivo Narrow', Archivo, sans-serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
}

/* ─── Inputs ─────────────────────────────────────────────────────── */
input[type="text"],
input[type="password"],
input[type="tel"],
input[type="search"] {
  background: transparent;
  border: 1px solid var(--border3);
  color: var(--text);
  padding: 15px 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  letter-spacing: .1em;
  outline: none;
  transition: border-color 150ms;
}
input:focus { border-color: var(--accent); }
input::placeholder { color: var(--faint); letter-spacing: .1em; }

/* ─── Buttons ────────────────────────────────────────────────────── */
.solid-btn {
  background: var(--text);
  color: var(--bg);
  border: 0;
  padding: 16px 28px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 150ms;
}
.solid-btn:hover { opacity: .88; }
.solid-btn:active { opacity: .72; }
.solid-btn.w100 { width: 100%; margin-top: 6px; display: block; }

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 13px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: .06em;
  cursor: pointer;
  transition: color 150ms;
  width: 100%;
  display: block;
}
.ghost-btn:hover { color: var(--text); }

.field-label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--faint);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.form-error {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: 14px;
}

/* ─── Tabs ───────────────────────────────────────────────────────── */
.tabs { display: flex; border: 1px solid var(--border); margin-bottom: 28px; }
.tab-panel { display: block; }
.tab-panel.hidden { display: none; }

.tab {
  flex: 1;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-right: 1px solid var(--border);
  padding: 11px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.tab:last-child { border-right: 0; }
.tab.active { background: var(--text); color: var(--bg); }
.tab:hover:not(.active) { color: var(--text); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.session-note {
  margin-top: 26px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: .1em;
  color: var(--faint);
}

/* ─── Gate View ──────────────────────────────────────────────────── */
#gate-view {
  display: grid;
  align-content: center;
  padding: clamp(28px, 7vw, 110px);
}
.gate-inner { max-width: 560px; }
.locked-row {
  display: flex;
  border: 1px solid var(--border3);
  max-width: 460px;
}
.locked-row input { flex: 1; min-width: 0; border: 0; margin: 0; width: auto; }
.gate-stats {
  display: flex;
  gap: 34px;
  margin-top: 56px;
  border-top: 1px solid var(--border);
  padding-top: 22px;
  flex-wrap: wrap;
}
.stat-k {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--faint);
  margin-bottom: 6px;
}
.stat-v {
  font-family: 'Archivo Narrow', Archivo, sans-serif;
  font-weight: 700;
  font-size: 26px;
}

/* ─── Login View ─────────────────────────────────────────────────── */
#login-view { display: block; }
.login-cols {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  min-height: calc(100vh - var(--hdr));
}
.login-info {
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  border-right: 1px solid var(--border);
  background: var(--bg2);
}
.login-specs { border-top: 1px solid var(--border); }
.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border2);
  font-size: 13px;
}
.spec-key { color: var(--muted); }
.spec-val { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .1em; }

.login-form-panel { padding: clamp(28px, 5vw, 64px); display: flex; align-items: center; }
.login-form { width: 100%; max-width: 420px; }

.phone-row { display: flex; border: 1px solid var(--border3); margin-bottom: 16px; }
.phone-pfx {
  padding: 15px 14px;
  border-right: 1px solid var(--border3);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}
.phone-row input { border: 0; flex: 1; min-width: 0; margin: 0; width: auto; }

/* ─── Main View ──────────────────────────────────────────────────── */
#main-view {
  display: grid;
  grid-template-columns: 360px minmax(0,1fr);
  height: calc(100vh - var(--hdr));
  overflow: hidden;
}

/* ─── Sidebar ────────────────────────────────────────────────────── */
#guide-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow: hidden;
  min-height: 0;
}

#search-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#search-input {
  flex: 1; min-width: 0;
  border: 0;
  background: transparent;
  padding: 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--text);
  outline: none;
}
#search-input::placeholder { color: var(--faint); }
#voice-search-btn {
  flex-shrink: 0;
  width: 52px;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: color 150ms;
}
#voice-search-btn:hover { color: var(--accent); }
#voice-search-btn.listening { color: var(--accent); animation: pulse-mic 1.1s ease-in-out infinite; }
#voice-search-btn.unsupported { display: none; }
@keyframes pulse-mic { 0%,100%{opacity:1} 50%{opacity:.35} }

.filter-section { padding: 14px 16px 0; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.filter-heading {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: .18em;
  color: var(--faint);
  margin-bottom: 9px;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  transition: color 150ms;
}
.filter-heading:hover { color: var(--dim); }
.filter-arrow { transition: transform 200ms; display: inline-block; }
.filter-heading.open .filter-arrow { transform: rotate(180deg); }
.pill-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pill-filter.collapsed { display: none; margin-bottom: 0; }

.pill {
  flex-shrink: 0;
  background: transparent;
  color: var(--dim);
  border: 1px solid var(--border3);
  padding: 6px 11px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .1em;
  cursor: pointer;
  white-space: nowrap;
  text-transform: uppercase;
  transition: background 150ms, color 150ms, border-color 150ms;
}
.pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill:hover:not(.active) { border-color: var(--accent); color: var(--text); }
.pill:focus-visible { outline: 2px solid var(--accent); }

.count-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.count-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--muted);
  text-transform: uppercase;
}
.fav-pill {
  background: transparent;
  border: 1px solid var(--border3);
  color: var(--muted);
  padding: 6px 11px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .1em;
  cursor: pointer;
  transition: border-color 150ms, color 150ms, background 150ms;
}
.fav-pill:hover { border-color: var(--accent); color: var(--accent); }
.fav-pill.active { background: rgba(232,66,43,.1); border-color: var(--accent); color: var(--accent); }

/* Channel list */
#channel-grid {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.channel-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border2);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background 100ms, border-color 100ms;
  user-select: none;
  background: transparent;
  outline: none;
  width: 100%;
  text-align: left;
}
.channel-card:hover { background: var(--bg3); }
.channel-card:focus { border-left-color: var(--accent); background: var(--bg3); }
.channel-card.active { background: var(--bg4); border-left-color: var(--accent); }

.channel-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--faint);
  width: 26px;
  flex-shrink: 0;
  text-align: right;
}
.channel-card.active .channel-num,
.channel-card:focus .channel-num { color: var(--accent); }
.sd-num { width: 36px; font-size: 10px; letter-spacing: .04em; color: var(--dim); }


.channel-mono {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border: 1px solid var(--border3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Archivo Narrow', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--dim);
  overflow: hidden;
  position: relative;
}
.channel-card.active .channel-mono { border-color: var(--dim); }
.channel-logo-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background: transparent;
}

.channel-text { flex: 1; min-width: 0; }
.channel-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -.005em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.channel-live-tag {
  flex-shrink: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  letter-spacing: .16em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 2px 5px;
}
.channel-card.active .channel-live-tag { background: var(--accent); color: #fff; }
.channel-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-fav-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--faint);
  font-size: 13px;
  cursor: pointer;
  padding: 6px;
  opacity: 0;
  transition: opacity 150ms, color 150ms;
}
.channel-card:hover .channel-fav-btn,
.channel-card:focus .channel-fav-btn { opacity: 1; }
/* Favourited heart: always visible in accent red */
.channel-card.favorited .channel-fav-btn { opacity: 1; color: var(--accent); }
.channel-fav-btn:hover { color: var(--accent) !important; opacity: 1 !important; }

/* States */
.loading-state, .empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .1em;
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--faint);
  flex-shrink: 0;
}

/* ─── Guide Main (right side) ────────────────────────────────────── */
#guide-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

/* ─── Player Panel ───────────────────────────────────────────────── */
#player-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #000;
  border-bottom: 1px solid var(--border);
}

#player-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: repeating-linear-gradient(135deg,#141417 0 7px,#101013 7px 14px);
  overflow: hidden;
}

#video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}

#player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px;
  background: linear-gradient(to bottom,rgba(0,0,0,.78) 0%,transparent 40%);
  pointer-events: none;
  z-index: 1;
  opacity: 1;
  transition: opacity 300ms;
}
#player-overlay button { pointer-events: auto; }
#player-panel:not(.has-stream) #player-overlay { display: none; }

#now-playing-info { display: flex; align-items: center; gap: 10px; }
.live-badge {
  display: flex; align-items: center; gap: 5px;
  background: var(--accent);
  padding: 5px 9px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; font-weight: 500;
  letter-spacing: .18em;
  color: #fff;
  flex-shrink: 0;
}
.live-dot { width: 6px; height: 6px; background: #fff; flex-shrink: 0; }

#now-playing-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: rgba(255,255,255,.7);
}
#now-playing-num:empty { display: none; }
#now-playing-name { font-size: 15px; font-weight: 700; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.8); letter-spacing: -.01em; }
#now-playing-show { font-size: 12px; color: rgba(255,255,255,.65); margin-top: 2px; }

.fs-icon-btn {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,.85);
  cursor: pointer;
  padding: 6px;
  line-height: 0;
  align-items: center;
  justify-content: center;
}
#player-panel:fullscreen .fs-icon-btn,
#player-panel.is-fullscreen .fs-icon-btn { display: flex; }
.fs-icon-btn:hover { color: #fff; }

#player-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.ph-mark { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .2em; color: var(--faint); }
.ph-sub  { font-family: 'IBM Plex Mono', monospace; font-size: 9px;  letter-spacing: .14em; color: var(--faint); }

/* Control bar */
#fs-controlbar {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}
#player-panel:not(.has-stream) #fs-controlbar { opacity: .35; pointer-events: none; }

.ctrl-btn {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border);
  color: var(--dim);
  padding: 13px 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .14em;
  cursor: pointer;
  white-space: nowrap;
  transition: color 150ms, background 150ms;
}
.ctrl-btn:hover { color: var(--text); background: var(--bg3); }
.ctrl-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ctrl-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.ctrl-primary:hover { opacity: .88; background: var(--accent); color: #fff; }

#fs-now-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 0 18px; }
#fs-now-num { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--muted); flex-shrink: 0; }
#fs-now-num:empty { display: none; }
#fs-now-text { min-width: 0; }
#fs-now-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#fs-now-show { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctrl-spacer { flex: 1; }

/* Fullscreen */
#player-panel:fullscreen,
#player-panel.is-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw; height: 100vh;
  display: flex; flex-direction: column;
  background: #000;
  z-index: 9999;
}
#player-panel:fullscreen #player-wrap,
#player-panel.is-fullscreen #player-wrap {
  flex: 1; min-height: 0; width: 100%;
}
#player-panel:fullscreen #fs-controlbar,
#player-panel.is-fullscreen #fs-controlbar { display: none; }

#player-panel.is-fullscreen.overlay-idle #player-overlay { opacity: 0; pointer-events: none; }

/* ─── Now Airing ─────────────────────────────────────────────────── */
#now-airing {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-shrink: 0;
  background: var(--bg);
  min-height: 0;
}
#now-airing-left { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
#now-airing-right { text-align: right; flex-shrink: 0; }

#now-airing-label { margin-bottom: 0; font-size: 9px; }
#now-airing-title {
  font-family: 'Archivo Narrow', Archivo, sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.0;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#now-airing-meta { display: none; }

#now-airing-bar-wrap {
  height: 2px;
  background: var(--border);
  flex-shrink: 0;
}
#now-airing-bar { height: 100%; background: var(--accent); transition: width 500ms; }

/* ─── EPG Strip ──────────────────────────────────────────────────── */
#epg-strip { padding: 12px 24px 14px; flex-shrink: 0; background: var(--bg); }

#epg-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.epg-nav-group { display: flex; gap: 6px; }
.epg-nav {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 28px; height: 28px;
  cursor: pointer;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.epg-nav:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.epg-nav:focus-visible { outline: 2px solid var(--accent); }

#epg-list {
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  scrollbar-width: none;
  scroll-behavior: smooth;
}
#epg-list::-webkit-scrollbar { display: none; }

.epg-item {
  flex-shrink: 0;
  width: 160px;
  height: 100px;
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  border-top: 2px solid transparent;
  opacity: .45;
  transition: background 150ms;
  overflow: hidden;
}
.epg-item.now { background: var(--bg3); border-top-color: var(--accent); opacity: 1; }

.epg-time { font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: .12em; color: var(--muted); margin-bottom: 6px; }

.epg-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  letter-spacing: .16em;
  color: var(--accent);
  margin-bottom: 3px;
  text-transform: uppercase;
}

.epg-show {
  font-family: 'Archivo Narrow', Archivo, sans-serif;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.18;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.epg-progress { margin-top: auto; height: 2px; background: var(--border); }
.epg-progress-fill { height: 100%; background: var(--accent); }


/* ─── Toast ──────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 22px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .1em;
  z-index: 9999;
  animation: fadeUp 200ms ease;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  white-space: nowrap;
}
.toast.error { border-color: var(--accent); color: var(--accent); }
@keyframes fadeUp { from { opacity:0; transform: translateX(-50%) translateY(8px); } }

/* ─── Volume overlay ─────────────────────────────────────────────── */
#volume-overlay {
  position: fixed;
  right: 24px; top: 50%;
  transform: translateY(-50%);
  background: rgba(11,11,12,.94);
  border: 1px solid var(--border);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 8000;
  min-width: 44px;
}
#volume-bar-track { width: 4px; height: 72px; background: var(--border); display: flex; align-items: flex-end; }
#volume-bar-fill { width: 100%; background: var(--accent); transition: height 80ms; }
#volume-label { font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: .1em; color: var(--muted); }

/* ─── Channel number overlay ─────────────────────────────────────── */
#channel-num-overlay {
  position: absolute;
  left: 24px; bottom: 24px;
  z-index: 5;
  min-width: 120px;
  padding: 18px 26px;
  background: var(--bg);
  border: 1px solid var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 38px;
  letter-spacing: .18em;
  color: var(--text);
  opacity: 0;
  transform: scale(.9);
  pointer-events: none;
  transition: opacity 150ms, transform 150ms;
  text-align: center;
}
#channel-num-overlay.visible { opacity: 1; transform: scale(1); }

/* ─── Mobile nav ─────────────────────────────────────────────────── */
#mobile-nav { display: none; }
.mob-tab {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none;
  border-top: 2px solid transparent;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 10px 0;
  min-height: 56px;
  transition: color 150ms;
}
.mob-tab.active { color: var(--accent); border-top-color: var(--accent); }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    z-index: 1000;
  }
  #main-view {
    grid-template-columns: 1fr;
    height: calc(100vh - var(--hdr) - 60px);
  }
  #guide-sidebar { height: calc(100vh - var(--hdr) - 60px); }
  #guide-main { display: none; height: calc(100vh - var(--hdr) - 60px); }
  #main-view.show-player #guide-sidebar { display: none; }
  #main-view.show-player #guide-main   { display: flex; }
  .login-cols { grid-template-columns: 1fr; }
  .login-info { display: none; }
  .toast { bottom: 76px; }
  #now-airing { padding: 10px 14px; }
  #epg-strip  { padding: 10px 14px 12px; }
  .epg-item   { width: 140px; height: 90px; }
  /* Control bar: channel info on its own row, icon-only buttons below */
  #fs-controlbar { flex-wrap: wrap; }
  #fs-now-info {
    order: -1;
    width: 100%;
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
  }
  #fs-prev-btn { flex: 1; justify-content: center; }
  #fs-next-btn { flex: 1; justify-content: center; }
  .ctrl-spacer { display: none; }
  .ctrl-label { display: none; }
  #fs-controlbar .ctrl-btn { padding: 14px 16px; font-size: 16px; }
}

@media (min-width: 769px) and (max-width: 1100px) {
  #main-view { grid-template-columns: 300px minmax(0,1fr); }
}

@media (min-width: 1400px) {
  #main-view { grid-template-columns: 420px minmax(0,1fr); }
  .epg-item   { width: 200px; height: 110px; }
}
