:root {
  --bg: #0f1114;
  --panel: rgba(21, 24, 28, 0.94);
  --panel-solid: #15181c;
  --panel-raised: #1a1e23;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #eef1f4;
  --muted: #9ca5af;
  --muted-strong: #cbd1d7;
  --accent: #5b7485;
  --accent-dark: #4d6375;
  --accent-soft: rgba(91, 116, 133, 0.15);
  --danger: #9b6870;
  --danger-soft: rgba(155, 104, 112, 0.14);
  --warning: #8c7d61;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 300px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  background:
    radial-gradient(circle at 0 0, rgba(91, 116, 133, 0.1), transparent 32rem),
    radial-gradient(circle at 100% 100%, rgba(65, 79, 91, 0.1), transparent 38rem),
    var(--bg);
}

body.player-open,
body.detail-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
  touch-action: manipulation;
}

button,
a,
select,
.media-card,
.recording-card,
.episode-card {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.background-glow {
  position: fixed;
  z-index: 0;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(95px);
  opacity: 0.15;
}

.background-glow-one {
  top: -14rem;
  left: 30%;
  background: #5b7485;
}

.background-glow-two {
  right: -12rem;
  bottom: -16rem;
  background: #414f5b;
}

.site-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 0.94fr);
  min-height: 100vh;
}

.brand-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  padding: clamp(3rem, 7vw, 7rem);
  overflow: hidden;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(150deg, rgba(15, 27, 38, 0.92), rgba(8, 11, 18, 0.96)),
    var(--bg);
}

.brand-panel::before {
  position: absolute;
  width: 32rem;
  height: 32rem;
  right: -16rem;
  bottom: -14rem;
  border: 1px solid rgba(91, 116, 133, 0.1);
  border-radius: 50%;
  box-shadow:
    0 0 0 4rem rgba(91, 116, 133, 0.025),
    0 0 0 8rem rgba(91, 116, 133, 0.018);
  content: "";
}

.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 1rem;
  place-items: center;
  border: 1px solid rgba(91, 116, 133, 0.35);
  border-radius: 17px;
  color: var(--accent);
  background: var(--accent-soft);
}

.brand-mark svg {
  width: 36px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.3;
}

.brand-mark svg path:nth-child(2) {
  fill: currentColor;
  stroke: none;
}

.brand-name {
  margin-bottom: clamp(4rem, 11vh, 8rem);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-name span,
.mobile-brand span,
.topbar-brand strong {
  color: var(--accent);
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-panel h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(3.2rem, 6vw, 6.8rem);
  font-weight: 780;
  letter-spacing: -0.065em;
  line-height: 0.94;
}

.brand-copy {
  max-width: 620px;
  margin: 1.8rem 0 0;
  color: var(--muted-strong);
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  line-height: 1.7;
}

.feature-list {
  display: flex;
  margin: 2.4rem 0 0;
  padding: 0;
  flex-wrap: wrap;
  gap: 1rem 1.7rem;
  color: var(--muted-strong);
  font-size: 0.9rem;
  list-style: none;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-check {
  display: inline-grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.72rem;
  font-weight: 900;
}

.login-card-wrap {
  display: grid;
  min-height: 100vh;
  padding: 2rem;
  place-items: center;
}

.login-card {
  width: min(100%, 490px);
  padding: clamp(2rem, 4vw, 3.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.mobile-brand {
  display: none;
}

.login-card h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.7rem);
  letter-spacing: -0.045em;
}

.form-intro {
  margin: 0.75rem 0 2rem;
  color: var(--muted);
  line-height: 1.6;
}

.login-tabs {
  display: grid;
  margin: 1.4rem 0 0;
  padding: 4px;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 8, 13, 0.58);
}

.login-tab {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 800;
}

.login-tab.is-active {
  color: var(--text);
  background: rgba(91, 116, 133, 0.15);
  box-shadow: inset 0 0 0 1px rgba(91, 116, 133, 0.22);
}

.login-tab:focus-visible,
.section-tab:focus-visible,
.category-picker select:focus-visible {
  outline: 3px solid rgba(91, 116, 133, 0.42);
  outline-offset: 2px;
}

.field {
  display: grid;
  margin-top: 1.15rem;
  gap: 0.55rem;
}

.field > span:first-child {
  color: var(--muted-strong);
  font-size: 0.8rem;
  font-weight: 750;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap > svg,
.search-box svg,
.button svg,
.usage-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.input-wrap > svg {
  position: absolute;
  left: 1rem;
  width: 19px;
  color: #707c8e;
  pointer-events: none;
}

.input-wrap input,
.search-box input {
  width: 100%;
  border: 1px solid var(--line-strong);
  outline: none;
  color: var(--text);
  background: rgba(6, 9, 15, 0.68);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-wrap input {
  min-height: 54px;
  padding: 0.8rem 4.25rem 0.8rem 3rem;
  border-radius: var(--radius-sm);
}

.input-wrap input::placeholder,
.search-box input::placeholder {
  color: #687386;
}

.input-wrap input:focus,
.search-box input:focus {
  border-color: rgba(91, 116, 133, 0.68);
  background: rgba(7, 12, 18, 0.9);
  box-shadow: 0 0 0 4px rgba(91, 116, 133, 0.12);
}

.input-action {
  position: absolute;
  right: 0.9rem;
  padding: 0.4rem;
  border: 0;
  cursor: pointer;
  color: var(--accent);
  background: transparent;
  font-size: 0.75rem;
  font-weight: 800;
}

.button {
  display: inline-flex;
  min-height: 43px;
  padding: 0.7rem 1rem;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  gap: 0.55rem;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 150ms ease, filter 150ms ease, border-color 150ms ease, background 150ms ease;
}

.button:hover {
  filter: brightness(1.08);
}

.button:active {
  transform: translateY(1px);
}

.button:focus-visible,
.icon-button:focus-visible,
.player-back-button:focus-visible,
.player-tool-button:focus-visible,
.player-backdrop:focus-visible,
.input-action:focus-visible {
  outline: 3px solid rgba(91, 116, 133, 0.42);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.35);
  opacity: 0.6;
}

.button-primary {
  color: #f7f8fa;
  background: linear-gradient(135deg, #657f94, #536d80);
  box-shadow: 0 12px 28px rgba(27, 35, 42, 0.25);
}

.button-secondary {
  border-color: var(--line-strong);
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.045);
}

.button-secondary svg {
  width: 18px;
}

.button-quiet {
  min-height: 38px;
  border-color: var(--line);
  color: var(--muted-strong);
  background: transparent;
}

.button-danger {
  border-color: rgba(255, 108, 124, 0.2);
  color: #ff9aa5;
  background: var(--danger-soft);
}

.button-wide {
  width: 100%;
  min-height: 54px;
  margin-top: 1.6rem;
}

.button.is-loading .button-label {
  opacity: 0.7;
}

.button-loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.button.is-loading .button-loader {
  display: block;
}

.login-help {
  margin: 1.5rem 0 0;
  color: #758093;
  font-size: 0.76rem;
  line-height: 1.55;
  text-align: center;
}

.message {
  margin: 0 0 1.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(91, 116, 133, 0.3);
  border-radius: 11px;
  color: #c4d0d9;
  background: rgba(91, 116, 133, 0.1);
  font-size: 0.84rem;
  line-height: 1.45;
}

.message-error {
  border-color: rgba(255, 108, 124, 0.24);
  color: #ffabb4;
  background: var(--danger-soft);
}

.library-layout,
.portal-layout {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 72px;
  padding: 0 5vw;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 21, 25, 0.96);
  backdrop-filter: blur(22px);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.topbar-brand strong {
  font-weight: 900;
}

.topbar-logo,
.mobile-logo {
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: #f7f8fa !important;
  background: var(--accent);
}

.topbar-logo {
  width: 34px;
  height: 34px;
  font-size: 0.65rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.section-nav {
  display: flex;
  padding: 4px;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 8, 13, 0.55);
}

.section-tab {
  min-height: 36px;
  padding: 0.5rem 0.85rem;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 800;
  transition: color 150ms ease, background 150ms ease;
}

.section-tab:hover {
  color: var(--text);
}

.section-tab.is-active {
  color: #f7f8fa;
  background: var(--accent);
}

.account-label {
  display: flex;
  max-width: 360px;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.account-label span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.library-content,
.portal-content {
  width: min(1380px, 92vw);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5.5rem) 0 5rem;
}

.welcome-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.welcome-row h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.subtle {
  color: var(--muted);
}

.welcome-row .subtle {
  margin: 0.8rem 0 0;
}

.usage-card {
  display: grid;
  margin-top: 2.2rem;
  padding: 1.2rem 1.35rem;
  align-items: center;
  grid-template-columns: auto minmax(240px, 0.75fr);
  gap: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(120deg, rgba(91, 116, 133, 0.1), rgba(21, 24, 28, 0.9));
}

.usage-copy {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.usage-copy p {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.usage-copy strong {
  font-size: 0.94rem;
}

.usage-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  color: var(--accent);
  background: var(--accent-soft);
}

.usage-icon svg {
  width: 23px;
}

.usage-meter-wrap {
  display: grid;
  align-items: center;
  grid-template-columns: 1fr 44px;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.usage-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.usage-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #536d80, #71899c);
  box-shadow: 0 0 14px rgba(91, 116, 133, 0.26);
  transition: width 400ms ease;
}

.library-toolbar {
  display: flex;
  margin: 2.5rem 0 1.2rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.catalog-toolbar {
  display: grid;
  margin: 2.5rem 0 1.2rem;
  align-items: end;
  grid-template-columns: minmax(190px, 250px) minmax(240px, 390px) 1fr;
  gap: 1rem;
}

.catalog-toolbar .recording-count {
  justify-self: end;
  padding-bottom: 0.85rem;
}

.recent-activity {
  display: grid;
  margin: 0 0 1.5rem;
  gap: 1.35rem;
}

.activity-section {
  min-width: 0;
}

.activity-heading {
  display: flex;
  margin-bottom: 0.7rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.activity-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.recent-search-list {
  display: flex;
  padding-bottom: 0.15rem;
  gap: 0.55rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.recent-search-chip {
  min-height: 36px;
  padding: 0.5rem 0.8rem;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted-strong);
  background: rgba(18, 23, 32, 0.86);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 750;
}

.recent-search-chip:hover,
.recent-search-chip:focus-visible {
  border-color: rgba(91, 116, 133, 0.72);
  color: var(--text);
  background: rgba(91, 116, 133, 0.18);
}

.history-row {
  display: grid;
  padding: 0 0 0.65rem;
  grid-auto-columns: minmax(168px, 200px);
  grid-auto-flow: column;
  gap: 0.85rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-width: thin;
}

.history-row.history-row-live {
  grid-auto-columns: minmax(285px, 340px);
}

.history-card {
  scroll-snap-align: start;
}

.history-card .media-meta {
  min-height: 2.3em;
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.history-card .media-actions .button {
  width: 100%;
}

.history-progress {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 0;
  left: 0;
  height: 5px;
  background: rgba(0, 0, 0, 0.58);
}

.history-progress > span {
  display: block;
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, #71899c, #9fb6c7);
  box-shadow: 0 0 12px rgba(113, 137, 156, 0.55);
}

.category-picker {
  display: grid;
  gap: 0.5rem;
  color: var(--muted-strong);
  font-size: 0.76rem;
  font-weight: 750;
}

.category-picker select {
  min-height: 45px;
  padding: 0.65rem 2.4rem 0.65rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: 0;
  color: var(--text);
  background: #0b0f17;
}

.category-picker select:disabled {
  opacity: 0.6;
}

.search-box {
  position: relative;
  display: flex;
  width: min(100%, 390px);
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 0.9rem;
  width: 18px;
  color: #768194;
  pointer-events: none;
}

.search-box input {
  min-height: 45px;
  padding: 0.65rem 1rem 0.65rem 2.8rem;
  border-radius: 11px;
}

.recording-count {
  color: var(--muted);
  font-size: 0.8rem;
}

.recording-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}

.media-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(24, 30, 43, 0.92), rgba(14, 18, 27, 0.96));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.15);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.media-card:hover {
  transform: translateY(-2px);
  border-color: rgba(91, 116, 133, 0.48);
  box-shadow: 0 19px 45px rgba(0, 0, 0, 0.23);
}

.media-card.is-returned {
  border-color: rgba(91, 116, 133, 0.72);
  box-shadow: 0 0 0 1px rgba(91, 116, 133, 0.38), 0 16px 36px rgba(0, 0, 0, 0.22);
}

.media-art {
  position: relative;
  display: grid;
  aspect-ratio: 2 / 3;
  place-items: center;
  overflow: hidden;
  color: var(--accent);
  background:
    radial-gradient(circle at 72% 20%, rgba(91, 116, 133, 0.18), transparent 35%),
    linear-gradient(145deg, #20262c, #12161a);
}

.media-live .media-art {
  aspect-ratio: 16 / 10;
}

.media-art img {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #10151e;
}

.media-live .media-art img {
  padding: 12%;
  object-fit: contain;
}

.media-fallback {
  position: relative;
  z-index: 0;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.favorite-toggle {
  position: absolute;
  z-index: 3;
  top: 0.55rem;
  left: 0.55rem;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  cursor: pointer;
  color: #f4e4b4;
  background: rgba(8, 10, 14, 0.62);
  font-size: 1rem;
  line-height: 1;
  backdrop-filter: blur(8px);
}

.favorite-toggle.is-active {
  color: #f6d36a;
  background: rgba(12, 16, 22, 0.78);
}

.favorite-toggle:hover,
.favorite-toggle:focus-visible {
  border-color: rgba(246, 211, 106, 0.45);
}

.media-card.is-saved {
  box-shadow: inset 0 0 0 1px rgba(246, 211, 106, 0.16);
}

.media-badge {
  position: absolute;
  z-index: 2;
  top: 0.7rem;
  right: 0.7rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #f8d48c;
  background: rgba(5, 8, 13, 0.72);
  font-size: 0.64rem;
  font-weight: 850;
  backdrop-filter: blur(8px);
}

.media-body {
  padding: 0.95rem;
}

.media-body h2 {
  margin: 0;
  overflow: hidden;
  font-size: 0.92rem;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-meta {
  min-height: 1.2em;
  margin: 0.4rem 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-epg {
  display: grid;
  gap: 0.18rem;
  margin: 0.35rem 0 0;
}

.media-epg p {
  display: flex;
  min-width: 0;
  align-items: baseline;
  margin: 0;
  overflow: hidden;
  font-size: 0.72rem;
  line-height: 1.35;
}

.media-epg em {
  flex: 0 0 auto;
  margin-right: 0.4rem;
  color: var(--accent);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.media-epg span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epg-now {
  color: var(--text);
}

.epg-next {
  color: var(--muted);
}

.media-epg time {
  flex: 0 0 auto;
  margin-left: 0.4rem;
  color: var(--muted);
  font-size: 0.64rem;
}

.media-actions {
  display: grid;
  margin-top: 0.85rem;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
}

.media-live .media-actions {
  grid-template-columns: minmax(0, 1fr) auto;
}

.media-actions .button {
  min-height: 39px;
  padding: 0.55rem 0.7rem;
  font-size: 0.76rem;
}

.media-actions svg {
  width: 16px;
}

.record-button {
  padding-inline: 0.65rem !important;
}

.record-button svg {
  fill: var(--danger);
  stroke: var(--danger);
}

.load-more-wrap {
  display: flex;
  padding-top: 1.5rem;
  justify-content: center;
}

.link-card {
  display: grid;
  margin-top: 2rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
  gap: clamp(2rem, 6vw, 6rem);
  border: 1px solid rgba(91, 116, 133, 0.38);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 0 0, rgba(91, 116, 133, 0.12), transparent 45%),
    var(--panel);
  box-shadow: var(--shadow);
}

.link-card h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  letter-spacing: -0.045em;
}

.link-card > div > p:last-child {
  max-width: 570px;
  color: var(--muted);
  line-height: 1.65;
}

.link-form .button-wide {
  margin-top: 1.15rem;
}

.dvr-clean-link {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.dvr-clean-link a {
  color: #c5d4de;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid rgba(197, 212, 222, 0.35);
}

.dvr-clean-link a:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.dvr-offer-card {
  display: grid;
  margin-top: 2rem;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1.4rem, 4vw, 2.8rem);
  border: 1px solid rgba(91, 116, 133, 0.38);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 0 0, rgba(91, 116, 133, 0.16), transparent 48%),
    var(--panel);
  box-shadow: var(--shadow);
}

.dvr-offer-visual {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border: 1px solid rgba(91, 116, 133, 0.42);
  border-radius: 22px;
  background: linear-gradient(145deg, #29333c, #1c2228);
}

.dvr-offer-rec {
  color: #e7eef3;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.dvr-offer-copy h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.045em;
}

.dvr-offer-copy > p:not(.eyebrow) {
  max-width: 34rem;
  margin: 0 0 1.25rem;
  color: var(--muted);
  line-height: 1.65;
}

.dvr-offer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.entitlement-view {
  display: grid;
  min-height: calc(100vh - 10rem);
  align-items: center;
  grid-template-columns: minmax(280px, 0.8fr) minmax(520px, 1.2fr);
  gap: clamp(2rem, 5vw, 5rem);
}

.entitlement-copy {
  max-width: 560px;
}

.entitlement-copy h1 {
  margin: 0;
  font-size: clamp(2.7rem, 5vw, 5rem);
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.entitlement-copy > p:not(.eyebrow, .trust-note) {
  color: var(--muted-strong);
  line-height: 1.7;
}

.entitlement-shield {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 1.5rem;
  place-items: center;
  border: 1px solid rgba(91, 116, 133, 0.52);
  border-radius: 18px;
  color: #dbe2e7;
  background: linear-gradient(145deg, #29333c, #1c2228);
  font-size: 1.5rem;
  font-weight: 900;
}

.auth-steps {
  display: grid;
  margin-top: 2rem;
  gap: 0.7rem;
}

.auth-step {
  display: flex;
  min-height: 48px;
  padding: 0.65rem 0.8rem;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #15191d;
  font-size: 0.82rem;
  font-weight: 750;
}

.auth-step b {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 7px;
  color: #dbe2e7;
  background: #29333c;
}

.auth-step.is-complete {
  border-color: rgba(118, 150, 129, 0.35);
  color: #b9c9bf;
}

.auth-step.is-complete b {
  background: #40564a;
}

.trust-note {
  margin: 1rem 0 0;
  color: #7f8993;
  font-size: 0.74rem;
  line-height: 1.55;
}

.entitlement-view .link-card {
  margin-top: 0;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

.catalog-browser {
  min-width: 0;
}

.category-rail {
  display: none;
}

.category-title {
  margin: 0;
  color: #b9c4cd;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.previous-list-button {
  display: inline-flex;
  width: 100%;
  min-height: 38px;
  margin-top: 0.75rem;
  padding: 0.45rem 0.7rem;
  align-items: center;
  border: 1px solid rgba(91, 116, 133, 0.28);
  border-radius: 8px;
  cursor: pointer;
  gap: 0.45rem;
  color: var(--muted-strong);
  background: rgba(91, 116, 133, 0.08);
  font-size: 0.74rem;
  font-weight: 750;
}

.previous-list-button:hover {
  border-color: rgba(91, 116, 133, 0.5);
  color: var(--text);
  background: rgba(91, 116, 133, 0.16);
}

.previous-list-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.category-list {
  display: grid;
  margin-top: 0.75rem;
  gap: 3px;
}

.category-button {
  display: flex;
  width: 100%;
  min-height: 43px;
  padding: 0.55rem 0.7rem;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  gap: 0.65rem;
  color: var(--muted);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 750;
  text-align: left;
}

.category-button.favorites-category {
  color: #f4e4b4;
}

.category-button.favorites-category .category-star {
  width: auto;
  height: auto;
  color: #f6d36a;
  background: transparent;
  font-size: 0.92rem;
  line-height: 1;
}

.category-button.favorites-category.is-active {
  border-color: rgba(246, 211, 106, 0.32);
  color: #f6d36a;
  background: linear-gradient(90deg, rgba(246, 211, 106, 0.14), #20262c);
}

.category-button.favorites-category.is-active .category-star {
  background: transparent;
  box-shadow: none;
}

.category-divider {
  height: 1px;
  margin: 0.4rem 0.55rem 0.5rem;
  background: #303740;
}

.category-button:hover {
  color: var(--text);
  background: #1d2228;
}

.category-button:focus-visible {
  outline: 2px solid rgba(91, 116, 133, 0.68);
  outline-offset: 1px;
}

.category-button.is-active {
  border-color: #3a4651;
  color: #f4f6f8;
  background: linear-gradient(90deg, rgba(91, 116, 133, 0.24), #20262c);
}

.category-marker {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #505a64;
}

.category-button.is-active .category-marker {
  background: #8da5b7;
  box-shadow: 0 0 0 4px rgba(91, 116, 133, 0.13);
}

.section-icon {
  display: inline-grid;
  width: 23px;
  place-items: center;
  color: #71899c;
  font-size: 0.78rem;
}

.recording-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(24, 30, 43, 0.92), rgba(14, 18, 27, 0.96));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.15);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.recording-card:hover {
  transform: translateY(-2px);
  border-color: rgba(91, 116, 133, 0.44);
  box-shadow: 0 19px 45px rgba(0, 0, 0, 0.23);
}

.recording-art {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 8.7;
  padding: 1.2rem;
  align-content: end;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 25%, rgba(62, 224, 191, 0.25), transparent 28%),
    linear-gradient(145deg, #172638, #10141d 64%);
}

.recording-art::after {
  position: absolute;
  right: -25%;
  bottom: -85%;
  width: 90%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  box-shadow: 0 0 0 2.2rem rgba(255, 255, 255, 0.018);
  content: "";
}

.recording-card:nth-child(3n + 2) .recording-art {
  background:
    radial-gradient(circle at 76% 25%, rgba(64, 139, 230, 0.24), transparent 28%),
    linear-gradient(145deg, #192339, #10141d 64%);
}

.recording-card:nth-child(3n + 3) .recording-art {
  background:
    radial-gradient(circle at 76% 25%, rgba(157, 103, 229, 0.2), transparent 28%),
    linear-gradient(145deg, #242035, #10141d 64%);
}

.play-circle {
  position: relative;
  z-index: 1;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 50%;
  color: #f7f8fa;
  background: rgba(91, 116, 133, 0.96);
  box-shadow: 0 10px 28px rgba(27, 35, 42, 0.3);
  font-size: 0.78rem;
}

.recording-status {
  position: absolute;
  z-index: 2;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  padding: 0.35rem 0.58rem;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: #d7dde7;
  background: rgba(5, 8, 13, 0.62);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.recording-status.status-recording,
.recording-status.status-starting,
.recording-status.status-stopping {
  border-color: rgba(255, 108, 124, 0.35);
  color: #ffadb6;
  background: rgba(77, 16, 27, 0.7);
}

.recording-status.status-scheduled,
.recording-status.status-pending {
  border-color: rgba(248, 198, 107, 0.3);
  color: #ffda94;
  background: rgba(72, 49, 13, 0.68);
}

.recording-body {
  padding: 1.15rem 1.2rem 1.2rem;
}

.recording-body h2 {
  margin: 0;
  overflow: hidden;
  font-size: 1rem;
  letter-spacing: -0.018em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recording-channel {
  min-height: 1.2em;
  margin: 0.38rem 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.77rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recording-meta {
  display: flex;
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 0.45rem 0.95rem;
  color: #7f8a9b;
  font-size: 0.7rem;
}

.recording-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.recording-actions {
  display: grid;
  margin-top: 1rem;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
}

.recording-actions .button {
  min-height: 40px;
}

.recording-actions .button-danger {
  width: 42px;
  padding: 0;
}

.recording-actions svg {
  width: 17px;
}

.empty-state {
  padding: clamp(3.5rem, 9vw, 7rem) 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: rgba(17, 22, 33, 0.52);
  text-align: center;
}

.empty-state.compact {
  padding: 3rem 1.5rem;
}

.empty-state h2 {
  margin: 1rem 0 0.45rem;
  font-size: 1.3rem;
}

.empty-state p {
  max-width: 500px;
  margin: 0 auto 1.4rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.empty-icon {
  display: inline-grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 50%;
  color: #f7f8fa;
  background: var(--accent);
}

.skeleton-card {
  min-height: 310px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
}

.skeleton-card::after {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.055) 45%, transparent 65%);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}

.detail-overlay {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  padding: clamp(1rem, 4vw, 3rem);
  place-items: center;
  overflow: hidden;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 4, 8, 0.9);
  backdrop-filter: blur(16px);
}

.detail-panel {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(1080px, 100%);
  max-height: calc(100dvh - 3rem);
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: #0e121b;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.65);
}

.detail-header {
  display: grid;
  padding: 1.15rem 1.3rem;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.2rem;
  border-bottom: 1px solid var(--line);
}

.detail-header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.detail-header .eyebrow {
  margin-bottom: 0.25rem;
}

.detail-header .subtle {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
}

.detail-content {
  padding: 1.4rem;
  overflow-y: auto;
}

.detail-plot {
  max-width: 850px;
  margin: 0 0 1.4rem;
  color: var(--muted-strong);
  font-size: 0.86rem;
  line-height: 1.65;
}

.detail-loading {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  color: var(--muted);
}

.episode-grid {
  display: grid;
  gap: 0.75rem;
}

.episode-card {
  display: grid;
  padding: 1rem;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
}

.episode-card .eyebrow {
  margin-bottom: 0.3rem;
  font-size: 0.6rem;
}

.episode-card h3 {
  margin: 0;
  font-size: 0.94rem;
}

.episode-card .subtle {
  margin: 0.3rem 0 0;
  font-size: 0.72rem;
}

.player-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: clamp(1rem, 4vw, 3rem);
  place-items: center;
  overflow: hidden;
}

.player-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  cursor: default;
  background: rgba(2, 4, 8, 0.88);
  backdrop-filter: blur(16px);
}

.player-panel {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(1180px, 100%);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - clamp(2rem, 8vw, 6rem));
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: #0e121b;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.65);
}

.player-header {
  display: grid;
  min-height: 92px;
  padding: 1rem 1.2rem;
  align-items: center;
  flex: 0 0 auto;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.2rem;
  border-bottom: 1px solid var(--line);
}

.player-header .eyebrow {
  margin-bottom: 0.32rem;
  font-size: 0.62rem;
}

.player-title-copy {
  min-width: 0;
}

.player-header h2 {
  margin: 0;
  overflow: hidden;
  font-size: 1.2rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-header .subtle {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
}

.player-back-button,
.player-tool-button {
  display: inline-flex;
  min-height: 42px;
  padding: 0.65rem 0.85rem;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  cursor: pointer;
  gap: 0.45rem;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.76rem;
  font-weight: 800;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.player-back-button:hover,
.player-tool-button:hover {
  border-color: rgba(91, 116, 133, 0.54);
  color: var(--text);
  background: rgba(91, 116, 133, 0.12);
}

.player-back-button svg,
.player-tool-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.player-header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.04);
  font-size: 1.5rem;
}

.video-frame {
  position: relative;
  display: grid;
  min-height: 0;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  flex: 1 1 auto;
  background: #000;
}

.video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
}

.channel-zap {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
}

.channel-zap-button {
  position: absolute;
  right: 0.75rem;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  color: rgba(238, 241, 244, 0.88);
  background: rgba(8, 10, 14, 0.38);
  backdrop-filter: blur(8px);
  transition: opacity 160ms ease, background 160ms ease, border-color 160ms ease;
}

.channel-zap-button:nth-last-child(2) {
  top: 16%;
}

.channel-zap-button:last-child {
  bottom: 22%;
}

.return-list-button {
  top: auto;
  right: auto;
  bottom: 22%;
  left: 0.75rem;
}

.channel-zap-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.video-frame:hover .channel-zap-button,
.channel-zap.is-visible .channel-zap-button,
.channel-zap-button:focus-visible {
  opacity: 1;
}

.channel-zap-button:hover,
.channel-zap-button:focus-visible {
  border-color: rgba(91, 116, 133, 0.5);
  background: rgba(12, 16, 22, 0.62);
}

.channel-zap-toast {
  position: absolute;
  z-index: 5;
  top: 0.85rem;
  left: 0.85rem;
  display: grid;
  max-width: min(72%, 22rem);
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text);
  background: rgba(8, 10, 14, 0.58);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.channel-zap-toast.is-visible {
  opacity: 1;
  transform: none;
}

.channel-zap-toast span:first-child {
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.channel-zap-toast strong {
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-zap-toast span:last-child {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: none) {
  .channel-zap-button {
    opacity: 0.4;
  }
}

.player-panel:fullscreen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: #000;
}

.player-panel:fullscreen .video-frame {
  flex: 1 1 100%;
}

.video-frame video:fullscreen {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  background: #000;
}

.video-loading,
.video-error {
  position: absolute;
  inset: 0;
  display: flex;
  padding: 1.5rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.8rem;
  color: var(--muted-strong);
  background: #000;
  font-size: 0.85rem;
  text-align: center;
}

.video-error strong {
  color: #ff9aa5;
  font-size: 1.05rem;
}

.video-error span {
  max-width: 450px;
  color: var(--muted);
  line-height: 1.5;
}

.large-loader {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

.noscript-message {
  position: fixed;
  z-index: 200;
  inset: 1rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--danger);
  color: var(--text);
  background: var(--bg);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

@media (min-width: 901px) {
  .portal-layout {
    min-height: 100vh;
    padding-left: 232px;
    background:
      radial-gradient(circle at 18% 0, rgba(91, 116, 133, 0.06), transparent 32rem),
      linear-gradient(160deg, #121519, #101317 58%, #0e1013);
  }

  .portal-layout .topbar {
    position: fixed;
    z-index: 30;
    top: 0;
    bottom: 0;
    left: 0;
    width: 232px;
    min-height: 100vh;
    padding: 1.7rem 1rem 1.1rem;
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
    border-right: 1px solid #293039;
    border-bottom: 0;
    background: #121519;
    box-shadow: 10px 0 28px rgba(0, 0, 0, 0.18);
    backdrop-filter: none;
  }

  .topbar-brand {
    min-height: 44px;
    padding: 0 0.55rem;
    font-size: 0.92rem;
  }

  .topbar-logo {
    width: 36px;
    height: 36px;
    border: 1px solid #697f91;
    background: #536d80;
  }

  .section-nav {
    display: grid;
    width: 100%;
    margin-top: 3.2rem;
    padding: 0;
    align-items: stretch;
    gap: 0.38rem;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .section-tab {
    display: flex;
    width: 100%;
    min-height: 50px;
    padding: 0.7rem 0.85rem;
    align-items: center;
    justify-content: flex-start;
    border: 1px solid transparent;
    border-radius: 9px;
    gap: 0.65rem;
    color: #aeb6bf;
    font-size: 0.82rem;
  }

  .section-tab:hover {
    border-color: #303943;
    background: #1a1f25;
  }

  .section-tab.is-active {
    border-color: #3c4852;
    color: #f4f6f8;
    background: linear-gradient(90deg, rgba(91, 116, 133, 0.22), #1c2127);
    box-shadow: inset 3px 0 0 #71899c;
  }

  .topbar-actions {
    width: 100%;
    margin-top: auto;
    padding-top: 1rem;
    align-items: stretch;
    flex-direction: column;
    border-top: 1px solid #293039;
  }

  .account-label {
    max-width: none;
    padding: 0.2rem 0.65rem;
    line-height: 1.45;
  }

  .button-quiet {
    width: 100%;
    justify-content: flex-start;
    border-color: #303740;
    background: #171b20;
  }

  .portal-content {
    width: auto;
    max-width: 1680px;
    margin: 0 auto;
    padding: 2.2rem clamp(1.6rem, 3vw, 3.5rem) 5rem;
  }

  .welcome-row {
    align-items: center;
  }

  .welcome-row h1 {
    font-size: clamp(2.25rem, 4vw, 3.7rem);
  }

  .catalog-browser {
    display: grid;
    margin-top: 1.8rem;
    align-items: start;
    grid-template-columns: 214px minmax(0, 1fr);
    gap: 1.25rem;
  }

  .category-rail {
    position: sticky;
    top: 1.5rem;
    display: block;
    max-height: calc(100vh - 3rem);
    padding: 1rem 0.7rem;
    overflow-y: auto;
    border: 1px solid #303740;
    border-radius: 12px;
    background: linear-gradient(180deg, #191d22, #15181c);
  }

  .category-title {
    padding: 0 0.7rem 0.35rem;
  }

  .catalog-results {
    min-width: 0;
  }

  .catalog-toolbar {
    margin: 0 0 1rem;
    grid-template-columns: minmax(240px, 420px) 1fr;
  }

  .catalog-toolbar .category-picker {
    display: none;
  }

  .media-grid.catalog-live {
    grid-template-columns: repeat(auto-fill, minmax(315px, 1fr));
  }

  .media-grid.catalog-movie,
  .media-grid.catalog-series,
  .media-grid.catalog-favorites {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  }

  .media-card {
    border-radius: 11px;
    background: linear-gradient(145deg, #1b1f24, #16191e);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  }

  .media-card:hover {
    transform: none;
    box-shadow: inset 0 0 0 1px rgba(91, 116, 133, 0.25), 0 13px 28px rgba(0, 0, 0, 0.22);
  }

  .media-live {
    display: grid;
    min-height: 128px;
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .media-live .media-art {
    height: 100%;
    min-height: 126px;
    aspect-ratio: auto;
    border-right: 1px solid #303740;
  }

  .media-live .media-body {
    display: flex;
    min-width: 0;
    padding: 0.9rem;
    justify-content: center;
    flex-direction: column;
  }

  .media-live .media-actions {
    margin-top: 0.7rem;
  }

  .recording-card {
    border-radius: 11px;
    background: linear-gradient(145deg, #1b1f24, #16191e);
  }
}

@media (max-width: 1100px) {
  .login-layout {
    grid-template-columns: minmax(300px, 0.82fr) minmax(400px, 1fr);
  }

  .brand-panel {
    padding: 3rem;
  }

  .brand-panel h1 {
    font-size: clamp(3rem, 6vw, 4.8rem);
  }

  .feature-list {
    display: grid;
  }

  .recording-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .link-card {
    grid-template-columns: minmax(0, 1fr) minmax(290px, 390px);
    gap: 2rem;
  }
}

@media (hover: none) {
  .button:hover,
  .media-card:hover,
  .recording-card:hover,
  .section-tab:hover,
  .category-button:hover,
  .player-back-button:hover,
  .player-tool-button:hover {
    transform: none;
    filter: none;
  }
}

@media (max-width: 900px) {
  .topbar {
    padding: calc(0.45rem + env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) 0.55rem max(1rem, env(safe-area-inset-left, 0px));
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
  }

  .section-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .section-nav::-webkit-scrollbar {
    display: none;
  }

  .section-icon {
    display: none;
  }

  .section-tab {
    display: inline-flex;
    min-height: 44px;
    flex: 1 1 0;
    min-width: 0;
    align-items: center;
    justify-content: center;
    padding-inline: 0.45rem;
    font-size: 0.72rem;
  }

  .catalog-browser {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }

  .category-rail {
    display: block;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
  }

  .category-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .previous-list-button {
    width: auto;
    min-height: 36px;
    margin: 0 0 0.45rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    font-size: 0.7rem;
  }

  .category-list {
    display: flex;
    margin: 0;
    padding: 0.15rem 0 0.35rem;
    gap: 0.45rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-list::-webkit-scrollbar {
    display: none;
  }

  .category-button {
    width: auto;
    min-height: 40px;
    padding: 0.45rem 0.85rem;
    flex: 0 0 auto;
    border: 1px solid #303740;
    border-radius: 999px;
    background: #171b20;
    white-space: nowrap;
  }

  .category-button.is-active {
    border-color: #4d6375;
    background: rgba(91, 116, 133, 0.22);
  }

  .category-button.favorites-category {
    border-color: rgba(246, 211, 106, 0.28);
  }

  .category-button.favorites-category.is-active {
    border-color: rgba(246, 211, 106, 0.5);
    background: rgba(246, 211, 106, 0.14);
  }

  .category-divider {
    display: none;
  }

  .catalog-toolbar {
    margin-top: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .catalog-toolbar .category-picker {
    display: none;
  }

  .input-wrap input,
  .search-box input,
  .category-picker select,
  .login-tab {
    font-size: 16px;
  }

  .media-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .media-grid.catalog-live {
    grid-template-columns: 1fr;
  }

  .entitlement-view {
    min-height: auto;
    align-items: start;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .entitlement-copy {
    max-width: 680px;
  }
}

@media (max-width: 760px) {
  .login-layout {
    display: block;
  }

  .brand-panel {
    display: none;
  }

  .login-card-wrap {
    min-height: 100svh;
    min-height: 100dvh;
    padding: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
    align-items: start;
  }

  .login-card {
    width: 100%;
    padding: 1.35rem 1.2rem 1.5rem;
    border-radius: 18px;
  }

  .login-card h2 {
    font-size: 1.85rem;
  }

  .form-intro {
    margin-bottom: 1.15rem;
    font-size: 0.92rem;
  }

  .mobile-brand {
    display: flex;
    margin-bottom: 1.4rem;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
  }

  .mobile-logo {
    width: 33px;
    height: 33px;
    font-size: 0.6rem;
  }

  .login-tab,
  .button-wide,
  .input-wrap input {
    min-height: 48px;
  }

  .topbar {
    min-height: 0;
    padding-left: max(4vw, env(safe-area-inset-left, 0px));
    padding-right: max(4vw, env(safe-area-inset-right, 0px));
  }

  .account-label {
    max-width: 34vw;
  }

  .library-content,
  .portal-content {
    width: auto;
    max-width: none;
    padding: 1.25rem max(4vw, env(safe-area-inset-right, 0px)) max(2.5rem, env(safe-area-inset-bottom, 0px)) max(4vw, env(safe-area-inset-left, 0px));
  }

  .welcome-row {
    align-items: flex-start;
    justify-content: space-between;
    flex-direction: row;
    gap: 0.75rem;
  }

  .welcome-row h1 {
    font-size: 1.7rem;
    letter-spacing: -0.04em;
    line-height: 1.1;
  }

  .welcome-row .subtle {
    display: none;
  }

  .welcome-row .button {
    width: auto;
    min-width: 44px;
    padding-inline: 0.75rem;
  }

  .usage-card {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .library-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-toolbar .recording-count {
    justify-self: start;
    padding-bottom: 0;
  }

  .recent-activity {
    margin-bottom: 1.15rem;
    gap: 1.1rem;
  }

  .activity-heading {
    margin-bottom: 0.6rem;
  }

  .activity-heading h2 {
    font-size: 0.94rem;
  }

  .history-row {
    margin-right: calc(-1 * max(4vw, env(safe-area-inset-right, 0px)));
    padding-right: max(4vw, env(safe-area-inset-right, 0px));
    grid-auto-columns: minmax(148px, 44vw);
    gap: 0.7rem;
  }

  .history-row.history-row-live {
    grid-auto-columns: minmax(270px, 82vw);
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    min-height: 48px;
  }

  .recording-grid,
  .media-grid,
  .media-grid.catalog-movie,
  .media-grid.catalog-series,
  .media-grid.loading-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .media-grid.catalog-live {
    grid-template-columns: 1fr;
  }

  .media-live {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .media-live .media-art {
    height: 100%;
    min-height: 92px;
    aspect-ratio: auto;
  }

  .media-live .media-body {
    padding: 0.75rem;
  }

  .media-live .media-actions {
    margin-top: 0.6rem;
  }

  .media-body {
    padding: 0.75rem;
  }

  .media-actions .button {
    min-height: 42px;
  }

  .entitlement-copy h1 {
    font-size: 1.85rem;
  }

  .entitlement-shield {
    width: 52px;
    height: 52px;
  }

  .dvr-offer-card,
  .link-card {
    margin-top: 1.25rem;
    padding: 1.15rem;
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .dvr-offer-visual {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }

  .dvr-offer-copy h2,
  .link-card h2 {
    font-size: 1.45rem;
  }

  .detail-overlay,
  .player-overlay {
    padding: 0;
  }

  .detail-panel,
  .player-panel {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .detail-header {
    padding: calc(0.85rem + env(safe-area-inset-top, 0px)) 1rem 0.85rem;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .detail-content {
    padding: 1rem 1rem max(1.25rem, env(safe-area-inset-bottom, 0px));
  }

  .episode-card {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .episode-card .button {
    width: 100%;
    min-height: 44px;
  }

  .player-header {
    min-height: 0;
    padding: calc(0.7rem + env(safe-area-inset-top, 0px)) 0.85rem 0.7rem;
    grid-template-columns: 1fr auto;
    gap: 0.65rem;
  }

  .player-title-copy {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .player-header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .player-back-button {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .player-header h2 {
    font-size: 1rem;
  }

  .video-frame {
    flex: 1 1 auto;
    aspect-ratio: auto;
    min-height: 0;
  }

  .channel-zap-button {
    opacity: 0.42;
    width: 34px;
    height: 34px;
  }

  .channel-zap-toast {
    top: 0.65rem;
    left: 0.65rem;
    max-width: min(78%, 18rem);
  }
}

@media (max-width: 760px) and (orientation: landscape) {
  .welcome-row .eyebrow,
  .welcome-row .subtle {
    display: none;
  }

  .welcome-row h1 {
    font-size: 1.35rem;
  }

  .player-title-copy {
    display: none;
  }

  .player-header {
    padding: 0.45rem 0.75rem;
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }

  .player-back-button,
  .player-header-actions {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 420px) {
  .topbar-brand {
    font-size: 0.78rem;
    letter-spacing: 0;
  }

  .topbar-actions {
    gap: 0.5rem;
  }

  .account-label {
    display: none;
  }

  .button-quiet {
    padding-inline: 0.75rem;
    font-size: 0.75rem;
  }

  .section-tab {
    font-size: 0.68rem;
  }

  .media-actions {
    grid-template-columns: 1fr !important;
  }

  .media-live .media-actions {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .record-button span {
    display: inline;
  }

  .player-back-button span,
  .player-tool-button span {
    display: none;
  }

  .player-back-button,
  .player-tool-button {
    width: 44px;
    padding: 0;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
