html, body { margin: 0; height: 100%; background: #000; color: #fff; overflow: hidden; cursor: none;
             font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; }
.hidden { display: none !important; }

/* Sizes use container units of #tv (cqh/cqw), not the window, so they stay right when the TV is turned sideways. */
#tv { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; overflow: hidden; container: tv / size; }
/* Portrait: lay the page out tall, then turn it to fit the sideways screen. */
body.rot-portrait #tv, body.rot-portrait-flipped #tv { width: 100vh; height: 100vw; transform-origin: 0 0; }
body.rot-portrait #tv { left: 100vw; transform: rotate(90deg); }
body.rot-portrait-flipped #tv { top: 100vh; transform: rotate(-90deg); }
#frame { position: absolute; inset: 0; display: flex; flex-direction: column; }
#stage { position: relative; flex: 1; overflow: hidden; }

body.preview { cursor: default; }

/* ---------- background and layout zones ---------- */
#bg { position: absolute; inset: 0; background: #000; overflow: hidden; }
#bg .bg-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
#stage { --gap: 0px; --radius: 0px; }
#stage[data-gap="thin"] { --gap: 1.2cqh; }
#stage[data-gap="wide"] { --gap: 3cqh; }
#stage.rounded { --radius: 1.8cqh; }
/* Half the gap around each zone plus half around the screen edge gives even spacing everywhere. */
#zones { position: absolute; inset: calc(var(--gap) / 2); }
.zone { position: absolute; box-sizing: border-box; padding: calc(var(--gap) / 2); }
.zone-box { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: var(--radius);
            container: zone / size; }
.zone.inset { z-index: 3; padding: 0; }
.zone.inset .zone-box { border-radius: max(var(--radius), 1.4cqh); box-shadow: 0 1cqh 4cqh rgba(0,0,0,.55); background: #000; }

/* ---------- slides and transitions ---------- */
/* Sizes inside slides use container units (cqh/cqw/cqmin), so a slide scales to whichever zone it plays in. */
.layer { position: absolute; inset: 0; opacity: 0; overflow: hidden; background: transparent;
         transition: opacity .8s ease, transform .9s cubic-bezier(.22,.8,.3,1); }
#stage .layer.show { opacity: 1; transform: none; z-index: 2; }   /* beats every transition's starting position */
.layer.leave { z-index: 1; }
/* With see-through slides, fading the old one out a beat later avoids a flash of background mid-fade. */
.tr-fade .layer.leave { transition-delay: .35s; }
.tr-slide .layer { transform: translateX(100%); opacity: 1; }
.tr-slide .layer.leave { transform: translateX(-30%); opacity: .3; }
.tr-zoom .layer { transform: scale(1.12); }
.tr-zoom .layer.leave { transform: scale(.94); opacity: 0; }
.tr-none .layer { transition: none; }

.layer > .fg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fit-contain { object-fit: contain; }
.fit-cover { object-fit: cover; }
.layer > .bg-blur { position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover; filter: blur(4cqmin) brightness(.55) saturate(1.2); }
.kenburns { animation: kenburns var(--kb-time, 10s) ease-out forwards; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.14); } }
.layer > iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; background: #fff; }

/* ---------- pairing / idle ---------- */
.screen { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center;
          text-align: center; background: radial-gradient(circle at 50% 40%, #1e293b, #020617); z-index: 20; }
.screen.on { display: flex; }
.label { font-size: 2.4cqw; letter-spacing: .3em; text-transform: uppercase; color: #94a3b8; }
.code { font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 13cqw; font-weight: 700; letter-spacing: .06em; margin: 2cqh 0; }
.hint { font-size: 2cqw; color: #cbd5e1; max-width: 70cqw; line-height: 1.5; }
.sub { position: absolute; bottom: 3cqh; font-size: 1.2cqw; color: #64748b; }
#status { position: absolute; right: 1cqw; bottom: 1cqh; font-size: 12px; color: #f87171; display: none; z-index: 30; }

/* ---------- ticker ---------- */
#ticker { height: 7.5cqh; display: flex; align-items: stretch; font-size: 3.6cqh; font-weight: 600; flex: none; z-index: 5; }
.tk-label { display: flex; align-items: center; padding: 0 2cqw; background: rgba(0,0,0,.35); text-transform: uppercase;
            letter-spacing: .08em; font-weight: 800; white-space: nowrap; }
.tk-label:empty { display: none; }
.tk-track { flex: 1; overflow: hidden; position: relative; display: flex; align-items: center; }
.tk-run { display: inline-flex; white-space: nowrap; will-change: transform; animation: tk linear infinite; }
.tk-run span { padding-right: 3cqw; }
.tk-run .sep { opacity: .6; padding-right: 3cqw; }
.tk-run .src { opacity: .75; font-weight: 800; text-transform: uppercase; font-size: .8em; letter-spacing: .06em; padding-right: 1cqw; }
@keyframes tk { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- overlays ---------- */
#info { position: absolute; top: 2.5cqh; right: 1.8cqw; display: flex; gap: 1cqw; z-index: 10; }
#info > div { background: rgba(0,0,0,.55); backdrop-filter: blur(6px); border-radius: 1.4cqh; padding: 1cqh 1.4cqw;
              display: flex; flex-direction: column; justify-content: center; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
#clock .time { font-size: 4.4cqh; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
#clock .date { font-size: 1.9cqh; opacity: .85; }
#wxbadge { flex-direction: row !important; align-items: center; gap: .8cqw; }
#wxbadge svg { width: 5.5cqh; height: 5.5cqh; }
#wxbadge .t { font-size: 4.4cqh; font-weight: 700; line-height: 1; }
#wxbadge .l { font-size: 1.9cqh; opacity: .85; }
#logo { position: absolute; max-height: 11cqh; max-width: 18cqw; z-index: 10; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
#logo.top-left { top: 2.5cqh; left: 1.8cqw; } #logo.top-right { top: 2.5cqh; right: 1.8cqw; }
#logo.bottom-left { bottom: 2.5cqh; left: 1.8cqw; } #logo.bottom-right { bottom: 2.5cqh; right: 1.8cqw; }
body.has-ticker #logo.bottom-left, body.has-ticker #logo.bottom-right { bottom: 10cqh; }

/* ---------- weather slide ---------- */
.wx { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto auto; padding: 3.5cqh 5cqw 2.5cqh; gap: 1.8cqh;
      background: linear-gradient(160deg, #0ea5e9, #1e3a8a); }
.wx.night { background: linear-gradient(160deg, #1e1b4b, #020617); }
.wx.cloudy, .wx.fog { background: linear-gradient(160deg, #64748b, #1e293b); }
.wx.rain, .wx.drizzle, .wx.sleet, .wx.storm { background: linear-gradient(160deg, #334155, #0f172a); }
.wx.snow { background: linear-gradient(160deg, #94a3b8, #334155); }
.wx-head { font-size: 3.4cqh; font-weight: 600; opacity: .9; letter-spacing: .02em; }
.wx-head small { display: block; font-size: 2.2cqh; font-weight: 400; opacity: .8; }
.wx-now { display: flex; align-items: center; gap: 4cqw; }
.wx-now svg { width: 22cqh; height: 22cqh; flex: none; filter: drop-shadow(0 6px 20px rgba(0,0,0,.25)); }
.wx-temp { font-size: 18cqh; font-weight: 200; line-height: .9; letter-spacing: -.03em; }
.wx-temp sup { font-size: .35em; vertical-align: top; margin-left: .3cqw; font-weight: 300; }
.wx-cond { font-size: 4.4cqh; font-weight: 600; }
.wx-meta { display: flex; gap: 3cqw; font-size: 2.6cqh; opacity: .9; margin-top: 1cqh; }
.wx-hours { display: grid; grid-template-columns: repeat(8, 1fr); gap: 1cqw; background: rgba(255,255,255,.1); border-radius: 2cqh; padding: 1.2cqh 1cqw; }
.wx-hours div { text-align: center; font-size: 2.3cqh; }
.wx-hours svg { width: 4.4cqh; height: 4.4cqh; display: block; margin: .3cqh auto; }
.wx-hours b { font-size: 2.8cqh; }
.wx-hours .p { font-size: 1.8cqh; color: #7dd3fc; min-height: 1em; }
.wx-days { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1cqw; }
.wx-days div { background: rgba(255,255,255,.12); border-radius: 2cqh; padding: 1.2cqh 1cqw; text-align: center; font-size: 2.3cqh; }
.wx-days svg { width: 5.6cqh; height: 5.6cqh; display: block; margin: .4cqh auto; }
.wx-days .hi { font-size: 3.2cqh; font-weight: 700; } .wx-days .lo { opacity: .7; margin-left: .6cqw; }
.wx-days .p { font-size: 1.9cqh; color: #7dd3fc; min-height: 1em; }

/* ---------- news slide ---------- */
.news { position: absolute; inset: 0; background: #0b1020; display: flex; flex-direction: column; }
.news-bar { display: flex; align-items: center; gap: 1.5cqw; padding: 2.6cqh 4cqw; background: #111827; border-bottom: .5cqh solid #dc2626; }
.news-bar .tag { background: #dc2626; padding: .6cqh 1.2cqw; border-radius: .8cqh; font-weight: 800; letter-spacing: .1em; font-size: 2.4cqh; }
.news-bar .src { font-size: 3cqh; font-weight: 600; }
.news-bar .dots { margin-left: auto; margin-right: 28cqw; display: flex; gap: .6cqw; }
.news-bar .dots i { width: 1.2cqh; height: 1.2cqh; border-radius: 50%; background: #475569; display: block; }
.news-bar .dots i.on { background: #f8fafc; }
.news-body { flex: 1; display: grid; grid-template-columns: 1.15fr 1fr; gap: 4cqw; padding: 5cqh 4cqw; align-items: center; min-height: 0; }
.news-body.noimg { grid-template-columns: 1fr; padding: 6cqh 10cqw; }
.news-img { width: 100%; height: 100%; max-height: 66cqh; object-fit: cover; border-radius: 2cqh; background: #1f2937; }
.news-title { font-size: 6cqh; font-weight: 800; line-height: 1.15; margin: 0 0 3cqh;
              display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.news-body.noimg .news-title { font-size: 8cqh; }
.news-sum { font-size: 3cqh; line-height: 1.45; color: #cbd5e1; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.news-time { font-size: 2.4cqh; color: #94a3b8; margin-top: 3cqh; }
.news-story { animation: fadeUp .7s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(2cqh); } to { opacity: 1; transform: none; } }

/* ---------- announcement slide ---------- */
.txt { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 8cqh 9cqw;
       background-size: cover; background-position: center; }
.txt.has-bg::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.txt > * { position: relative; }
.txt.center { text-align: center; align-items: center; }
.txt h1 { font-size: min(11cqh, 6.2cqw); line-height: 1.05; margin: 0 0 4cqh; font-weight: 800; text-shadow: 0 2px 10px rgba(0,0,0,.25); }
.txt p { font-size: min(5cqh, 2.8cqw); line-height: 1.4; margin: 0; white-space: pre-line; max-width: 80cqw; }
.txt.size-s h1 { font-size: min(8cqh, 4.5cqw); } .txt.size-s p { font-size: min(3.8cqh, 2.1cqw); }
.txt.size-l h1 { font-size: min(15cqh, 8.4cqw); } .txt.size-l p { font-size: min(6.5cqh, 3.7cqw); }
.txt.panel-clear h1, .txt.panel-clear p { text-shadow: 0 .3cqh 2cqh rgba(0,0,0,.55); }
.txt .glass { background: rgba(0,0,0,.32); backdrop-filter: blur(2cqmin) saturate(1.3); border: 1px solid rgba(255,255,255,.2);
              border-radius: 3cqmin; padding: 6cqmin 7cqmin; max-width: 86cqw; box-sizing: border-box; box-shadow: 0 2cqh 6cqh rgba(0,0,0,.3); }
.txt.center .glass { display: flex; flex-direction: column; align-items: center; }
.txt .glass p:last-child, .txt .glass h1:last-child { margin-bottom: 0; }
.txt h1, .txt p { animation: fadeUp .9s ease both; } .txt p { animation-delay: .25s; }

.loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 4cqh; color: #94a3b8; background: #0f172a; }

/* ---------- slides in tall, narrow zones (sidebars, columns) ---------- */
@container zone (aspect-ratio < 1.1) {
  .wx { grid-template-rows: auto 1fr auto; padding: 5cqw; gap: 3cqw; }
  .wx-head { font-size: 6cqw; } .wx-head small { font-size: 4cqw; }
  .wx-now { flex-direction: column; justify-content: center; text-align: center; gap: 2cqw; }
  .wx-now svg { width: 34cqw; height: 34cqw; }
  .wx-temp { font-size: 26cqw; } .wx-cond { font-size: 7cqw; }
  .wx-meta { flex-direction: column; align-items: center; gap: 1cqw; font-size: 4.4cqw; }
  .wx-hours { display: none; }
  .wx-days { grid-template-columns: repeat(3, 1fr); gap: 2cqw; } .wx-days div:nth-child(n+4) { display: none; }
  .wx-days div { font-size: 4.4cqw; padding: 2.5cqw 1cqw; border-radius: 3cqw; }
  .wx-days svg { width: 11cqw; height: 11cqw; } .wx-days .hi { font-size: 6cqw; } .wx-days .p { font-size: 3.4cqw; }

  .news-bar { padding: 3.5cqw 5cqw; gap: 3cqw; border-bottom-width: 1cqw; }
  .news-bar .tag { font-size: 3.8cqw; padding: 1cqw 2cqw; } .news-bar .src { font-size: 4.6cqw; }
  .news-bar .dots { margin-right: 0; gap: 1.2cqw; } .news-bar .dots i { width: 2cqw; height: 2cqw; }
  .news-body, .news-body.noimg { grid-template-columns: 1fr; grid-template-rows: auto 1fr; padding: 6cqw 5cqw; gap: 5cqw; align-items: start; }
  .news-img { height: auto; aspect-ratio: 16 / 10; max-height: 40cqh; border-radius: 3cqw; }
  .news-title, .news-body.noimg .news-title { font-size: 7.5cqw; margin-bottom: 3cqw; }
  .news-sum { font-size: 4.6cqw; } .news-time { font-size: 3.8cqw; margin-top: 3cqw; }
  .txt { padding: 8cqw; }
}

/* ---------- slides in short, wide zones (banners) ---------- */
@container zone (aspect-ratio > 2.2) {
  .wx { display: flex; align-items: center; gap: 3cqw; padding: 0 3cqw; }
  .wx-head { font-size: 14cqh; max-width: 22cqw; } .wx-head small { font-size: 10cqh; }
  .wx-now { gap: 2cqw; } .wx-now svg { width: 70cqh; height: 70cqh; }
  .wx-temp { font-size: 58cqh; } .wx-cond { font-size: 15cqh; } .wx-meta { display: none; }
  .wx-hours { display: none; }
  .wx-days { margin-left: auto; grid-template-columns: repeat(4, auto); gap: 1.2cqw; } .wx-days div:nth-child(n+5) { display: none; }
  .wx-days div { font-size: 11cqh; padding: 5cqh 1.6cqw; border-radius: 6cqh; }
  .wx-days svg { width: 26cqh; height: 26cqh; } .wx-days .hi { font-size: 14cqh; } .wx-days .p { display: none; }

  .news { flex-direction: row; }
  .news-bar { flex-direction: column; justify-content: center; align-items: flex-start; gap: 5cqh; padding: 0 2.5cqw; border-bottom: none; border-right: 1.2cqh solid #dc2626; }
  .news-bar .tag { font-size: 12cqh; padding: 2.5cqh 1cqw; border-radius: 3cqh; }
  .news-bar .src { font-size: 12cqh; max-width: 22cqw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .news-bar .dots { display: none; }
  .news-body, .news-body.noimg { grid-template-columns: 1fr; padding: 0 3cqw; }
  .news-img, .news-sum, .news-time { display: none; }
  .news-title, .news-body.noimg .news-title { font-size: 24cqh; margin: 0; -webkit-line-clamp: 2; }
  .txt { padding: 6cqh 4cqw; }
  .txt h1, .txt.size-s h1, .txt.size-l h1 { font-size: min(30cqh, 5cqw); margin-bottom: 3cqh; }
  .txt p, .txt.size-s p, .txt.size-l p { font-size: min(16cqh, 2.6cqw); }
  .txt .glass { padding: 4cqh 3cqw; }
}

/* Shorter strips (a portrait footer, say): fewer forecast days, no heading. */
@container zone (aspect-ratio > 2.2) and (aspect-ratio < 4.5) {
  .wx-head { display: none; }
  .wx-days div:nth-child(n+3) { display: none; }
  .wx-days { grid-template-columns: repeat(2, auto); }
}

/* ---------- widgets: schedule and menu ---------- */
/* --fit is lowered by the player until the content fits its zone. */
.wg { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(var(--fit, 1) * 5cqmin) calc(var(--fit, 1) * 6cqmin);
      box-sizing: border-box; gap: calc(var(--fit, 1) * 2.5cqmin); --accent: #fbbf24; --ink: #fff; --soft: rgba(255,255,255,.72); --card: rgba(255,255,255,.08); color: var(--ink); }
.wg.theme-midnight { background: linear-gradient(160deg, #1e1b4b, #0f172a 70%); --accent: #fbbf24; }
.wg.theme-warm { background: linear-gradient(160deg, #7c2d12, #431407); --accent: #fdba74; }
.wg.theme-forest { background: linear-gradient(160deg, #064e3b, #022c22); --accent: #6ee7b7; }
.wg.theme-ocean { background: linear-gradient(160deg, #075985, #0c4a6e 60%, #082f49); --accent: #7dd3fc; }
.wg.theme-light { background: linear-gradient(180deg, #fffbeb, #fef3c7); --ink: #1c1917; --soft: #57534e; --card: rgba(120,53,15,.07); --accent: #b45309; }
.wg.theme-glass { background: rgba(0,0,0,.35); backdrop-filter: blur(2cqmin); --card: rgba(255,255,255,.1); }
.wg-head { flex: none; border-bottom: calc(var(--fit, 1) * .5cqmin) solid var(--accent); padding-bottom: calc(var(--fit, 1) * 2cqmin); }
.wg-title { font-size: calc(var(--fit, 1) * 7.5cqmin); font-weight: 800; line-height: 1.05; letter-spacing: -.01em; }
.wg-sub { font-size: calc(var(--fit, 1) * 3.4cqmin); color: var(--soft); margin-top: calc(var(--fit, 1) * .8cqmin); }
.wg-body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: calc(var(--fit, 1) * 1.6cqmin); }
.wg-empty { margin: auto; font-size: calc(var(--fit, 1) * 4.5cqmin); color: var(--soft); text-align: center; }
.wg-note { flex: none; font-size: calc(var(--fit, 1) * 2.8cqmin); color: var(--soft); text-align: center; font-style: italic; }

.ev { display: flex; align-items: center; gap: calc(var(--fit, 1) * 3cqmin); background: var(--card); border-radius: calc(var(--fit, 1) * 2cqmin);
      padding: calc(var(--fit, 1) * 1.8cqmin) calc(var(--fit, 1) * 2.6cqmin); border-left: calc(var(--fit, 1) * .8cqmin) solid transparent; flex: none; }
.ev-time { flex: none; min-width: 6.2em; font-size: calc(var(--fit, 1) * 4.2cqmin); font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
.ev-time small { font-size: .55em; margin-left: .2em; font-weight: 700; }
.ev-end { display: block; font-size: .5em; font-weight: 600; color: var(--soft); margin-top: .2em; }
.ev-main { flex: 1; min-width: 0; }
.ev-title { font-size: calc(var(--fit, 1) * 4.6cqmin); font-weight: 700; line-height: 1.15; }
.ev-loc { display: flex; align-items: center; gap: .35em; font-size: calc(var(--fit, 1) * 3cqmin); color: var(--soft); margin-top: .25em; }
.ev-loc .pin { width: 1em; height: 1em; flex: none; }
.ev-badge { flex: none; font-size: calc(var(--fit, 1) * 2.6cqmin); font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
            background: var(--accent); color: #111; padding: .35em .8em; border-radius: 999px; }
.ev-badge.next { background: transparent; color: var(--accent); border: .15em solid var(--accent); }
.ev.now { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.ev.done { opacity: .4; }

.mn-cols { display: flex; flex-direction: column; gap: calc(var(--fit, 1) * 3cqmin); }
.wg-menu.two-col .mn-cols { display: block; column-count: 2; column-gap: calc(var(--fit, 1) * 6cqmin); }
.mn-sec { break-inside: avoid; margin-bottom: calc(var(--fit, 1) * 3cqmin); }
.mn-sec h3 { margin: 0 0 calc(var(--fit, 1) * 1.4cqmin); font-size: calc(var(--fit, 1) * 4cqmin); color: var(--accent); text-transform: uppercase; letter-spacing: .1em; }
.mn-item { margin-bottom: calc(var(--fit, 1) * 1.6cqmin); break-inside: avoid; }
.mn-line { display: flex; align-items: baseline; gap: .4em; font-size: calc(var(--fit, 1) * 4.2cqmin); font-weight: 700; }
.mn-dots { flex: 1; border-bottom: .12em dotted var(--soft); opacity: .6; transform: translateY(-.25em); }
.mn-price { font-weight: 800; color: var(--accent); }
.mn-desc { font-size: calc(var(--fit, 1) * 3cqmin); color: var(--soft); margin-top: .15em; line-height: 1.3; }
@container zone (aspect-ratio < 1.1) { .wg-menu.two-col .mn-cols { column-count: 1; } }
/* Wide but not banner-short (the main area above a banner, say): two columns. */
@container zone (aspect-ratio > 1.9) and (aspect-ratio <= 3.4) {
  .wg-sched .wg-body { display: grid; grid-template-columns: 1fr 1fr; align-content: start; }
  .wg-menu .mn-cols { display: block; column-count: 2; column-gap: calc(var(--fit, 1) * 6cqmin); }
}
@container zone (aspect-ratio > 3.4) {
  .wg { flex-direction: row; align-items: center; }
  .wg-head { border-bottom: none; border-right: calc(var(--fit, 1) * .5cqmin) solid var(--accent); padding: 0 calc(var(--fit, 1) * 3cqmin) 0 0; max-width: 28%; }
  .wg-body { flex-direction: row; height: 100%; align-items: center; }
  .ev { flex: 1 1 0; min-width: 0; padding: 4cqh 1.6cqw; border-radius: 6cqh; gap: 1.4cqw; }
  .ev.done, .ev.later { display: none; }
  /* A banner is short, so size from its height. */
  .wg-title { font-size: calc(var(--fit, 1) * 15cqh); } .wg-sub { font-size: calc(var(--fit, 1) * 8cqh); }
  .ev-time { font-size: calc(var(--fit, 1) * 11cqh); min-width: 0; }
  .ev-title { font-size: calc(var(--fit, 1) * 12cqh); } .ev-loc { font-size: calc(var(--fit, 1) * 8cqh); }
  .ev-badge { font-size: calc(var(--fit, 1) * 7cqh); }
}
/* Sidebars: the badge goes under the activity name instead of squeezing it. */
@container zone (aspect-ratio < 1.1) {
  .ev { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: calc(var(--fit, 1) * 3cqmin); row-gap: .4em; }
  .ev-time { min-width: 0; }
  .ev-badge { grid-column: 2; justify-self: start; }
}

/* Small notice while the controller can't confirm its license (the TV keeps playing). */
#license-badge { position: absolute; left: 1cqw; bottom: 1cqh; z-index: 30; font: 600 12px system-ui, sans-serif; color: #fde68a;
  background: rgba(0, 0, 0, .55); padding: 3px 8px; border-radius: 6px; }
#license-badge.hidden { display: none; }
