/* ============================================================
   CodoPlayer — player app
   ============================================================ */

html, body { height: 100%; overflow: hidden; }
body { background: radial-gradient(1200px 700px at 75% -10%, rgba(109,94,252,.14), transparent 60%), var(--bg-0); }

.app { display: flex; height: 100vh; height: 100dvh; }

/* ---------------- rail ---------------- */
/* Every button shows its name as well as its picture (owner 2026-11-18): beside the picture on a wide window, under it
   on a narrower one. Only the phone's bottom bar (860px and below, at the end of this file) keeps pictures alone. */
.rail {
  width: 88px; flex: none;
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 0;
  gap: 18px;
  background: var(--bg-1);
  border-right: 1px solid var(--stroke);
  backdrop-filter: blur(14px);
  z-index: 30;
}
.rail-logo { display: flex; align-items: center; gap: 12px; flex: none; color: var(--text); text-decoration: none; }
.rail-logo img {
  width: 44px; height: 44px; border-radius: 13px; object-fit: cover; display: block; flex: none;
  box-shadow: 0 6px 22px rgba(109, 94, 252, .35);
}
.rail-name { display: none; font-family: var(--font-display); font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.rail-nav { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; }
.rail-bottom { display: flex; flex-direction: column; gap: 6px; }
.rail-btn {
  width: 72px; height: 56px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  color: var(--text-mute);
  transition: all .18s var(--ease);
  position: relative;
}
.rail-btn svg { width: 21px; height: 21px; flex: none; }
.rail-lbl {
  /* under the picture: up to two centred lines ("Switch user", long words in other languages), never cut short */
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  max-width: 100%; padding: 0 3px; text-align: center; overflow: hidden; overflow-wrap: anywhere;
  font-size: 10.5px; font-weight: 600; line-height: 1.12; letter-spacing: .1px;
}
.rail-btn:hover { color: var(--text); background: var(--surface); }
.rail-btn.active {
  color: var(--text);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(109, 94, 252, .45);
}
.rail-btn.active::before {
  content: ''; position: absolute; left: -8px; top: 14px; bottom: 14px;
  width: 3.5px; border-radius: 4px; background: var(--brand-grad);
}
@media (min-width: 861px) and (max-height: 700px) {
  .rail { gap: 10px; padding: 12px 0; }
  .rail-btn { height: 46px; gap: 2px; }
  .rail-btn svg { width: 17px; height: 17px; }
  .rail-lbl { font-size: 9.5px; line-height: 1.08; }
}
@media (min-width: 1280px) {
  .rail { width: 212px; align-items: stretch; padding: 18px 14px; }
  .rail-logo { padding: 0 6px 4px; }
  .rail-name { display: block; }
  .rail-btn {
    width: 100%; height: 46px;
    flex-direction: row; justify-content: flex-start; gap: 14px; padding: 0 14px;
  }
  .rail-lbl {
    display: block; flex: 1; min-width: 0; padding: 0; text-align: left;
    font-size: 14px; letter-spacing: 0; line-height: 1.3;
    white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal;
  }
  .rail-btn.active::before { left: -14px; top: 11px; bottom: 11px; }
}
@media (min-width: 1280px) and (max-height: 700px) {
  .rail-btn { height: 40px; }
}
/* ---------------- stage ---------------- */
.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.stage-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(16px, 3vw, 34px) 14px;
  gap: 16px;
}
.view-title { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.3px; }
.view-sub { color: var(--text-mute); font-size: 13px; min-height: 18px; }
.head-right { display: flex; align-items: center; gap: 14px; }
.net-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--stroke);
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.clock { font-size: 15px; font-weight: 600; color: var(--text-dim); letter-spacing: 1px; }
/* The speed test's chip in the page head: its name before a first run; afterwards the figure and the best picture the
   connection carries. The sentence (.sp-line) stays for screen readers and the tooltip. */
.speed-pill {
  position: relative; flex: none; max-width: none; cursor: pointer;
  gap: 9px; padding: 5px 6px 5px 12px; min-height: 34px;
  font-family: inherit; color: var(--text-dim);
  transition: border-color .18s, background .18s, color .18s, transform .18s var(--ease);
}
.speed-pill:empty { display: none; }
.speed-pill[data-state="none"] { padding-right: 14px; }
.speed-pill:hover { color: var(--text); background: var(--surface-2); border-color: rgba(109, 94, 252, .55); transform: translateY(-1px); }
.speed-pill:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.speed-pill > svg { width: 16px; height: 16px; flex: none; color: var(--brand-2); }
.speed-pill b { font-weight: 600; }
.speed-pill .sp-fig { font-size: 13.5px; font-weight: 700; color: var(--text); }
.speed-pill .sp-fig small { font-size: 11.5px; font-weight: 500; color: var(--text-mute); }
.speed-pill .sp-q {
  display: grid; place-items: center; min-width: 34px; height: 24px; padding: 0 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .4px;
  color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, transparent);
}
.speed-pill .sp-q svg { width: 13px; height: 13px; }
.speed-pill[data-state="low"] .sp-q { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.speed-pill[data-state="slow"] .sp-q { color: var(--danger); background: color-mix(in srgb, var(--danger) 16%, transparent); }
.speed-pill .sp-line, .speed-pill:not([data-state="none"]) b {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.views { flex: 1; min-height: 0; position: relative; }
.view {
  position: absolute; inset: 0;
  padding: 4px clamp(16px, 3vw, 34px) 26px;
  overflow-y: auto;
  opacity: 0; pointer-events: none;
  transition: opacity .22s;
}
.view.active { opacity: 1; pointer-events: auto; }

/* ---------------- home ---------------- */
.home-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 8px; }
.home-card {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  padding: 30px 26px;
  min-height: 168px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  border: 1px solid var(--stroke);
  cursor: pointer;
  transition: transform .22s var(--ease), box-shadow .25s, border-color .25s;
  text-align: left;
}
.home-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow); border-color: rgba(109,94,252,.5); }
.home-card .hc-ic {
  position: absolute; top: 22px; left: 24px;
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.12); backdrop-filter: blur(6px);
}
.home-card .hc-ic svg { width: 22px; height: 22px; color: #fff; }
.home-card .hc-count { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: #fff; }
.home-card .hc-label { font-weight: 600; color: #fff; letter-spacing: .3px; }
.home-card.c-live   { background: linear-gradient(140deg, #21316e 0%, #4353d9 60%, #21d4fd 130%); }
.home-card.c-vod    { background: linear-gradient(140deg, #46156e 0%, #8b2fd6 65%, #ff5fa2 140%); }
.home-card.c-series { background: linear-gradient(140deg, #0b4f4f 0%, #0e9594 65%, #7ee081 140%); }
.home-card .skel-count { width: 70px; height: 30px; }

.rail-title { margin: 30px 0 12px; font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--text-dim); }
.h-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.chip-card {
  flex: none; width: 210px;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-md);
  cursor: pointer; transition: all .18s;
  text-align: left;
}
.chip-card:hover { background: var(--surface-2); border-color: var(--stroke-2); }
.chip-card img, .chip-card .ph {
  width: 42px; height: 42px; border-radius: 9px; object-fit: contain;
  background: rgba(0,0,0,.35); flex: none;
  display: grid; place-items: center; color: var(--text-mute);
}
.chip-card .ph svg { width: 18px; height: 18px; }
.chip-card .cc-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-card .cc-sub { font-size: 11.5px; color: var(--text-mute); }
.chip-card > div { min-width: 0; }

/* ---------------- live layout ---------------- */
.live-layout {
  display: grid;
  grid-template-columns: 230px minmax(280px, 1fr) minmax(320px, 1.25fr);
  gap: 16px;
  height: 100%;
  min-height: 0;
}
.col { display: flex; flex-direction: column; min-height: 0; border-radius: var(--r-md); }
.col-head { padding: 4px 4px 10px; display: flex; align-items: center; gap: 8px; }
.col-head .t { font-weight: 700; font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-mute); }
.col-head .n { font-size: 12px; color: var(--text-mute); margin-left: auto; }
.col-scroll { flex: 1; overflow-y: auto; min-height: 0; padding-right: 4px; }

.cat-item {
  width: 100%; text-align: left;
  padding: 11px 14px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: var(--text-dim);
  transition: all .15s;
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  border: 1px solid transparent;
}
.cat-item:hover { background: var(--surface); color: var(--text); }
.cat-item.active { background: var(--brand-soft); color: #cfc9ff; border-color: rgba(109,94,252,.4); font-weight: 600; }
.cat-item .cnt { font-size: 11px; color: var(--text-mute); }
.cat-item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ch-item {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 11px;
  transition: background .15s, border-color .15s;
  border: 1px solid transparent;
}
.ch-item:hover { background: var(--surface); }
.ch-item.active { background: var(--brand-soft); border-color: rgba(109,94,252,.45); }
.ch-item .num { font-size: 11px; color: var(--text-mute); width: 34px; flex: none; text-align: right; }
.ch-item img, .ch-item .ph {
  width: 38px; height: 38px; border-radius: 8px; object-fit: contain;
  background: rgba(0,0,0,.4); flex: none;
}
.ch-item .ph { display: grid; place-items: center; color: var(--text-mute); }
.ch-item .ph svg { width: 16px; height: 16px; }
.ch-item .ch-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-item .ch-epg { font-size: 11.5px; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-item > div { min-width: 0; flex: 1; }
.ch-item .fav-btn { color: var(--text-mute); padding: 6px; border-radius: 7px; opacity: 0; transition: opacity .15s; flex: none; }
.ch-item:hover .fav-btn { opacity: 1; }
.ch-item .fav-btn:hover { color: var(--warn); }
.ch-item .fav-btn.on { color: var(--warn); opacity: 1; }
.ch-item .fav-btn svg { width: 15px; height: 15px; }

/* preview column */
.preview { background: var(--bg-1); border: 1px solid var(--stroke); overflow: hidden; }
.preview-video {
  aspect-ratio: 16 / 9;
  background: #000;
  position: relative;
  cursor: pointer;
}
.preview-video video { width: 100%; height: 100%; }
.preview-video .pv-hint {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--text-mute); font-size: 13.5px; gap: 8px;
  background: radial-gradient(circle at 50% 45%, rgba(109,94,252,.12), transparent 60%);
  text-align: center; padding: 12px;
}
.pv-hint svg { width: 40px; height: 40px; opacity: .5; }
/* preview inline controls — appear on hover so you can pause / mute / go
   fullscreen without being forced into the theater */
.pv-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.pv-paused {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(10,14,26,.55); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(5px);
}
.pv-paused svg { width: 25px; height: 25px; color: #fff; }
.pv-ctrls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.74));
  opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s;
}
.preview-video:hover .pv-ctrls, .preview-video:focus-within .pv-ctrls { opacity: 1; transform: none; }
.pv-hint:not(.hidden) ~ .pv-ctrls { opacity: 0 !important; pointer-events: none; }
.pv-ctl {
  color: #fff; padding: 8px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(255,255,255,.12); transition: background .15s; flex: none;
}
.pv-ctl:hover { background: rgba(255,255,255,.26); }
.pv-ctl svg { width: 18px; height: 18px; display: block; }
.pv-spacer { flex: 1; }
.pv-vol {
  -webkit-appearance: none; appearance: none; width: 88px; height: 5px;
  border-radius: 999px; outline: none; cursor: pointer; background: transparent;
}
.pv-vol::-webkit-slider-runnable-track { height: 5px; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2)) 0 / var(--fill,100%) 100% no-repeat, rgba(255,255,255,.28); }
.pv-vol::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -3.5px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.pv-vol::-moz-range-track { height: 5px; border-radius: 999px; background: rgba(255,255,255,.28); }
.pv-vol::-moz-range-progress { height: 5px; border-radius: 999px; background: linear-gradient(90deg, var(--brand-1), var(--brand-2)); }
.pv-vol::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
.preview-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.pv-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.epg-row { display: flex; gap: 12px; }
.epg-time { font-size: 12px; color: var(--info); font-weight: 600; flex: none; width: 88px; }
.epg-info .t { font-weight: 600; font-size: 13.5px; }
.epg-info .d { font-size: 12px; color: var(--text-mute); max-height: 54px; overflow: hidden; }
.epg-now { border-left: 3px solid; border-image: var(--brand-grad) 1; padding-left: 12px; }

/* ---------------- grids (vod/series) ---------------- */
.browse { display: grid; grid-template-columns: 230px 1fr; gap: 16px; height: 100%; min-height: 0; }
.browse-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.browse-main .poster-grid { flex: 1; }
.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 16px;
  align-content: start;
  overflow-y: auto;
  min-height: 0;
  padding: 2px 4px 20px 2px;
}
.poster {
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: transform .2s var(--ease);
  text-align: left;
}
.poster:hover { transform: translateY(-4px) scale(1.02); }
.poster .p-img {
  aspect-ratio: 2 / 3;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  overflow: hidden;
  border: 1px solid var(--stroke);
  display: grid; place-items: center; color: var(--text-mute);
  position: relative;
}
.poster:hover .p-img { border-color: rgba(109,94,252,.6); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.poster .p-img img { width: 100%; height: 100%; object-fit: cover; }
.poster .p-img svg { width: 30px; height: 30px; opacity: .4; }
.poster .p-rating {
  position: absolute; top: 8px; right: 8px;
  padding: 3px 8px; border-radius: 7px;
  background: rgba(0,0,0,.72); backdrop-filter: blur(4px);
  font-size: 11.5px; font-weight: 700; color: var(--warn);
  display: flex; align-items: center; gap: 4px;
}
.poster .p-rating svg { width: 11px; height: 11px; opacity: 1; }
.poster .p-name { margin-top: 9px; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poster .p-sub { font-size: 11.5px; color: var(--text-mute); }

.load-more { grid-column: 1 / -1; display: flex; justify-content: center; padding: 12px; }

/* ---------------- search ---------------- */
.search-bar { position: relative; max-width: 620px; margin: 6px 0 22px; }
.search-bar svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--text-mute); }
.search-bar .input { padding-left: 48px; padding-block: 14px; font-size: 16px; border-radius: 14px; }
.result-title { margin: 22px 0 12px; font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--text-dim); display:flex; align-items:center; gap:8px; }
.result-title .n { font-size: 12px; color: var(--text-mute); font-weight: 500; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 16px; }
.result-rows { display: flex; flex-direction: column; gap: 4px; max-width: 720px; }

/* ---------------- settings ---------------- */
.settings-wrap { max-width: 640px; display: flex; flex-direction: column; gap: 16px; }
.setting-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.setting-card h3 { margin: 0; font-size: 16px; font-family: var(--font-display); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.setting-row .s-label { font-weight: 600; font-size: 14px; }
.setting-row .s-sub { font-size: 12.5px; color: var(--text-mute); }
.setting-row select.input { width: auto; min-width: 160px; }
.smart-audio-custom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; font-size: 13px; }
.smart-audio-custom label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.smart-audio-custom select { min-width: 92px; }
.smart-audio-custom input[type="range"] { width: 130px; }
.acct-grid { display: grid; grid-template-columns: auto 1fr; gap: 7px 20px; font-size: 13.5px; }
.acct-grid dt { color: var(--text-mute); }
.acct-grid dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---------------- theater ---------------- */
.theater {
  position: fixed; inset: 0; z-index: 100;
  background: #000;
  display: none;
}
.theater.open { display: block; }
.theater video { width: 100%; height: 100%; }
.theater-veil {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  opacity: 1; transition: opacity .3s;
  background: linear-gradient(rgba(0,0,0,.62), transparent 22%, transparent 78%, rgba(0,0,0,.72));
}
.theater.hide-ui .theater-veil { opacity: 0; cursor: none; }
/* a film's own subtitles (the in-browser engine's layer, subs.js): lifted above the controls while they show */
.theater .codo-sub-foot { transition: bottom .3s; }
.theater:not(.hide-ui) .codo-sub-foot { bottom: max(6%, 96px) !important; }
.th-top { display: flex; align-items: center; gap: 14px; padding: 18px 22px; }
.th-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.th-sub { font-size: 12.5px; color: var(--text-dim); }
.th-badge { margin-left: auto; }
.th-badge .live {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 13px; border-radius: 8px;
  background: rgba(255, 60, 80, .18); border: 1px solid rgba(255, 60, 80, .5);
  color: #ff7080; font-weight: 700; font-size: 12px; letter-spacing: 1.5px;
}
.th-badge .live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #ff4055; animation: pulse-dot 1.6s infinite; }
.th-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.th-center .spinner.lg { border-top-color: #fff; }
.th-err {
  pointer-events: auto;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  background: rgba(10, 14, 26, .88); border: 1px solid var(--stroke-2);
  padding: 26px 34px; border-radius: var(--r-md); max-width: 420px; text-align: center;
}
.th-err svg { width: 34px; height: 34px; color: var(--danger); }
.th-bottom { display: flex; align-items: center; gap: 14px; padding: 16px 22px 20px; }
.th-ctl { color: #fff; padding: 9px; border-radius: 10px; }
.th-ctl:hover { background: rgba(255,255,255,.14); }
.th-ctl svg { width: 21px; height: 21px; display: block; }
.th-speed-lbl { font-size: 12.5px; font-weight: 700; min-width: 30px; display: block; text-align: center; }

/* pop-up menu (speed / audio / subtitles) */
.th-menu {
  position: absolute; right: 18px; bottom: 78px; z-index: 30;
  min-width: 230px; max-width: 320px; max-height: 58vh; overflow: auto;
  background: rgba(10, 14, 26, .97); border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.55);
}
.th-menu h5 {
  margin: 8px 8px 4px; font-size: 10.5px; font-weight: 800;
  letter-spacing: 1.3px; text-transform: uppercase; color: var(--text-mute);
}
.th-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 8px; color: var(--text-dim);
  font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.th-menu button:hover { background: rgba(255,255,255,.08); color: var(--text); }
.th-menu button.on { color: var(--brand-2); font-weight: 700; }
.th-menu .none { padding: 10px 12px; color: var(--text-mute); font-size: 13px; }

/* a group's or channel's menu (right-click / long-press) and Manage visibility */
.ctx-menu { position: fixed; right: auto; bottom: auto; z-index: 250; }
.vis-modal { display: flex; flex-direction: column; gap: 12px; }
.vis-list { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; }
.vis-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.vis-row:hover { background: rgba(255,255,255,.06); }
.vis-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vis-row input, .hid-switch input { accent-color: var(--brand-1); width: 18px; height: 18px; flex: none; }
.vis-more { padding: 10px; text-align: center; font-size: 12.5px; }
.vis-actions { display: flex; justify-content: flex-end; }
.hid-switch { cursor: pointer; }
.hid-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.hid-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--stroke); text-align: left; cursor: pointer; font-size: 13.5px; }
.hid-item:hover { border-color: rgba(109,94,252,.5); }
.hid-none { padding: 14px 4px 2px; font-size: 12.5px; }

/* paused overlay badge */
.th-paused {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(10, 14, 26, .6); border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(6px); pointer-events: none;
}
.th-paused svg { width: 38px; height: 38px; color: #fff; }

/* in-view quick filter */
.col-filter {
  width: 220px; min-width: 0; margin-left: auto;
  background: rgba(0,0,0,.32); border: 1px solid var(--stroke);
  border-radius: 11px; color: var(--text); font: inherit; font-size: 15px;
  padding: 11px 15px; outline: none;
}
.col-filter::placeholder { color: var(--text-mute); }
.col-filter:focus { border-color: rgba(109,94,252,.6); box-shadow: 0 0 0 3px rgba(109,94,252,.16); }
/* live view: let the channel filter fill the column so it reads big & clear */
.col-head .col-filter { flex: 1 1 auto; width: auto; margin: 0 8px; }
.grid-tools { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.grid-tools .col-filter { width: 100%; max-width: 520px; margin-left: 0; }
.th-time { font-size: 12.5px; color: var(--text-dim); min-width: 96px; text-align: center; }
.th-seek { flex: 1; }
.th-vol { width: 96px; }

/* --- scrubber & volume: gradient-filled progress (--fill % set from JS) --- */
input[type="range"].th-seek, input[type="range"].th-vol {
  -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 999px; outline: none; cursor: pointer;
  background: transparent; transition: height .12s ease;
}
/* WebKit / Blink — track carries the fill */
input[type="range"].th-seek::-webkit-slider-runnable-track,
input[type="range"].th-vol::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background:
    linear-gradient(90deg, var(--brand-1) 0%, var(--brand-2) 100%) 0 / var(--fill, 0%) 100% no-repeat,
    rgba(255,255,255,.18);
  transition: height .12s ease;
}
input[type="range"].th-seek::-webkit-slider-thumb,
input[type="range"].th-vol::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -4px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,.55), 0 0 0 3px rgba(109,94,252,.4);
  transform: scale(.55); transition: transform .12s ease;
}
/* Firefox — native progress element handles the fill */
input[type="range"].th-seek::-moz-range-track,
input[type="range"].th-vol::-moz-range-track { height: 6px; border-radius: 999px; background: rgba(255,255,255,.18); }
input[type="range"].th-seek::-moz-range-progress,
input[type="range"].th-vol::-moz-range-progress { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--brand-1), var(--brand-2)); }
input[type="range"].th-seek::-moz-range-thumb,
input[type="range"].th-vol::-moz-range-thumb {
  width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,.55), 0 0 0 3px rgba(109,94,252,.4);
  transform: scale(.55); transition: transform .12s ease;
}
/* hover / drag — bar thickens, handle pops in */
input[type="range"].th-seek:hover, input[type="range"].th-vol:hover { height: 9px; }
input[type="range"].th-seek:hover::-webkit-slider-runnable-track,
input[type="range"].th-vol:hover::-webkit-slider-runnable-track { height: 9px; }
input[type="range"].th-seek:hover::-webkit-slider-thumb,
input[type="range"].th-vol:hover::-webkit-slider-thumb,
input[type="range"].th-seek:active::-webkit-slider-thumb { transform: scale(1); }
input[type="range"].th-seek:hover::-moz-range-thumb,
input[type="range"].th-vol:hover::-moz-range-thumb { transform: scale(1); }
.th-seek:disabled { opacity: .4; cursor: default; }
.th-seek:disabled::-webkit-slider-thumb { opacity: 0; }

/* ---------------- info modal ---------------- */
.info-modal { max-width: 720px; padding: 0; overflow: hidden; }
.im-hero { display: flex; gap: 22px; padding: 26px; background: linear-gradient(160deg, rgba(109,94,252,.16), transparent 60%); }
.im-poster { width: 168px; flex: none; border-radius: var(--r-sm); overflow: hidden; background: var(--bg-2); aspect-ratio: 2/3; }
.im-poster img { width: 100%; height: 100%; object-fit: cover; }
.im-head { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.im-head h3 { margin: 0; font-size: 23px; font-family: var(--font-display); }
.im-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.im-plot { font-size: 13.5px; color: var(--text-dim); max-height: 120px; overflow-y: auto; }
.im-actions { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.im-body { padding: 0 26px 26px; }
.season-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; }
.season-tab {
  padding: 8px 16px; border-radius: 9px; flex: none;
  background: var(--surface); border: 1px solid var(--stroke);
  font-weight: 600; font-size: 13px; color: var(--text-dim);
}
.season-tab.active { background: var(--brand-soft); color: #cfc9ff; border-color: rgba(109,94,252,.5); }
.ep-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.ep-row {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid transparent;
  transition: all .15s; text-align: left; width: 100%;
}
.ep-row:hover { border-color: rgba(109,94,252,.45); background: var(--surface-2); }
.ep-row .ep-thumb {
  width: 74px; height: 44px; flex: none; object-fit: cover;
  border-radius: 7px; background: var(--bg-2);
}
.ep-row .ep-n {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(0,0,0,.35); font-weight: 700; font-size: 13px; color: var(--brand-2);
}
.ep-row .ep-t { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-row .ep-d { font-size: 11.5px; color: var(--text-mute); }
.ep-row > div { min-width: 0; }
.ep-row svg { width: 16px; height: 16px; margin-left: auto; flex: none; color: var(--text-mute); }

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) {
  .live-layout { grid-template-columns: 200px 1fr; grid-template-rows: auto 1fr; }
  .preview { grid-column: 1 / -1; grid-row: 1; }
  .preview-body { display: none; }
  .preview-video { aspect-ratio: auto; height: 220px; }
}
@media (max-width: 860px) {
  .app { flex-direction: column-reverse; }
  .rail {
    width: 100%; height: 66px; flex-direction: row;
    padding: 0 10px; border-right: 0; border-top: 1px solid var(--stroke);
    gap: 2px;
  }
  .rail-logo, .rail-lbl { display: none; }
  /* nine buttons share the bar's width: at 44px each they were wider than a 390px phone and Settings and Switch user
     fell off the right edge */
  .rail-nav { flex-direction: row; flex: 7 1 0; min-width: 0; gap: 2px; justify-content: space-around; }
  .rail-bottom { flex-direction: row; flex: 2 1 0; min-width: 0; gap: 2px; justify-content: space-around; }
  .rail-btn { flex: 1 1 0; min-width: 0; width: auto; max-width: 48px; height: 44px; }
  .head-right { min-width: 0; gap: 8px; }
  .speed-pill .sp-fig small { display: none; }
  #profilePill { max-width: 150px; }
  .rail-btn.active::before { display: none; }
  .home-cards { grid-template-columns: 1fr; }
  .browse { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .browse .col { max-height: 130px; }
  .live-layout { grid-template-columns: 1fr; grid-template-rows: 200px 150px 1fr; }
  .live-layout .col:first-child { grid-row: 2; }
  .stage-head { padding-top: 14px; }
  .clock { display: none; }
  .th-vol { display: none; }
}

/* ---------------- catch-up (TV archive) ---------------- */
.cu-box { border-top: 1px solid var(--stroke); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.cu-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 14.5px; }
.cu-head svg { width: 16px; height: 16px; color: var(--brand-2); }
.cu-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.cu-day { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-mute); margin: 8px 0 3px; }
.cu-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--r-sm);
  text-align: left; cursor: pointer;
  transition: background .15s;
}
.cu-row:hover { background: var(--surface-2); }
.cu-time { font-size: 12px; color: var(--text-dim); flex: none; }
.cu-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cu-play { flex: none; color: var(--text-mute); display: grid; place-items: center; }
.cu-play svg { width: 14px; height: 14px; }
.cu-row:hover .cu-play { color: var(--brand-2); }

/* ---------------- multi-view ---------------- */
.mv-wrap { height: 100%; display: flex; flex-direction: column; gap: 10px; }
.mv-grid {
  flex: 1; min-height: 0;
  display: grid; gap: 10px;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.mv-tile {
  position: relative; overflow: hidden;
  background: #000; border-radius: var(--r-md);
  border: 1px solid var(--stroke);
  min-height: 0;
}
.mv-tile.audio { border-color: var(--brand-1); box-shadow: 0 0 0 1px rgba(109,94,252,.5); }
.mv-tile video { width: 100%; height: 100%; object-fit: contain; display: block; }
.mv-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-mute); font-size: 13.5px; font-weight: 600;
  background: var(--surface); cursor: pointer;
  transition: color .15s, background .15s;
}
.mv-empty:hover { color: var(--text); background: var(--surface-2); }
.mv-empty svg { width: 26px; height: 26px; }
.mv-tile.filled .mv-empty { display: none; }
.mv-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: none; align-items: center; gap: 6px;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.78));
  opacity: 0; transition: opacity .18s;
}
.mv-tile.filled .mv-bar { display: flex; }
.mv-tile.filled:hover .mv-bar { opacity: 1; }
.mv-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-btn {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  color: rgba(255,255,255,.8); background: rgba(255,255,255,.12);
  cursor: pointer; transition: background .15s;
}
.mv-btn:hover { background: rgba(255,255,255,.25); color: #fff; }
.mv-btn svg { width: 14px; height: 14px; }
.mv-audio-badge {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 8px;
  display: none; place-items: center;
  background: rgba(109,94,252,.85); color: #fff;
}
.mv-audio-badge svg { width: 14px; height: 14px; }
.mv-tile.audio .mv-audio-badge { display: grid; }
.mv-hint { font-size: 12px; margin: 0; flex: none; }

/* Connection capacity: what this subscription will actually serve at once.
   Colour is a second signal only — the sentence always says it in words. */
.mv-cap {
  flex: none; display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; border-radius: var(--r-md);
  border: 1px solid var(--stroke); background: var(--surface);
}
.mv-cap-ic { display: grid; place-items: center; flex: none; }
.mv-cap-ic svg { width: 18px; height: 18px; }
.mv-cap-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mv-cap-body b { font-size: 13px; font-weight: 700; }
.mv-cap-body span { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.mv-cap .btn { margin-left: auto; flex: none; }
.mv-cap.sev-bad  { border-color: rgba(240,74,94,.45); background: rgba(240,74,94,.09); }
.mv-cap.sev-bad  b, .mv-cap.sev-bad  .mv-cap-ic { color: var(--danger); }
.mv-cap.sev-warn { border-color: rgba(245,181,68,.45); background: rgba(245,181,68,.09); }
.mv-cap.sev-warn b, .mv-cap.sev-warn .mv-cap-ic { color: var(--warn); }
.mv-cap.sev-ok   { border-color: rgba(47,210,125,.35); background: rgba(47,210,125,.07); }
.mv-cap.sev-ok   b, .mv-cap.sev-ok   .mv-cap-ic { color: var(--ok); }

/* A tile the provider wouldn't serve: says why, in words, with a way out. */
.mv-tile.blocked { border-color: rgba(240,74,94,.6); }
.mv-tile.blocked .mv-empty, .mv-tile.blocked .mv-bar { display: none; }
.mv-blocked {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 16px; text-align: center;
  background: linear-gradient(180deg, rgba(26,13,18,.96), rgba(16,8,12,.96));
}
.mv-blocked-ic { color: var(--danger); display: grid; place-items: center; }
.mv-blocked-ic svg { width: 22px; height: 22px; }
.mv-blocked b { font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-blocked-why { font-size: 11.5px; color: var(--danger); line-height: 1.35; }
.mv-blocked-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

.mv-pick { display: flex; flex-direction: column; gap: 12px; max-width: 460px; }
.mv-pick-head { display: flex; align-items: center; justify-content: space-between; }
.mv-pick-head h3 { margin: 0; }
.mv-pick-list { min-height: 200px; max-height: 44vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.mv-pick-load { display: flex; align-items: center; gap: 10px; justify-content: center;
  padding: 34px 10px; color: var(--text-mute); font-size: 13px; }

/* Which subscription feeds this tile. One chip per saved line: how much of it
   is in use, and an explicit FULL state instead of a click that does nothing. */
.mv-pick-lines { display: flex; gap: 8px; flex-wrap: wrap; }
.mv-line-chip {
  display: flex; align-items: center; gap: 8px; min-height: 40px;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--stroke); background: var(--surface); color: var(--text-dim);
  font-size: 12.5px; transition: border-color .15s, background .15s, color .15s;
}
.mv-line-chip:hover { color: var(--text); border-color: var(--stroke-2); }
.mv-line-chip b { font-size: 10.5px; letter-spacing: .08em; color: var(--text-mute); }
.mv-line-chip span { max-width: 13ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-line-chip small { font-size: 10.5px; color: var(--text-mute); font-weight: 700; }
.mv-line-chip.on { border-color: var(--brand-1); background: var(--brand-soft); color: var(--text); }
.mv-line-chip.on b { color: #b9b0ff; }
.mv-line-chip.full { border-color: rgba(240,74,94,.5); background: rgba(240,74,94,.09); }
.mv-line-chip.full small { color: var(--danger); }
.mv-line-chip.add { color: var(--info); border-style: dashed; }
.mv-line-chip.add svg { width: 14px; height: 14px; }

/* The LINE badge on a playing tile — proof that combining actually worked. */
.mv-line {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  padding: 3px 9px; border-radius: 999px; pointer-events: none;
  background: rgba(6,8,15,.72); backdrop-filter: blur(6px);
  border: 1px solid var(--stroke-2); color: #cfc9ff;
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Add-a-subscription dialog (the browser can hold as many lines as you like). */
.mv-add { max-width: 440px; display: flex; flex-direction: column; gap: 14px; }
.mv-add-form { display: flex; flex-direction: column; gap: 12px; }
.mv-add-form .tabs { margin-bottom: 2px; }
.mv-add-form .field { margin: 0; }
.mv-add-hint, .mv-add-note { margin: 6px 0 0; font-size: 11.5px; color: var(--text-mute); line-height: 1.5; }
.mv-add-note { border-top: 1px solid var(--stroke); padding-top: 10px; }
.mv-add .panel-actions { display: flex; gap: 10px; }

/* ---------------- parental PIN modal ---------------- */
.pin-modal { max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.pin-input { font-size: 22px; letter-spacing: 10px; text-align: center; }

/* ---------------- tier lock notices ---------------- */
.im-lock {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--r-sm);
  background: rgba(255, 84, 112, .12); border: 1px solid rgba(255, 84, 112, .35);
  color: var(--text); font-size: 13px; line-height: 1.45;
}
.im-lock svg { width: 16px; height: 16px; flex: none; color: var(--danger); }
.im-lock.warn { background: rgba(245, 181, 68, .10); border-color: rgba(245, 181, 68, .35); }
.im-lock.warn svg { color: var(--warn); }
