:root {
  color-scheme: dark;
  --ink: #fbf8ff;
  --soft: #d3c6e3;
  --muted: #ab9ebd;
  --border: #594170;
  --accent: #d655ff;
}
body {
  display: grid;
  grid-template-columns: clamp(155px, 16vw, 232px) minmax(0, 1fr);
  gap: clamp(12px, 1.7vw, 30px);
  padding: 7px 12px 9px 8px;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(ellipse at 72% -15%, #3e145c 0, transparent 53%),
    radial-gradient(ellipse at 8% 94%, #21122f 0, transparent 45%), #100d1a;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.sidebar {
  width: 100%;
  min-width: 0;
  height: calc(100vh - 16px);
  top: 7px;
  gap: 14px;
  padding: clamp(10px, 1.2vw, 19px);
  border-color: #57456e65;
  background: linear-gradient(142deg, #251b34, #171424 54%, #181423);
  box-shadow: inset 0 1px #b98cf214, 0 6px 22px #08041166;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  font-size: clamp(17px, 2vw, 32px);
  font-weight: 770;
  letter-spacing: -.06em;
  white-space: nowrap;
}
.brand img {
  display: block;
  width: clamp(44px, 5.4vw, 88px);
  margin-bottom: 2px;
  mix-blend-mode: lighten;
}
.brand b { color: #c13df1; }
.sidebar nav { gap: 4px; }
.sidebar nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 10px;
  white-space: nowrap;
}
.nav-icon { width: 1.35em; flex: none; color: #e0d6eb; font-size: 1.2em; text-align: center; }
.sidebar nav button:hover, .settings-shortcuts button:hover, .stack button:hover { background-color: #3a2751; }
.sidebar nav button.active, button.primary, .live-layout button[aria-pressed="true"] {
  color: #fff;
  border-color: #ce64fa;
  background: linear-gradient(178deg, #ac31de 0%, #821db2 60%, #5c1682 100%);
  box-shadow: inset 0 1px 6px #f0a6ff58, 0 0 12px #bd45ed57;
}
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid #f2c1ff;
  outline-offset: 2px;
  box-shadow: 0 0 14px #bb4ff3;
}
.profile { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 14px 0 3px; font-size: .82rem; }
.profile small { display: block; color: var(--soft); }
.profile small#status::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #47f489; }
.profile-icon {
  position: relative;
  width: 36px;
  height: 36px;
  border: 1px solid #ce70ff;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 86%, #c750ff, #502079 65%, #241539);
}
.profile-icon::before, .profile-icon::after { content: ""; position: absolute; left: 50%; background: #ecc4ff; transform: translateX(-50%); }
.profile-icon::before { width: 10px; height: 10px; top: 7px; border-radius: 50%; }
.profile-icon::after { width: 17px; height: 9px; bottom: 5px; border-radius: 10px 10px 5px 5px; }
.profile .app-version { margin: 0; color: var(--muted); font-size: .65rem; }
main { min-width: 0; padding: 0; }
.page-header { min-height: clamp(49px, 5.4vw, 86px); gap: 12px; }
.page-header h1 { margin: 0; text-align: left; font-size: clamp(24px, 3vw, 49px); line-height: 1; letter-spacing: -.045em; }
.header-meta { display: flex; align-items: center; gap: clamp(9px, 1.7vw, 26px); font-size: clamp(10px, 1.12vw, 16px); }
.clock { display: grid; text-align: right; line-height: 1.18; }
.clock time { font-size: 1.25em; font-weight: 650; }
.clock small { color: var(--soft); }
.connection { padding-left: 12px; border-left: 1px solid #69547e; font-weight: 630; white-space: nowrap; }
.connection::before { content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .55em; border-radius: 50%; background: #ac8bc0; }
.connection.connected::before { background: #43ef8d; box-shadow: 0 0 8px #43ef8d75; }
#content { min-width: 0; }
.shelf { min-width: 0; margin: 0 0 clamp(7px, 1.05vw, 18px); }
.shelf-heading h3, .film-categories h3, .live-layout h3, .live-guide h3 { color: var(--ink); margin: 0 0 5px; font-size: clamp(13px, 1.45vw, 23px); }
body[data-view="Início"] .shelf-heading h3 { color: #e8ddef; text-transform: uppercase; font-size: clamp(12px, 1.24vw, 20px); }
.shelf-row {
  display: grid;
  grid-auto-flow: column;
  gap: clamp(5px, .75vw, 13px);
  min-width: 0;
  padding: 4px 3px 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #634485 transparent;
  scroll-snap-type: x proximity;
}
.shelf-row .tile {
  isolation: isolate;
  width: 100%;
  height: auto;
  min-width: 0;
  aspect-ratio: var(--tile-ratio);
  border-color: #ad93c346;
  border-radius: clamp(6px, .82vw, 14px);
  background: linear-gradient(140deg, #39254f, #1b1529 65%, #100c17);
  scroll-snap-align: start;
}
.featured-row { grid-auto-columns: calc((100% - 24px) / 3); --tile-ratio: 2.09; }
.poster-row { grid-auto-columns: calc((100% - 64px) / 8); --tile-ratio: .78; }
.channel-card-row { grid-auto-columns: calc((100% - 45px) / 6); --tile-ratio: 2.32; }
.series-card-row { grid-auto-columns: calc((100% - 40px) / 6); --tile-ratio: 1.74; }
.resume-card-row { grid-auto-columns: calc((100% - 30px) / 4); --tile-ratio: 2.7; }
.shelf-row .tile:hover { border-color: #dd82ff; }
.shelf-row .tile img { display: block; position: absolute; inset: 0; }
.tile-caption { position: absolute; inset: auto 0 0; display: grid; justify-items: start; gap: 3px; padding: 8% 7% 6%; pointer-events: none; }
.tile-caption.with-title { background: linear-gradient(transparent, #090612eb); }
.tile .tile-caption strong { position: static; padding: 0; background: none; font-size: clamp(10px, 1.14vw, 18px); line-height: 1.16; }
.tile.featured .tile-caption, .tile.resume-card .tile-caption { padding-right: 25%; }
.featured .tile-caption strong { text-transform: uppercase; letter-spacing: .12em; }
.tile-play { position: absolute; bottom: 13%; right: 5%; display: grid; place-items: center; width: clamp(17px, 2.15vw, 32px); aspect-ratio: 1; font-size: .65em; border: 1px solid #e68fff; border-radius: 50%; background: linear-gradient(#b944e6, #66208d); color: #fff; }
.tile-caption small { font-size: clamp(8px, .82vw, 13px); }
.tile progress { width: 100%; height: 5px; accent-color: var(--accent); }
.shelf-row .channel-card { background: radial-gradient(ellipse at top, #62307d, #231734 73%); }
.shelf-row .channel-card:nth-child(3n + 1) { background: radial-gradient(ellipse at top, #792755, #331323 78%); }
.shelf-row .channel-card:nth-child(3n) { background: radial-gradient(ellipse at top, #352a6e, #1c1835 78%); }
.channel-card .tile-caption { inset: 0; align-content: center; justify-items: center; text-align: center; }
.channel-card .tile-caption.with-title { background: none; }
.channel-card img { object-fit: contain; padding: 4% 12% 24%; }
.channel-card.has-artwork .tile-caption { align-content: end; }
.channel-card small::before { content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .4em; border-radius: 50%; background: #ff435c; }
.shelf-empty { margin: 4px 0 0; padding: 8px 12px; border: 1px solid #6d50863b; border-radius: 8px; color: var(--soft); background: #1e162b; font-size: .85rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.film-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  min-height: clamp(195px, 19vw, 330px);
  margin-bottom: 10px;
  border: 1px solid #866aa04f;
  border-radius: 16px;
  background: radial-gradient(ellipse at 65% 70%, #572448, #241737 68%, #140f20);
}
.film-hero img { position: absolute; top: 0; right: 0; width: 67%; height: 100%; object-fit: cover; object-position: center 38%; z-index: -2; }
.film-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #150e20 5%, #1c1229 26%, #21152a45 59%, transparent), linear-gradient(0deg, #130d22, transparent 38%); }
.film-info { max-width: 62%; padding: 14px 3%; }
.hero-label { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #8c2bb0; font-size: .72rem; }
.film-info h3 { color: #fff; margin: 7px 0; font-size: clamp(24px, 4vw, 67px); line-height: .95; letter-spacing: .13em; }
.film-info p { max-width: 31ch; margin: 6px 0; font-size: clamp(11px, 1.13vw, 17px); line-height: 1.35; }
.film-info button { margin: 5px 5px 0 0; padding: 6px 10px; font-size: clamp(10px, 1vw, 16px); }
.films-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 15%); gap: clamp(8px, 1vw, 20px); }
.film-categories { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow: auto; max-height: 40vh; }
.film-categories button { text-align: left; padding: 6px 8px; font-size: clamp(10px, 1vw, 17px); }
.film-categories button[aria-pressed="true"] { border-color: #c867f1; background: #54266d; }
.films-layout .poster-row { grid-auto-columns: calc((100% - 51px) / 7); }
.films-layout .resume-card-row { grid-auto-columns: calc((100% - 24px) / 3); }
.live-layout { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 1.73fr) minmax(0, 1.85fr); gap: 9px; }
.live-layout .panel, .live-guide { min-width: 0; padding: 8px; background: linear-gradient(152deg, #241a39, #191426 72%); border-color: #65478572; }
.live-layout .stack { gap: 4px; max-height: clamp(185px, 29vw, 475px); scrollbar-width: thin; }
.live-layout .stack button {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: clamp(28px, 3.15vw, 54px);
  padding: 4px 7px;
  font-size: clamp(9px, 1vw, 16px);
  background-color: #2c2140;
  border-color: #6e568166;
}
.live-layout .stack button[aria-pressed="true"] { border-color: #f09aff; }
.category-icon, .channel-arrow { color: #f3dcff; flex: none; }
.live-categories small, .channel-arrow { margin-left: auto; }
.channel-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.channel-name strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-name img { width: clamp(17px, 3vw, 55px); height: clamp(14px, 2vw, 32px); object-fit: contain; }
.channel-number { min-width: 2.3em; }
.channel-arrow { font-size: .72em; opacity: .35; }
.live-channels button[aria-pressed="true"] .channel-arrow { opacity: 1; }
.live-preview .channel-preview, .channel-placeholder {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  border: 1px solid #a175bf86;
  border-radius: 10px;
  background: radial-gradient(ellipse at 46% 51%, #443173, #261943 56%, #120e21);
}
.channel-placeholder { display: grid; place-items: center; color: var(--soft); font-size: .9rem; }
.preview-actions { gap: 5px; margin-top: 5px; }
.preview-actions button { padding: 5px 7px; font-size: clamp(10px, .93vw, 15px); }
.on-air { margin-top: 8px; padding: 6px 8px; border: 1px solid #69467c; border-radius: 8px; background: #2b1e3e; }
.on-air h3 { font-size: clamp(12px, 1.2vw, 19px); color: #ebacff; }
.on-air p, .preview-status { margin: 4px 0 0; font-size: .76rem; color: var(--soft); }
.live-guide { margin-top: 10px; }
.guide-header { min-height: 28px; margin-bottom: 3px; }
.guide-header time { color: var(--soft); font-size: .8rem; }
.guide-line { display: grid; grid-template-columns: clamp(78px, 12vw, 175px) minmax(0, 1fr); gap: 3px; margin-top: 3px; font-size: clamp(9px, .95vw, 15px); }
.guide-line > .channel-name { padding: 2px 4px; background: #21182e; border-radius: 4px; }
.guide-hours { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); color: var(--soft); }
.guide-hours time { padding-left: 4px; border-left: 1px solid #7256857a; }
.guide-track { position: relative; min-height: clamp(21px, 2.2vw, 33px); border-radius: 4px; background: repeating-linear-gradient(90deg, #38294d 0, #38294d calc(20% - 1px), #211830 calc(20% - 1px), #211830 20%); }
.guide-track small { padding: 3px 6px; }
.guide-programme { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 5px; overflow: hidden; white-space: nowrap; border: 1px solid #a66cce; border-radius: 4px; background: #5f2e7c; }

body[data-view="Definições"] { background: radial-gradient(ellipse at 48% -50%, #c268ff 0, #571e92 30%, #20123f 47%, transparent 61%), radial-gradient(ellipse at 42% 85%, #462569, #16112a 57%, #0c0a17); }
.settings {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(90px, .59fr) minmax(245px, 1.45fr) minmax(155px, 1fr);
  align-items: start;
  gap: clamp(9px, 1.25vw, 20px);
  margin: clamp(5px, 2vw, 32px) 0 0;
  padding: 0 0 30px;
}
.settings::before { content: ""; position: absolute; z-index: -1; height: 90%; width: 55%; bottom: -35px; left: 0; background: url('assets/landscape.jpg') center 62% / cover; opacity: .72; mask-image: linear-gradient(180deg, transparent, #000 42%, #000 68%, transparent), linear-gradient(90deg, #000 35%, transparent); mask-composite: intersect; }
.settings-brand { padding-top: clamp(42px, 9vw, 150px); font-style: italic; }
.settings-brand img { width: clamp(40px, 7vw, 120px); }
.settings-forms { min-width: 0; }
.settings form {
  gap: clamp(7px, 1vw, 17px);
  padding: clamp(12px, 2.1vw, 36px);
  border-radius: clamp(12px, 1.8vw, 30px);
  border-color: #995dc487;
  background: linear-gradient(151deg, #522980ee, #261a3ced 61%, #30204dd9);
  box-shadow: 0 16px 50px #0b06199e, inset 0 2px 15px #bc5ef632;
}
.settings form h2 { margin: 0 0 3px; color: #fff; font-size: clamp(18px, 2.25vw, 38px); letter-spacing: -.04em; }
.settings form label { color: #f4e7ff; font-size: clamp(11px, 1.08vw, 16px); font-weight: 650; }
.settings form input { min-height: 35px; padding: clamp(6px, 1vw, 14px); border-color: #8757ae; border-radius: 8px; background: #4a3268; font-weight: 400; }
.settings form input::placeholder { color: #cab1e3; }
.settings form .primary { margin: 3px 0; padding: 8px; border: 2px solid #f0ceff; box-shadow: 0 0 15px #d15cfa, inset 0 0 12px #d870ed; font-weight: 700; }
.settings form p { margin: 0; color: #f3defc; font-size: .85rem; }
.settings form p:empty { display: none; }
.settings-forms > button { padding: 5px 10px; font-size: .8rem; }
.settings-shortcuts { display: grid; gap: 8px; margin: 0; padding: clamp(8px, 1.4vw, 22px); border: 1px solid #6f4a9385; border-radius: 17px; background: linear-gradient(145deg, #2b1d42e8, #211633bd); }
.settings-shortcuts button { min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left; padding: clamp(7px, 1.15vw, 17px); background-color: #39294c; border-color: #7b549c85; }
.settings-shortcuts button[aria-pressed="true"] { background-color: #4b3266; border-color: #aa69cc; }
.shortcut-icon { color: #ebcaff; font-size: 1.35em; }
.shortcut-caption { min-width: 0; display: grid; gap: 2px; }
.shortcut-caption strong { font-size: clamp(10px, 1.14vw, 18px); }
.shortcut-caption small { color: #ddcee8; font-size: clamp(8px, .81vw, 13px); }
.shortcut-arrow { margin-left: auto; color: #ebcaff; }

@media (min-width: 701px) and (max-height: 670px) {
  .sidebar { gap: 8px; }
  .sidebar nav { overflow-y: auto; }
  .sidebar nav button { min-height: 31px; font-size: .82rem; }
  .profile { padding-top: 7px; }
}
@media (max-width: 900px) {
  .settings { grid-template-columns: minmax(0, 1.4fr) minmax(135px, 1fr); }
  .settings-brand { display: none; }
  .live-layout { grid-template-columns: minmax(105px, .8fr) minmax(0, 1.3fr) minmax(0, 1.6fr); }
  .preview-actions button { min-height: 29px; }
}
@media (max-width: 700px) {
  body { display: block; padding: 6px 9px; }
  .sidebar { position: relative; top: 0; height: auto; gap: 8px; margin-bottom: 6px; padding: 7px; }
  .sidebar #brand { align-self: start; padding-left: 4px; }
  .sidebar .brand { flex-direction: row; gap: 4px; }
  .sidebar .brand img { width: 32px; }
  .sidebar nav { gap: 4px; padding: 2px 3px 4px; }
  .sidebar nav button { gap: 4px; font-size: .84rem; }
  .profile { display: none; }
  .featured-row { grid-auto-columns: minmax(190px, 66%); }
  .poster-row, .films-layout .poster-row { grid-auto-columns: minmax(75px, 24%); }
  .channel-card-row, .series-card-row { grid-auto-columns: minmax(100px, 32%); }
  .resume-card-row, .films-layout .resume-card-row { grid-auto-columns: minmax(124px, 48%); }
  .tile .tile-caption strong { font-size: 11px; }
  .films-layout { display: flex; flex-direction: column; }
  .film-categories { order: -1; flex-direction: row; align-items: center; overflow-x: auto; }
  .film-categories h3, .film-categories button { flex: none; }
  .film-hero { min-height: 180px; }
  .film-info { max-width: 72%; }
  .live-layout { grid-template-columns: minmax(100px, .7fr) minmax(0, 1.3fr); }
  .live-preview { grid-column: 1 / -1; }
  .live-preview .channel-preview, .channel-placeholder { max-height: 50vh; }
  .settings { gap: 9px; }
}
@media (max-width: 440px) {
  .settings { display: flex; flex-direction: column; }
  .settings-forms, .settings-shortcuts { width: 100%; }
  .settings-shortcuts { order: -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.channel-programme { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-badge {
  display: inline-grid;
  place-items: center;
  width: 1.6em;
  aspect-ratio: 1;
  margin-right: .42em;
  border: 1px solid #ad78ce;
  border-radius: 8px;
  background: linear-gradient(145deg, #794795, #50306b);
  font-size: .8em;
  vertical-align: middle;
}
.password-box { position: relative; display: grid; }
.settings form .password-box input { padding-right: 70px; }
.password-box button { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); padding: 4px 6px; border: 0; color: #f3deff; background: #4a3268; font-size: .75rem; }
.xtream-form .primary::before {
  content: "";
  display: inline-block;
  margin-right: .5em;
  border: .32em solid transparent;
  border-left: .5em solid currentColor;
  border-right: 0;
}
.guide-hours { position: relative; }
.guide-now { position: absolute; bottom: -3px; height: 12px; width: 2px; background: #e18aff; box-shadow: 0 0 5px #d75fff; }
.password-box button { top: auto; bottom: 6px; transform: none; }
.demo-preview { position: relative; overflow: hidden; }
.demo-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.demo-preview-label { position: absolute; top: 6px; left: 6px; padding: 2px 5px; border-radius: 4px; color: #fff; background: #5e267e; font-size: .7rem; }
.live-guide .guide-header { display: flex; justify-content: space-between; }
.ui-icon {
  width: 1.12em;
  height: 1.12em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar nav .ui-icon { width: 1.24em; height: 1.24em; color: #e6d7f2; }
.icon-control { display: inline-flex; align-items: center; justify-content: center; gap: .55em; }
.icon-control[hidden] { display: none; }
.profile #profile-link { width: 100%; display: flex; align-items: center; gap: .6rem; padding: 0; min-width: 0; text-align: left; border: 0; background: transparent; font-size: inherit; }
.profile #profile-link > span:last-child { min-width: 0; }
.profile #status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-icon { flex: none; }
.profile-card { min-width: 0; padding: clamp(13px, 2vw, 25px); }
.profile-card h2 { display: flex; align-items: center; gap: .45em; }
.profile-card dl { display: grid; grid-template-columns: minmax(85px, 1fr) minmax(0, 1fr); gap: .55rem; margin: 0 0 14px; }
.profile-card dd { margin: 0; color: #eacadf; overflow-wrap: anywhere; }
.profile-card dt { color: var(--soft); }
.profile-card form { margin: 0; padding: 0; background: transparent; border: 0; box-shadow: none; }
.reserve-addresses { border: 1px solid #a773d063; border-radius: 9px; padding: 8px 10px; }
.reserve-addresses summary { cursor: pointer; color: #f4deff; font-size: .86rem; font-weight: 650; }
.reserve-addresses small { display: block; margin-top: 6px; color: var(--soft); }
.reserve-addresses label { margin-top: 8px; }
.live-channels .stack button > .ui-icon:last-child { margin-left: auto; opacity: .55; }
.settings-shortcuts .ui-icon { color: #ebcaff; }
.preview-frame { position: relative; }
.preview-frame .frame-start { position: absolute; z-index: 1; top: 48%; left: 50%; transform: translate(-50%, -50%); min-height: 42px; padding: 8px 15px; white-space: nowrap; }
.preview-actions { gap: 8px; margin-top: 8px; }
.preview-actions button { min-height: 36px; padding: 6px 12px; }
.preview-actions button[aria-pressed="true"] { color: #f1c7ff; border-color: #cf75ff; background: #47215d; }
.preview-actions button[aria-pressed="true"] .ui-icon { fill: currentColor; }
#player #error:empty { display: none; }
#player #close { float: right; }
#player #playing { padding-right: 105px; }

.list-library { display: grid; justify-items: start; gap: 12px; }
.list-library h2, .list-library h3, .list-library p { margin: 0; }
.list-library a { color: #edb8ff; }
.saved-list-rows { width: 100%; }
.saved-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.saved-list strong { flex: 1 1 120px; overflow-wrap: anywhere; }
.saved-list button, .live-list-tools button { padding: 6px 10px; }
.live-list-tools { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.settings form .save-list-option { display: flex; align-items: center; gap: 7px; }
.settings form .save-list-option input { min-height: 0; width: 16px; height: 16px; accent-color: var(--accent); }

.public-list-buttons { display: flex; flex-wrap: wrap; }
.public-list-buttons button { margin: 0 8px 8px 0; }

html, body { height: 100%; overflow: hidden; }
body { min-height: 0; height: 100vh; }
aside.sidebar { min-height: 0; }
.sidebar nav { min-height: 0; overflow-y: auto; }
.sidebar .app-version { margin-top: auto; color: var(--muted); }
main { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.page-header { flex: none; display: flex; align-items: center; justify-content: space-between; }
.header-meta > * + * { margin-left: 8px; }
.header-meta button { white-space: nowrap; }
#header-list { max-width: 22vw; overflow: hidden; text-overflow: ellipsis; }
#content { flex: 1 1 0; min-height: 0; overflow: auto; padding: 4px; }
.tv-shortcuts { flex: none; }
.series-layout { display: flex; height: 100%; min-height: 0; }
.series-categories { flex: 0 0 23%; min-width: 0; display: flex; flex-direction: column; margin-right: 10px; }
.series-categories h3 { margin: 0 0 8px; }
.series-categories .stack, .series-results { overflow: auto; min-height: 0; padding: 4px; }
.series-categories button { display: block; width: 100%; margin-bottom: 5px; text-align: left; }
.series-categories button[aria-pressed=true] { background: #821db2; }
.series-results { flex: 1; min-width: 0; }
.preview-frame .native-video { display: block; width: 100%; height: 17vw; background: transparent; }
.preview-frame [hidden] { display: none !important; }
.preview-frame .preview-status {
  position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%);
  max-width: 85%; padding: 8px 14px; border-radius: 8px;
  color: white; background: rgba(0, 0, 0, .82); text-align: center;
}
.preview-frame.live-fullscreen {
  position: fixed; z-index: 100; top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
}
.preview-frame.live-fullscreen video, .preview-frame.live-fullscreen .native-video {
  display: block; width: 100%; height: 100%; max-height: none; object-fit: contain;
}
@media (max-width: 760px) {
  .page-header { flex-wrap: wrap; padding-bottom: 5px; }
  .header-meta { flex-wrap: wrap; gap: 4px; }
  #header-list { max-width: 40vw; }
  .series-layout { flex-direction: column; }
  .series-categories { flex: 0 1 auto; max-height: 32%; margin: 0 0 8px; }
}
.preview-status.buffering::before {
  content: ""; display: inline-block; vertical-align: middle; width: .85em; height: .85em;
  border: 2px solid #fff5; border-top-color: #fff; border-radius: 50%; margin-right: .6em;
  animation: preview-spinner .75s linear infinite;
}
@keyframes preview-spinner { to { transform: rotate(360deg); } }

.sidebar #brand { margin-bottom: 30px; }
.sidebar nav button { transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease; }
.sidebar nav button:focus, .sidebar nav button:hover { background-color: #3a2751; }
.header-meta button { display: inline-flex; align-items: center; }
.header-meta .ui-icon { flex: none; margin-right: .45em; }
#header-list #status { overflow: hidden; text-overflow: ellipsis; }
.header-meta > * + * { margin-left: 12px; }

.home-dashboard { margin: 9px 4px 24px; }
.home-primary, .home-shortcuts { display: flex; }
.home-primary > button, .home-shortcuts > button { flex: 1 1 0; min-width: 0; }
.home-primary > button + button, .home-shortcuts > button + button { margin-left: 14px; }
.home-entry {
  min-height: 24vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 18px; font-size: clamp(18px, 2.5vw, 40px); font-weight: 700;
}
.home-entry .ui-icon { width: 2.1em; height: 2.1em; margin: 0 0 14px; }
.home-primary .home-entry-tv { background: linear-gradient(145deg, #175767, #163250); border-color: #6399ae; }
.home-primary .home-entry-film { background: linear-gradient(145deg, #6c3152, #421f45); border-color: #a96085; }
.home-primary .home-entry-series { background: linear-gradient(145deg, #493c83, #302251); border-color: #8773b9; }
.home-shortcuts { margin-top: 14px; }
.home-shortcuts button { min-height: 60px; justify-content: center; }

.favorite-marker[hidden] { display: none !important; }
.favorite-marker { flex: none; color: #ffa6d1; }
.favorite-marker svg, .preview-favorite[aria-pressed=true] .ui-icon { fill: currentColor; }
.live-channels .favorite-marker { margin-left: auto; }
.tile .favorite-marker { position: absolute; z-index: 2; top: 8px; right: 8px; padding: 5px; border-radius: 50%; background: #2c1739; }
.preview-favorite[aria-pressed=true] { color: #ffa6d1; border-color: #bb75a1; }

.detail-heading { margin-bottom: 16px; }
.detail-heading h2 { margin-top: 0; }
.detail-actions { display: flex; }
.detail-actions button + button { margin-left: 10px; }
.episode-layout { display: flex; align-items: flex-start; }
.season-choices { flex: 0 0 24%; max-height: 55vh; overflow: auto; margin-right: 18px; }
.season-choices button { display: block; width: 100%; margin-bottom: 7px; text-align: left; }
.season-choices button[aria-pressed=true] { background: #671f8c; border-color: #ba68df; }
.episode-list { min-width: 0; flex: 1; max-height: 62vh; overflow: auto; padding: 4px; }
.episode-list h3, .episode-list p { margin: 0 0 10px; }
.episode-entry { display: flex; width: 100%; min-height: 50px; align-items: center; text-align: left; margin-bottom: 8px; }
.episode-entry small { min-width: 3em; color: var(--soft); }
.episode-entry strong { flex: 1; }
.episode-entry .ui-icon { margin-left: 8px; }

.list-maintenance { margin: 16px 0 6px; }
.public-address-form { display: block; margin: 14px 0; }
.public-address-form label, .public-address-form textarea { display: block; width: 100%; }
.public-address-form textarea { margin: 6px 0 10px; padding: 8px; color: var(--ink); background: #1e172c; border: 1px solid var(--border); border-radius: 8px; }
.public-address-form button { margin-right: 8px; }

body.native-live, body.native-live .native-live-panel,
body.native-live .native-live-frame { background: transparent; }
.native-video-backdrop {
  position: fixed; z-index: -1; pointer-events: none;
  box-shadow: 0 0 0 200vmax #181222;
}
.preview-frame .native-video { border: 0; }
.live-fullscreen:focus { outline: none; }
@media (max-width: 760px) {
  .sidebar #brand { margin-bottom: 0; }
  .home-primary > button + button, .home-shortcuts > button + button { margin-left: 6px; }
  .home-entry { min-height: 18vh; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar nav button { transition: none; }
}
.tile.has-favorite-marker { position: relative; }
.tv-ui .sidebar nav button { padding-left: 12px; }
.tv-ui .sidebar #brand + nav { margin-top: 0; }
