/* The car's touch sizes on top of the desktop look (/shared/app.css).
   Two window sizes: Drive 773×601 and parked 1254×784 (CSS px, pixel ratio 1.53).
   Touch first: tap targets 48 px or more, text 17 px or more, no hover-only controls. */

/* ───────────────────────────── base ───────────────────────────── */
:root { --pad: 16px; --gap: 14px; --bar-h: 64px; }
html { font-size: 17px; }
@media (min-width: 1000px) { :root { --pad: 28px; --gap: 20px; } html { font-size: 18px; } }
html, body { height: 100dvh; }
body { -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
a, button, [role=button], .key { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
img { -webkit-user-drag: none; }
.dragging { scroll-snap-type: none !important; scroll-behavior: auto !important; cursor: grabbing; }
.dragging * { cursor: grabbing !important; }
.note { font-size: 1rem; margin: 1.2rem 0; }
.muted.big { font-size: 1.05rem; margin: 0 0 .9rem; line-height: 1.45; }
.loading-line { font-size: 1rem; }

/* A finger leaves the last thing it touched in :hover, so hover doesn't change the look here;
   :active gives the feedback instead. */
.card:hover { transform: none; box-shadow: var(--shadow); z-index: auto; }
.card:active { transform: scale(.97); transition-duration: .08s; }
.chip:hover { background: rgba(255, 255, 255, .09); color: var(--ink-2); }
.chip.on, .chip.on:hover { background: #f2f3f5; color: #15171a; }
.cat:hover { background: none; color: var(--ink-2); }
.cat.on, .cat.on:hover { background: #f2f3f5; color: #15171a; }
.chan-row:hover { background: none; }
.chan-row.playing { background: rgba(255, 255, 255, .12); }
nav.main a:hover { background: none; }
nav.main a.on, nav.main a.on:hover { background: var(--pill-on); }
.btn:hover { background: var(--glass); }
.btn.primary:hover { background: #f4f5f7; }
.round:hover { background: rgba(255, 255, 255, .1); }
.pill:hover { background: var(--glass); }
.chip:active, .cat:active, .pill:active, nav.main a:active { background: rgba(255, 255, 255, .24); }
.btn:active, .round:active { transform: scale(.95); }
.chan-row:active { background: rgba(255, 255, 255, .1); }
.btn:disabled { opacity: .55; }
.btn.on svg.i { fill: var(--accent); color: var(--accent); }

/* bigger touch controls from app.css */
.round { width: 48px; height: 48px; }
.round svg.i { width: 1.3rem; height: 1.3rem; }
.round.on { color: var(--accent); }
.btn { height: 52px; padding: 0 1.3rem; font-size: 1.02rem; border-radius: 16px; }
.chip { height: 48px; padding: 0 1.1rem; font-size: 1rem; }
.chip .n { font-size: .85rem; }
.chips { gap: .5rem; padding: .3rem var(--pad) .7rem; scroll-padding-inline: var(--pad); overscroll-behavior-x: contain; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding: 0; }
.seg { margin: 0; padding: 4px; }
.seg button { height: 46px; min-width: 64px; padding: 0 1rem; font-size: 1rem; }
.switch { width: 62px; height: 36px; position: relative; }
.switch::before { content: ""; position: absolute; inset: -8px -6px; }
.switch::after { top: 4px; left: 4px; width: 28px; height: 28px; }
.switch.on::after { transform: translateX(26px); }

/* ───────────────────────────── top bar ───────────────────────────── */
#top { height: var(--bar-h); padding: 0 var(--pad); }
#top .left, #top .right { gap: .6rem; }
nav.main { gap: 2px; }
nav.main a { height: 48px; padding: 0 14px; font-size: 1rem; font-weight: 650; }
nav.main a.ico { width: 48px; padding: 0; justify-content: center; }
nav.main .ico svg.i { width: 1.35rem; height: 1.35rem; }
#top .pill { width: 48px; height: 48px; min-width: 0; padding: 0; }
#top .pill svg.i { width: 1.3rem; height: 1.3rem; }
#top .pill.on { background: var(--pill-on); }
.fake-tag { font-size: .75rem; font-weight: 800; letter-spacing: .14em; color: var(--accent); padding: .25rem .55rem; border-radius: 8px; box-shadow: inset 0 0 0 1.5px currentColor; }
@media (max-width: 820px) { nav.main a { padding: 0 11px; } }

/* ───────────────────────────── pages ───────────────────────────── */
#view { padding: calc(var(--bar-h) + 4px) 0 2rem; overscroll-behavior: contain; scroll-behavior: auto; }
.row-scroll, .chips, .cats, .chan-list { scroll-behavior: auto; }
#view.fixed-page { overflow: hidden; padding-bottom: 0; }
body.watching #view { visibility: hidden; }   /* nothing underneath the player gets drawn */
.toolbar { padding: .2rem var(--pad) .3rem; margin: 0 0 .2rem; gap: .8rem; flex-wrap: wrap; }
.toolbar h1 { font-size: 1.6rem; }
.toolbar .count { color: var(--ink-3); font-size: .95rem; font-weight: 600; margin-right: auto; }
.toolbar h1:has(+ .count) { margin-right: 0; }
.results::-webkit-scrollbar, .cats::-webkit-scrollbar { width: 0; height: 0; }

.section { margin-top: 1rem; }
.section:first-child { margin-top: .2rem; }
.section h2 { font-size: 1.45rem; align-items: center; }
.section h2 .more { font-size: .95rem; padding: 12px 14px; margin: -12px 0; border-radius: 999px; color: var(--ink-3); }
.section h2 .more:active { background: rgba(255, 255, 255, .14); }
.row-scroll { gap: var(--gap); padding: .7rem var(--pad) 1.1rem; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.row-scroll > .card { scroll-snap-align: start; }

/* cards: about 2¼ wide cards / 4½ posters across in Drive, 3⅓ / 6½ parked */
.card.wide { width: calc((100vw - 2 * var(--pad) - 2 * var(--gap)) / 2.25); }
.card.poster { width: calc((100vw - 2 * var(--pad) - 4 * var(--gap)) / 4.4); }
@media (min-width: 1000px) {
  .card.wide { width: calc((100vw - 2 * var(--pad) - 3 * var(--gap)) / 3.3); }
  .card.poster { width: calc((100vw - 2 * var(--pad) - 6 * var(--gap)) / 6.4); }
}
.card.wide .meta { left: 1rem; right: 1rem; bottom: .8rem; }
.card.wide .ttl { font-size: 1.5rem; }
.card.wide .ttl.caps { font-size: 1.3rem; letter-spacing: .12em; }
.card.wide .sub { font-size: 1rem; }
.card .fallback { font-size: 1.15rem; padding: .85rem; }
.card.wide .fallback { font-size: 1.5rem; }
.card.chan .logo { inset: 12% 20% 42%; }
.card.chan .logo .initials { font-size: 2.1rem; }
.card.chan .ttl { font-size: 1.15rem; }
.card.chan .now { font-size: 1rem; }
.live-tag { font-size: .78rem; padding: .2rem .55rem; }
.card .live-tag { top: .7rem; left: .7rem; }
.card.event .match { inset: 14% 6% 32%; }
.card.event .team { font-size: 1.45rem; }
.card.event .league, .card.score .league { font-size: .78rem; top: .8rem; right: .85rem; }
.card.score .teams { inset: 22% 6% 30%; gap: .45rem; }
.card.score .lg { width: 2.1rem; height: 2.1rem; }
.card.score .nm { font-size: 1.25rem; }
.card.score .sc { font-size: 1.6rem; }
.card.score .now { font-size: 1rem; }
.card.score .where { font-size: .95rem; }
.card.poster.blank, .chan-row.blank { opacity: .3; pointer-events: none; }

/* ───────────────────────────── Live TV ───────────────────────────── */
.live-wrap { grid-template-columns: minmax(13rem, 16rem) 1fr; gap: 1rem; padding: 0 var(--pad); height: calc(100dvh - var(--bar-h) - 16px); }
.cats { padding: .4rem; overscroll-behavior: contain; }
.cats .grp { padding: .8rem .8rem .3rem; font-size: .8rem; }
.cat { min-height: 50px; font-size: 1rem; padding: .5rem .8rem; }
.cat .n { font-size: .85rem; }
.chan-pane .toolbar { padding: 0; margin: 0 0 .4rem; }
.chan-pane .toolbar h1 { font-size: 1.5rem; }
.chan-pane .toolbar .pill { height: 48px; padding: 0 1rem; }
.chan-list { overscroll-behavior: contain; }
.chan-row { height: 4.6rem; grid-template-columns: 2.2rem 5rem 1fr auto; gap: .8rem; padding: 0 .4rem 0 .6rem; }
.chan-row .num { font-size: .9rem; }
.chan-row .lg { height: 3.4rem; }
.chan-row .nm { font-size: 1.08rem; }
.chan-row .ep { font-size: .95rem; gap: .6rem; }
.chan-row .acts { opacity: 1; }
.chan-row .acts .round { background: transparent; color: var(--ink-3); }
.chan-row .acts .round.on { color: var(--accent); }
.pick-list .chan-row { position: relative; margin-bottom: 4px; grid-template-columns: 5rem 1fr; }
.pick-list .chan-row .num { display: none; }
@media (max-width: 999px) {
  .live-wrap { display: flex; flex-direction: column; gap: .3rem; padding: 0; }
  .cats { flex: none; display: flex; gap: .5rem; overflow-x: auto; overflow-y: hidden; padding: .2rem var(--pad) .5rem; background: none; box-shadow: none; border-radius: 0; scroll-padding-inline: var(--pad); }
  .cats .grp { display: none; }
  .cat { flex: none; width: auto; height: 48px; min-height: 0; border-radius: 999px; padding: 0 1rem; background: rgba(255, 255, 255, .09); }
  .cat span.name { overflow: visible; }
  .chan-pane { flex: 1; min-height: 0; padding: 0 var(--pad); }
  .chan-row { grid-template-columns: 4.4rem 1fr auto; padding-left: .2rem; }
  .chan-row .num { display: none; }
}

/* ───────────────────────────── Movies & Shows ───────────────────────────── */
.vgrid { margin: .2rem var(--pad) 1rem; }

/* ───────────────────────────── movie & show pages ───────────────────────────── */
.detail { min-height: 0; }
.detail .head { grid-template-columns: 10rem 1fr; gap: 1.3rem; padding: .8rem var(--pad) .4rem; }
@media (min-width: 1000px) { .detail .head { grid-template-columns: 13rem 1fr; gap: 2rem; padding-top: 1.4rem; } }
.detail h1 { font-size: 2.1rem; }
.detail .facts { font-size: 1rem; margin-top: .6rem; }
.detail .plot { font-size: 1.02rem; margin-top: .7rem; -webkit-line-clamp: 3; }
.detail .people { font-size: .95rem; }
.detail .actions { margin-top: 1rem; gap: .7rem; }
.resume-bar { margin-top: .9rem; }
.resume-bar .bar { width: 14rem; height: 6px; display: block; }
.detail .chips { padding-top: 1rem; }
.ep-grid { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--gap); padding: .3rem var(--pad) 2rem; }
.card.ep .eptitle { font-size: 1.08rem; }
.card.ep .sub { font-size: .95rem; }

/* ───────────────────────────── Sports ───────────────────────────── */
.scores-head { padding: .2rem var(--pad) .1rem; }
.scores-head h1 { font-size: 1.6rem; }
.chips.days { padding-bottom: .2rem; }
.score-league { margin: .7rem var(--pad) 0; font-size: 1.25rem; }
.score-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: var(--gap); padding: .7rem var(--pad) .5rem; }

/* ───────────────────────────── Search ───────────────────────────── */
.search-page { display: flex; flex-direction: column; gap: 8px; height: calc(100dvh - var(--bar-h) - 4px); padding-bottom: 10px; }
.qbar {
  flex: none; display: flex; align-items: center; gap: .55rem; height: 56px; margin: 0 var(--pad); padding: 0 4px 0 18px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); font-size: 1.3rem; font-weight: 650; cursor: text;
}
.qbar > svg.i { width: 1.4rem; height: 1.4rem; color: var(--ink-2); }
.qbar .q { white-space: pre; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.qbar .caret { flex: none; width: 2px; height: 1.5em; margin-left: -.45rem; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
.qbar .ph { flex: 1; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: -.3rem; }
.qbar .ph.hidden + .round { margin-left: auto; }
.qbar .round { flex: none; background: transparent; }
.search-page.kb-hidden .qbar .round:last-child { color: var(--accent); }
.search-page.kb-hidden .caret { animation: none; opacity: 0; }
@keyframes blink { 50% { opacity: 0; } }
.results { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.results .note { padding: 0 var(--pad); margin: 1rem 0; }
.keypad { flex: none; display: grid; grid-template-columns: repeat(20, 1fr); gap: 6px; width: 100%; max-width: 780px; margin: 0 auto; padding: 0 var(--pad); }
.key {
  grid-column: span 2; height: 48px; border-radius: 12px; background: rgba(255, 255, 255, .14); font-size: 1.3rem; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), 0 2px 0 rgba(0, 0, 0, .3); display: grid; place-items: center;
}
.key.fn { background: rgba(255, 255, 255, .07); font-size: 1rem; }
.key.space { grid-column: span 4; }
.key svg.i { width: 1.6rem; height: 1.6rem; }
.key:active { background: rgba(255, 255, 255, .34); transform: translateY(1px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
@media (min-width: 1000px) { .key { height: 54px; } }
.search-page.kb-hidden .keypad { display: none; }

/* ───────────────────────────── Settings ───────────────────────────── */
.settings-page .panel { margin: 0 var(--pad) 2rem; max-width: 54rem; padding: .2rem 1.2rem 1rem; border-radius: 22px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
.toggle-row { min-height: 68px; padding: .7rem 0; }
.toggle-row .a { font-size: 1.05rem; }
.toggle-row .b { font-size: .93rem; line-height: 1.35; }
.toggle-row.block { display: block; }
.toggle-row.block .seg, .toggle-row.block .chips { margin-top: .7rem; }
.seg.quality { flex-wrap: wrap; }
h4.sub { font-size: .85rem; margin-top: 1.2rem; }
.about { font-size: .95rem; margin: 1rem 0 0; }

/* ───────────────────────────── messages ───────────────────────────── */
.empty-state { margin: 5dvh auto 0; }
.empty-state .badge-ico { width: 4.4rem; height: 4.4rem; margin-bottom: 1.1rem; }
.empty-state h1 { font-size: 1.8rem; }
.empty-state p { font-size: 1.05rem; margin: .7rem 0 1.4rem; }
#sheet-layer { padding: 1rem; }
.sheet { max-height: calc(100dvh - 2rem); }
.sheet header { padding: 1rem 1.2rem .4rem 1.4rem; }
.sheet header h2 { font-size: 1.4rem; }
.sheet .body { padding: .4rem 1.4rem 1.4rem; overscroll-behavior: contain; }
.list-item { width: 100%; min-height: 60px; text-align: left; }
.list-item .a { font-size: 1.05rem; }
.list-item .b { font-size: .92rem; }
.list-item svg.i { width: 1.4rem; height: 1.4rem; color: var(--ok); }
#toast { bottom: 1.4rem; }
.toast { font-size: 1rem; }

/* ───────────────────────────── the player ───────────────────────────── */
.cw { position: absolute; inset: 0; overflow: hidden; background: #000; touch-action: manipulation; user-select: none; }
.cw .pic { position: absolute; inset: 0; }
.cw .pic canvas { width: 100%; height: 100%; }
.cw-soundonly { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; background: radial-gradient(80% 80% at 50% 40%, #2a2f36, #0d0e10); text-align: center; padding: 0 var(--pad); }
.cw-soundonly svg.i { width: 4.4rem; height: 4.4rem; color: var(--ink-2); stroke-width: 1.6; }
.cw-soundonly .t { font-size: 1.7rem; font-weight: 800; }
.cw-soundonly .b { font-size: 1.05rem; color: var(--ink-2); }

.cw-ctl { position: absolute; inset: 0; transition: opacity .3s; pointer-events: none; }
.cw-ctl > :not(.shade) { pointer-events: auto; }
.cw.idle .cw-ctl { opacity: 0; }
.cw.idle .cw-ctl > * { pointer-events: none; }
.cw-ctl .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .62) 0%, transparent 24%, transparent 52%, rgba(0, 0, 0, .78) 100%); }
.cw-top { position: absolute; top: 12px; left: var(--pad); right: var(--pad); display: flex; align-items: center; gap: .8rem; }
.cw-top .titles { flex: 1; min-width: 0; text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.cw-top .tl1 { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.cw-top .t1 { font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-top .t2 { margin-top: .15rem; font-size: 1rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-top .live-tag { flex: none; }
.cw-top .grp { display: flex; gap: .5rem; flex: none; }
.cw .round.big { width: 52px; height: 52px; flex: none; background: rgba(30, 33, 38, .62); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.cw .round.big svg.i { width: 1.45rem; height: 1.45rem; stroke-width: 2.4; }

.cbtn {
  height: 52px; min-width: 52px; padding: 0 1rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: rgba(255, 255, 255, .12); font-size: 1rem; font-weight: 700; white-space: nowrap; transition: background .15s, transform .15s var(--ease);
}
.cbtn svg.i { width: 1.4rem; height: 1.4rem; }
.cbtn.ico { width: 52px; padding: 0; }
.cbtn.ico .l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.cbtn:active { background: rgba(255, 255, 255, .3); transform: scale(.95); }
.cbtn.on { background: #f2f3f5; color: #15171a; }
.cw-top .cbtn { background: rgba(30, 33, 38, .62); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.cw-top .cbtn.on { background: #f2f3f5; color: #15171a; }
.cw-top .cbtn.fav.on { background: rgba(30, 33, 38, .62); color: var(--accent); }
.cbtn.fav.on svg.i { fill: currentColor; }
.cw .rocker { display: flex; align-items: center; border-radius: 999px; background: rgba(255, 255, 255, .12); }
.cw .rocker .cbtn { background: transparent; }
.cw .rocker .cbtn:active { background: rgba(255, 255, 255, .3); }
.cw .rocker .lbl { font-size: .9rem; font-weight: 800; letter-spacing: .08em; color: var(--ink-2); padding: 0 .1rem; }

.cw-bar { position: absolute; left: var(--pad); right: var(--pad); bottom: 12px; max-width: 66rem; margin: 0 auto; border-radius: 24px; padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; }
.cw-bar .btns { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cw-bar .grp { display: flex; align-items: center; gap: 6px; }
.cw .timeline { display: flex; align-items: center; gap: .8rem; padding: 0 .5rem; font-size: 1rem; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.cw .timeline .tc { min-width: 3.4rem; }
.cw .timeline .tc:last-child { text-align: right; }
.scrub { position: relative; flex: 1; height: 44px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.scrub .track { position: relative; width: 100%; height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.scrub .fill { position: absolute; inset: 0 auto 0 0; background: #fff; }
.scrub .knob { position: absolute; top: 50%; left: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); transition: transform .15s; }
.scrub.drag .knob { transform: scale(1.3); }
.scrub .tip { position: absolute; bottom: 44px; transform: translateX(-50%); padding: .3rem .65rem; border-radius: 10px; background: rgba(0, 0, 0, .82); color: #fff; font-size: 1.05rem; font-weight: 750; pointer-events: none; }
.cw .onnow { padding: 4px .6rem 2px; min-height: 1.6rem; }
.cw .onnow .row1 { display: flex; align-items: center; gap: .8rem; font-size: .95rem; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cw .onnow .bar { flex: 1 1 auto; height: 5px; }
.cw .onnow .nx { margin-top: 4px; font-size: 1rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cw-status { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: .8rem; text-align: center; pointer-events: none; font-size: 1.15rem; font-weight: 700; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.cw-status .spinner { width: 3.2rem; height: 3.2rem; }
.cw-status.pill { flex-direction: row; padding: .8rem 1.4rem; border-radius: 999px; background: rgba(30, 33, 38, .75); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); text-shadow: none; }
.cw-status.pill .spinner { width: 1.6rem; height: 1.6rem; border-width: 3px; }
.cw-status.panel { pointer-events: auto; width: min(34rem, calc(100% - 2 * var(--pad))); z-index: 3; text-shadow: none; }
.cw.has-panel .cw-bar, .cw.has-panel .cw-zap, .cw.has-panel .cw-upnext { display: none; }
.card-msg { border-radius: 26px; padding: 1.4rem 1.6rem 1.5rem; }
.card-msg .badge-ico { width: 3.6rem; height: 3.6rem; border-radius: 18px; margin: 0 auto; display: grid; place-items: center; background: rgba(255, 255, 255, .12); }
.card-msg .badge-ico svg.i { width: 1.8rem; height: 1.8rem; }
.card-msg h2 { margin: .7rem 0 .35rem; font-size: 1.5rem; font-weight: 800; }
.card-msg p { margin: 0; font-size: 1.05rem; font-weight: 550; line-height: 1.45; color: var(--ink-2); }
.card-msg .actions { justify-content: center; margin-top: 1.1rem; }

.cw-unmute { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 0 var(--pad); background: rgba(0, 0, 0, .5); color: #fff; text-align: center; }
.cw-unmute .disc { width: 6.6rem; height: 6.6rem; border-radius: 50%; display: grid; place-items: center; margin-bottom: .4rem; background: rgba(255, 255, 255, .95); color: #121417; box-shadow: 0 20px 50px rgba(0, 0, 0, .55); animation: pulse 1.6s ease-in-out 4; }
.cw-unmute .disc svg.i { width: 3rem; height: 3rem; }
.cw-unmute .t { font-size: 1.9rem; font-weight: 800; text-shadow: 0 2px 14px rgba(0, 0, 0, .6); }
.cw-unmute .b { font-size: 1.05rem; font-weight: 600; color: var(--ink-2); }
.cw-unmute:active .disc { transform: scale(.94); }
@keyframes pulse { 50% { transform: scale(1.07); } }

.cw-zap { position: absolute; left: var(--pad); top: 50%; transform: translateY(-50%); max-width: min(28rem, calc(100% - 2 * var(--pad))); padding: .9rem 1.2rem; border-radius: 20px; display: flex; align-items: center; gap: 1rem; z-index: 2; }
.cw-zap .num { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.cw-zap .grow { min-width: 0; }
.cw-zap .nm { font-size: 1.2rem; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-zap .ep { font-size: 1rem; color: var(--ink-2); font-weight: 600; margin-top: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-upnext { position: absolute; right: var(--pad); bottom: 150px; width: min(27rem, calc(100% - 2 * var(--pad))); border-radius: 20px; padding: .8rem .8rem .8rem 1.1rem; display: flex; align-items: center; gap: .7rem; z-index: 2; }
.cw-upnext .grow { flex: 1; min-width: 0; }
.cw-upnext .t { font-size: .85rem; color: var(--ink-3); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.cw-upnext .n { font-size: 1.05rem; font-weight: 750; margin-top: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-stats { position: absolute; top: 76px; right: var(--pad); z-index: 2; padding: .65rem .9rem; border-radius: 14px; font: 600 .9rem/1.5 ui-monospace, Consolas, "DejaVu Sans Mono", monospace; pointer-events: none; max-width: calc(100% - 2 * var(--pad)); }
.cw-stats .ln { display: flex; gap: .8rem; white-space: nowrap; }
.cw-stats .k { flex: none; width: 5.2rem; color: var(--ink-3); }
.cw-stats .v { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 999px) {
  .cw-bar .cbtn:not(.ico) { padding: 0 .85rem; }
  .cw-upnext { bottom: 140px; }
}

/* ───────────────────────────── logins (CONTRACTS §11) ───────────────────────────── */
body.bare #top { display: none; }
body.bare #view { padding-top: 14px; }
#top .left { gap: .5rem; }

/* the on-screen keypad for forms (keypad.js): docked at the bottom while a field is in use */
.kp-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: grid; grid-template-columns: repeat(20, 1fr); gap: 6px;
  padding: 8px max(var(--pad), calc((100vw - 780px) / 2)) 10px; background: rgba(22, 24, 28, .94);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 -1px 0 var(--glass-line), 0 -18px 40px rgba(0, 0, 0, .45);
}
.kp-dock .key { font-size: 1.25rem; }
.kp-dock .key.fn { font-size: 1rem; }
.kp-dock .key.wide { grid-column: span 4; }
.kp-dock .key.space { grid-column: span 8; }
.kp-dock .key.enter { grid-column: span 6; background: #f2f3f5; color: #15171a; font-weight: 800; }
.kp-dock .key.on { background: rgba(255, 255, 255, .3); }
.kp-dock .key.lock { background: #f2f3f5; color: #15171a; }
body.kp-open #view { padding-bottom: calc(var(--kp-h, 290px) + 16px); }
body.kp-open #sheet-layer { padding-bottom: calc(var(--kp-h, 290px) + 8px); }
body.kp-open .sheet { max-height: calc(100dvh - var(--kp-h, 290px) - 2rem); }
#toast { z-index: 90; }
body.kp-open #toast { bottom: calc(var(--kp-h, 290px) + 1rem); }

/* fields */
.field { margin: 0 0 .8rem; }
.field > span { font-size: .92rem; margin-bottom: .35rem; }
.field input, .login-form input { height: 52px; padding: 0 1rem; border-radius: 14px; border: 0; outline: none; width: 100%; font-size: 1.1rem; color: var(--ink);
  background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.field input:focus, .login-form input:focus { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .75); }
.field input::placeholder, .login-form input::placeholder { color: var(--ink-4); }
.pw { display: flex; gap: .5rem; align-items: center; }
.pw input { flex: 1; min-width: 0; }
.eye { flex: none; height: 52px; min-width: 76px; padding: 0 .9rem; border-radius: 14px; background: var(--glass); font-weight: 700; }
.eye:active { background: rgba(255, 255, 255, .3); }
.pill.small { height: 52px; flex: none; }
.field .hint { font-size: .92rem; }
.hint.weak { color: #ffb37a; }
.hint.strong { color: #7ee2a3; }
.form-err { margin: .2rem 0; color: #ff8f86; font-weight: 650; font-size: 1rem; }
.safe-note { display: flex; gap: .6rem; align-items: flex-start; margin: .2rem 0 .6rem; padding: .75rem 1rem; border-radius: 14px;
  background: rgba(52, 199, 89, .12); color: #c4f0d3; font-size: .95rem; font-weight: 600; line-height: 1.4; }
.safe-note svg.i { flex: none; margin-top: .1rem; }
.form { display: flex; flex-direction: column; max-width: 36rem; }
.form .actions { margin-top: .5rem; }
.btn.wide { width: 100%; justify-content: center; }
.btn.small { height: 48px; padding: 0 1rem; font-size: .98rem; border-radius: 14px; }
.btn .spinner { width: 1.2rem; height: 1.2rem; border-width: 2px; }

/* sign in */
.login-page { max-width: 30rem; margin: 0 auto; padding: 0 var(--pad); }
.login-head { display: flex; align-items: center; gap: 1rem; margin: .2rem 0 1rem; }
.login-head h1 { margin: 0; font-size: 1.8rem; letter-spacing: -.01em; }
.login-head p { margin: .2rem 0 0; font-size: .98rem; line-height: 1.4; }
.badge-ico { flex: none; width: 3.4rem; height: 3.4rem; border-radius: 18px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.badge-ico svg.i { width: 1.7rem; height: 1.7rem; }
.badge-ico.ok { background: rgba(52, 199, 89, .2); color: var(--ok); }
.login-form { display: flex; flex-direction: column; gap: .6rem; }
.login-form .btn { margin-top: .2rem; }

/* your account, admin, setup */
.account-page .panel, .admin-page .panel, .setup-card {
  margin: 0 var(--pad) 1rem; max-width: 54rem; padding: 1rem 1.2rem 1.2rem; border-radius: 22px;
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}
.account-page .panel h2, .admin-page .panel h2 { margin: 0 0 .8rem; font-size: 1.3rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.panel-head h2 { margin: 0 !important; }
.who { display: flex; align-items: center; gap: 1rem; }
.who .a, .person .a, .stream .a { font-weight: 750; font-size: 1.1rem; }
.who .b, .person .b, .stream .b { color: var(--ink-3); font-size: .95rem; margin-top: .1rem; }
.avatar { flex: none; width: 3.2rem; height: 3.2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; background: linear-gradient(155deg, #5a6f94, #2c3446); }
.avatar.small { width: 2.5rem; height: 2.5rem; font-size: 1rem; }
.tv-status { display: flex; gap: .7rem; align-items: center; margin-bottom: 1rem; padding: .8rem 1rem; border-radius: 14px; background: rgba(255, 255, 255, .07); font-weight: 650; }
.tv-status.on { background: rgba(52, 199, 89, .14); }
.tv-status.on > svg.i { color: var(--ok); }
.tv-status .b { margin-top: .15rem; color: var(--ink-2); font-size: .95rem; font-weight: 600; }
.tv-status .spinner { width: 1.2rem; height: 1.2rem; border-width: 2px; }
.person { margin-bottom: .6rem; padding: .8rem .9rem; border-radius: 16px; background: rgba(255, 255, 255, .05); }
.person.off { opacity: .75; }
.person .top { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.person .grow { flex: 1; min-width: 10rem; }
.person .you { color: var(--ink-3); font-weight: 600; }
.tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.tag { padding: .25rem .65rem; border-radius: 999px; background: rgba(255, 255, 255, .1); font-size: .88rem; font-weight: 700; white-space: nowrap; }
.tag.green { background: rgba(52, 199, 89, .2); color: #93efb5; }
.tag.red { background: rgba(255, 69, 58, .2); color: #ff9e96; }
.person .acts { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.stream { display: flex; align-items: center; gap: .8rem; padding: .65rem 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.stream:last-child { border-bottom: 0; }
body.setup #view { padding: 24px 16px 40px; }
.setup-page { max-width: 42rem; margin: 0 auto; }
.setup-card { margin: 0; }
.warn-note { background: rgba(255, 138, 46, .14); color: #ffd0a8; }

/* ───────────────────────────── Multiview (CONTRACTS §12) ───────────────────────────── */
.chan-row .acts { gap: .2rem; }
.mv-page .toolbar .seg { margin-left: auto; }
.mv-note { padding: 0 var(--pad); margin: .2rem 0 .8rem; }
.mv-grid { display: grid; gap: 8px; margin: 0 var(--pad); max-width: 54rem; aspect-ratio: 16 / 9; max-height: calc(100dvh - var(--bar-h) - 15rem); }
.mv-grid.l-2 { grid-template-columns: 1fr 1fr; aspect-ratio: 32 / 9; }
.mv-grid.l-big2 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.mv-grid.l-big2 > :first-child { grid-row: span 2; }
.mv-grid.l-2x2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mv-tile {
  position: relative; min-width: 0; min-height: 64px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  background: linear-gradient(160deg, #3d434b, #262a30); box-shadow: var(--shadow); padding: .6rem; overflow: hidden;
}
.mv-tile img { max-width: 55%; max-height: 45%; object-fit: contain; }
.mv-tile .nm { font-size: 1.05rem; font-weight: 750; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-tile.empty { background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .14); color: var(--ink-2); }
.mv-tile .plus, .mv-add .plus { width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .12); }
.mv-tile.hear { box-shadow: inset 0 0 0 3px #fff, var(--shadow); }
.mv-tile .snd { position: absolute; top: .55rem; left: .6rem; display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem; border-radius: 999px; background: #f2f3f5; color: #15171a; font-size: .8rem; font-weight: 800; }
.mv-tile .snd svg.i { width: .9rem; height: .9rem; }
.mv-tile:active { transform: scale(.98); }
.mv-actions { padding: 0 var(--pad); margin-top: 1rem; }
.walls-list { padding: .6rem var(--pad); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: .6rem; }
.wall-item { display: flex; align-items: center; gap: .4rem; }
.wall-card { flex: 1; min-width: 0; display: flex; align-items: center; gap: .9rem; padding: .7rem .9rem; border-radius: 16px; background: rgba(255, 255, 255, .07); text-align: left; min-height: 64px; }
.wall-card .a { font-weight: 750; font-size: 1.05rem; } .wall-card .b { color: var(--ink-3); font-size: .92rem; }
.wall-card:active { background: rgba(255, 255, 255, .14); }
.mv-mini { flex: none; width: 4.2rem; aspect-ratio: 16 / 9; display: grid; gap: 2px; }
.mv-mini.l-2 { grid-template-columns: 1fr 1fr; } .mv-mini.l-2x2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mv-mini.l-big2 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; } .mv-mini.l-big2 > :first-child { grid-row: span 2; }
.mv-mini i { background: rgba(255, 255, 255, .5); border-radius: 2px; } .mv-mini i.e { background: rgba(255, 255, 255, .14); }
.seg.mv-layouts { flex-wrap: nowrap; }
.big-acts { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.big-btn { height: 64px; justify-content: center; font-size: 1.08rem; }
.big-btn:disabled { opacity: .55; }
.game-row .lg b { font-size: .8rem; letter-spacing: .06em; }
.picker-list { height: min(52dvh, 30rem); }

/* playing: the squares over the picture */
.mv-ov { position: absolute; inset: 0; }
.cw.single .mv-ov { pointer-events: none; }
.mv-t { position: absolute; display: flex; align-items: center; justify-content: center; text-align: center; padding: .5rem; }
.mv-t.hear::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px #fff; pointer-events: none; }
.mv-t .lbl { position: absolute; left: .6rem; bottom: .55rem; max-width: calc(100% - 1.2rem); display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem; border-radius: 10px;
  background: rgba(20, 22, 26, .72); font-size: .95rem; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .5s; }
.mv-t .lbl svg.i { width: 1rem; height: 1rem; flex: none; }
.cw.quiet.idle .mv-t .lbl { opacity: 0; }
.mv-state { display: flex; flex-direction: column; align-items: center; gap: .5rem; max-width: 100%; color: var(--ink-2); font-weight: 650; font-size: .95rem; }
.mv-state .msg { color: var(--ink); font-weight: 750; font-size: 1rem; }
.mv-state .spinner { width: 2rem; height: 2rem; }
.mv-add { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: .8rem 1.2rem; border-radius: 16px; font-size: 1.05rem; font-weight: 750; color: var(--ink); }
.mv-add:active { background: rgba(255, 255, 255, .1); }
.mini-scores { display: flex; flex-direction: column; gap: .35rem; width: min(100%, 22rem); }
.mini { display: flex; align-items: center; gap: .5rem; padding: .35rem .6rem; border-radius: 10px; background: rgba(255, 255, 255, .08); font-size: .88rem; font-weight: 650; text-align: left; }
.mini .lg { flex: none; padding: .05rem .4rem; border-radius: 5px; background: rgba(255, 255, 255, .16); font-size: .72rem; font-weight: 800; letter-spacing: .06em; }
.mini .lg.live { background: var(--live); color: #fff; }
.mini .m { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.mini .c { flex: none; color: var(--ink-3); font-size: .82rem; }
.mini-none { font-size: .9rem; color: var(--ink-3); }
.mv-none { position: absolute; inset: 0; display: grid; place-items: center; }
.mv-bar { max-width: 46rem; }
.mv-bar .btns { flex-wrap: wrap; }
.cw.mv .cw-ctl { z-index: 2; }
.cw.mv .cw-ctl .shade { background: linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, transparent 18%, transparent 78%, rgba(0, 0, 0, .6) 100%); }
.cw.mv.idle .cw-ctl { pointer-events: none; }
.seg.mv-layouts { flex: none; } .seg.mv-layouts button { white-space: nowrap; }
.seg.mv-layouts button { flex: none; }
