:root {
  color-scheme: dark;
  --accent: #65e8ff;
  --accent-soft: #65e8ff20;
  --accent-glow: #65e8ff55;
  --ink: #07111f;
  --panel: #0b1828d9;
  --muted: #9aacc2;
  --line: #c2e8ff1b;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }

/* Login e bloqueio de assinatura da Luna */
body[data-luna-auth="pending"] > .space,
body[data-luna-auth="pending"] > .topbar,
body[data-luna-auth="pending"] > main,
body[data-luna-auth="pending"] > footer,
body[data-luna-auth="pending"] > .toast { display: none !important; }
#luna-auth-shell[hidden],
#luna-account-tools[hidden] { display: none !important; }
.luna-auth-shell [hidden] { display: none !important; }
.luna-auth-shell {
  position: fixed;
  z-index: 20000;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 22px;
  color: #f3f7ff;
  background: radial-gradient(ellipse at 50% 10%, #18344c 0, #07111f 55%, #050b13 100%);
}
.luna-auth-card {
  width: min(460px, 100%);
  padding: clamp(24px, 5vw, 36px);
  border: 1px solid #61d9ff38;
  border-radius: 21px;
  background: linear-gradient(155deg, #10243a, #0a1725);
  box-shadow: 0 30px 90px #0009;
}
.luna-auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 28px; font-size: 19px; font-weight: 850; letter-spacing: .07em; }
.luna-auth-brand small { color: #70d6f1; font-size: .75em; }
.luna-auth-orb { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid #65e8ff75; border-radius: 50%; color: #65e8ff; background: #65e8ff12; box-shadow: 0 0 22px #65e8ff20; }
.luna-auth-eyebrow { margin: 0 0 8px; color: #65e8ff; font-size: 11px; font-weight: 750; letter-spacing: .16em; }
.luna-auth-card h1 { margin: 0; font-size: clamp(25px, 6vw, 31px); }
.luna-auth-copy { color: #a4b6c9; font-size: 14px; line-height: 1.65; }
.luna-auth-form { display: grid; gap: 9px; margin-top: 23px; }
.luna-auth-options { display: grid; gap: 4px; margin-top: 15px; }
.luna-auth-secondary { width: 100%; min-height: 46px; margin-top: 8px; border: 1px solid #65e8ff45; border-radius: 10px; color: #eaf7ff; background: #65e8ff0b; font-size: 14px; font-weight: 700; cursor: pointer; }
.luna-auth-secondary:hover { border-color: #65e8ff; background: #65e8ff18; }
.luna-auth-secondary:disabled { opacity: .6; cursor: wait; }
.luna-auth-form label { margin-top: 5px; color: #c4d1df; font-size: 13px; }
.luna-auth-form input { width: 100%; height: 48px; padding: 0 13px; border: 1px solid #334960; border-radius: 10px; outline: none; color: #f4f8ff; background: #081523; font: inherit; font-size: 16px; }
.luna-auth-form input:focus { border-color: #65e8ff; box-shadow: 0 0 0 3px #65e8ff20; }
.luna-auth-primary { width: 100%; min-height: 49px; margin-top: 11px; border: 0; border-radius: 10px; color: #06202a; background: linear-gradient(100deg, #56d4ff, #77f0d1); font-size: 15px; font-weight: 800; cursor: pointer; }
.luna-auth-primary:disabled { opacity: .65; cursor: wait; }
.luna-auth-link { display: block; width: 100%; margin: 13px auto 0; padding: 8px; border: 0; color: #7ddcf6; background: none; font-size: 13px; cursor: pointer; }
.luna-auth-link:hover { color: #c9f4ff; }
.luna-auth-status { min-height: 20px; margin: 13px 0 0; color: #9ec3d8; font-size: 13px; line-height: 1.5; }
.luna-auth-status.is-error { color: #ffabb2; }
.luna-auth-foot { margin: 22px 0 0; padding-top: 14px; border-top: 1px solid #ffffff15; color: #8398ad; font-size: 12px; line-height: 1.55; }
.luna-auth-blocked { margin-top: 15px; }
.luna-auth-blocked .luna-auth-copy { padding: 13px; border: 1px solid #ffb45e38; border-radius: 10px; background: #ffb45e0b; }
.luna-plan-picker { margin-top: 24px; padding-top: 21px; border-top: 1px solid #ffffff18; }
.luna-plan-heading h2 { margin: 0; font-size: 21px; }
.luna-plan-heading .luna-auth-copy { margin: 8px 0 0; }
.luna-plan-list { display: grid; gap: 10px; margin-top: 17px; }
.luna-plan-card { padding: 15px; border: 1px solid #65e8ff30; border-radius: 13px; background: linear-gradient(130deg, #10263b, #0b1828); }
.luna-plan-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.luna-plan-card h3 { margin: 0; font-size: 16px; }
.luna-plan-price { margin: 8px 0 12px; color: #f3f7ff; font-size: 21px; font-weight: 800; }
.luna-plan-price small { margin-left: 4px; color: #9aacc2; font-size: 12px; font-weight: 500; }
.luna-plan-description { margin: 0 0 12px; color: #a4b6c9; font-size: 12px; line-height: 1.5; }
.luna-plan-buy { width: 100%; min-height: 42px; border: 0; border-radius: 9px; color: #06202a; background: linear-gradient(100deg, #56d4ff, #77f0d1); font-weight: 800; cursor: pointer; }
.luna-plan-buy:disabled { opacity: .58; cursor: wait; }
.luna-plan-empty { margin: 15px 0 0; padding: 12px; border: 1px solid #ffb45e38; border-radius: 10px; color: #ffd29b; background: #ffb45e0b; font-size: 13px; line-height: 1.5; }
.luna-checkout-status { margin: 12px 0 0; color: #9ec3d8; font-size: 13px; line-height: 1.5; }
.luna-checkout-status.is-error { color: #ffabb2; }
.luna-account-tools { position: relative; display: flex; align-items: center; }
.luna-account-core { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #61d9ff73; border-radius: 50%; color: #8deaff; background: radial-gradient(circle at 35% 32%, #d7fbff, #4ed7f8 24%, #153e67 58%, #0b1424 72%); box-shadow: 0 0 0 4px #61d9ff12, 0 0 24px #61d9ff40; font-size: 25px; cursor: pointer; }
.luna-account-core:hover,.luna-account-core[aria-expanded="true"] { transform: scale(1.06); box-shadow: 0 0 0 5px #61d9ff1d, 0 0 30px #61d9ff5b; }
.luna-account-menu { position: absolute; z-index: 30; top: calc(100% + 11px); right: 0; width: min(280px, calc(100vw - 24px)); padding: 14px; border: 1px solid #61d9ff3c; border-radius: 15px; background: #091727f5; box-shadow: 0 18px 48px #0009; }
.luna-account-menu b,.luna-account-menu small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.luna-account-menu b{color:#e8f6ff;font-size:12px}.luna-account-menu small{margin:5px 0 12px;color:#9aafc4;font-size:10px}.luna-account-menu button{width:100%;min-height:35px;margin-top:7px;border:1px solid #61d9ff2b;border-radius:9px;color:#ccecff;background:#61d9ff0d;font:inherit;font-size:11px;cursor:pointer}.luna-account-menu #luna-signout{border-color:#ff8b9538;color:#ffc1c7;background:#ff7c870d}
.luna-profile-dialog{width:min(560px,calc(100vw - 28px));padding:0;border:1px solid #61d9ff43;border-radius:20px;color:#edf7ff;background:#0a1829;box-shadow:0 28px 90px #000c}.luna-profile-dialog::backdrop{background:#020814d1;backdrop-filter:blur(5px)}.luna-profile-card{position:relative;padding:27px;display:grid;gap:17px}.luna-profile-card h2{margin:0;font-size:24px}.luna-profile-close{position:absolute;top:15px;right:15px;width:31px;height:31px;border:1px solid var(--line);border-radius:9px;color:#b8cce0;background:transparent;font-size:21px;cursor:pointer}.luna-profile-identity{display:flex;align-items:center;gap:14px;padding:14px;border:1px solid #61d9ff24;border-radius:14px;background:#61d9ff08}.luna-profile-avatar{width:70px;height:70px;display:grid;place-items:center;flex:0 0 auto;overflow:hidden;border:1px solid #61d9ff65;border-radius:50%;color:#9deeff;background:#123957;font-size:35px;cursor:pointer}.luna-profile-avatar img{width:100%;height:100%;object-fit:cover}.luna-profile-identity b,.luna-profile-identity small{display:block;max-width:340px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.luna-profile-identity b{font-size:15px}.luna-profile-identity small{margin-top:5px;color:#91a8be;font-size:11px}.luna-profile-photo-action{margin-top:9px;border:0;color:#75ddf9;background:none;font:inherit;font-size:11px;cursor:pointer}.luna-profile-form{display:grid;gap:9px}.luna-profile-form label{display:grid;gap:6px;color:#b8c9da;font-size:11px}.luna-profile-form input{min-height:42px;padding:0 11px;border:1px solid var(--line);border-radius:9px;color:#edf7ff;background:#06121f;font:inherit}.luna-profile-message{min-height:16px;margin:0;color:#87e7b7;font-size:11px}.luna-profile-plan{display:flex;align-items:center;justify-content:space-between;gap:13px;padding:15px;border:1px solid #9e89ff31;border-radius:14px;background:#9e89ff0a}.luna-profile-plan h3{margin:4px 0;font-size:16px}.luna-profile-plan p{margin:0;color:#a9bad0;font-size:11px}.luna-profile-plan button,.luna-profile-signout{min-height:37px;padding:0 12px;border:1px solid #61d9ff43;border-radius:9px;color:#bfeeff;background:#61d9ff0d;font:inherit;font-size:11px;cursor:pointer}.luna-profile-plan-list{display:grid;gap:9px}.luna-profile-plan-list .luna-plan-card{margin:0}.luna-profile-signout{border-color:#ff8b9538;color:#ffc1c7;background:#ff7c870d}
@media (max-width: 600px) {
  .luna-auth-shell { padding: 14px; }
  .luna-auth-card { padding: 25px 21px; }
  .luna-account-tools { max-width: 47vw; }
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: #f3f7ff;
  background: #050b16;
  font-family: inherit;
}

button, input, select { font: inherit; }
button { color: inherit; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.space {
  position: fixed;
  z-index: -2;
  inset: 0;
  background:
    radial-gradient(ellipse at 82% 25%, #163b665c 0, transparent 35%),
    radial-gradient(ellipse at 12% 78%, #152b4c55 0, transparent 38%),
    linear-gradient(125deg, #040811, #091628 55%, #050a13);
}

.space::after {
  position: absolute;
  inset: 0;
  content: "";
  opacity: .31;
  background-image:
    radial-gradient(1px 1px at 12% 24%, white 99%, transparent),
    radial-gradient(1px 1px at 68% 18%, white 99%, transparent),
    radial-gradient(2px 2px at 83% 72%, var(--accent) 99%, transparent),
    radial-gradient(1px 1px at 38% 62%, white 99%, transparent);
  background-size: 260px 220px;
}

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  min-height: 82px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  gap: clamp(18px, 3.2vw, 52px);
  border-bottom: 1px solid #ffffff12;
  background: #07111eeF;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  color: #f5f8ff;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: .16em;
  text-decoration: none;
}

.thin { color: var(--accent); font-weight: 450; }
.orb { color: var(--accent); font-size: 27px; text-shadow: 0 0 20px var(--accent-glow); }

.topnav {
  min-width: 0;
  display: flex;
  flex: 1;
  align-items: center;
  gap: 6px;
}

.nav-item {
  flex: 0 0 auto;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #a9bad0;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}

.nav-item:hover, .nav-item.active { color: #fff; background: var(--accent-soft); }
.nav-item.active { border-color: var(--accent-glow); }

.topbar-tools { display: flex; flex: 0 0 auto; align-items: center; gap: 15px; }
.clock { min-width: 72px; text-align: right; font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; }
.clock small { display: block; color: var(--muted); font-size: 10px; font-weight: 500; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; color: var(--accent); background: #ffffff08; font-size: 21px; cursor: pointer; }
.icon-button:hover { border-color: var(--accent-glow); background: var(--accent-soft); }

main { width: 100%; max-width: 2880px; flex: 1; align-self: center; padding: 30px 5vw 27px; }
.view[hidden] { display: none; }
.view { animation: rise-in .34s ease both; }
body.tv-view-active { height: 100vh; min-height: 0; overflow: hidden; }
body.tv-view-active main { height: var(--tv-main-height, calc(100vh - 82px)); flex: 0 0 auto; overflow: hidden; }
body.tv-view-active footer { display: none; }
body.tv-view-active .view[data-view="tv"].active { height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
body.tv-view-active .view[data-view="tv"] .page-heading { margin-bottom: 14px; }
body.tv-view-active .tv-layout { min-height: 0; height: 100%; }
body.tv-view-active .tv-player-panel, body.tv-view-active .channel-panel { min-height: 0; height: 100%; }
body.tv-view-active .tv-player-panel { align-items: center; justify-content: center; }
body.tv-view-active .tv-player-stage { min-height: 0; height: auto; aspect-ratio: var(--tv-player-ratio, 16 / 9); }

@media (max-width: 1000px) {
  body.tv-view-active { width: 100vw; height: 100dvh; min-height: 0; overflow: hidden; }
  body.tv-view-active footer { display: none !important; }
  body.tv-view-active main { width: 100vw; height: var(--tv-main-height, calc(100dvh - 70px)); min-height: 0; padding: 0; overflow: hidden; }
  body.tv-view-active .view[data-view="tv"].active { width: 100%; height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
  body.tv-view-active .view[data-view="tv"] .page-heading { margin: 5px 12px 7px; }
  body.tv-view-active .view[data-view="tv"] .page-heading .eyebrow { margin: 0 0 2px; font-size: 9px; }
  body.tv-view-active .view[data-view="tv"] .page-heading h1 { margin: 0; font-size: 22px; }
  body.tv-view-active .view[data-view="tv"] .page-heading > p:not(.eyebrow) { display: none; }
  body.tv-view-active .tv-layout { width: 100%; height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "player" "channels"; gap: 0; }
  body.tv-view-active .tv-player-panel { width: 100%; height: auto; min-height: 0; padding: 0; border: 0; border-radius: 0; }
  body.tv-view-active .channel-panel { width: 100%; height: auto; min-height: 0; max-height: none; align-self: stretch; padding: 12px; border-radius: 0; }
  body.tv-view-active .tv-player-stage { width: 100%; height: auto; aspect-ratio: var(--tv-player-ratio, 16 / 9); border-radius: 0; }
}

@media (max-width: 1000px) and (orientation: landscape) {
  body.tv-view-active { width: 100vw; height: 100dvh; min-height: 0; overflow: hidden; }
  body.tv-view-active .topbar, body.tv-view-active footer,
  body.tv-view-active .view[data-view="tv"] .page-heading,
  body.tv-view-active .channel-panel { display: none !important; }
  body.tv-view-active main { width: 100vw; max-width: none; height: 100dvh; min-height: 0; padding: 0; overflow: hidden; }
  body.tv-view-active .view[data-view="tv"].active { width: 100%; height: 100%; min-height: 0; display: block; overflow: hidden; }
  body.tv-view-active .tv-layout { width: 100%; height: 100%; min-height: 0; display: block; }
  body.tv-view-active .tv-player-panel { width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; }
  body.tv-view-active .tv-player-stage { width: 100%; height: auto; min-height: 0; aspect-ratio: var(--tv-player-ratio, 16 / 9); border-radius: 0; }
}

@media (min-width: 1001px) {
  body.library-view-active { height: 100vh; min-height: 0; overflow: hidden; }
  body.library-view-active main { height: var(--tv-main-height, calc(100vh - 82px)); flex: 0 0 auto; overflow: hidden; }
  body.library-view-active footer { display: none; }
  body.library-view-active .view[data-view="biblioteca"].active { height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
  body.library-view-active .view[data-view="biblioteca"] .page-heading { margin-bottom: 14px; }
  body.library-view-active .library-layout { min-height: 0; height: 100%; }
  body.library-view-active .library-panel, body.library-view-active .library-player-panel { min-height: 0; height: 100%; }
}
@keyframes rise-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, #0d1b2bd9, #091523e8);
  box-shadow: 0 18px 50px #00000020;
}

.hero {
  position: relative;
  min-height: 348px;
  padding: 42px clamp(27px, 5vw, 76px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(105deg, #091627f5 4%, #0c2034ee 55%, #122843a8);
  box-shadow: 0 28px 80px #0006, inset 0 1px #ffffff12, 0 0 70px #218bcb12;
}

.hero::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  background-color: #07111f;
  background-image:
    linear-gradient(90deg, #07111f 0%, #07111fe8 31%, #07111f30 66%, #07111f08 100%),
    url("assets/amor-proibido.png"),
    url("assets/amor-proibido-alem-do-destino.png"),
    url("assets/amor-proibido-sob-lua-roxa.png"),
    url("assets/amor-proibido-desejo-redencao.png"),
    url("assets/amor-proibido-poder-segredos.png"),
    url("assets/entre-amor-e-poder.png");
  background-position: center, 98% 50%, 86% 50%, 74% 50%, 62% 50%, 50% 50%, 38% 50%;
  background-size: cover, 14% auto, 14% auto, 14% auto, 14% auto, 14% auto, 14% auto;
  background-repeat: no-repeat;
  content: "";
  opacity: .9;
  pointer-events: none;
}

.hero-copy { position: relative; z-index: 2; max-width: 600px; }
.eyebrow { margin: 0; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.hero h1 { margin: 17px 0 12px; font-size: clamp(44px, 5.3vw, 70px); line-height: 1.03; letter-spacing: -.055em; }
.hero h1 em { color: var(--accent); font-style: normal; text-shadow: 0 0 32px var(--accent-glow); }
.subtitle { color: #bdcce0; font-size: 15px; }
.hero-actions { margin-top: 25px; display: flex; flex-wrap: wrap; gap: 12px; }

.primary, .secondary {
  min-height: 43px;
  padding: 11px 17px;
  border: 1px solid var(--accent-glow);
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.primary { color: #06121e; background: linear-gradient(110deg, var(--accent), #79a7ff); box-shadow: 0 8px 26px var(--accent-soft); }
.primary:hover, .secondary:hover { transform: translateY(-2px); }
.secondary { color: #e8f7ff; background: #ffffff0b; }
.secondary:hover { border-color: var(--accent); background: var(--accent-soft); }
button:disabled { opacity: .55; cursor: wait; }

.hero-art {
  position: absolute;
  top: 50%;
  right: 9%;
  width: 285px;
  height: auto;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: translateY(calc(-49% - 6px));
}

.luna-core { position: relative; z-index: 1; width: 100%; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid #4bd7f355; border-radius: 50%; box-shadow: 0 0 44px #19a9d11c, inset 0 0 36px #1688a20d; }
.luna-core::before, .luna-core::after { position: absolute; border: 1px solid #42bbd52c; border-radius: 50%; content: ""; }
.luna-core::before { inset: 5%; }
.luna-core::after { inset: 11%; border-style: dotted; opacity: .62; }
.core-ring { position: absolute; border: 1px solid #50bfd52c; border-radius: 50%; pointer-events: none; }
.core-ring-outer { inset: 8%; border-left-color: transparent; border-right-color: transparent; transform: rotate(-22deg); }
.core-ring-middle { inset: 14%; border-color: #61c6dd22; }
.core-ring-dotted { inset: 3%; border-style: dashed; border-color: #50bfd522; transform: rotate(28deg); }
.core-disc { position: relative; width: 77%; aspect-ratio: 1; overflow: hidden; border: 1px solid #253b4c; border-radius: 50%; background: radial-gradient(ellipse at 38% 30%, #172938 0, #0b1722 43%, #050a0f 82%); box-shadow: inset 0 0 38px #000b, 0 0 20px #0007; }
.core-app-orbit { --app-orbit-radius: clamp(42px, 7vw, 82px); position: absolute; inset: 0; animation: core-apps-rotate 26s linear infinite; }
.core-app-position { position: absolute; top: 50%; left: 50%; width: 0; height: 0; }
.core-app-position:nth-child(1) { --icon-angle: 0deg; transform: rotate(0deg) translateX(var(--app-orbit-radius)); }
.core-app-position:nth-child(2) { --icon-angle: 60deg; transform: rotate(60deg) translateX(var(--app-orbit-radius)); }
.core-app-position:nth-child(3) { --icon-angle: 120deg; transform: rotate(120deg) translateX(var(--app-orbit-radius)); }
.core-app-position:nth-child(4) { --icon-angle: 180deg; transform: rotate(180deg) translateX(var(--app-orbit-radius)); }
.core-app-position:nth-child(5) { --icon-angle: 240deg; transform: rotate(240deg) translateX(var(--app-orbit-radius)); }
.core-app-position:nth-child(6) { --icon-angle: 300deg; transform: rotate(300deg) translateX(var(--app-orbit-radius)); }
.core-app-icon { position: absolute; top: 0; left: 0; width: clamp(34px, 4vw, 48px); aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; padding: 0; border: 1px solid #ffffff55; border-radius: 15px; color: white; background-color: transparent; font: inherit; text-decoration: none; cursor: pointer; box-shadow: inset 0 1px #ffffff55, 0 7px 19px #0009, 0 0 19px var(--app-icon-glow); animation: core-app-icon-counter-rotate 26s linear infinite; transition: scale .2s ease; }
.core-app-icon:hover { scale: 1.12; }
.core-app-glyph { display: grid; place-items: center; width: 100%; height: 100%; font-size: 19px; font-weight: 850; text-shadow: 0 1px 5px #0008; }
.core-app-youtube { --app-icon-glow: #ff324c88; background: linear-gradient(145deg, #ff6675, #c91531); }
.core-app-youtube .core-app-glyph { padding-left: 2px; font-size: 15px; }
.core-app-netflix { --app-icon-glow: #e5091488; background: linear-gradient(145deg, #27202a, #08080b); color: #ff3845; }
.core-app-netflix .core-app-glyph { font-family: Arial, sans-serif; font-size: 27px; }
.core-app-spotify { --app-icon-glow: #1ed76088; background: linear-gradient(145deg, #44e58a, #087b43); color: #062c1a; }
.core-app-spotify .core-app-glyph { font-size: 28px; }
.core-app-network { --app-icon-glow: #41e5bd88; background: linear-gradient(145deg, #48dcb5, #087e83); }
.core-app-network .core-app-glyph { font-size: 27px; }
.core-app-tv { --app-icon-glow: #aa7cff88; background: linear-gradient(145deg, #a777ff, #5034b7); }
.core-app-tv .core-app-glyph { font-size: 13px; letter-spacing: -.05em; }
.core-app-tv .core-app-glyph img { width: 100%; height: 100%; object-fit: cover; }
.core-app-files { --app-icon-glow: #ffc86688; background: linear-gradient(145deg, #ffcd72, #a96721); color: #36200a; }
.core-app-files .core-app-glyph { font-size: 23px; }
#hero-tv-player, .hero-radio { display: none; }
@keyframes core-apps-rotate { to { transform: rotate(360deg); } }
@keyframes core-app-icon-counter-rotate {
  from { transform: translate(-50%, -50%) rotate(calc(0deg - var(--icon-angle))); }
  to { transform: translate(-50%, -50%) rotate(calc(0deg - var(--icon-angle) - 360deg)); }
}
.hero-glow { position: absolute; right: 9%; width: 275px; height: 275px; border-radius: 50%; background: var(--accent-soft); filter: blur(45px); pointer-events: none; }

.radio-panel {
  --radio-accent: #65e8b5;
  position: relative;
  min-height: 96px;
  margin-top: 22px;
  padding: 8px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) 112px;
  align-items: center;
  gap: 22px;
  overflow: hidden;
  border-color: #65e8b533;
  background:
    radial-gradient(ellipse at 92% 50%, #65e8b511, transparent 40%),
    linear-gradient(115deg, #10251fef, #0a1723f2 63%);
}
.radio-panel[hidden] { display: none; }
.radio-identity { min-width: 0; display: flex; align-items: center; gap: 16px; }
.radio-art { position: relative; width: 62px; height: 62px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #65e8b544; border-radius: 19px; color: var(--radio-accent); background: linear-gradient(145deg, #65e8b51e, #65e8b508); box-shadow: inset 0 1px #ffffff12, 0 0 28px #65e8b510; }
.radio-dial { z-index: 1; font-size: 27px; text-shadow: 0 0 18px #65e8b577; }
.radio-wave { position: absolute; inset: 9px; border: 1px solid #65e8b522; border-radius: 50%; }
.radio-wave-one { transform: scaleX(1.3); }
.radio-wave-two { transform: scaleY(1.3); }
.radio-heading { min-width: 0; }
.radio-eyebrow { margin: 0 0 4px; color: var(--radio-accent); font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.radio-heading h2 { margin: 0 0 6px; font-size: 20px; }
.radio-live-label { display: inline-flex; align-items: center; gap: 6px; color: #a4b9b1; font-size: 10px; }
.radio-live-label span { width: 6px; height: 6px; border-radius: 50%; background: var(--radio-accent); box-shadow: 0 0 9px #65e8b588; }
.radio-controls { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 12px; }
.radio-station-select { min-width: 0; }
.radio-station-select label { display: block; margin-bottom: 3px; color: #91a99f; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.radio-station-select select { width: 100%; min-width: 0; height: 32px; padding: 0 30px 0 11px; border: 1px solid #65e8b533; border-radius: 10px; color: #e9fff6; background: #071610; font-size: 11px; }
.radio-station-select select:focus-visible { outline-color: var(--radio-accent); }
.radio-station-select option { color: #e9fff6; background: #071610; }
.radio-status { min-height: 14px; margin: 3px 0 0; overflow: hidden; color: #91a99f; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.radio-buttons { display: flex; align-items: center; gap: 6px; padding-top: 0; }
.radio-control-button { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #65e8b533; border-radius: 11px; color: #c9e8dc; background: #65e8b50b; font-size: 13px; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.radio-control-button:hover { transform: translateY(-1px); border-color: #65e8b588; background: #65e8b51e; }
.radio-play-button { width: 41px; height: 41px; border-color: #65e8b577; color: #062116; background: linear-gradient(145deg, #8af2c9, #40c995); box-shadow: 0 5px 18px #65e8b522; font-size: 15px; }
.radio-play-button:hover { border-color: #b0ffdf; background: linear-gradient(145deg, #b0ffdf, #65e8b5); }
.radio-volume-control { grid-column: 1 / -1; display: flex; align-items: center; gap: 9px; }
.radio-volume-button { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #65e8b533; border-radius: 9px; color: #c9e8dc; background: #65e8b50b; font-size: 13px; cursor: pointer; }
.radio-volume-button:hover { border-color: #65e8b588; background: #65e8b51e; }
.radio-volume-control input { width: min(100%, 180px); height: 18px; flex: 1; accent-color: #65e8b5; cursor: pointer; }
.radio-volume-control output { min-width: 32px; color: #9ab5a8; text-align: right; font-size: 9px; font-variant-numeric: tabular-nums; }
.radio-station-count { grid-column: 1 / -1; color: #70877d; text-align: right; font-size: 9px; }
.radio-visualizer { height: 36px; display: flex; align-items: center; justify-content: center; gap: 5px; opacity: .63; }
.radio-visualizer span { width: 4px; height: 13px; border-radius: 5px; background: linear-gradient(180deg, #a4f5d5, #39b987); transform: scaleY(.35); transform-origin: center; }
.radio-panel.is-playing .radio-visualizer span { animation: radio-waveform .85s ease-in-out infinite alternate; }
.radio-panel.is-playing .radio-visualizer span:nth-child(3n + 1) { animation-delay: -.55s; }
.radio-panel.is-playing .radio-visualizer span:nth-child(3n + 2) { animation-delay: -.25s; }
.radio-panel.is-playing .radio-visualizer span:nth-child(3n) { animation-delay: -.72s; }
.radio-panel.is-playing .radio-live-label span { animation: radio-pulse 1.6s ease-in-out infinite; }
@keyframes radio-waveform { from { transform: scaleY(.28); } to { transform: scaleY(1.75); } }
@keyframes radio-pulse { 50% { opacity: .45; box-shadow: 0 0 2px #65e8b544; } }

.shelf { margin-top: 28px; }
.shelf-heading { margin-bottom: 13px; display: flex; align-items: end; justify-content: space-between; gap: 15px; }
.shelf-heading h2, .page-heading h1 { margin: 5px 0 0; }
.shelf-heading h2 { font-size: 22px; }
.hint, .footnote { color: #8fa6bd; font-size: 11px; }
.home-clock-slot { min-width: 0; display: flex; align-items: center; justify-content: flex-end; }
.home-clock { display: none; }
.app-grid { display: grid; gap: 13px; }
.compact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.app-grid-large { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.app-card {
  min-width: 0;
  min-height: 124px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border: 1px solid #a3dfff22;
  border-radius: 16px;
  color: #f5faff;
  text-align: left;
  text-decoration: none;
  background: #0b1a2bd9;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.app-card:hover, .app-card:focus-visible { transform: translateY(-4px); border-color: var(--accent); background: #122b43; box-shadow: 0 10px 26px #0005, 0 0 0 2px var(--accent-soft); }
.app-card b { font-size: 13px; }
.app-card small { color: #93a9c0; font-size: 10px; line-height: 1.5; }
.app-icon { width: 37px; height: 37px; margin-bottom: 5px; display: grid; place-items: center; border-radius: 11px; color: var(--accent); background: #183d5c; font-size: 19px; font-weight: 900; }
.app-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.network-icon { color: #71e9c2; background: linear-gradient(145deg, #1a594d, #183d5c); }
.quick-card { position: relative; min-height: 100px; padding: 18px; flex-direction: row; align-items: center; gap: 14px; overflow: hidden; border-color: #a3dfff2b; background: linear-gradient(130deg, #10243ae8, #0a1728ed); }
.quick-card::after { position: absolute; top: -38px; right: -28px; width: 112px; height: 112px; border-radius: 50%; background: var(--quick-glow); content: ""; filter: blur(30px); opacity: .42; pointer-events: none; transition: opacity .2s ease; }
.quick-card:hover::after, .quick-card:focus-visible::after { opacity: .85; }
.quick-icon { width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--quick-border); border-radius: 17px; color: var(--quick-color); background: linear-gradient(145deg, var(--quick-tint), #101d2dcc); box-shadow: inset 0 1px #ffffff18, 0 8px 20px #0003, 0 0 24px var(--quick-glow); }
.quick-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.quick-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.quick-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 6px; position: relative; z-index: 1; }
.quick-copy b { font-size: 14px; }
.quick-copy small { font-size: 11px; }
.quick-arrow { position: relative; z-index: 1; align-self: flex-start; color: var(--quick-color); font-size: 17px; opacity: .75; transition: transform .18s ease, opacity .18s ease; }
.quick-card:hover .quick-arrow, .quick-card:focus-visible .quick-arrow { transform: translate(2px, -2px); opacity: 1; }
.quick-apps { --quick-color: #79dcff; --quick-tint: #1d5b79aa; --quick-border: #79dcff55; --quick-glow: #36b9ff66; }
.quick-library { --quick-color: #ffd27b; --quick-tint: #795b20aa; --quick-border: #ffd27b55; --quick-glow: #ffb94766; }
.quick-tv { --quick-color: #c3a2ff; --quick-tint: #503487aa; --quick-border: #c3a2ff55; --quick-glow: #9e70ff66; }
.quick-settings { --quick-color: #7ce9b1; --quick-tint: #1c6848aa; --quick-border: #7ce9b155; --quick-glow: #42d99066; }
.youtube { color: #ff6d78; }
.netflix { color: #ff5366; }
.spotify { color: #64f0a0; }
.iptv { color: #c4a7ff; }
.files { color: #ffdb88; }
.settings-icon { color: var(--accent); }
.footnote { margin: 13px 0 0; line-height: 1.7; }

.notice { padding: 13px 15px; display: flex; align-items: flex-start; gap: 11px; border: 1px solid var(--accent-glow); border-radius: 13px; font-size: 11px; line-height: 1.6; }
.notice > span:first-child { flex: 0 0 auto; color: var(--accent); font-weight: 850; }
.notice-warning { margin-top: 15px; color: #e8d8ae; border-color: #e9bb6655; background: #3c301b30; }
.notice-warning > span:first-child { color: #ffd37e; }

.page-heading { margin: 9px 0 24px; }
.page-heading h1 { font-size: clamp(34px, 4vw, 47px); letter-spacing: -.045em; }
.page-heading > p:last-child { margin: 9px 0 0; color: #a7b8cb; font-size: 13px; line-height: 1.6; }
.app-card-large { min-height: 124px; padding: 18px; display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: auto auto auto; align-items: center; column-gap: 15px; row-gap: 4px; overflow: hidden; border-radius: 20px; background: linear-gradient(130deg, #10243ae8, #0a1728ed); }
.app-card-large .app-icon { width: 52px; height: 52px; margin: 0; grid-column: 1; grid-row: 1 / 4; border: 1px solid #a3dfff2b; border-radius: 17px; background: linear-gradient(145deg, #183d5c, #101d2dcc); box-shadow: inset 0 1px #ffffff18, 0 8px 20px #0003; font-size: 24px; }
.app-card-large .app-icon svg { width: 28px; height: 28px; }
.app-card-large b { grid-column: 2; grid-row: 1; align-self: end; font-size: 15px; }
.app-card-large small { max-width: 100%; min-height: 0; grid-column: 2; grid-row: 2; align-self: start; }
.card-action { margin: 2px 0 0; padding: 0; grid-column: 2; grid-row: 3; color: var(--accent); font-size: 10px; font-weight: 750; }
.network-test { padding: clamp(20px, 3vw, 42px); }
.network-test[hidden] { display: none; }
.network-test-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.network-test-heading h2 { margin: 7px 0 0; font-size: clamp(27px, 3vw, 42px); }
.network-test-copy { margin: 8px 0 0; color: #9db1c7; font-size: 13px; }
.network-back { flex: 0 0 auto; }
.network-metrics { margin: clamp(24px, 4vh, 42px) 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); }
.network-metric { --meter-color: #b6c8dc; --meter-tint: #b6c8dc16; --meter-border: #b6c8dc44; --meter-glow: #b6c8dc22; min-width: 0; padding: clamp(18px, 2.4vw, 34px) 12px; display: flex; flex-direction: column; align-items: center; border: 1px solid #a3dfff20; border-radius: 20px; text-align: center; background: radial-gradient(ellipse at 50% 0, var(--meter-tint), transparent 68%), #0a1728d9; box-shadow: inset 0 1px #ffffff12, 0 16px 38px #0003; transition: border-color .2s ease, box-shadow .2s ease; }
.metric-ping { --meter-color: #82d9ff; --meter-tint: #82d9ff16; --meter-border: #82d9ff55; --meter-glow: #82d9ff22; }
.metric-download { --meter-color: #79e7b1; --meter-tint: #79e7b116; --meter-border: #79e7b155; --meter-glow: #79e7b122; }
.metric-upload { --meter-color: #c3a2ff; --meter-tint: #c3a2ff16; --meter-border: #c3a2ff55; --meter-glow: #c3a2ff22; }
.network-metric.is-active { border-color: var(--meter-color); box-shadow: inset 0 1px #ffffff18, 0 0 30px var(--meter-glow); }
.metric-label { margin: 0 0 10px; color: #aabbd0; font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.metric-gauge { position: relative; width: min(100%, 220px); aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--meter-border); border-radius: 50%; background: radial-gradient(circle at 50% 42%, #142944 0, #091625 68%); box-shadow: inset 0 0 28px var(--meter-glow), 0 0 28px var(--meter-glow); }
.metric-gauge svg { width: 100%; height: 100%; overflow: visible; }
.gauge-face { fill: transparent; stroke: #ffffff0a; stroke-width: 1; }
.gauge-track, .gauge-progress { fill: none; stroke-linecap: round; }
.gauge-track { stroke: #d7ecff19; stroke-width: 5; }
.gauge-progress { stroke: var(--meter-color); stroke-width: 5; filter: drop-shadow(0 0 5px var(--meter-color)); transition: stroke-dashoffset 1.4s cubic-bezier(.16, 1, .3, 1); }
.gauge-tick, .gauge-tick-major { stroke: #8196ad75; stroke-width: 1.5; stroke-linecap: round; }
.gauge-tick-major { stroke: var(--meter-color); stroke-width: 2.5; }
.gauge-needle line { stroke: #f3f8ff; stroke-width: 2.5; stroke-linecap: round; filter: drop-shadow(0 0 5px var(--meter-color)); }
.gauge-pivot { fill: var(--meter-color); stroke: #f3f8ff; stroke-width: 2; filter: drop-shadow(0 0 7px var(--meter-color)); }
.metric-reading { position: absolute; top: 57%; left: 50%; width: 100%; min-height: 1.2em; margin: 0; transform: translate(-50%, -50%); color: #f3f8ff; font-size: clamp(25px, 3.2vw, 42px); font-weight: 760; font-variant-numeric: tabular-nums; letter-spacing: -.05em; text-shadow: 0 2px 12px #000b; }
.metric-reading small { margin-left: 4px; color: var(--meter-color); font-size: clamp(10px, 1vw, 13px); font-weight: 650; letter-spacing: 0; }
.metric-note { margin: 8px 0 0; color: #8398af; font-size: 11px; }
.network-test-controls { min-height: 66px; padding-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid #ffffff12; }
.network-test-controls p { margin: 0; color: #b7c8da; font-size: 13px; }
.network-test-controls > div { display: flex; flex-wrap: wrap; gap: 9px; }
.network-test-disclosure { margin: 18px 0 0; color: #7f94aa; font-size: 10px; line-height: 1.6; }

.toolbar { min-height: 71px; margin-bottom: 15px; padding: 13px 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.toolbar .primary, .toolbar .secondary { min-height: 39px; padding: 9px 14px; }
.toolbar-hint { margin-left: auto; color: var(--muted); font-size: 11px; }
.library-layout, .tv-layout { display: grid; gap: 15px; }
.library-layout { grid-template-columns: minmax(260px, .65fr) minmax(0, 1.75fr); align-items: stretch; }
.tv-layout { grid-template-columns: minmax(240px, .62fr) minmax(0, 1.75fr); grid-template-areas: "channels player"; align-items: stretch; }
.library-panel, .player-panel, .channel-panel, .playlist-panel, .settings-panel { min-width: 0; padding: 19px; }
.panel-heading { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 19px; }
.player-panel video { width: 100%; max-height: 360px; aspect-ratio: 16 / 9; display: block; border-radius: 12px; background: #02060c; }
.library-panel, .library-player-panel { height: var(--library-panel-height, clamp(420px, 41vw, 820px)); min-height: 0; overflow: hidden; border-radius: 22px; }
.library-panel { display: flex; flex-direction: column; }
.library-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.library-actions .primary, .library-actions .secondary { min-height: 36px; padding: 8px 10px; font-size: 11px; }
.library-count { margin: -6px 0 10px; color: var(--muted); font-size: 11px; }
.library-panel .media-list { height: 0; min-height: 0; max-height: none; flex: 1; overflow-y: auto; scrollbar-gutter: stable; }
.library-player-panel { display: flex; flex-direction: column; }
.library-player-stage { position: relative; min-height: 0; flex: 1; display: flex; align-items: center; overflow: hidden; border-radius: 14px; background: #02060c; }
.library-player-stage::before { content: ""; position: absolute; inset: 0; z-index: 0; background: #02060c url("assets/luna-tv-icon.png") center / min(58%, 330px) auto no-repeat; opacity: .2; mix-blend-mode: screen; transition: opacity .2s ease; }
.library-player-stage:not(.is-idle)::before { opacity: 0; }
.library-player-stage video { position: relative; z-index: 1; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; object-fit: cover; border-radius: inherit; background: transparent; }
.library-player-stage.is-idle video { visibility: hidden; }
.tv-player-panel { grid-area: player; display: flex; flex-direction: column; border-radius: 22px; }
.tv-player-stage { position: relative; width: 100%; aspect-ratio: var(--tv-player-ratio, 16 / 9); overflow: hidden; border-radius: 14px; background: radial-gradient(ellipse at center, #13273c 0%, #0a1728 62%, #07111e 100%); }
.tv-player-stage::before { content: ""; position: absolute; inset: 0; z-index: 0; background: #02060c url("assets/luna-tv-icon.png") center / min(58%, 330px) auto no-repeat; opacity: .2; mix-blend-mode: screen; transition: opacity .2s ease; }
.tv-player-stage:not(.is-idle)::before { opacity: 0; }
.tv-player-panel .tv-player-stage video { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; object-fit: contain; border-radius: inherit; background: transparent; }
.tv-player-stage.is-idle video { visibility: hidden; }
.tv-player-panel[hidden] { display: none; }
.tv-player-mpegts-panel { border-color: var(--accent-glow); box-shadow: 0 0 0 1px var(--accent-soft), 0 16px 38px #0005; }
.tv-player-mpegts-panel .panel-heading { color: var(--accent); }

.empty-state { min-height: 248px; padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state h3 { margin: 13px 0 5px; font-size: 15px; }
.empty-state p { max-width: 310px; margin: 0; color: #91a6bb; font-size: 11px; line-height: 1.6; }
.empty-icon { width: 49px; height: 49px; display: grid; place-items: center; border: 1px solid var(--accent-glow); border-radius: 15px; color: var(--accent); background: var(--accent-soft); font-size: 22px; }
.media-list, .channel-list { max-height: 420px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.media-list li + li, .channel-list li + li { border-top: 1px solid #ffffff0e; }
.media-button, .channel-button { width: 100%; min-height: 57px; padding: 8px 6px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 8px; text-align: left; background: transparent; cursor: pointer; }
.media-button:hover, .channel-button:hover { background: var(--accent-soft); }
.channel-button-imported:hover { background: #c5a1ff20; }
.media-icon, .channel-number { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: var(--accent-soft); font-size: 15px; }
.channel-number-imported { color: #c5a1ff; background: #c5a1ff20; }
.media-button > span:last-child, .channel-button > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.media-button b, .channel-button b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.media-button small, .channel-button small { color: #91a6bb; font-size: 10px; }

.playlist-panel { grid-area: playlist; margin: 0; border-radius: 22px; }
.playlist-form { display: grid; gap: 8px; }
.field-label { color: #e2edf8; font-size: 11px; font-weight: 700; }
.url-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.url-row input { min-width: 180px; min-height: 42px; flex: 1; padding: 10px 12px; border: 1px solid #ffffff20; border-radius: 10px; color: #edf5ff; background: #060e19; font-size: 12px; }
.url-row input::placeholder { color: #657d95; }
.url-row .primary, .url-row .secondary { min-height: 42px; padding: 9px 13px; }
.field-help { margin: 0; color: #8299b0; font-size: 10px; line-height: 1.5; }
.channel-panel { grid-area: channels; height: var(--tv-channel-panel-height, clamp(420px, 41vw, 820px)); min-height: 0; max-height: none; align-self: start; display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; }
.channel-panel .panel-heading { position: sticky; z-index: 1; top: -19px; margin: -1px -1px 12px; padding: 1px 1px 12px; background: #0b1828; }
.channel-list { height: 0; min-height: 0; max-height: none; flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.channel-list > li:not(.channel-category):not(.channel-source-heading) { margin: 0 2px 9px; }
.channel-list li + li { border-top: 0; }
.channel-source-heading { padding: 14px 7px 8px; color: #e7f2ff; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.channel-source-heading-imported { margin-top: 8px; border-top: 1px solid #c5a1ff45; color: #c5a1ff; }
.channel-category { padding: 13px 7px 7px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.channel-category:not(:first-child) { margin-top: 6px; border-top: 1px solid #ffffff16; }
.channel-source-heading + .channel-category { margin-top: 0; border-top: 0; }
.channel-button { min-height: 76px; padding: 12px 14px; gap: 14px; border: 1px solid #a3dfff2b; border-radius: 17px; background: linear-gradient(130deg, #10243ae8, #0a1728ed); box-shadow: inset 0 1px #ffffff12, 0 7px 18px #0003; transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.channel-button:hover, .channel-button:focus-visible { transform: translateY(-2px); border-color: var(--accent); background: linear-gradient(130deg, #173451, #102239); box-shadow: 0 9px 23px #0005, 0 0 0 2px var(--accent-soft); outline: none; }
.channel-button.is-playing { border-color: var(--accent); background: linear-gradient(130deg, #123646, #0c1c2d); box-shadow: inset 0 0 0 1px var(--accent-soft), 0 0 22px #65e8ff20; }
.channel-button.is-playing::after { content: "NO AR"; margin-left: auto; padding: 5px 8px; flex: 0 0 auto; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.channel-button-imported { border-color: #c5a1ff40; }
.private-channel-access { width: 100%; min-height: 40px; margin: 0; padding: 9px 12px; display: flex; align-items: center; gap: 9px; border: 1px solid #ffffff1b; border-radius: 10px; color: #b8c9da; text-align: left; background: #ffffff06; box-shadow: none; font: inherit; font-size: 11px; font-weight: 650; cursor: pointer; }
.private-channel-access:hover, .private-channel-access:focus-visible { border-color: #ff738255; color: #ffdfe2; background: #ff66770c; outline: none; }
.profile-private-channel-access { justify-self: start; width: auto; min-width: min(250px,100%); }
.channel-search { width: 100%; min-height: 54px; flex: 0 0 54px; margin: 0 0 10px; padding: 0 14px; display: flex; align-items: center; gap: 10px; border: 1px solid #65e8ff55; border-radius: 15px; color: var(--accent); background: #061421; box-shadow: inset 0 1px #ffffff0b; }
.channel-search > span { flex: 0 0 auto; font-size: 22px; line-height: 1; }
.channel-search input { width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; color: #edf7ff; background: transparent; font: inherit; font-size: 12px; }
.channel-search input::placeholder { color: #8299b0; }
.channel-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.channel-search-empty { margin: 0 0 8px; color: var(--muted); font-size: 11px; }
.channel-search-empty[hidden] { display: none; }
.channel-source-heading-private { margin-top: 12px; border-top: 1px solid #ff667766; color: #ff9aa5; }
.channel-button-private { border-color: #ff667766; background: linear-gradient(130deg, #3a1c29, #211622); }
.channel-button-private:hover, .channel-button-private:focus-visible { border-color: #ff7382; background: linear-gradient(130deg, #572534, #301b2a); box-shadow: 0 0 0 2px #ff66772b, 0 8px 20px #0004; }
.channel-number-private { border-color: #ff738288; color: #ffabb4; background: #8f354433; }
.private-channel-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid #ff738277; border-radius: 20px; color: #f2f6fb; background: #0b1726; box-shadow: 0 24px 80px #000b; }
.private-channel-dialog::backdrop { background: #020711d9; backdrop-filter: blur(5px); }
.private-channel-dialog form { padding: 22px; display: grid; gap: 11px; }
.private-channel-dialog h2 { margin: 0; font-size: 20px; }
.private-channel-dialog p { margin: 0; color: #aebfd0; font-size: 12px; line-height: 1.55; }
.private-channel-dialog input { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #ffffff26; border-radius: 10px; color: #f5f8fc; background: #050d17; font: inherit; }
.private-channel-dialog input:focus { border-color: #ff7382; outline: 2px solid #ff738233; }
.private-channel-dialog [hidden] { display: none !important; }
.private-channel-dialog-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 4px; }
.private-channel-error { min-height: 16px; color: #ff9aa5 !important; }

.channel-button-imported:hover, .channel-button-imported:focus-visible { border-color: #c5a1ff; background: linear-gradient(130deg, #30264b, #171d36); box-shadow: 0 9px 23px #0005, 0 0 0 2px #c5a1ff20; }
.channel-number { width: 44px; height: 44px; border: 1px solid #65e8ff35; border-radius: 14px; font-size: 16px; font-weight: 800; }
.channel-number-imported { border-color: #c5a1ff55; }
.channel-button > span:last-child { gap: 5px; }
.channel-button b { display: -webkit-box; overflow: hidden; color: #f1f7ff; font-size: 15px; font-weight: 750; line-height: 1.35; text-shadow: 0 1px 1px #0005; text-overflow: ellipsis; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.channel-button small { color: #a9bdd2; font-size: 12px; line-height: 1.35; }
.empty-state-small { min-height: 200px; }
.pill { padding: 6px 9px; border: 1px solid var(--accent-glow); border-radius: 20px; color: var(--accent); background: var(--accent-soft); font-size: 9px; white-space: nowrap; }
.pill-limited { flex: 0 0 auto; color: #d3bb89; border-color: #e9bb6650; background: #e9bb6610; }

.catalog-toolbar { margin-bottom: 17px; padding: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.catalog-provider, .catalog-playlists { margin: -7px 0 18px; padding: 17px; }
.catalog-playlists[hidden] { display: none; }
.catalog-import-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.catalog-import-heading h2 { margin: 4px 0 0; font-size: 16px; }
.catalog-import-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.catalog-import-row { margin-top: 12px; }
.catalog-provider[hidden] { display: none; }
.catalog-provider h2 { margin: 0 0 7px; font-size: 16px; }
.catalog-provider p, .catalog-provider small { color: #aebfd1; font-size: 11px; line-height: 1.6; }
.catalog-provider-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 9px 0; }
.catalog-provider-row input { min-width: min(100%, 280px); flex: 1 1 320px; }
.catalog-search { min-width: min(100%, 230px); flex: 1 1 260px; min-height: 43px; padding: 0 13px; display: flex; align-items: center; gap: 10px; border: 1px solid #ffffff20; border-radius: 11px; color: var(--accent); background: #060e19; font-size: 19px; }
.catalog-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: #eff7ff; background: transparent; font-size: 12px; }
.catalog-search input::placeholder { color: #71859a; }
.catalog-select { min-height: 43px; padding: 8px 30px 8px 12px; border: 1px solid #ffffff20; border-radius: 11px; color: #eaf5ff; background: #0a1624; font-size: 11px; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: clamp(11px, 1.3vw, 20px); }
.catalog-grid[hidden], .catalog-details[hidden], .catalog-empty[hidden], .catalog-loading[hidden] { display: none; }
.catalog-card { min-width: 0; padding: 9px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; border: 1px solid #a3dfff20; border-radius: 17px; text-align: left; color: inherit; background: linear-gradient(145deg, #0d1b2be8, #091523f2); cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.catalog-card:hover, .catalog-card:focus-visible { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 12px 28px #0006, 0 0 0 2px var(--accent-soft); outline: none; }
.poster-frame { position: relative; width: 100%; overflow: hidden; display: grid; place-items: center; aspect-ratio: 2 / 3; border-radius: 12px; color: var(--accent); background: radial-gradient(ellipse at 50% 35%, #18425a, #0a1728 60%, #050b14); }
.poster-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster-placeholder { color: #65e8ffb8; font-size: clamp(42px, 5vw, 76px); font-weight: 800; letter-spacing: -.06em; text-shadow: 0 0 28px #65e8ff5c; }
.poster-frame-compact { border: 1px solid #ffffff12; }
.poster-frame-compact .poster-placeholder { font-size: clamp(37px, 5vw, 66px); }
.catalog-card-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.catalog-card-copy b { overflow: hidden; color: #f3f7ff; font-size: 12px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.catalog-card-copy small { overflow: hidden; color: #9aaec3; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-empty { margin-top: 12px; }
.catalog-loading { margin: 20px 0; color: #b3c7d8; text-align: center; font-size: 12px; }
.catalog-details { margin-top: 10px; padding: clamp(14px, 2vw, 26px); }
.catalog-back { margin-bottom: 0; }
.catalog-detail-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); align-items: start; gap: clamp(20px, 3vw, 42px); }
.catalog-preview-wrap { position: sticky; top: 18px; min-width: 0; overflow: hidden; border: 1px solid #ffffff20; border-radius: 20px; background: #02070d; box-shadow: 0 18px 44px #0008; }
.catalog-preview-wrap video { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: min(76vh, 820px); min-height: 320px; object-fit: contain; background: #02070d; }
.catalog-video-controls { min-height: 42px; padding: 8px 12px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #e5f1fd; font-size: 12px; font-weight: 700; text-align: center; text-overflow: ellipsis; }
.catalog-preview-wrap:fullscreen { position: fixed; inset: 0; z-index: 9999; width: 100vw; height: 100vh; display: grid; grid-template-rows: 1fr; border: 0; border-radius: 0; background: #000; }
.catalog-preview-wrap:fullscreen video { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; }
.catalog-preview-wrap:fullscreen .catalog-video-controls { justify-content: center; min-height: 58px; background: linear-gradient(transparent, #000b); }
.catalog-detail-poster { max-width: 360px; border: 1px solid #ffffff1c; border-radius: 18px; }
.catalog-detail-poster .poster-placeholder { font-size: clamp(56px, 9vw, 120px); }
.catalog-detail-copy { min-width: 0; padding-top: 7px; }
.catalog-detail-copy h2 { margin: 8px 0 13px; font-size: clamp(25px, 3.5vw, 46px); line-height: 1.12; }
.catalog-metadata { display: flex; flex-wrap: wrap; gap: 8px; }
.catalog-meta-chip { padding: 7px 10px; border: 1px solid #ffffff1a; border-radius: 999px; color: #c7d5e4; background: #ffffff08; font-size: 10px; }
.catalog-description { max-width: 780px; margin: 20px 0; color: #b0c0d0; font-size: 13px; line-height: 1.8; }
.catalog-detail-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.catalog-edit-toggle { margin-top: 14px; }
.catalog-editor { margin-top: 12px; padding: 15px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; border: 1px solid #ffffff19; border-radius: 14px; background: #071320; }
.catalog-editor[hidden] { display: none; }
.catalog-editor input, .catalog-editor textarea, .catalog-provider-row input { width: 100%; min-height: 39px; padding: 9px 11px; border: 1px solid #ffffff22; border-radius: 9px; color: #eff7ff; background: #0a1725; font: inherit; font-size: 12px; }
.catalog-editor textarea { grid-column: 1 / -1; min-height: 92px; resize: vertical; }
.catalog-editor .field-label { align-self: end; font-size: 10px; }
.catalog-editor-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.catalog-attribution { margin: 13px 0 0; color: #91a6bb; font-size: 10px; line-height: 1.6; }
.catalog-attribution a { color: #87ddff; }
.catalog-attribution img { width: 48px; height: auto; margin-left: 7px; vertical-align: middle; }
.catalog-source-options { margin-top: 18px; }
.catalog-source-options h3 { font-size: 13px; }
#catalog-source-list { display: flex; flex-wrap: wrap; gap: 7px; }
#catalog-source-list button { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-episodes { margin-top: 25px; }
.catalog-episodes h3 { margin-bottom: 10px; font-size: 14px; }
#catalog-episode-list { display: grid; gap: 8px; }
.episode-button { min-height: 46px; padding: 10px 12px; border: 1px solid #ffffff17; border-radius: 10px; color: #e8f2fb; text-align: left; background: #ffffff08; cursor: pointer; }
.episode-button:hover, .episode-button:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.playlist-sources { margin-top: 20px; padding-top: 15px; border-top: 1px solid #ffffff16; }
.playlist-sources-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.playlist-sources-heading h3 { margin: 4px 0 0; font-size: 15px; }
.playlist-source-list { margin: 8px 0 0; padding: 0; list-style: none; }
.playlist-source-list li { min-width: 0; padding: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid #ffffff10; }
.playlist-source-list li > span:first-child { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.playlist-source-list b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.playlist-source-list small { color: #91a6bb; font-size: 9px; }
.playlist-source-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; }
.playlist-source-actions button { min-height: 31px; padding: 6px 8px; font-size: 9px; }
.source-remove { border: 1px solid #ff8a8a35; border-radius: 9px; color: #ffb0b0; background: #ed4e4e0c; cursor: pointer; }
.source-remove:hover, .source-remove:focus-visible { border-color: #ff8888; background: #ed4e4e20; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 15px; }
.settings-panel { padding: 22px; }
.setting-row { min-height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid #ffffff10; cursor: pointer; }
.setting-row > span { display: flex; flex-direction: column; gap: 5px; }
.setting-row b, .system-item b { font-size: 12px; }
.setting-row small, .system-item small { color: #92a7bd; font-size: 10px; line-height: 1.5; }
.setting-row select { min-width: 125px; padding: 9px 28px 9px 10px; border: 1px solid #ffffff25; border-radius: 9px; color: #eaf5ff; background: #0a1624; font-size: 11px; }
.setting-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.setting-row input[type="range"] { width: 125px; accent-color: var(--accent); }
.system-item { min-height: 74px; display: flex; align-items: center; gap: 11px; border-top: 1px solid #ffffff10; }
.system-item > span:nth-child(2) { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.system-icon { width: 33px; height: 33px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: var(--accent-soft); font-size: 15px; }
.wifi-controls { padding: 10px 0; display: flex; flex-wrap: wrap; gap: 9px; }
.wifi-controls button, .wifi-connect-form button { min-height: 38px; padding: 8px 13px; }
.wifi-network-list { max-height: 230px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.wifi-network-list li + li { border-top: 1px solid #ffffff10; }
.wifi-network-button { width: 100%; min-height: 52px; padding: 8px 10px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; border: 0; border-radius: 8px; text-align: left; background: transparent; cursor: pointer; }
.wifi-network-button:hover, .wifi-network-button:focus-visible { background: var(--accent-soft); }
.wifi-network-button b { font-size: 11px; }
.wifi-network-button small { color: #92a7bd; font-size: 10px; }
.wifi-connect-form { padding: 12px 0; display: grid; gap: 9px; border-top: 1px solid #ffffff10; }
.wifi-connect-form[hidden] { display: none; }
.wifi-connect-form > p:first-child { margin: 0; color: #e2edf8; font-size: 11px; font-weight: 700; }
.wifi-connect-form input { min-height: 40px; padding: 9px 11px; border: 1px solid #ffffff25; border-radius: 9px; color: #eaf5ff; background: #0a1624; font-size: 12px; }
.save-status { min-height: 16px; margin: 14px 0 0; color: #91a6bb; font-size: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

footer { width: 100%; padding: 14px 5vw; display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid #ffffff12; color: #8298ae; font-size: 9px; letter-spacing: .07em; }
.footer-divider { padding: 0 5px; color: var(--accent); }
.toast { position: fixed; z-index: 10; bottom: 24px; left: 50%; width: max-content; max-width: min(520px, calc(100vw - 32px)); padding: 12px 17px; border: 1px solid var(--accent-glow); border-radius: 11px; color: #eafaff; text-align: center; background: #071a2bf2; box-shadow: 0 12px 38px #0007; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s ease, transform .2s ease; font-size: 11px; line-height: 1.5; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 1450px) {
  main { padding-right: clamp(64px, 4vw, 120px); padding-left: clamp(64px, 4vw, 120px); }
  .topbar, footer { padding-right: clamp(64px, 4vw, 120px); padding-left: clamp(64px, 4vw, 120px); }
}

@media (min-width: 1200px) and (min-height: 700px) {
  .topbar {
    min-height: clamp(82px, 8vh, 132px);
    gap: clamp(22px, 3vw, 58px);
    padding-right: clamp(42px, 4vw, 120px);
    padding-left: clamp(42px, 4vw, 120px);
  }
  .brand { gap: clamp(11px, .8vw, 18px); font-size: clamp(20px, 1.35vw, 30px); }
  .orb { font-size: clamp(27px, 2vw, 42px); }
  .topnav { gap: clamp(6px, .55vw, 14px); }
  .nav-item { padding: clamp(11px, .8vw, 18px) clamp(14px, 1.05vw, 24px); border-radius: 14px; font-size: clamp(13px, .9vw, 19px); }
  .topbar-tools { gap: clamp(15px, 1.25vw, 28px); }
  .clock { min-width: clamp(72px, 5vw, 108px); font-size: clamp(19px, 1.35vw, 30px); }
  .clock small { font-size: clamp(10px, .7vw, 15px); }
  .icon-button { width: clamp(44px, 3.2vw, 68px); height: clamp(44px, 3.2vw, 68px); border-radius: 16px; font-size: clamp(21px, 1.5vw, 34px); }
  main { padding-top: clamp(28px, 3.3vh, 58px); padding-bottom: clamp(28px, 3.3vh, 58px); }
  .hero { min-height: clamp(410px, 46vh, 700px); padding: clamp(48px, 5vh, 90px) clamp(56px, 5.4vw, 140px); border-radius: 30px; }
  .hero-copy { max-width: clamp(600px, 48vw, 1050px); }
  .eyebrow { font-size: clamp(10px, .72vw, 16px); }
  .hero h1 { margin: clamp(17px, 1.5vw, 34px) 0 clamp(12px, 1vw, 24px); font-size: clamp(64px, 5vw, 112px); }
  .subtitle { font-size: clamp(15px, 1.05vw, 23px); }
  .hero-actions { margin-top: clamp(25px, 2vw, 44px); gap: clamp(12px, 1vw, 23px); }
  .primary, .secondary { min-height: clamp(48px, 3.2vw, 68px); padding: clamp(12px, .9vw, 20px) clamp(18px, 1.35vw, 30px); border-radius: 14px; font-size: clamp(13px, .82vw, 18px); }
  .hero-art { width: clamp(300px, 25vw, 560px); }
  .luna-core { width: 100%; }
  .hero-glow { width: clamp(275px, 23vw, 515px); height: clamp(275px, 23vw, 515px); }
  .radio-panel { min-height: clamp(96px, 9vh, 140px); margin-top: clamp(24px, 2vh, 36px); padding: clamp(8px, .8vw, 16px) clamp(24px, 2vw, 40px); gap: clamp(22px, 2vw, 40px); border-radius: 26px; }
  .radio-art { width: clamp(62px, 4.5vw, 88px); height: clamp(62px, 4.5vw, 88px); border-radius: 22px; }
  .radio-heading h2 { font-size: clamp(20px, 1.5vw, 30px); }
  .radio-live-label, .radio-station-select select { font-size: clamp(10px, .75vw, 15px); }
  .radio-station-select label, .radio-status, .radio-station-count { font-size: clamp(9px, .62vw, 13px); }
  .radio-control-button { width: clamp(35px, 2.8vw, 54px); height: clamp(35px, 2.8vw, 54px); font-size: clamp(13px, .9vw, 18px); }
  .radio-play-button { width: clamp(41px, 3.2vw, 62px); height: clamp(41px, 3.2vw, 62px); }
  .radio-visualizer { height: clamp(60px, 5vw, 90px); }
  .shelf { margin-top: clamp(32px, 4vh, 70px); }
  .shelf-heading { margin-bottom: clamp(16px, 1.6vh, 30px); }
  .shelf-heading h2 { font-size: clamp(22px, 1.7vw, 38px); }
  .hint, .footnote { font-size: clamp(11px, .75vw, 16px); }
  .app-grid { gap: clamp(13px, 1.1vw, 26px); }
  .quick-card { min-height: clamp(136px, 14vh, 210px); padding: clamp(22px, 1.9vw, 44px); gap: clamp(17px, 1.5vw, 34px); border-radius: 24px; box-shadow: 0 18px 42px #0005, inset 0 1px #ffffff16; }
  .quick-card::after { top: -50px; right: -40px; width: clamp(125px, 11vw, 250px); height: clamp(125px, 11vw, 250px); }
  .quick-icon { width: clamp(68px, 4.8vw, 108px); height: clamp(68px, 4.8vw, 108px); border-radius: clamp(19px, 1.55vw, 34px); }
  .quick-icon svg { width: clamp(34px, 2.5vw, 56px); height: clamp(34px, 2.5vw, 56px); }
  .quick-copy { gap: clamp(7px, .65vw, 15px); }
  .quick-copy b { font-size: clamp(17px, 1.2vw, 28px); }
  .quick-copy small { font-size: clamp(13px, .9vw, 20px); }
  .quick-arrow { font-size: clamp(21px, 1.5vw, 34px); }
  .notice { padding: clamp(13px, 1vw, 24px) clamp(15px, 1.2vw, 28px); gap: clamp(11px, .8vw, 18px); border-radius: 16px; font-size: clamp(12px, .8vw, 18px); }
  .page-heading { margin: 12px 0 clamp(24px, 2.8vh, 50px); }
  .page-heading h1 { font-size: clamp(47px, 3.4vw, 76px); }
  .page-heading > p:last-child { font-size: clamp(13px, .9vw, 20px); }
  .app-card { border-radius: 22px; }
  .app-card-large { min-height: clamp(124px, 13vh, 180px); padding: clamp(18px, 1.8vw, 28px); }
  .app-card-large .app-icon { width: clamp(50px, 4vw, 88px); height: clamp(50px, 4vw, 88px); border-radius: 18px; font-size: clamp(25px, 1.9vw, 42px); }
  .app-card-large .app-icon svg { width: clamp(30px, 2.5vw, 54px); height: clamp(30px, 2.5vw, 54px); }
  .app-card-large b { font-size: clamp(16px, 1.15vw, 26px); }
  .app-card-large small, .card-action { font-size: clamp(12px, .8vw, 18px); }
  .channel-button { min-height: clamp(82px, 7vh, 112px); padding: clamp(14px, 1vw, 22px); gap: clamp(14px, 1vw, 22px); border-radius: 20px; }
  .channel-number { width: clamp(48px, 3.3vw, 72px); height: clamp(48px, 3.3vw, 72px); border-radius: 17px; font-size: clamp(17px, 1.15vw, 25px); }
  .channel-button b { font-size: clamp(16px, 1.05vw, 23px); }
  .channel-button small { font-size: clamp(13px, .8vw, 18px); }
  .network-test { padding: clamp(26px, 3vw, 48px); }
  .network-test-heading h2 { font-size: clamp(36px, 3vw, 56px); }
  .network-test-copy, .network-test-controls p { font-size: clamp(15px, 1vw, 20px); }
  .network-metrics { gap: clamp(18px, 2vw, 32px); }
  .network-metric { padding: clamp(28px, 3vw, 52px) 18px; border-radius: 26px; }
  .metric-gauge { width: min(100%, 260px); }
  .metric-label { font-size: clamp(14px, .9vw, 20px); }
  .metric-reading { font-size: clamp(38px, 3.4vw, 58px); }
  .metric-reading small, .metric-note { font-size: clamp(12px, .8vw, 17px); }
  .network-test-disclosure { font-size: clamp(12px, .75vw, 16px); }
  footer { padding-top: clamp(14px, 1.3vh, 24px); padding-bottom: clamp(14px, 1.3vh, 24px); font-size: clamp(10px, .65vw, 14px); }
}

@media (min-width: 1200px) and (max-height: 850px) {
  .topbar { min-height: 72px; }
  main { padding-top: 20px; padding-bottom: 20px; }
  .hero { min-height: 370px; padding-top: 36px; padding-bottom: 36px; }
  .shelf { margin-top: 24px; }
  .quick-card { min-height: 120px; }
  footer { padding-top: 10px; padding-bottom: 10px; }
}

@media (max-width: 1000px) {
  .topbar { gap: 17px; padding-right: 22px; padding-left: 22px; }
  .topnav { gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .nav-item { padding: 10px 9px; font-size: 11px; }
  main { padding-right: 24px; padding-left: 24px; }
  .hero-art { right: 3%; opacity: .7; }
  .hero-glow { right: 3%; }
  .radio-panel { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 18px; }
  .radio-visualizer { display: none; }
  .library-layout, .tv-layout, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .tv-layout { grid-template-areas: "player" "channels"; }
  .library-layout, .tv-layout { gap: 13px; }
  .channel-panel { height: calc((100vw - 48px) * .5625 + 38px); min-height: 0; max-height: none; aspect-ratio: auto; }
  .library-panel, .library-player-panel { height: auto; min-height: 0; overflow: visible; }
  .library-panel .media-list { height: auto; min-height: 0; max-height: 420px; }
  .library-player-stage { aspect-ratio: 16 / 9; flex: initial; }
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
  .catalog-card { padding: 7px; border-radius: 14px; }
  .catalog-detail-layout { grid-template-columns: minmax(250px, .9fr) minmax(0, 1.1fr); gap: 18px; }
  footer { padding-right: 24px; padding-left: 24px; }
}

@media (max-width: 650px) {
  .topbar { min-height: 72px; padding-right: 13px; padding-left: 13px; gap: 10px; }
  .brand { gap: 6px; font-size: 14px; }
  .orb { font-size: 21px; }
  .nav-item { padding: 9px 7px; font-size: 10px; }
  .topbar-tools { gap: 8px; }
  .clock { min-width: 52px; font-size: 15px; }
  .clock small { font-size: 8px; }
  .icon-button { width: 34px; height: 34px; }
  main { padding: 19px 14px 20px; }
  .hero { min-height: 310px; padding: 29px 22px; }
  .hero h1 { font-size: 43px; }
  .hero-art { right: -120px; opacity: .28; }
  .hero-glow { right: -90px; opacity: .3; }
  .radio-panel { min-height: 0; margin-top: 16px; padding: 10px 15px; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .radio-identity { gap: 12px; padding-right: 88px; }
  .radio-art { width: 52px; height: 52px; border-radius: 16px; }
  .radio-dial { font-size: 23px; }
  .radio-heading h2 { font-size: 18px; }
  .radio-visualizer { position: absolute; top: 15px; right: 15px; width: 70px; height: 52px; display: flex; gap: 4px; }
  .radio-visualizer span { width: 3px; }
  .radio-controls { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 9px; }
  .radio-station-select select { height: 36px; font-size: 10px; }
  .radio-buttons { gap: 4px; padding-top: 13px; }
  .radio-control-button { width: 31px; height: 34px; border-radius: 9px; font-size: 11px; }
  .radio-play-button { width: 37px; height: 37px; }
  .radio-volume-control { gap: 7px; }
  .radio-volume-button { width: 27px; height: 27px; }
  .radio-status { font-size: 8px; }
  .radio-station-count { font-size: 8px; }
  .shelf-heading { align-items: flex-start; }
  .shelf-heading h2 { font-size: 19px; }
  .hint { max-width: 105px; text-align: right; line-height: 1.5; }
  .compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-grid-large { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .app-card-large { min-height: 120px; padding: 12px; grid-template-columns: 42px minmax(0, 1fr); column-gap: 10px; }
  .app-card-large .app-icon { width: 42px; height: 42px; border-radius: 14px; font-size: 20px; }
  .app-card-large .app-icon svg { width: 24px; height: 24px; }
  .network-test-heading { flex-wrap: wrap; }
  .network-back { width: 100%; }
  .network-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .network-metric:last-child { grid-column: 1 / -1; }
  .network-metric { padding: 13px 4px; border-radius: 14px; }
  .metric-label { margin-bottom: 5px; font-size: 8px; letter-spacing: .12em; }
  .metric-gauge { width: min(100%, 160px); }
  .metric-reading { font-size: clamp(16px, 5vw, 25px); }
  .metric-reading small { margin-left: 2px; font-size: 8px; }
  .metric-note { font-size: 8px; }
  .network-test-controls { align-items: flex-start; flex-direction: column; }
  .network-test-controls > div { width: 100%; }
  .network-test-controls button { flex: 1; }
  .page-heading { margin-bottom: 17px; }
  .page-heading h1 { font-size: 36px; }
  .toolbar { align-items: stretch; }
  .toolbar-hint { width: 100%; margin-left: 0; align-self: center; }
  .library-panel, .player-panel, .channel-panel, .playlist-panel, .settings-panel { padding: 15px; }
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
  .catalog-toolbar { align-items: stretch; }
  .catalog-search { flex-basis: 100%; }
  .catalog-select { flex: 1 1 130px; }
  .catalog-detail-layout { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .catalog-preview-wrap { position: static; }
  .catalog-preview-wrap video { max-height: 58vh; min-height: 220px; }
  .catalog-description { margin: 13px 0; font-size: 11px; }
  .catalog-editor { grid-template-columns: 1fr; }
  .catalog-editor textarea, .catalog-editor-actions { grid-column: 1; }
  .playlist-source-list li { align-items: flex-start; flex-direction: column; }
  .playlist-source-actions { width: 100%; }
  .playlist-source-actions button { flex: 1; }
  .url-row input { min-width: 100%; }
  .setting-row { gap: 9px; }
  .setting-row select { min-width: 110px; }
  .setting-row input[type="range"] { width: 95px; }
  .system-item { flex-wrap: wrap; padding: 10px 0; }
  .system-item .pill { margin-left: 44px; }
  footer { padding: 11px 14px; flex-direction: column; gap: 5px; line-height: 1.5; }
}

@media (max-width: 380px) {
  .topbar { gap: 6px; }
  .brand { font-size: 12px; letter-spacing: .1em; }
  .nav-item { padding: 8px 5px; font-size: 9px; }
  .topbar-tools { gap: 5px; }
  .clock { min-width: 46px; }
  .app-grid-large { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 650px) and (orientation: portrait) {
  .topbar-tools { display: none; }
  .hero {
    min-height: 0;
    padding: 14px 18px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .hero::before {
    background-image: linear-gradient(180deg, #07111ff2 0%, #07111fc9 48%, #07111f78 100%);
    background-position: center;
    background-size: cover;
  }

  .hero-copy { display: none; }

  .hero-radio {
    min-width: 0;
    min-height: 60px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #65e8b544;
    border-radius: 15px;
    background: linear-gradient(110deg, #10251ff2, #0a1723ed 70%);
    box-shadow: inset 0 1px #ffffff12, 0 8px 22px #0004;
  }

  .hero-radio-mark { flex: 0 0 auto; color: #65e8b5; font-size: 23px; text-shadow: 0 0 14px #65e8b577; }
  .hero-radio-info { min-width: 0; flex: 1; display: grid; gap: 3px; }
  #hero-radio-station { width: 100%; min-width: 0; padding: 3px 20px 3px 0; border: 0; color: #f3f7ff; background: transparent; font-size: 12px; font-weight: 750; text-overflow: ellipsis; }
  #hero-radio-station option { color: #f3f7ff; background: #0b1828; }
  #hero-radio-status { overflow: hidden; color: #91a99f; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  .hero-art {
    position: relative;
    inset: auto;
    width: min(82vw, 280px, 100%);
    margin: 0 auto;
    opacity: 1;
    transform: none;
  }

  .core-app-orbit { --app-orbit-radius: clamp(38px, 12vw, 46px); }
  .core-app-icon { width: clamp(37px, 10vw, 42px); border-radius: 13px; }
  .core-app-netflix .core-app-glyph { font-size: 25px; }
  .core-app-spotify .core-app-glyph, .core-app-network .core-app-glyph { font-size: 25px; }
  .core-app-tv .core-app-glyph { font-size: 12px; }
  .core-app-files .core-app-glyph { font-size: 21px; }
  .core-app-orbit { display: none; }
  .core-disc { width: 82%; }
  #hero-tv-player { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 50%; background: #02060c; object-fit: cover; object-position: center; }
  .remote-control-hint { display: none; }
  .home-clock { min-width: 0; display: block; font-size: 15px; }
  .home-clock small { font-size: 8px; }

  .hero-glow {
    top: auto;
    right: auto;
    bottom: 18px;
    left: 50%;
    width: min(74vw, 285px);
    height: min(74vw, 285px);
    transform: translateX(-50%);
  }
}
