:root {
  color-scheme: dark;
  --bg: #101522;
  --panel: #171e2d;
  --panel-2: #1d2637;
  --line: rgba(185, 199, 222, .11);
  --muted: #8d9ab0;
  --text: #f2f5fb;
  --accent: #ff754a;
  --accent-2: #ff9b67;
  font-family: "DM Sans", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  background: radial-gradient(ellipse at 78% -12%, rgba(64, 87, 133, .25), transparent 42%), var(--bg);
}
button, input { font: inherit; }
.topbar {
  height: 72px; padding: 0 max(5vw, 24px); display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--line);
  background: rgba(16, 21, 34, .78); backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font: 700 22px "Space Grotesk", sans-serif; letter-spacing: -1px; }
.brand-accent { color: var(--accent); }
.brand-mark { display: flex; align-items: end; gap: 3px; height: 22px; }
.brand-mark span { width: 5px; border-radius: 5px; background: var(--accent); }
.brand-mark span:nth-child(1) { height: 12px; opacity: .7; }
.brand-mark span:nth-child(2) { height: 21px; }
.brand-mark span:nth-child(3) { height: 16px; opacity: .85; }
.topbar-right { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.live-dot { width: 7px; height: 7px; background: #53d69a; border-radius: 50%; box-shadow: 0 0 12px #53d69a88; }
.live-label { font-weight: 700; letter-spacing: 1.2px; color: #dbe4f4; }
.top-date { border-left: 1px solid var(--line); padding-left: 14px; margin-left: 5px; }
.page { width: min(1380px, 90%); margin: 0 auto; }
.hero { display: flex; justify-content: space-between; align-items: end; padding: 64px 0 48px; gap: 24px; }
.eyebrow, .date-kicker { margin: 0 0 12px; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 2px; }
h1 { margin: 0; font: 700 clamp(42px, 6vw, 66px)/1.05 "Space Grotesk", sans-serif; letter-spacing: -3px; }
h1 span { color: var(--accent); }
.hero-subtitle { color: var(--muted); margin: 13px 0 0; font-size: 15px; }
.hero-date { text-align: right; padding: 0 0 4px; }
.date-kicker { display: block; color: var(--muted); font-size: 9px; margin-bottom: 8px; }
.hero-date strong { display: block; font: 600 19px "Space Grotesk", sans-serif; text-transform: capitalize; }
.hero-date > span:last-child { display: block; color: var(--muted); font-size: 11px; margin-top: 6px; }
.toolbar { display: flex; align-items: center; gap: 14px; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toolbar-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.toolbar-icon { color: var(--accent); font-size: 18px; }
.channel-total { color: var(--muted); background: var(--panel-2); padding: 3px 7px; border-radius: 6px; font-size: 10px; }
.search-wrap { margin-left: auto; display: flex; align-items: center; gap: 9px; width: min(280px, 40vw); padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.025); }
.search-wrap input { min-width: 0; width: 100%; outline: none; border: 0; background: transparent; color: var(--text); font-size: 12px; }
.search-wrap input::placeholder { color: #77849a; }
.refresh-button { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); color: #dce4f2; background: var(--panel); padding: 9px 13px; border-radius: 9px; cursor: pointer; font-size: 12px; }
.refresh-button:hover { border-color: #53627a; background: var(--panel-2); }
.refresh-button span:first-child { color: var(--accent); font-size: 17px; line-height: 12px; }
.guide { padding: 12px 0 30px; }
.channel-row { display: grid; grid-template-columns: 164px minmax(0, 1fr); gap: 18px; padding: 17px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.channel-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.channel-logo { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 12px; object-fit: contain; padding: 5px; background: #f7f8fb; }
.channel-fallback { display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #3a4862, #202b40); font: 700 14px "Space Grotesk", sans-serif; }
.channel-number { display: block; color: var(--accent); font-size: 10px; font-weight: 700; margin-bottom: 3px; }
.channel-name { display: block; font-weight: 700; font-size: 13px; overflow-wrap: anywhere; }
.programme-list { display: flex; gap: 10px; min-width: 0; overflow-x: auto; padding: 1px 2px 9px; scrollbar-width: thin; scrollbar-color: #39465c transparent; }
.programme-card { position: relative; flex: 0 0 205px; min-height: 106px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-align: left; color: var(--text); cursor: pointer; overflow: hidden; transition: border-color .15s, transform .15s, background .15s; }
.programme-card:hover { border-color: #58677f; background: var(--panel-2); transform: translateY(-2px); }
.programme-card.current { border-color: rgba(255,117,74,.65); background: linear-gradient(145deg, rgba(255,117,74,.13), var(--panel) 72%); }
.programme-card.current::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.programme-time { display: flex; align-items: center; gap: 7px; color: var(--accent-2); font-size: 10px; font-weight: 700; letter-spacing: .2px; }
.now-tag { color: #55d99d; font-size: 9px; letter-spacing: .8px; }
.programme-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 9px; padding-right: 2px; font-size: 12px; font-weight: 700; line-height: 1.35; }
.programme-subtitle { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-top: 5px; color: var(--muted); font-size: 10px; }
.programme-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; color: #8390a5; font-size: 9px; line-height: 1.4; }
.programme-thumb { float: right; width: 36px; height: 36px; object-fit: contain; margin: 7px 0 4px 8px; border-radius: 5px; }
.progress-track { height: 2px; position: absolute; left: 13px; right: 13px; bottom: 0; background: rgba(255,255,255,.09); }
.progress-fill { height: 100%; background: var(--accent); }
.no-programmes { display: flex; align-items: center; color: var(--muted); font-size: 12px; padding: 20px; background: rgba(255,255,255,.02); border-radius: 9px; }
.loading-state, .error-state, .empty-state { min-height: 240px; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; gap: 12px; font-size: 13px; }
.spinner { width: 26px; height: 26px; border: 2px solid #344158; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state button { padding: 9px 14px; border: 0; border-radius: 8px; background: var(--accent); color: #171b25; font-weight: 700; cursor: pointer; }
.footer { display: flex; justify-content: space-between; padding: 20px 0 30px; border-top: 1px solid var(--line); color: #6f7c91; font-size: 9px; letter-spacing: 1px; }
.footer-separator { color: var(--accent); padding: 0 5px; }
.programme-dialog { width: min(540px, calc(100% - 32px)); max-height: min(82vh, 760px); overflow: auto; padding: 30px; color: var(--text); background: #1a2333; border: 1px solid #3a465b; border-radius: 16px; box-shadow: 0 25px 100px #0009; }
.programme-dialog::backdrop { background: rgba(4, 8, 15, .78); backdrop-filter: blur(5px); }
.dialog-close { position: absolute; top: 12px; right: 15px; border: 0; background: transparent; color: #aab6c9; font-size: 28px; cursor: pointer; }
.dialog-channel { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.dialog-time { color: var(--muted); margin: 10px 0 18px; font-size: 12px; }
.dialog-title { margin: 0; font: 700 26px/1.2 "Space Grotesk", sans-serif; letter-spacing: -.7px; }
.dialog-subtitle { color: #c2cada; font-size: 14px; margin: 8px 0 0; }
.dialog-description { color: #aab6c9; font-size: 13px; line-height: 1.7; white-space: pre-line; margin: 20px 0; }
.dialog-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.meta-chip { border: 1px solid var(--line); background: rgba(255,255,255,.04); border-radius: 6px; padding: 6px 9px; color: #bdc8d9; font-size: 10px; }
.dialog-actors { color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: 16px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 15px; background: #263348; border: 1px solid #48566c; border-radius: 9px; color: #eaf0fa; font-size: 12px; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 720px) {
  .topbar { height: 62px; padding: 0 5%; }
  .page { width: 90%; }
  .hero { padding: 44px 0 32px; align-items: start; flex-direction: column; }
  .hero-date { text-align: left; }
  .toolbar { flex-wrap: wrap; }
  .search-wrap { order: 3; width: 100%; margin-left: 0; }
  .refresh-button { margin-left: auto; }
  .channel-row { grid-template-columns: 1fr; gap: 12px; padding: 15px 0; }
  .channel-logo { width: 38px; height: 38px; flex-basis: 38px; border-radius: 10px; }
  .programme-card { flex-basis: 190px; }
  .footer { gap: 10px; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
