/* Israel TV web player styles (split out of index.html). */
:root {
  color-scheme: dark;
  --bg: #070b12;
  --bg-soft: #0e1520;
  --card: #151d2b;
  --card-hover: #1d283a;
  --line: #243044;
  --text: #eef3f8;
  --muted: #93a0b3;
  --accent: #3d8bff;
  --accent-2: #f5c451;
  --live: #ff4d4d;
  --ok: #3dd68c;
  --radius: 16px;
  --header: 64px;
  --video-max-h: min(32vh, 360px);
  --video-ar: 1.777778;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}
#app { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: "Segoe UI", "Rubik", "Arial Hebrew", Arial, sans-serif;
}
html:not(.tv) {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html:not(.tv) body { overflow-x: hidden; }
dialog:not([open]) { display: none !important; }
html[data-session="1"],
html[data-session="1"] body {
  height: 100%;
  overflow: hidden;
}

header.top {
  position: relative;
  flex-shrink: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: var(--header);
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: rgba(7, 11, 18, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  cursor: pointer;
}
.brand img { width: 36px; height: 36px; border-radius: 10px; background: transparent; object-fit: cover; }
.brand h1 { margin: 0; font-size: 18px; letter-spacing: 0.02em; white-space: nowrap; }
.brand span { display: none; }
.expiry {
  appearance: none;
  font: inherit;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 1px;
  min-height: 36px;
  background: rgba(61, 139, 255, 0.14);
  color: #cfe2ff;
  border: 1px solid #2d4f80;
  border-radius: 10px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  cursor: default;
  pointer-events: none;
}
.expiry .expiry-main { font-size: 11px; }
.expiry .expiry-until { font-size: 9px; font-weight: 600; opacity: 0.88; }
.expiry.warn { background: rgba(245, 196, 81, 0.14); color: #f5c451; border-color: #6d5a24; }
.expiry.danger { background: rgba(255, 77, 77, 0.12); color: #ff8a8a; border-color: #6d2a2a; }
.expiry[hidden] { display: none !important; }
.header-chrome {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
.header-account,
.header-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}
.header-actions { margin-inline-start: auto; }
.header-account .icon-btn svg,
.header-actions .icon-btn svg { width: 20px; height: 20px; display: block; }
.install { display: none !important; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.presets button {
  background: #243044 !important;
  padding: 8px 10px !important;
  font-size: 13px;
}
.install[hidden] { display: none !important; }
#iosHint, .ios-hint { display: none !important; }
.gate-install {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.gate-install:not([hidden]) { display: flex; }
.gate-install svg { width: 18px; height: 18px; }
html.tv .gate-install,
html.tv #installBtn,
html.tv .login-device { display: none !important; }
html.ios:not(.tv):not(.installed) #installGateBtn,
html.android:not(.tv):not(.installed) #installGateBtn { display: none !important; }
.login-device {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.login-device h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.login-device p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.login-device .install-steps { margin: 14px 0 0; }
.login-device-install {
  display: none;
  width: 100%;
  margin-top: 12px;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: #3d8bff;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
html:not(.tv):not(.installed).ios .login-device-ios,
html:not(.tv):not(.installed).android .login-device-android { display: block; }
html.android:not(.tv):not(.installed) .login-device-install { display: block; }
#installYes.install-direct {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  margin: 0 0 14px;
  border-radius: 14px;
  font-weight: 800;
}
#installYes.install-direct[hidden] { display: none !important; }
html.tv #pairPhoneBox { display: none !important; }
html.ios #installAndroidSteps,
html.android #installIosSteps,
html.tv #installIosSteps,
html.tv #installAndroidSteps { display: none !important; }
.install-steps,
.ios-install {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.install-steps[hidden],
.ios-install[hidden] { display: none !important; }
.install-steps li,
.ios-install li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}
.install-steps b,
.ios-install b { font-weight: 800; }
.help-block { margin: 0 0 16px; }
.help-block h4 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.ios-step {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(61, 139, 255, 0.16);
  color: var(--accent-2);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}
.ios-share-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 2px;
  color: var(--accent-2);
}

.header-search {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.search {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: inherit;
  padding: 0 16px;
  font-size: 16px;
}
.search:focus { outline: 2px solid var(--accent); border-color: transparent; }
.count { color: var(--muted); font-size: 13px; white-space: nowrap; }

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
main {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 16px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.stage {
  flex: 0 0 auto;
  max-height: 40vh;
  background: var(--bg);
}
.stage[hidden] { display: none !important; }
html.pip-on:not(.ios) .theater {
  width: 1px;
  height: 1px;
  max-height: 1px;
  aspect-ratio: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}
html.pip-on:not(.ios) .theater video {
  width: 1px;
  height: 1px;
}
html.pip-on .now { display: none; }
html.pip-on .stage { max-height: none; }
.catalog {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.catalog::-webkit-scrollbar { display: none; }

.theater {
  position: relative;
  width: min(100%, calc(var(--video-max-h) * var(--video-ar)));
  max-height: var(--video-max-h);
  aspect-ratio: var(--video-ar);
  margin-inline: auto;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.theater video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.theater video.player-warm {
  opacity: 0 !important;
  pointer-events: none;
  z-index: 0;
}
.idle, .status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  pointer-events: none;
}
.idle { background: radial-gradient(circle at 50% 20%, #1a2740 0%, #070b12 70%); }
.idle strong { font-size: 22px; }
.idle p, .status p { margin: 0; color: var(--muted); }
.status { background: #070b12; gap: 14px; z-index: 3; }
.theater.is-buffering video::-webkit-media-controls {
  display: none !important;
}
.status.hidden, .idle.hidden { display: none; }
.status-spinner {
  display: none;
  width: 36px;
  height: 36px;
  border: 3px solid #2a3a52;
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-spin 0.7s linear infinite;
}
.status.is-loading .status-spinner { display: block; }
.status.is-error .status-spinner { display: none; }
.camera-open {
  display: none;
  margin-top: 6px;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  pointer-events: auto;
}
.status.is-camera .camera-open { display: inline-flex; }
.status.is-camera { pointer-events: auto; background: rgba(7, 11, 18, 0.88); }
.status.is-camera p { color: #d7e2f3; font-size: 15px; max-width: 28ch; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live); box-shadow: 0 0 0 6px rgba(255, 77, 77, 0.15);
}

.now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 10px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
}
.now-logo {
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}
.now-logo[hidden] { display: none !important; }
.now-meta {
  flex: 1 1 140px;
  min-width: 0;
  display: grid;
  gap: 1px;
}
.now-meta[hidden] { display: none !important; }
.now-meta strong {
  font-size: 14px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.now-prog {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.now-prog[hidden] { display: none !important; }
.card .sub.is-now { color: #c5d4e8; }
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 12px);
  z-index: 80;
  padding: 10px 16px;
  border-radius: 999px;
  background: #1c2738;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.actions { margin-inline-start: auto; display: flex; gap: 8px; }
.actions button[hidden] { display: none !important; }
.actions button, .actions a {
  border: 0;
  border-radius: 12px;
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #243044;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.actions button.primary { background: var(--accent); color: #fff; }
.actions button.casting { background: var(--accent); color: #fff; }
.actions svg { width: 20px; height: 20px; display: block; }
.cast-banner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: radial-gradient(circle at 50% 20%, #1a2740 0%, #070b12 70%);
  text-align: center;
  padding: 24px;
}
.cast-banner[hidden] { display: none !important; }
.cast-banner strong { font-size: 20px; }
.cast-banner p { margin: 0; color: var(--muted); }

.section { margin-top: 12px; }
.section[hidden] { display: none !important; }
.section h2 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--muted);
  font-weight: 650;
}

.chips, .cats { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .cat {
  border: 1px solid var(--line);
  background: var(--card);
  color: inherit;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  touch-action: manipulation;
}
.cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-inline: 10px 12px;
}
.cat svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.chip.active, .cat.active { background: var(--accent); border-color: transparent; color: #fff; }
.chip.chip-logo {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 5px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.chip.chip-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.chip.chip-logo.active {
  background: var(--card);
  color: inherit;
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}
.card {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: inherit;
  border-radius: var(--radius);
  padding: 12px 10px 14px;
  cursor: pointer;
  text-align: center;
  min-width: 0;
  touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) {
  .chip:hover, .cat:hover, .card:hover { background: var(--card-hover); }
}
.card.active {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.card-add {
  border-style: dashed;
  background: rgba(61, 139, 255, 0.08);
}
.card-add .logo {
  background: rgba(61, 139, 255, 0.16);
  color: var(--accent-2);
  font-size: 34px;
  font-weight: 700;
}
.logo {
  width: 72px; height: 72px; margin: 0 auto 10px;
  border-radius: 16px; background: #0b1018;
  display: grid; place-items: center; overflow: hidden;
}
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.card .title { font-weight: 700; font-size: 14px; line-height: 1.3; }
.card .sub { color: var(--muted); font-size: 12px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

footer.credit {
  margin: 36px 16px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  direction: ltr;
}
footer.credit a { color: inherit; font-weight: 700; }

html[data-session="1"] #gate { display: none !important; }
html[data-session="1"] #app[hidden] { display: flex !important; }
#app[hidden] { display: none !important; }
#gate {
  min-height: 100dvh;
  display: grid;
  place-items: start center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px 32px;
  overflow-x: hidden;
}
#gate[hidden] { display: none !important; }
.gate-stack {
  width: min(420px, 100%);
  max-width: 100%;
  min-width: 0;
  justify-self: stretch;
  display: grid;
  gap: 12px;
}
.login {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 22px 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.login-sales {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 18px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}
.login-sales::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #229ed9, #d4b06a);
}
.login-sales-kicker {
  margin: 0 0 4px;
  color: #8eb4ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}
.login-sales h3 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.25;
}
.login-sales-lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.login-sales-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 14px;
}
.login-sales-stat {
  background: #101826;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
}
.login-sales-stat strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  color: #d4b06a;
  font-weight: 800;
}
.login-sales-stat small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.login-sales-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #229ed9;
  color: #fff !important;
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
}
.login-sales-btn svg { width: 22px; height: 22px; flex: 0 0 auto; }
.login-sales-btn small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
}
.login-sales-btn span { text-align: right; line-height: 1.25; }
.login-sales-list {
  margin: 16px 0 0;
  padding-top: 4px;
}
.login-sales-list-title {
  margin: 0 0 4px;
  font-size: 15px;
}
.login-sales-list-sub {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}
.sales-folder {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.sales-folder header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.sales-folder h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sales-folder-ic {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 6px;
  object-fit: contain;
}
.sales-folder header b {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: #101826;
  border: 1px solid var(--line);
  color: #d4b06a;
  font-size: 12px;
  font-weight: 800;
}
.sales-folder,
.sales-folder-names {
  min-width: 0;
  max-width: 100%;
}
.sales-folder header h4 {
  min-width: 0;
  overflow-wrap: anywhere;
}
.sales-folder-names {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sales-folder-names span {
  padding: 5px 8px;
  border-radius: 8px;
  background: #101826;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}
/* Premium packages (sport + VIVA) are marked with a crown icon per channel. */
.sales-folder.premium .sales-folder-names span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.prem-ic {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  fill: #e6b44c;
}
.login-sales-cta-bottom { margin-top: 14px; }
/* The channel catalog lives in its own block so desktop can lay it out full
   width below the login/pitch hero. On phone it is just another stacked card;
   on TV it is hidden (the catalog never shows there). */
.login-catalog {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 18px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}
.login-catalog .login-sales-list { margin-top: 0; }
html.tv .login-catalog { display: none !important; }
.login-busy {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  background: rgba(10, 16, 26, 0.78);
  border-radius: inherit;
  backdrop-filter: blur(8px);
}
.login-busy[hidden] { display: none !important; }
.login-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #2a3a52;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: login-spin 0.7s linear infinite;
}
.login-busy strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}
@keyframes login-spin { to { transform: rotate(360deg); } }
html.tv .login-spinner { width: 56px; height: 56px; border-width: 4px; }
html.tv .login-busy strong { font-size: 20px; }
.login-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
}
.login-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: transparent;
  object-fit: cover;
  flex: 0 0 44px;
}
html.tv .login-mark { display: none; }
.login-head > div { min-width: 0; }
.login h2 { margin: 0; font-size: 22px; }
.login p { margin: 0; color: var(--muted); font-size: 14px; }
.login-head #loginLead { margin-top: 4px; }
html:not(.tv) #gate .login-pair-on-tv,
html:not(.tv) #gate .license-tile { display: none !important; }
html:not(.tv) #gate #loginLead,
html:not(.tv) #gate #loginType { display: block !important; }
html:not(.tv) #gate .gate-stack { width: min(400px, 100%); max-width: 100%; }
html.android #gate,
html.ios #gate {
  padding: calc(16px + env(safe-area-inset-top, 0px)) 12px 24px;
}
html.android #gate .gate-stack,
html.ios #gate .gate-stack {
  width: 100%;
  max-width: 100%;
  grid-template-columns: 1fr;
}
html:not(.tv) #gate .login {
  width: 100%;
  max-width: 100%;
  padding: 20px 16px 16px;
}
html:not(.tv) #gate .login-sales {
  max-width: 100%;
}
html:not(.tv) #gate .phone-login-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  min-width: 0;
  max-width: 100%;
}
html:not(.tv) #gate .phone-login-row input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 48px;
  margin: 0;
  padding: 0 14px;
}
html:not(.tv) #gate .phone-login-row .login-qr-icon {
  flex: 0 0 48px;
  width: 48px !important;
  min-width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
}
html:not(.tv) #gate .login-btns button {
  height: 48px;
}
@media (min-width: 900px) {
  html:not(.tv):not(.android):not(.ios) #gate {
    place-items: start center;
    padding: 40px 28px 56px;
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
    background:
      radial-gradient(ellipse 70% 55% at 80% 12%, rgba(61, 139, 255, 0.16), transparent 60%),
      radial-gradient(ellipse 60% 50% at 12% 88%, rgba(245, 196, 81, 0.07), transparent 58%),
      var(--bg);
  }
  /* Desktop: a balanced hero — a strong login card beside the pitch — with
     the full channel catalog spanning the width below. Scoped to desktop
     only (not tv/android/ios) so phone, iPhone and TV layouts are untouched. */
  html:not(.tv):not(.android):not(.ios) #gate .gate-stack {
    width: min(1180px, 94vw);
    grid-template-columns: minmax(360px, 400px) minmax(0, 1fr);
    grid-template-areas:
      "login marketing"
      "catalog catalog";
    gap: 22px;
    align-items: stretch;
  }
  html:not(.tv):not(.android):not(.ios) #gate .login {
    grid-area: login;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 26px 24px;
    border-radius: 22px;
    border-color: rgba(61, 139, 255, 0.26);
    background:
      linear-gradient(180deg, rgba(61, 139, 255, 0.10), transparent 46%),
      var(--card);
    box-shadow:
      0 26px 60px rgba(0, 0, 0, 0.44),
      0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  }
  html:not(.tv):not(.android):not(.ios) #gate .login h2 {
    font-size: 26px;
    letter-spacing: -0.02em;
  }
  html:not(.tv):not(.android):not(.ios) #gate .login input {
    height: 50px;
    font-size: 15px;
    border-radius: 13px;
  }
  html:not(.tv):not(.android):not(.ios) #gate .login button {
    height: 50px;
    font-size: 16px;
    border-radius: 13px;
  }
  html:not(.tv):not(.android):not(.ios) #gate .login-sales {
    grid-area: marketing;
    padding: 28px 26px 22px;
    border-radius: 22px;
  }
  html:not(.tv):not(.android):not(.ios) #gate .login-sales h3 {
    font-size: 32px;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
    max-width: 20ch;
  }
  html:not(.tv):not(.android):not(.ios) #gate .login-sales-lead {
    font-size: 15px;
    line-height: 1.6;
    max-width: 56ch;
    margin-bottom: 18px;
  }
  html:not(.tv):not(.android):not(.ios) #gate .login-sales-stats {
    gap: 12px;
    margin-bottom: 16px;
  }
  html:not(.tv):not(.android):not(.ios) #gate .login-sales-stat {
    padding: 14px 10px;
    border-radius: 16px;
  }
  html:not(.tv):not(.android):not(.ios) #gate .login-sales-stat strong { font-size: 26px; }
  /* Full-width catalog, flowed into columns so every channel stays visible
     but scannable instead of one long list. */
  html:not(.tv):not(.android):not(.ios) #gate .login-catalog {
    grid-area: catalog;
    padding: 24px 26px 22px;
    border-radius: 22px;
  }
  html:not(.tv):not(.android):not(.ios) #gate #salesFoldersList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    grid-auto-flow: row dense;
    align-items: start;
    gap: 14px;
  }
  html:not(.tv):not(.android):not(.ios) #gate .sales-folder {
    border-top: 0;
    margin: 0;
    padding: 14px 14px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(16, 24, 38, 0.55);
  }
  /* A very large category (e.g. ספורט גלובלי) spans the full row instead of
     pinning one tall cell and leaving the others half-empty. */
  html:not(.tv):not(.android):not(.ios) #gate .sales-folder-wide {
    grid-column: 1 / -1;
  }
  html:not(.tv):not(.android):not(.ios) #gate .sales-folder h4 { font-size: 15px; }
  html:not(.tv):not(.android):not(.ios) #gate .sales-folder-names span {
    background: rgba(16, 24, 38, 0.92);
  }
  html:not(.tv):not(.android):not(.ios) #gate .login-sales-cta-bottom { margin-top: 18px; }
}
.login-qr-icon {
  flex: 0 0 36px;
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px !important;
  background: #243044 !important;
  color: inherit;
  cursor: pointer;
}
.login-qr-icon svg { width: 20px; height: 20px; }
.login-qr-icon.pair { display: none !important; }
.login-qr-icon.phone-scan { display: grid !important; }
html.tv .login-qr-icon.phone-scan,
html.pair-login .login-qr-icon.phone-scan { display: none !important; }
.login-pair-on-tv { display: none !important; }
html.tv .login-pair-on-tv,
html.pair-login .login-pair-on-tv { display: flex !important; }
.login input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  color: inherit;
  padding: 0 14px;
  font-size: 16px;
  margin-bottom: 12px;
  -webkit-user-select: text;
  user-select: text;
}
#licenseInput {
  direction: ltr;
  text-align: left;
}
.login-qr-icon.paste-license svg { width: 18px; height: 18px; }
.login button {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.login .err { color: #ff8a8a; font-size: 13px; min-height: 18px; margin: 0 0 8px; }
#serviceDown {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 20px calc(24px + env(safe-area-inset-bottom, 0px));
  background: rgba(5, 8, 14, 0.78);
  backdrop-filter: blur(10px);
}
#serviceDown[hidden] { display: none !important; }
.service-down-card {
  width: min(400px, 100%);
  padding: 28px 22px 22px;
  border-radius: 22px;
  background: #121922;
  border: 1px solid #2a3648;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.service-down-card svg {
  width: 42px;
  height: 42px;
  color: #8eb4ff;
  margin: 0 0 12px;
}
.service-down-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
}
.service-down-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}
.service-down-card button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}
.service-down-card a {
  display: inline-block;
  margin-top: 14px;
  color: #9ec0ff;
  font-weight: 700;
  text-decoration: none;
}
html.tv #serviceDown { place-items: center; }
html.tv .service-down-card { width: min(560px, 70vw); padding: 36px 32px 28px; }
html.tv .service-down-card h2 { font-size: 28px; }
html.tv .service-down-card p { font-size: 18px; }
html.tv .service-down-card button { min-height: 56px; font-size: 18px; }
.login .login-btns { display: grid; gap: 8px; }
.login button.scan-btn { background: #243044; }
.login button.scan-btn svg { width: 18px; height: 18px; }
.login .scan-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login .login-qr-icon.scan-btn {
  display: grid;
  gap: 0;
}
html.tv .scan-btn, html.tv #scanDlg, html.tv .paste-license { display: none !important; }
.devices-box {
  margin: 0 0 16px;
  padding: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.devices-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin: 0 0 10px;
}
.devices-head h4 { margin: 0; font-size: 15px; }
.devices-left { color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.35; }
.devices-left.full { color: #ffb27a; }
.devices-list { display: grid; gap: 8px; }
.device-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.device-item > div { min-width: 0; }
.device-item strong {
  display: block;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.device-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
#deviceLimitDlg { width: min(440px, calc(100% - 20px)); }
#deviceLimitDlg h3 { margin-bottom: 6px; }
#deviceLimitLead {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
#deviceLimitDlg .devices-list { margin: 0 0 14px; }
#deviceLimitErr {
  min-height: 18px;
  margin: 0 0 10px;
  color: #ff8a8a;
  font-size: 13px;
}
html:not(.tv) #deviceLimitDlg .device-item {
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 8px 10px;
}
html:not(.tv) #deviceLimitDlg .device-item button {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 42px;
  background: var(--accent);
  color: #fff;
}
html.tv #deviceLimitDlg {
  width: min(560px, calc(100% - 48px));
}
html.tv #deviceLimitDlg .device-item button {
  min-height: 48px;
  padding: 0 16px;
  font-size: 16px;
}
.device-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #47506a;
}
.device-dot.online { background: #45d483; }
.device-item button,
dialog.sheet .device-item button {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #3a2230;
  color: #ff9d9d;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.device-item button:disabled { opacity: 0.55; cursor: default; }
.device-empty { margin: 0; color: var(--muted); font-size: 13px; }
#keysDlg {
  --key-h: 42px;
  width: min(620px, calc(100% - 12px));
  max-height: min(92vh, 860px);
  padding: 18px 16px 14px;
}
#keysDlg h3,
#statsDlg h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 18px;
}
#keysDlg h3 .keys-meta,
#statsDlg h3 .keys-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.keys-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
#keysDlg .keys-toolbar input:not([type="file"]) {
  width: auto;
  flex: 1 1 140px;
  margin: 0 !important;
  height: var(--key-h);
  padding: 0 12px !important;
}
#keysDlg .keys-toolbar button {
  width: var(--key-h);
  height: var(--key-h);
  padding: 0;
  display: grid;
  place-items: center;
}
#keysDlg .keys-toolbar .keys-toggle-all {
  width: auto;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}
#keysDlg .keys-toolbar button svg { width: 16px; height: 16px; display: block; }
#statsDlg {
  width: min(720px, calc(100% - 24px));
}
.stats-health {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stats-health h4 { margin: 0 0 4px; font-size: 15px; }
.stats-health-sub { margin: 6px 0 4px; font-size: 13px; opacity: .75; }
.stats-health ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.stats-health li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; min-width: 0; }
.stats-health li strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-health li span { flex: none; opacity: .75; }
.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}
#statsDlg .stats-metric {
  width: 100%;
  padding: 10px 10px 9px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
  color: inherit;
  text-align: start;
  cursor: pointer;
}
#statsDlg .stats-metric:hover { border-color: var(--accent); }
#statsDlg .stats-metric.on {
  border-color: var(--accent);
  background: rgba(61, 139, 255, 0.12);
}
.stats-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.stats-metric strong {
  display: block;
  margin-top: 3px;
  font-size: 20px;
  line-height: 1.1;
}
.stats-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
#statsDlg .stats-toolbar input,
#statsDlg .stats-toolbar select {
  width: auto;
  flex: 1 1 140px;
  margin: 0;
}
#statsDlg .stats-toolbar button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
}
#statsDlg .stats-toolbar #statsClearFilter,
#statsDlg .stats-toolbar #statsOpenAll,
#statsDlg .stats-toolbar #statsCloseAll {
  width: auto;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}
#statsDlg .stats-toolbar button svg { width: 16px; height: 16px; display: block; }
.stats-list { display: grid; gap: 10px; }
.stats-card {
  display: grid;
  gap: 0;
  padding: 0;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.stats-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  cursor: pointer;
}
.stats-card.open .stats-card-head { border-bottom: 1px solid var(--line); }
#statsDlg .stats-name {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font-size: 15px;
  font-weight: 800;
  text-align: start;
}
#statsDlg .stats-name:hover { color: var(--accent-2); }
.stats-detail {
  display: none;
  gap: 10px;
  padding: 12px;
}
.stats-card.open .stats-detail { display: grid; }
.stats-device {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stats-device-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.stats-device-head strong { display: block; font-size: 14px; }
.stats-device-head small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.stats-card-head strong { display: block; font-size: 15px; }
.stats-card-head small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.stats-section-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.stats-channels { display: grid; gap: 7px; }
.stats-ch {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  align-items: baseline;
}
.stats-ch strong { font-size: 13px; }
.stats-ch small { color: var(--muted); font-size: 11px; }
.stats-ch-bar {
  grid-column: 1 / -1;
  height: 4px;
  background: #1b2536;
  border-radius: 99px;
  overflow: hidden;
}
.stats-ch-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}
.stats-log {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}
.stats-log-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  font-size: 12px;
}
.stats-log-row time { color: var(--muted); }
.stats-log-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.stats-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3d4a5f;
  flex: 0 0 8px;
  margin-top: 6px;
}
.stats-dot.on { background: var(--ok); }
.stats-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 12px;
}
.stats-chart { display: grid; gap: 6px; }
.stats-chart label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.stats-chart label em {
  font-style: normal;
  color: var(--accent-2);
  font-weight: 700;
}
.stats-chart label span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.stats-bars,
.stats-hours {
  direction: ltr;
  display: grid;
  align-items: end;
  width: 100%;
  min-width: 0;
  height: 84px;
}
.stats-bars {
  grid-template-columns: repeat(var(--cols, 14), minmax(0, 1fr));
  gap: 3px;
}
.stats-hours {
  grid-template-columns: repeat(var(--cols, 24), minmax(0, 1fr));
  gap: 2px;
}
.stats-bars .col,
.stats-hours .col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: 84px;
  gap: 3px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.stats-bars .col i,
.stats-hours .col i {
  display: block;
  width: 100%;
  height: 4px;
  flex: 0 0 auto;
  border-radius: 3px 3px 1px 1px;
  background: #243044;
}
.stats-bars .col i.has { background: var(--accent); }
.stats-hours .col i.has { background: var(--accent-2); }
.stats-bars .col .val {
  font-style: normal;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  white-space: nowrap;
}
.stats-bars .col b,
.stats-hours .col b {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}
.stats-bars .col b {
  font-size: 7px;
  white-space: pre-line;
  text-align: center;
}
.stats-hours .col.peak i { background: #ffd36a; }
.stats-hours .col.peak b { color: #ffd36a; }
.stats-bars .col.pick i { background: #ffd36a; }
.stats-bars .col.pick b { color: #ffd36a; }
#statsDlg .stats-day-back {
  height: auto;
  padding: 0;
  background: none;
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 700;
}
@media (max-width: 560px) {
  .stats-hours .col b { visibility: hidden; }
  .stats-hours .col:nth-child(3n+1) b { visibility: visible; }
}
.keys-list { display: grid; gap: 10px; }
.key-card {
  display: grid;
  gap: 0;
  padding: 0;
  background: linear-gradient(180deg, #121a28 0%, #0d141f 100%);
  border: 1px solid #223047;
  border-radius: 18px;
  min-width: 0;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}
.key-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  cursor: pointer;
}
.key-card.open .key-card-head { border-bottom: 1px solid var(--line); }
.key-card-head > div { min-width: 0; }
#keysDlg .key-name {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  text-align: start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#keysDlg .key-name:hover { color: var(--accent-2); }
.key-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.key-pills span {
  padding: 2px 7px;
  background: #0b1220;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.key-pills span.on { color: #7de3a8; background: rgba(69, 212, 131, 0.12); }
.key-pills span.warn { color: #ff9d9d; background: rgba(255, 77, 77, 0.12); }
.key-card-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.key-chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--muted);
  transition: transform 0.16s ease;
}
.key-card.open .key-chevron { transform: rotate(180deg); }
.key-detail {
  display: none;
  gap: 10px;
  padding: 12px;
}
.key-card.open .key-detail { display: grid; }
.key-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 0 10px;
  height: 28px;
  font-size: 12px;
  font-weight: 800;
  background: #243044;
  color: #cfe2ff;
}
.key-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.key-status.live.on, .key-status.active, .key-status.unused { background: rgba(69, 212, 131, 0.14); color: #7de3a8; }
.key-status.live.off { background: #243044; color: #93a0b3; }
.key-status.paused { background: rgba(245, 196, 81, 0.14); color: #f5c451; }
.key-status.banned, .key-status.expired { background: rgba(255, 77, 77, 0.12); color: #ff9d9d; }
.key-token {
  display: grid;
  grid-template-columns: var(--key-h) minmax(0, 1fr) var(--key-h);
  align-items: stretch;
  min-width: 0;
  height: var(--key-h);
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.key-token code {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: center;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: var(--key-h);
  padding: 0 8px;
  background: transparent;
  border: 0;
}
#keysDlg .key-token button {
  grid-column: 3;
  width: var(--key-h);
  height: var(--key-h);
  padding: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: #1a2436;
  color: inherit;
}
.key-token button svg { width: 16px; height: 16px; display: block; }
.key-card .devices-list { gap: 6px; }
.key-card .device-item {
  height: 48px;
  padding: 0 8px 0 10px;
  background: #0b1220;
  border-radius: 12px;
  cursor: pointer;
}
.key-card .device-item:hover { background: #141d2c; }
.key-card .device-item strong { font-size: 13px; }
.key-card .device-item small { margin: 0; font-size: 11px; }
#keysDlg .key-card .device-item button {
  width: 64px;
  height: 28px;
  padding: 0;
  background: #3a2230;
  color: #ff9d9d;
  font-size: 12px;
}
.key-stepper {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 4px;
}
.key-stepper strong {
  display: block;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
}
#keysDlg .key-stepper button {
  width: 36px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  background: #243044;
  color: inherit;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}
#keysDlg .key-stepper button:disabled { opacity: 0.4; }
.key-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}
.key-fields .key-expiry,
.key-fields .key-save { grid-column: 1 / -1; }
#deviceDlg {
  width: min(620px, calc(100% - 12px));
  max-height: min(92vh, 860px);
}
.device-dossier { display: grid; gap: 12px; }
.device-dossier-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.device-dossier-head h3 { margin: 0; font-size: 20px; }
.device-dossier-head small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.device-kind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #1a2436;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.key-field {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  height: 52px;
  padding: 6px 8px;
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.key-field label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
#keysDlg .key-fields input:not([type="file"]) {
  width: 100%;
  height: 22px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  font-size: 13px !important;
  font-weight: 700;
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
}
#keysDlg .key-fields input[type="number"] { text-align: start; }
#keysDlg .key-fields .key-save {
  width: 100%;
  height: 52px;
  padding: 0;
  background: #243044;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
}
.key-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
#keysDlg .key-actions button {
  width: 100%;
  height: var(--key-h);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #243044;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}
#keysDlg .key-actions button svg { width: 14px; height: 14px; flex: 0 0 14px; }
#keysDlg .key-actions button.danger { background: #3a2230; color: #ff9d9d; }
#keysDlg .row { margin-top: 12px; }
#keysDlg .row button { width: 100%; height: var(--key-h); }
.pair-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  margin: 0 0 16px;
}
.pair-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 18px;
  color: var(--text);
}
html.tv #loginLead, html.pair-login #loginLead { display: none; }
html.tv #loginType, html.pair-login #loginType:not(.open) { display: none; }
html.pair-login #loginType.open,
html.tv #loginType.open { display: block; }
html.tv .license-tile, html.pair-login .license-tile { display: flex !important; }
.license-tile {
  display: none !important;
  width: 100%;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  height: auto !important;
  background: var(--bg-soft) !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px;
  color: inherit !important;
  text-align: start;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.license-tile:hover { background: var(--card-hover) !important; }
.license-tile-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(61, 139, 255, 0.16);
  color: var(--accent);
}
.license-tile-icon svg { width: 24px; height: 24px; }
.license-tile-copy { flex: 1; min-width: 0; }
.license-tile-copy strong { display: block; font-size: 16px; font-weight: 800; }
.license-tile-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; font-weight: 600; }
.license-tile-go { color: var(--muted); font-size: 22px; line-height: 1; }
.license-panel { width: 100%; }
html.tv .license-panel.open,
html.pair-login .license-panel.open {
  margin-top: 14px;
  padding: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
}
html.pair-login .scan-btn { display: none !important; }
.pair-help {
  margin: 0 auto 16px !important;
  max-width: 34em;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}
.pair-wait {
  margin: 0 !important;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  line-height: 1.4;
}
.pair-code {
  margin: 0 !important;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.14em;
  direction: ltr;
  text-align: center;
  line-height: 1.3;
}
.login-qr { margin: 0 auto; width: fit-content; }
.pair-phone {
  margin: 0 0 16px;
  padding: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.pair-phone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 4px;
  min-width: 0;
}
.pair-phone-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.pair-phone .login-qr-icon,
dialog.sheet .login-qr-icon {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
}
.pair-phone h4 { margin: 0; font-size: 15px; }
.pair-help-btn,
dialog.sheet .pair-help-btn {
  flex: 0 0 auto;
  min-height: 32px !important;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #243044;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
}
.pair-steps {
  margin: 0 0 16px;
  padding: 0 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}
.pair-steps li { margin: 0 0 10px; }
.pair-steps a { color: var(--accent-2); font-weight: 700; }
html.tv #tvInstallGuide { display: none !important; }
html:not(.tv) #pairHelpTv { display: none !important; }
#tvInstallGuide > p { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.tv-install-card {
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
}
.tv-install-card.prefer { border-color: #3d8bff; }
.tv-install-badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(61, 139, 255, 0.18);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}
.tv-install-card h5 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
}
.tv-install-card p { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.tv-install-card ol { margin: 0 0 10px; }
.tv-install-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #0b1018;
}
.tv-install-code-hero {
  margin: 0 0 14px;
  padding: 12px 12px 10px;
  border: 1px solid #3d8bff;
  border-radius: 14px;
  background: #0b1220;
}
.tv-install-code-hero > span {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.tv-install-code-hero .tv-install-code-row {
  margin: 0 0 8px;
}
.tv-install-code-hero small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.tv-install-howto {
  margin: 0 0 12px;
}
.tv-install-howto h6 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
}
.tv-install-howto .pair-steps { margin: 0; }
.tv-install-code-row strong {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.08em;
  direction: ltr;
  text-align: center;
}
.tv-install-code-row strong.url {
  font-size: 17px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.tv-install-code-row button {
  flex: 0 0 auto;
  min-height: 36px !important;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
}
.tv-brand-pick {
  display: grid;
  gap: 10px;
  margin: 0 0 4px;
}
.tv-brand-pick button {
  width: 100%;
  min-height: 52px !important;
  height: auto;
  padding: 12px 14px;
  text-align: start;
  border-radius: 14px;
  background: #151d2b;
}
.tv-brand-pick button strong { display: block; font-size: 16px; }
.tv-brand-pick button span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.tv-install-back {
  margin: 0 0 12px !important;
  min-height: 36px !important;
  height: 36px;
  padding: 0 12px;
  background: #243044 !important;
}
.pair-phone p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.pair-busy {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  min-height: 160px;
  text-align: center;
}
.pair-busy[hidden] { display: none !important; }
.pair-busy strong {
  font-size: 20px;
  font-weight: 800;
}
.pair-dots::after {
  content: "";
  animation: pair-dots 1.2s steps(4, end) infinite;
}
@keyframes pair-dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}
.pair-phone .pair-row { display: flex; align-items: stretch; gap: 8px; min-width: 0; }
.pair-phone input,
dialog.sheet .pair-phone input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1220;
  color: inherit;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
}
.pair-phone .pair-row button,
dialog.sheet .pair-phone .pair-row button {
  flex: 0 0 auto;
  align-self: stretch;
  width: auto;
  min-width: 64px;
  min-height: 0;
  height: auto;
  padding: 0 14px;
  font-weight: 700;
}
.pair-phone .scan-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #243044;
}
.pair-phone .scan-btn svg { width: 18px; height: 18px; }
.qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 12px 0 4px;
}
.qr-block[hidden] { display: none !important; }
.qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0 auto;
  padding: 20px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
}
.qr-card[hidden] { display: none !important; }
.qr-target {
  display: block;
  width: min(72vw, 280px);
  height: min(72vw, 280px);
  overflow: hidden;
  line-height: 0;
}
.qr-card canvas, .qr-card img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
}
.qr-caption {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  font-weight: 600;
}
#scanDlg { width: min(520px, calc(100% - 20px)); }
.scan-frame {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #000;
}
#scanVideo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #000;
}
.scan-reticle {
  position: absolute;
  inset: 16% 12%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.38);
  pointer-events: none;
}
#scanHint { color: var(--muted); font-size: 15px; margin: 12px 0; text-align: center; }
#scanFile { display: none; }
.icon-btn {
  border: 0;
  border-radius: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: #243044;
  color: inherit;
  cursor: pointer;
}
.icon-btn[hidden] { display: none !important; }
#licenseBtn, #keysBtn, #statsBtn { display: none !important; }
html[data-admin="1"] #licenseBtn:not([hidden]),
html[data-admin="1"] #keysBtn:not([hidden]),
html[data-admin="1"] #statsBtn:not([hidden]) { display: grid !important; }
html.tv #keysBtn, html.tv #statsBtn { display: none !important; }
dialog.sheet {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: inherit;
  width: min(460px, calc(100% - 24px));
  max-height: min(90vh, 720px);
  overflow: auto;
  padding: 18px;
}
dialog.sheet .lic-label {
  display: block;
  margin: 2px 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.55); }
dialog.sheet h3 { margin: 0 0 10px; }
dialog.sheet h3:focus { outline: none; }
dialog.sheet input[hidden] { display: none !important; }
dialog.sheet input:not([type="file"]), dialog.sheet textarea, dialog.sheet select {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  color: inherit;
  padding: 10px;
  font-size: 16px;
}
dialog.sheet .row { display: flex; gap: 8px; }
dialog.sheet button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
dialog.sheet button.ghost { background: #243044; color: #eef3f8; }
#pairHelpDlg .tv-brand-pick button {
  background: #1c2636;
  color: #fff;
  border: 1px solid #3a4a63;
  box-shadow: inset 3px 0 0 #3d8bff;
}
#pairHelpDlg .tv-brand-pick button strong {
  color: #fff;
  font-weight: 800;
}
#pairHelpDlg .tv-brand-pick button span {
  color: #d5deea;
}
#pairHelpDlg .tv-install-back {
  background: #2a364a !important;
  color: #fff;
}
#pairHelpDlg #pairHelpLead,
#pairHelpDlg #tvInstallGuideIntro,
#pairHelpDlg .tv-install-card p,
#pairHelpDlg .pair-steps {
  color: #d7e0ec;
}
#pairHelpDlg h3,
#pairHelpDlg h4,
#pairHelpDlg h5 {
  color: #fff;
}
dialog.sheet button[hidden] { display: none !important; }
dialog.sheet .lic-make {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
}
dialog.sheet .lic-make svg { width: 20px; height: 20px; display: block; }
.key-box {
  position: relative;
  margin: 0 0 12px;
  direction: ltr;
}
.key-box[hidden] { display: none !important; }
dialog.sheet .key-box input {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  padding-inline-end: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b1220;
  color: inherit;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.05em;
  text-align: center;
  direction: ltr;
  unicode-bidi: isolate;
}
dialog.sheet .key-copy {
  position: absolute;
  top: 50%;
  inset-inline-end: 8px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #243044;
  color: inherit;
  display: grid;
  place-items: center;
}
dialog.sheet .key-copy svg { width: 18px; height: 18px; display: block; }
dialog.sheet .key-copy .icon-check { display: none; }
dialog.sheet .key-copy.copied { background: var(--ok); color: #062813; }
dialog.sheet .key-copy.copied .icon-copy { display: none; }
dialog.sheet .key-copy.copied .icon-check { display: block; }
.license-card {
  width: min(460px, calc(100% - 24px));
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.license-card .lic-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 22px 16px;
  background: linear-gradient(180deg, rgba(61, 139, 255, 0.18), transparent);
}
.license-card .lic-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 14px;
  background: rgba(61, 139, 255, 0.2);
  color: #9ec2ff;
  display: grid;
  place-items: center;
}
.license-card .lic-icon svg { width: 24px; height: 24px; display: block; }
.license-card h3 { margin: 0; font-size: 18px; }
.license-card .lic-sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.license-card .lic-body { padding: 4px 22px 22px; min-width: 0; overflow-x: hidden; }
.license-card .lic-meta {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.license-card .lic-row[hidden] { display: none !important; }
.license-card .lic-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.license-card .lic-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.license-card .lic-row strong {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 14px;
  font-weight: 700;
  text-align: start;
  word-break: break-word;
}
.license-card .lic-row strong span + span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.license-card .lic-key { margin-bottom: 16px; }
.license-card .lic-key[hidden] { display: none !important; }
.license-card .lic-key > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}
.license-card .lic-key .key-box { margin: 0; }
.settings-telegram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #229ed9;
  color: #fff !important;
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  box-sizing: border-box;
}
.settings-telegram svg { width: 22px; height: 22px; flex: 0 0 auto; }
.settings-telegram span { text-align: right; line-height: 1.25; }
.settings-telegram small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
}
.license-card .row { justify-content: flex-end; }
html:not(.tv) #licenseViewDlg {
  direction: rtl;
  unicode-bidi: isolate;
  width: min(420px, calc(100% - 20px));
  max-width: calc(100vw - 20px);
  box-sizing: border-box;
  overflow-x: hidden;
}
html:not(.tv) #licenseViewDlg .pair-phone-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
}
html:not(.tv) #licenseViewDlg .pair-phone-head h4 {
  min-width: 0;
  line-height: 1.3;
}
html:not(.tv) #licenseViewDlg .pair-phone-actions {
  display: contents;
}
html:not(.tv) #licenseViewDlg .pair-phone-actions .login-qr-icon {
  grid-column: 2;
  grid-row: 1;
}
html:not(.tv) #licenseViewDlg .pair-help-btn {
  grid-row: 2;
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
}
html:not(.tv) #pairHelpDlg,
html:not(.tv) #customDlg,
html:not(.tv) #devicesDlg,
html:not(.tv) #deviceLimitDlg {
  width: min(420px, calc(100% - 20px));
  max-width: calc(100vw - 20px);
  box-sizing: border-box;
  overflow-x: hidden;
}
html:not(.tv) .tv-install-code-row {
  flex-wrap: wrap;
}
html:not(.tv) .tv-install-code-row strong {
  flex: 1 1 100%;
  font-size: 32px;
}
html:not(.tv) .tv-install-code-row strong.url {
  font-size: 16px;
}
html:not(.tv) .tv-install-code-row button {
  width: 100%;
}
html:not(.tv) #customDlg .row,
html:not(.tv) #devicesDlg .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
html:not(.tv) #customDlg .row button,
html:not(.tv) #devicesDlg .row button {
  width: 100%;
  min-height: 42px;
}
html:not(.tv) #customDlg .custom-logo-box {
  align-items: flex-start;
}
html:not(.tv) #licenseViewDlg .lic-sub,
html:not(.tv) #licenseViewDlg .lic-row span,
html:not(.tv) #licenseViewDlg .lic-row strong,
html:not(.tv) #licenseViewDlg .lic-key > span,
html:not(.tv) #licenseViewDlg .qr-caption {
  direction: rtl;
  unicode-bidi: isolate;
  text-align: start;
}
html:not(.tv) #licenseViewDlg .qr-card { padding: 10px; }
html:not(.tv) #licenseViewDlg .qr-target,
html:not(.tv) #licenseViewDlg .qr-card canvas,
html:not(.tv) #licenseViewDlg .qr-card img {
  width: 148px !important;
  height: 148px !important;
}
html:not(.tv) #licenseViewDlg .qr-block { margin: 10px 0 0; gap: 8px; }
html:not(.tv) #licenseViewDlg .qr-caption { font-size: 13px; color: var(--muted); }
.custom-box {
  margin: 0 0 16px;
  padding: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.custom-box-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 0 0 12px;
}
.custom-box-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.custom-box h4 { margin: 0; font-size: 15px; }
.custom-box-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
dialog.sheet .custom-open-add,
dialog.sheet .custom-clear-all {
  flex: 1 1 130px;
  min-height: 38px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}
dialog.sheet .custom-clear-all {
  background: #3a2230;
  color: #ff9d9d;
}
.custom-box input {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1220;
  color: inherit;
  padding: 10px 12px;
  font-size: 15px;
}
.custom-box .custom-actions {
  display: flex;
  gap: 8px;
  margin: 2px 0 12px;
}
.custom-box .custom-add {
  flex: 1;
  min-height: 44px;
  font-size: 15px;
  font-weight: 700;
}
.custom-box .custom-cancel { flex: 0 0 auto; min-height: 44px; }
.custom-box .custom-err {
  min-height: 18px;
  margin: 0 0 6px;
  color: #ff8a8a;
  font-size: 13px;
}
.custom-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}
.custom-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-areas:
    "thumb meta"
    "btns btns";
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.custom-item.editing { outline: 2px solid var(--accent); }
.custom-item .custom-thumb { grid-area: thumb; }
.custom-item .custom-meta { grid-area: meta; min-width: 0; overflow: hidden; }
.custom-item .custom-item-btns { grid-area: btns; }
.custom-item .custom-thumb {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0b1220;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.custom-item .custom-thumb img { width: 100%; height: 100%; object-fit: contain; }
.custom-group {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.custom-group:first-child { margin-top: 0; }
.grid-group {
  grid-column: 1 / -1;
  margin: 6px 2px 0;
  padding: 10px 2px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  border-top: 1px solid var(--line);
}
.grid-group:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}
.custom-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.custom-item strong {
  display: block;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: left;
}
.custom-item-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.custom-logo-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.custom-logo-preview {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1220;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.custom-logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.custom-logo-fields { flex: 1; min-width: 0; }
.custom-logo-fields input { margin-bottom: 8px; }
.custom-logo-fields button { width: 100%; background: #243044; }
.custom-item button {
  width: 100%;
  background: #243044;
  padding: 8px 10px;
  min-height: 36px;
}
.file-pick {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 44px;
  margin: 0 0 12px;
  border-radius: 10px;
  background: #243044;
  color: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.file-pick[hidden] { display: none !important; }
.file-preview {
  display: none;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b1220;
}
.file-preview[hidden] { display: none !important; }
.file-preview.show { display: block; }
.file-preview strong { display: block; font-size: 15px; }
.file-preview small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.file-preview.loading {
  display: flex;
  align-items: center;
  gap: 10px;
}
.file-preview.loading .status-spinner {
  display: block;
  width: 22px;
  height: 22px;
  border-width: 2px;
}
.file-pick input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
@media (max-width: 720px) {
  header.top {
    flex-wrap: wrap;
    gap: 6px 8px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px;
  }
  .header-chrome { gap: 6px; }
  .header-account,
  .header-actions { gap: 4px; }
  .brand { gap: 6px; }
  .brand img { width: 28px; height: 28px; border-radius: 8px; }
  .brand h1 { font-size: 14px; }
  .expiry { padding: 3px 7px; min-height: 32px; }
  .expiry .expiry-main { font-size: 10px; }
  .expiry .expiry-until { font-size: 8px; }
  .header-search { flex-basis: 100%; }
  .search { height: 36px; padding: 0 12px; }
  .icon-btn { width: 36px; height: 36px; }
  .count { display: none; }
  main { padding: 10px 12px 0; }
  .theater {
    border-radius: 14px;
  }
  :root { --video-max-h: min(26vh, 220px); }
  .stage { max-height: 34vh; }
  .now { padding: 6px 8px; gap: 8px; }
  .now-logo { height: 28px; }
  .actions { width: auto; }
  .chips, .cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .chips::-webkit-scrollbar, .cats::-webkit-scrollbar { display: none; }
  .chip, .cat { flex: 0 0 auto; min-height: 40px; }
  .license-card { width: calc(100% - 16px); }
  .license-card .lic-head { padding: 16px 14px 12px; }
  .license-card .lic-body { padding: 4px 14px 16px; }
  .custom-box, .devices-box, .pair-phone { padding: 12px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .logo { width: 52px; height: 52px; border-radius: 12px; }
  .card { padding: 10px 6px 12px; }
  .card .title { font-size: 13px; }
  .idle strong { font-size: 16px; }
}
@media (max-width: 400px) {
  html:not(.tv) .brand h1 { display: none; }
}
@media (max-width: 1024px) {
  .install:not([hidden]) { display: grid !important; }
}
@supports (-webkit-touch-callout: none) {
  .install:not([hidden]) { display: grid !important; }
}

.tv-only { display: none !important; }
.tv-hint { display: none; }
html.tv {
  --header: 64px;
  --video-max-h: min(42vh, 460px);
  --radius: 14px;
  scroll-behavior: auto;
}
html.tv .card, html.tv .chip, html.tv .cat, html.tv .icon-btn {
  contain: paint;
}
html.tv body { font-size: 15px; }
html.tv #app, html.tv main { max-width: none; }
html.tv header.top {
  gap: 10px;
  padding: 12px 28px 10px;
  backdrop-filter: none;
  background: #070b12;
}
html.tv .header-chrome { gap: 10px; }
html.tv .brand span { display: none; }
html.tv .count, html.tv footer.credit { display: none; }
html.tv main { padding: 10px 28px 0; }
html.tv .catalog { padding-bottom: 28px; }
html.tv .section { margin-top: 10px; }
html.tv .section h2 { font-size: 13px; margin-bottom: 8px; }
html.tv .brand img { width: 36px; height: 36px; }
html.tv .brand h1 { font-size: 18px; }
html.tv .expiry { min-height: 36px; padding: 3px 8px; }
html.tv .expiry .expiry-main { font-size: 11px; }
html.tv .expiry .expiry-until { font-size: 9px; }
html.tv .icon-btn, html.tv .actions button, html.tv .actions a {
  width: 44px;
  height: 44px;
}
html.tv .header-search { display: none; }
html.tv .header-search.open,
html.tv .header-search:has(.tv-search-open) { display: flex; }
html.tv .search { height: 44px; font-size: 16px; }
html.tv .tv-only { display: grid !important; }
html.tv .tv-hint { display: none !important; }
html.tv #pipBtn, html.tv #castBtn, html.tv #openBtn, html.tv #installBtn { display: none !important; }
html.iphone #pipBtn { display: none !important; }
html.tv.tv-max header.top,
html.tv.tv-max .catalog,
html.tv.tv-max .now { display: none !important; }
html.tv .grid {
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}
html.tv .card {
  padding: 8px 6px 8px;
  overflow: hidden;
  border-radius: 14px;
}
html.tv .logo {
  width: 44px;
  height: 44px;
  margin: 0 auto 6px;
  border-radius: 10px;
  overflow: hidden;
}
html.tv .logo img,
html.tv .chip.chip-logo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
}
html.tv .card .title {
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.tv .card .sub,
html.tv .card .sub.is-now { display: none; }
html.tv .chip, html.tv .cat {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 18ch;
  min-height: 40px;
  font-size: 14px;
  padding: 7px 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
html.tv .chip.chip-logo {
  width: 40px;
  height: 40px;
  max-width: 40px;
  padding: 4px;
  overflow: hidden;
  font-size: 0;
  color: transparent;
}
html.tv .chips, html.tv .cats {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
html.tv .chips::-webkit-scrollbar, html.tv .cats::-webkit-scrollbar { display: none; }
html.tv #gate { place-items: center; padding: 24px; }
html.tv .gate-stack {
  width: min(640px, 86vw);
  max-height: 94dvh;
  overflow: auto;
}
html.tv .login {
  width: 100%;
  padding: 28px 32px 24px;
  text-align: center;
}
html.tv .login-sales {
  text-align: center;
  padding: 16px 20px 14px;
}
html.tv .login-sales h3 { font-size: 22px; }
html.tv .login-sales-lead { font-size: 16px; }
html.tv .login-sales-btn { min-height: 52px; font-size: 18px; }
html.tv .login-sales-list,
html.tv .login-sales-cta-bottom { display: none !important; }
html.tv .login-head { justify-content: center; margin-bottom: 18px; }
html.tv .login h2 { font-size: 28px; }
html.tv .login p { font-size: 18px; }
html.tv .login-qr-icon { width: 44px !important; height: 44px !important; flex-basis: 44px; }
html.tv .login-qr-icon svg { width: 22px; height: 22px; }
html.tv .pair-help { font-size: 18px; margin-bottom: 10px !important; }
html.tv .qr-card.login-qr {
  padding: 18px;
  border-radius: 24px;
  background: #fff;
}
html.tv .login-qr .qr-target {
  width: min(36vh, 300px);
  height: min(36vh, 300px);
}
html.tv .login-qr canvas,
html.tv .login-qr img {
  width: 100% !important;
  height: 100% !important;
  image-rendering: pixelated;
}
html.tv .pair-meta { margin: 0; }
html.tv .pair-code {
  display: inline-block;
  font-size: 30px;
  letter-spacing: 0.16em;
  color: #fff;
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 18px;
}
html.tv .pair-wait {
  font-size: 18px;
  color: #c5d0e0;
}
html.tv .license-tile {
  padding: 16px 18px;
  margin-top: 10px;
  background: #0b1220 !important;
}
html.tv .license-tile-icon { width: 48px; height: 48px; flex-basis: 48px; }
html.tv .license-tile-copy strong { font-size: 20px; color: #fff; }
html.tv .license-tile-copy small { font-size: 16px; color: #c5d0e0; }
html.tv .pair-box:focus { outline: 3px solid var(--accent-2); outline-offset: 3px; }
html.tv dialog.sheet[open] {
  position: fixed;
  inset: unset;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 86vw);
  height: auto;
  max-height: 86vh;
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
html.tv #licenseViewDlg[open] {
  padding: 0;
  overflow: hidden;
}
html.tv #licenseViewDlg .lic-head { flex: 0 0 auto; }
html.tv #licenseViewDlg .lic-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
}
html.tv .settings-telegram { min-height: 56px; font-size: 18px; }
html.tv #licenseViewDlg .qr-card { padding: 12px; }
html.tv #licenseViewDlg .qr-target,
html.tv #licenseViewDlg .qr-card canvas,
html.tv #licenseViewDlg .qr-card img {
  width: 160px !important;
  height: 160px !important;
}
html.tv .stage { max-height: 48vh; }
html.tv.tv-max,
html.tv.tv-max body,
html.tv.tv-max #app,
html.tv.tv-max main {
  height: 100dvh;
  max-height: 100dvh;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
html.tv.tv-max .stage,
html.tv.tv-max .theater,
html.tv.tv-max .theater video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  aspect-ratio: auto;
}
html.tv.tv-max .stage { z-index: 40; background: #000; }
html.tv.tv-max .theater { z-index: 41; }
html.tv.tv-max .theater video {
  z-index: 42;
  object-fit: contain;
  background: #000;
}
html.tv.tv-max .theater video.player-warm {
  z-index: 41;
  opacity: 0 !important;
}
html.tv .theater.is-buffering video,
html.tv video:not(.has-frame) {
  opacity: 0;
}
html.tv .status {
  background: #000;
}
html.tv.tv-max .status {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
}
html.tv .status.is-loading {
  gap: 14px;
}
html.tv .status-logo {
  display: none;
  width: 160px;
  height: 160px;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  background: transparent;
}
html.tv .status.is-loading .status-logo:not([hidden]) { display: block; }
html.tv .status-name {
  display: none;
  margin: 0;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
}
html.tv .status.is-loading .status-name:not([hidden]) { display: block; }
html.tv .status.is-loading p {
  color: #c5d0e0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
html.tv.tv-max .status-logo {
  width: 200px;
  height: 200px;
}
html.tv.tv-max .status-name { font-size: 34px; }
html.tv.tv-max .status.is-loading p { font-size: 20px; }
.tv-warm-hint { display: none !important; }
html.tv .tv-warm-hint.is-on:not([hidden]) {
  display: flex !important;
  position: fixed;
  top: 22px;
  right: 22px;
  left: auto;
  z-index: 2147483646;
  align-items: center;
  gap: 12px;
  max-width: min(52vw, 520px);
  padding: 10px 12px 10px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  pointer-events: none;
  direction: rtl;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
html.tv.tv-max .tv-warm-hint.is-on:not([hidden]) {
  top: 32px;
  right: 36px;
  left: auto;
  font-size: 24px;
  padding: 12px 14px 12px 22px;
}
html.tv .tv-warm-logo {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  object-fit: contain;
  background: #0b1018;
  border-radius: 10px;
}
html.tv .tv-warm-logo[hidden],
html.tv .tv-warm-logo:not([src]),
html.tv .tv-warm-logo[src=""] { display: none !important; }
html.tv.tv-max .tv-warm-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
}
html.tv .tv-warm-spin {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tv-warm-spin 0.7s linear infinite;
}
html.tv.tv-max .tv-warm-spin {
  width: 26px;
  height: 26px;
}
html.tv .tv-warm-hint span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@keyframes tv-warm-spin {
  to { transform: rotate(360deg); }
}
html.tv video::-webkit-media-controls,
html.tv video::-webkit-media-controls-enclosure,
html.tv video::-webkit-media-controls-start-playback-button {
  display: none !important;
}
html.tv .now { padding: 6px 8px; }
html.tv .now-logo { height: 32px; }
html.tv .status-spinner { width: 36px; height: 36px; border-width: 3px; }
html.tv .status p { font-size: 15px; }
html.tv button:focus, html.tv a:focus, html.tv input:focus, html.tv select:focus, html.tv textarea:focus, html.tv .theater:focus {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}
html.tv .card:focus, html.tv .chip:focus, html.tv .cat:focus { background: var(--card-hover); filter: none; }
html.tv .chip.chip-logo.active {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
  background: var(--card);
}
html.tv .chip.chip-logo:focus {
  outline: 3px solid #fff;
  outline-offset: 3px;
  background: var(--card-hover);
}
html.tv video, html.tv .theater { pointer-events: none; }
.tv-zapper { display: none !important; }
html.tv.tv-max .tv-zapper.is-open {
  display: block !important;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2147483000;
  padding: 32px 48px 40px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.55) 28%, rgba(0, 0, 0, 0.92) 100%);
  pointer-events: auto;
}
html.tv.tv-max .tv-zapper-row,
html.tv.tv-max .tv-zapper-gate {
  display: grid;
  align-items: start;
  justify-items: stretch;
  gap: 12px;
  direction: rtl;
}
html.tv.tv-max .tv-zapper.mode-zap .tv-zapper-gate {
  grid-template-columns: minmax(0, 1fr) auto auto auto auto auto minmax(0, 1fr);
  align-items: end;
  gap: 16px;
  direction: ltr;
}
html.tv.tv-max .tv-zapper.mode-zap .tv-zapper-gate::before,
html.tv.tv-max .tv-zapper.mode-zap .tv-zapper-gate::after {
  content: "";
}
html.tv.tv-max .tv-zapper.mode-browse.level-1 .tv-zapper-gate {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
html.tv.tv-max .tv-zapper.mode-browse.level-1 .tv-zapper-gate::-webkit-scrollbar { display: none; }
html.tv.tv-max .tv-gate {
  border: 0;
  color: inherit;
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #151d2b;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
html.tv.tv-max .tv-gate-logo {
  display: grid;
  place-items: center;
  overflow: hidden;
}
html.tv.tv-max .tv-gate-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
html.tv.tv-max .tv-zapper-name {
  display: block;
  width: 100%;
  direction: rtl;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.tv.tv-max .tv-gate-far {
  width: min(100px, 12vw);
  padding: 8px 6px 10px;
  border-radius: 14px;
  opacity: 0.42;
  justify-self: center;
}
html.tv.tv-max .tv-gate-far .tv-gate-logo {
  width: 36px;
  height: 36px;
}
html.tv.tv-max .tv-gate-far .tv-zapper-name { font-size: 11px; }
html.tv.tv-max .tv-gate-side {
  width: min(150px, 16vw);
  padding: 12px 12px 14px;
  border-radius: 18px;
  opacity: 0.7;
  justify-self: center;
}
html.tv.tv-max .tv-gate-far.left,
html.tv.tv-max .tv-gate-left { justify-self: end; }
html.tv.tv-max .tv-gate-far.right,
html.tv.tv-max .tv-gate-right { justify-self: start; }
html.tv.tv-max .tv-gate-side .tv-gate-logo {
  width: 56px;
  height: 56px;
}
html.tv.tv-max .tv-gate-side .tv-zapper-name { font-size: 14px; }
html.tv.tv-max .tv-gate-main {
  width: min(280px, 32vw);
  padding: 18px 22px 16px;
  border-radius: 24px;
  background: #1d283a;
  outline: 3px solid #fff;
  outline-offset: 4px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
html.tv.tv-max .tv-gate-main .tv-gate-logo {
  width: 108px;
  height: 108px;
}
html.tv.tv-max .tv-gate-main .tv-zapper-name { font-size: 24px; }
html.tv.tv-max .tv-gate-prog {
  display: none;
}
html.tv.tv-max .tv-zapper.mode-zap .tv-gate-prog {
  display: block;
  width: 100%;
  direction: rtl;
  color: #93a0b3;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.tv.tv-max .tv-gate[hidden] { display: none !important; }
html.tv.tv-max .tv-zapper.mode-browse.level-2 .tv-zapper-gate {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
html.tv.tv-max .tv-zapper.mode-browse.level-3 .tv-zapper-gate {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}
html.tv.tv-max .tv-zapper.mode-browse .tv-gate {
  width: auto;
  justify-self: stretch;
  opacity: 0.78;
  outline: none;
  box-shadow: none;
}
html.tv.tv-max .tv-zapper.mode-browse.level-1 .tv-gate {
  flex: 0 0 auto;
  width: min(132px, 14vw);
  padding: 10px 8px 8px;
  border-radius: 16px;
  scroll-snap-align: center;
}
html.tv.tv-max .tv-zapper.mode-browse.level-2 .tv-gate {
  padding: 10px 8px 8px;
  border-radius: 16px;
}
html.tv.tv-max .tv-zapper.mode-browse.level-3 .tv-gate {
  padding: 7px 6px 6px;
  border-radius: 12px;
}
html.tv.tv-max .tv-zapper.mode-browse.level-1 .tv-gate-logo,
html.tv.tv-max .tv-zapper.mode-browse.level-2 .tv-gate-logo {
  width: 52px;
  height: 52px;
}
html.tv.tv-max .tv-zapper.mode-browse.level-3 .tv-gate-logo {
  width: 36px;
  height: 36px;
}
html.tv.tv-max .tv-zapper.mode-browse.level-1 .tv-zapper-name,
html.tv.tv-max .tv-zapper.mode-browse.level-2 .tv-zapper-name { font-size: 13px; }
html.tv.tv-max .tv-zapper.mode-browse.level-3 .tv-zapper-name { font-size: 11px; }
html.tv.tv-max .tv-zapper .tv-gate.is-focus {
  opacity: 1;
  background: #243044;
  outline: 3px solid #fff;
  outline-offset: 2px;
}
#bootSplash {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  min-height: 100svh;
  z-index: 2147483646;
  display: grid;
  place-items: center;
  place-content: center;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: #070b12;
  box-sizing: border-box;
  transition: opacity 0.35s ease;
}
#bootSplash[hidden] { display: none !important; }
html:not(.tv)[data-booted="1"] #bootSplash { display: none !important; }
html.tv .boot-mark { animation: none !important; opacity: 1 !important; transform: none !important; }
#bootSplash.out { opacity: 0; pointer-events: none; }
.boot-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: auto;
  margin: 0;
}
.boot-label {
  margin: 0;
  color: #93a0b3;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}
html.tv .boot-mark { width: min(22vw, 168px); height: auto; }
html.tv .boot-label { font-size: 22px; }
.boot-mark {
  position: relative;
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  overflow: hidden;
  border-radius: 20px;
}
.boot-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
html:not(.tv) .boot-mark {
  width: 84px;
  height: 84px;
}
