/* XC Live TV — design system. Dark theme is the default: deep blacks,
   neon tech green primary, electric blue accents. Light theme via
   [data-theme="light"]. Branding colors are injected as CSS variables. */

:root {
  --primary: #22ff88;
  --secondary: #2196f3;
  --bg: #05070a;
  --bg2: #090d12;
  --panel: #0d1219;
  --panel2: #121a24;
  --line: #1d2836;
  --text: #e9f2ec;
  --muted: #8fa3a0;
  --danger: #ff5468;
  --warn: #ffb020;
  --radius: 14px;
  --ch-col: 190px;
  --row-h: 68px;
  --px-per-min: 4.4;
  --shadow: 0 10px 32px rgba(0, 0, 0, .55);
}
[data-theme="light"] {
  --bg: #eef1f4;
  --bg2: #e4e9ee;
  --panel: #ffffff;
  --panel2: #f2f5f8;
  --line: #d4dce4;
  --text: #12202a;
  --muted: #5c6f78;
  --shadow: 0 10px 28px rgba(20, 40, 60, .16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
.error { color: var(--danger); font-size: .9rem; }
.link { color: var(--secondary); }
h2 { margin: 18px 0 10px; }
h3 { margin: 6px 0 10px; }

.btn {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: .92rem;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .05s;
}
.btn:hover { border-color: var(--secondary); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #03130a; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger.ghost { border-color: var(--line); }
.btn.small { padding: 6px 10px; font-size: .84rem; }
.btn.big { width: 100%; padding: 13px; font-size: 1rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.field { display: block; margin: 0 0 14px; font-size: .88rem; color: var(--muted); }
.field input, .field select, .field textarea {
  display: block; width: 100%; margin-top: 5px;
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; font-size: 1rem;
}
.field input:focus, .field select:focus { outline: 2px solid var(--secondary); border-color: transparent; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(900px 480px at 50% -10%, rgba(34, 255, 136, .10), transparent 60%),
              radial-gradient(700px 420px at 85% 110%, rgba(33, 150, 243, .12), transparent 60%), var(--bg);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 20px; padding: 30px 28px;
  box-shadow: var(--shadow); text-align: center;
}
.login-card h1 { margin: 10px 0 2px; font-size: 1.7rem; letter-spacing: .4px; }
.login-card form { text-align: left; margin-top: 18px; }
.login-logo { max-width: 210px; max-height: 74px; object-fit: contain; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #03130a; font-weight: 900; font-size: 1.25rem; letter-spacing: .5px;
}
.logo-mark.sm { width: 34px; height: 34px; border-radius: 9px; font-size: .8rem; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg2) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { max-height: 36px; max-width: 150px; object-fit: contain; }
.brand-title { font-weight: 800; font-size: 1.12rem; white-space: nowrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 8px 13px; border-radius: 999px; font-size: .95rem; cursor: pointer;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: #03130a; background: var(--primary); font-weight: 700; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  width: 38px; height: 38px; border-radius: 10px; font-size: 1.05rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--secondary); }
.icon-btn.on { color: var(--primary); border-color: var(--primary); }
.search-box { position: relative; }
.search-box input {
  width: min(320px, 52vw); background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px; font-size: .93rem;
}
.search-box input:focus { outline: 2px solid var(--secondary); }
.search-results {
  position: absolute; right: 0; top: calc(100% + 6px); width: min(430px, 92vw);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); max-height: 60vh; overflow: auto; z-index: 80; padding: 6px;
}
.search-results .sr-group { padding: 7px 10px 3px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.search-results .sr-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.search-results .sr-item:hover { background: var(--panel2); }
.search-results .sr-item img { width: 34px; height: 24px; object-fit: contain; }
.search-results .sr-item .t { font-size: .9rem; }
.search-results .sr-item .s { font-size: .76rem; color: var(--muted); }
.account-wrap { position: relative; }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 250px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 14px; z-index: 80;
}
.account-info { font-size: .87rem; margin-bottom: 10px; line-height: 1.5; }

main { max-width: 1560px; margin: 0 auto; padding: 14px 16px 40px; }

/* ---------- player ---------- */
.player-zone { margin-bottom: 14px; }
.player-shell {
  position: relative; background: #000; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line);
  aspect-ratio: 16 / 9; max-height: 62vh; width: 100%;
}
.player-shell video { width: 100%; height: 100%; display: block; background: #000; }
.player-controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .82));
  opacity: 0; transition: opacity .2s;
}
.player-shell:hover .player-controls, .player-shell.touch .player-controls { opacity: 1; }
.pc-btn {
  background: rgba(255, 255, 255, .10); color: #fff; border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 9px; min-width: 38px; height: 38px; padding: 0 9px; cursor: pointer; font-size: .95rem;
}
.pc-btn:hover { background: rgba(255, 255, 255, .22); }
.live-badge { color: #ff5b6a; font-weight: 800; font-size: .8rem; letter-spacing: .04em; }
.live-badge.behind { color: var(--warn); }
#seekBar { flex: 1; accent-color: var(--primary); min-width: 60px; }
#volumeBar { width: 84px; accent-color: var(--secondary); }
.time-label { color: #dfe9e4; font-size: .78rem; min-width: 86px; text-align: center; }
.pc-menu-wrap { position: relative; }
.pc-menu {
  position: absolute; bottom: calc(100% + 8px); right: 0; min-width: 170px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; z-index: 40;
}
.pc-menu button {
  display: block; width: 100%; text-align: left; background: transparent; border: 0;
  color: var(--text); padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: .9rem;
}
.pc-menu button:hover { background: var(--panel2); }
.pc-menu button.sel { color: var(--primary); font-weight: 700; }
.pc-menu button:disabled { opacity: .45; cursor: not-allowed; }
.pc-menu button:disabled:hover { background: transparent; }
.pc-menu .plan-note {
  padding: 6px 10px 8px; font-size: .78rem; color: var(--muted);
  border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.pc-menu button .menu-note { display: block; font-size: .72rem; color: var(--warn); margin-top: 2px; }
.osd {
  position: absolute; left: 16px; bottom: 76px; z-index: 20;
  background: rgba(3, 10, 8, .82); border: 1px solid var(--primary);
  color: #eafff3; border-radius: 12px; padding: 10px 16px; font-size: 1.15rem; font-weight: 700;
  pointer-events: none;
}
.player-msg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 12px;
  color: #ffd7dc; background: rgba(0, 0, 0, .55); font-size: 1rem; padding: 20px; text-align: center; z-index: 15;
}
.player-tap {
  position: absolute; inset: 0; z-index: 16; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .45); cursor: pointer;
}
.player-tap.sound-chip {
  inset: auto 12px 52px auto; background: none; display: block;
}
.player-tap.sound-chip .btn {
  font-size: .85rem; padding: 8px 14px; border-radius: 99px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .5);
}
#singlePlayer:fullscreen { background: #000; }
#singlePlayer:fullscreen video { width: 100%; height: 100%; }
.catchup-badge {
  position: absolute; top: 12px; left: 12px; z-index: 20;
  background: rgba(3, 10, 8, .85); border: 1px solid var(--warn); color: var(--warn);
  padding: 6px 11px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  display: flex; gap: 8px; align-items: center;
}
.catchup-badge button { background: var(--warn); border: 0; border-radius: 999px; padding: 3px 10px; font-weight: 700; cursor: pointer; }

.now-bar {
  display: flex; gap: 14px; align-items: center; margin-top: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px;
}
.now-logo { width: 74px; height: 46px; object-fit: contain; }
.now-text { flex: 1; min-width: 0; }
.now-channel { font-weight: 800; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-prog { color: var(--text); opacity: .92; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-prog { color: var(--muted); font-size: .82rem; }
.progress { height: 5px; background: var(--line); border-radius: 99px; margin: 5px 0 3px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); width: 0%; }
.now-actions { display: flex; gap: 8px; }

/* multi-screen */
.multi-grid { display: grid; gap: 10px; }
.multi-grid.n2 { grid-template-columns: 1fr 1fr; }
.multi-grid.n3 { grid-template-columns: 1fr 1fr 1fr; }
.multi-grid.n4 { grid-template-columns: 1fr 1fr; }
.multi-cell { position: relative; background: #000; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.multi-cell.focused { border-color: var(--primary); }
.mc-tap {
  position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 16 / 9; z-index: 5;
  display: flex; align-items: center; justify-content: center; padding: 12px; text-align: center;
  background: rgba(0, 0, 0, .55); color: #fff; font-weight: 700; font-size: .9rem; cursor: pointer;
}
.multi-cell video { width: 100%; aspect-ratio: 16 / 9; display: block; background: #000; }
.multi-cell .mc-bar { display: flex; gap: 6px; padding: 7px; background: var(--panel); align-items: center; }
.multi-cell select { flex: 1; min-width: 0; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px; }
.multi-cell .mc-bar button { background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; }
.multi-cell .mc-msg { padding: 14px; color: var(--warn); font-size: .88rem; }

/* ---------- guide ---------- */
.guide-zone { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.guide-layout { display: flex; gap: 12px; align-items: flex-start; }
.guide-content { flex: 1; min-width: 0; }
/* category sidebar (wide screens) */
.guide-nav {
  display: flex; flex-direction: column; gap: 6px;
  width: 196px; flex: 0 0 196px; position: sticky; top: 12px;
  max-height: 66vh; overflow-y: auto; scrollbar-width: thin; padding-right: 2px;
}
.guide-nav button {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--panel2); color: var(--text); text-align: left;
  border: 1px solid var(--line); padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: .9rem;
}
.guide-nav button:hover { border-color: var(--secondary); }
.guide-nav button.active { background: var(--secondary); border-color: var(--secondary); color: #fff; font-weight: 700; }
.guide-nav button .n { opacity: .65; font-size: .78rem; }
/* category chips: narrow screens only (the sidebar takes over on wide ones) */
.cat-bar { display: none; gap: 7px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; }
.cat-bar button {
  white-space: nowrap; background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: .9rem;
}
.cat-bar button:hover { border-color: var(--secondary); }
.cat-bar button.active { background: var(--secondary); border-color: var(--secondary); color: #fff; font-weight: 700; }
.cat-bar button .n { opacity: .65; font-size: .78rem; margin-left: 5px; }
.guide-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 2px 0 10px; }
.guide-tools #epgStatus { margin-left: auto; }
.epg-win { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.epg-win select {
  background: var(--bg2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 7px; font-size: .84rem; cursor: pointer;
}
.guide-scroll { overflow: auto; max-height: 66vh; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); position: relative; }
.guide-inner { position: relative; }
.guide-head {
  position: sticky; top: 0; z-index: 12; display: flex; height: 34px;
  background: var(--panel2); border-bottom: 1px solid var(--line);
}
.guide-head .gh-ch { position: sticky; left: 0; z-index: 13; flex: 0 0 var(--ch-col); width: var(--ch-col); background: var(--panel2); border-right: 1px solid var(--line); }
.guide-head .gh-tick { position: absolute; top: 0; height: 100%; border-left: 1px solid var(--line); padding: 8px 0 0 7px; font-size: .74rem; color: var(--muted); white-space: nowrap; }
.guide-row { display: flex; height: var(--row-h); border-bottom: 1px solid var(--line); position: relative; content-visibility: auto; contain-intrinsic-size: auto var(--row-h); }
.guide-row.playing { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.g-ch {
  position: sticky; left: 0; z-index: 6; flex: 0 0 var(--ch-col); width: var(--ch-col);
  display: flex; align-items: center; gap: 9px; padding: 6px 10px;
  background: var(--panel); border-right: 1px solid var(--line); cursor: pointer; overflow: hidden;
}
.g-ch img { width: 44px; height: 30px; object-fit: contain; flex: 0 0 auto; }
.g-ch .g-name { font-size: .88rem; font-weight: 600; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.g-ch .g-star { color: var(--warn); font-size: .8rem; }
.g-ch .g-dot { width: 9px; height: 9px; border-radius: 99px; flex: 0 0 auto; }
.g-track { position: relative; flex: 1; }
.g-prog {
  position: absolute; top: 5px; bottom: 5px; overflow: hidden;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 9px;
  padding: 5px 8px; cursor: pointer; font-size: .8rem; line-height: 1.25;
}
.g-prog:hover { border-color: var(--secondary); }
.g-prog.compact { padding: 5px 6px; }
.g-prog.mini { padding: 4px 5px; }
.g-prog.mini .p-time { display: none; }
.g-prog.mini .p-t { font-size: .74rem; }
.g-prog.live { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--panel2)); }
.g-prog.past { opacity: .55; }
.g-prog .p-t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-prog .p-time { color: var(--muted); font-size: .72rem; }
.g-prog .p-fill {
  position: absolute; left: 0; bottom: 0; height: 3px; pointer-events: none;
  background: var(--primary); opacity: .75; border-radius: 0 0 9px 9px;
}
.g-prog .p-rec { color: var(--danger); font-size: .72rem; font-weight: 700; }
.now-line { position: absolute; top: 34px; bottom: 0; width: 2px; background: var(--danger); z-index: 8; pointer-events: none; }
.now-line::before { content: ""; position: absolute; top: -1px; left: -4px; width: 10px; height: 10px; border-radius: 99px; background: var(--danger); }
.guide-hint { margin: 9px 2px 0; }

/* ---------- cards / lists ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px;
}
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 22px; font-size: .93rem; }
.kv b { color: var(--muted); font-weight: 600; display: block; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 13px; }
.fav-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: border-color .15s, transform .1s;
}
.fav-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.fav-card img { height: 44px; max-width: 110px; object-fit: contain; display: block; margin-bottom: 9px; }
.fav-card .fc-name { font-weight: 700; }
.fav-card .fc-now { color: var(--muted); font-size: .83rem; margin-top: 4px; }

.rec-list { display: flex; flex-direction: column; gap: 10px; }
.rec-item {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 16px;
}
.rec-item .r-main { flex: 1; min-width: 200px; }
.rec-item .r-title { font-weight: 700; }
.rec-item .r-sub { color: var(--muted); font-size: .84rem; }
.chip { font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; letter-spacing: .03em; }
.chip.scheduled { background: rgba(33, 150, 243, .18); color: var(--secondary); }
.chip.recording { background: rgba(255, 84, 104, .16); color: var(--danger); }
.chip.done { background: rgba(34, 255, 136, .14); color: var(--primary); }
.chip.error, .chip.cancelled { background: rgba(255, 176, 32, .15); color: var(--warn); }

.cloud-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 11px 0; border-bottom: 1px solid var(--line); }
.cloud-row:last-child { border-bottom: 0; }
.cloud-row .c-name { font-weight: 700; min-width: 120px; }
.cloud-row .c-state { color: var(--muted); font-size: .88rem; flex: 1; }

.channel-mgr { display: flex; flex-direction: column; }
.mgr-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mgr-row img { width: 40px; height: 26px; object-fit: contain; }
.mgr-row input[type="text"] { flex: 1; min-width: 150px; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.mgr-row input[type="color"] { width: 42px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: transparent; padding: 2px; cursor: pointer; }

.lock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 18px; max-height: 260px; overflow: auto; padding: 6px 0; }
.lock-grid label { display: flex; gap: 8px; align-items: center; font-size: .9rem; padding: 4px 0; cursor: pointer; }
.pin-row { display: flex; gap: 9px; align-items: end; flex-wrap: wrap; }
.pin-row .field { margin: 0; }
.pin-row input { width: 130px; letter-spacing: .35em; text-align: center; }

/* ---------- menus / modal / toast ---------- */
.ctx-menu {
  position: fixed; z-index: 200; min-width: 210px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px;
}
.ctx-menu button { display: flex; width: 100%; gap: 9px; align-items: center; background: transparent; border: 0; color: var(--text); padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: .92rem; text-align: left; }
.ctx-menu button:hover { background: var(--panel2); }
.ctx-menu .ctx-head { padding: 7px 10px; font-weight: 700; font-size: .86rem; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.ctx-menu input[type="color"] { margin-left: auto; width: 34px; height: 26px; border: 0; background: transparent; cursor: pointer; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, .62);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; width: 100%; max-width: 430px; box-shadow: var(--shadow); max-height: 88vh; overflow: auto; }
.modal h3 { margin-top: 0; }
.modal .btn-row { justify-content: flex-end; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 400;
  background: var(--panel2); color: var(--text); border: 1px solid var(--primary);
  padding: 11px 18px; border-radius: 999px; box-shadow: var(--shadow); font-size: .92rem;
  max-width: 92vw; text-align: center;
}
.toast.err { border-color: var(--danger); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  :root { --ch-col: 128px; --row-h: 62px; --px-per-min: 3.6; }
  .topbar { gap: 9px; padding: 9px 10px; }
  .brand-title { display: none; }
  main { padding: 10px 10px 34px; }
  .player-shell { max-height: none; }
  #volumeBar { display: none; }
  .time-label { display: none; }
  .guide-scroll { max-height: 58vh; }
  .now-logo { width: 54px; }
  .search-box input { width: 42vw; }
  /* sidebar collapses to the horizontal chip bar above the grid */
  .guide-nav { display: none; }
  .cat-bar { display: flex; }
  .guide-tools #epgStatus { margin-left: 0; }
}
@media (max-width: 560px) {
  .tabs button { padding: 7px 9px; font-size: .86rem; }
  .multi-grid.n3, .multi-grid.n2, .multi-grid.n4 { grid-template-columns: 1fr; }
  .now-bar { padding: 10px 12px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .player-shell { max-height: 88vh; }
}

/* ---------- footer / admin link ---------- */
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 1400px; margin: 0 auto; padding: 20px 16px 28px; }
.admin-link { color: inherit; opacity: .45; font-size: .8rem; text-decoration: none; }
.admin-link:hover { opacity: 1; text-decoration: underline; }

/* ---------- generated channel badge (channels with no logo) ---------- */
.chan-badge { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 30px; border-radius: 8px; background: hsl(var(--badge-hue, 210) 55% 38%); color: #fff; font-weight: 800; font-size: .78rem; letter-spacing: .03em; flex: 0 0 auto; user-select: none; }
.search-results .sr-item .chan-badge { width: 34px; height: 24px; font-size: .62rem; border-radius: 6px; }
.fav-card .chan-badge { width: 64px; height: 44px; font-size: 1.05rem; margin-bottom: 9px; display: flex; }
.mgr-row .chan-badge { width: 40px; height: 26px; font-size: .66rem; }
.chan-badge.now-badge { width: 74px; height: 46px; font-size: 1.15rem; border-radius: 10px; }
@media (max-width: 760px) {
  .chan-badge.now-badge { width: 54px; height: 36px; font-size: .95rem; }
}
