/*
 * Remote (assets/js/views/remote.js). Everything is scoped under .v-remote and built on the
 * app.css tokens. Key sizes derive from --k / --ring, which scale with --remote-scale
 * (html[data-size="large"]), so "large buttons" grows the whole remote.
 */

/* ================================================================ tokens */
.v-remote {
  --k: calc(56px * var(--remote-scale));
  --ring: calc(220px * var(--remote-scale));
  --rm-gap: 16px;
  --key-radius: 18px;
  --key-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.045) 100%);
  --key-bg-press: linear-gradient(180deg, rgba(var(--accent-rgb), 0.36) 0%, rgba(var(--accent-rgb), 0.2) 100%);
  --key-border: rgba(255, 255, 255, 0.085);
  --key-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.4), 0 10px 20px -12px rgba(0, 0, 0, 0.85);
  --key-shadow-press: inset 0 2px 7px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(var(--accent-rgb), 0.55), 0 0 24px -4px var(--accent-glow);
  --body-bg:
    radial-gradient(120% 60% at 50% 0%, rgba(255, 255, 255, 0.07), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.02) 100%);
  --body-border: rgba(255, 255, 255, 0.09);
  --body-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 34px 70px -34px rgba(0, 0, 0, 0.9);
  --ring-bg: radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.055) 58%, rgba(255, 255, 255, 0.03) 100%);
  --lcd-bg: linear-gradient(180deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.28) 100%);
  --lcd-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  --led-off: rgba(255, 255, 255, 0.13);
  padding-top: 14px;
  padding-bottom: 20px;
}

html[data-theme="light"] .v-remote {
  --key-bg: linear-gradient(180deg, #ffffff 0%, #f1f4f9 100%);
  --key-bg-press: linear-gradient(180deg, rgba(var(--accent-rgb), 0.18) 0%, rgba(var(--accent-rgb), 0.1) 100%);
  --key-border: rgba(15, 23, 42, 0.1);
  --key-shadow: inset 0 1px 0 #ffffff, 0 1px 1px rgba(15, 23, 42, 0.08), 0 8px 16px -10px rgba(15, 23, 42, 0.35);
  --key-shadow-press: inset 0 2px 6px rgba(15, 23, 42, 0.13), 0 0 0 1px rgba(var(--accent-rgb), 0.45), 0 0 20px -6px var(--accent-glow);
  --body-bg: linear-gradient(180deg, #ffffff 0%, #f5f7fb 100%);
  --body-border: rgba(15, 23, 42, 0.08);
  --body-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 34px 70px -38px rgba(15, 23, 42, 0.45);
  --ring-bg: radial-gradient(circle at 50% 28%, #ffffff 0%, #f0f3f8 62%, #e6ebf3 100%);
  --lcd-bg: linear-gradient(180deg, #e9edf4 0%, #f1f4f9 100%);
  --lcd-shadow: inset 0 2px 6px rgba(15, 23, 42, 0.1), inset 0 0 0 1px rgba(15, 23, 42, 0.06);
  --led-off: rgba(15, 23, 42, 0.14);
}

/* Tall tablets (iPad portrait): there is room for bigger keys. */
@media (min-width: 700px) and (min-height: 1000px) {
  .v-remote {
    --k: calc(64px * var(--remote-scale));
    --ring: calc(250px * var(--remote-scale));
  }
}

/* Phones: shrink the D-pad so ring + rocker always fit the width. */
@media (max-width: 699px) {
  .v-remote {
    --k: min(calc(56px * var(--remote-scale)), 16vw);
    --ring: min(calc(220px * var(--remote-scale)), calc(100vw - 86px - var(--k)));
    --rm-gap: 14px;
  }
}

/* ================================================================ layout */
.v-remote .rm-layout {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.v-remote .rm-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
  max-width: 720px;
  margin: 0 auto;
}

.v-remote .rm-side {
  display: none;
}

@media (min-width: 700px) {
  .v-remote .rm-layout {
    max-width: 720px;
  }
}

/* iPad landscape: remote | favorites + recents */
@media (min-width: 1000px) {
  .v-remote .rm-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(290px, 29vw, 390px);
    align-items: start;
    gap: 24px;
    max-width: 1240px;
  }

  .v-remote .rm-side {
    position: -webkit-sticky;
    position: sticky;
    top: calc(var(--safe-top) + var(--topbar-h) + 14px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
  }

  .v-remote .rm-strip {
    display: none;
  }

  /* A TV set without apps / inputs lists has no side panel: keep the remote centered. */
  .v-remote .rm-layout.no-side {
    display: block;
    max-width: 720px;
  }
}

.v-remote .rm-empty {
  width: 100%;
  max-width: 560px;
  margin: 24px auto 0;
}

/* ======================================================= now-playing banner */
.v-remote .rm-np {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 94px;
  padding: 12px 10px 12px 12px;
  overflow: hidden;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  transition: transform 0.14s var(--ease), border-color 0.2s;
}

.v-remote .rm-np::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(420px 160px at 0% 50%, rgba(var(--accent-rgb), 0.16), transparent 70%);
  pointer-events: none;
}

.v-remote .rm-np.is-pressing {
  transform: scale(0.985);
}

@media (hover: hover) and (pointer: fine) {
  .v-remote .rm-np:hover {
    border-color: var(--border-strong);
  }
}

.v-remote .rm-np-art {
  position: relative;
  display: flex;
  flex: none;
}

.v-remote .rm-np-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 66px;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text-dim);
  box-shadow: inset 0 0 0 1px var(--border);
}

.v-remote .rm-np[data-state="standby"] .rm-np-tile {
  background: rgba(var(--warning-rgb), 0.14);
  color: var(--warning);
}

.v-remote .rm-np[data-state="offline"] .rm-np-tile {
  background: rgba(var(--danger-rgb), 0.14);
  color: var(--danger);
}

.v-remote .rm-np[data-state="error"] .rm-np-tile {
  background: rgba(var(--warning-rgb), 0.14);
  color: var(--warning);
}

/* TV sets: a TV that is off is normal, not an error. */
.v-remote .rm-np[data-kind="tvset"][data-state="standby"] .rm-np-tile,
.v-remote .rm-np[data-kind="tvset"][data-state="offline"] .rm-np-tile {
  background: var(--surface-2);
  color: var(--text-dim);
}

/* TV sets: the app on screen as an initials tile. */
.v-remote .rm-np-app {
  background: var(--app-color, var(--accent));
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.v-remote .rm-np-info {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  gap: 1px;
}

.v-remote .rm-np-switch {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 7px;
  max-width: 100%;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.v-remote .rm-np-dot {
  display: flex;
  align-items: center;
}

.v-remote .rm-np-dot .dot {
  width: 8px;
  height: 8px;
}

.v-remote .rm-np-tvname {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v-remote .rm-np-caret {
  flex: none;
  opacity: 0.7;
}

.v-remote .rm-np-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.v-remote .rm-np-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.v-remote .rm-np-sub {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.v-remote .rm-np-badges {
  display: flex;
  align-items: center;
  flex: none;
  gap: 6px;
}

.v-remote .rm-np-badges:empty {
  display: none;
}

.v-remote .rm-rec-badge {
  gap: 5px;
}

.v-remote .rm-rec-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: rm-blink 1.6s ease-in-out infinite;
}

.v-remote .rm-np-pbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.v-remote .rm-np-pbar .progress {
  flex: 1 1 auto;
}

.v-remote .rm-np-left {
  flex: none;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.v-remote .rm-np-action {
  position: relative;
  display: flex;
  flex: none;
}

.v-remote .rm-np-action:empty {
  display: none;
}

.v-remote .rm-np-star {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s var(--ease);
}

.v-remote .rm-np-star.pressed {
  background: var(--surface-2);
  transform: scale(0.9);
}

.v-remote .rm-np-star.on {
  color: var(--warning);
}

.v-remote .rm-np-star.on .icon {
  filter: drop-shadow(0 0 8px rgba(var(--warning-rgb), 0.55));
  animation: rm-pop 0.36s var(--ease);
}

/* Tuning in progress: soft fade + a sweeping line along the bottom edge. */
.v-remote .rm-np.is-busy .rm-np-info,
.v-remote .rm-np.is-busy .rm-np-art {
  opacity: 0.6;
  transition: opacity 0.2s;
}

.v-remote .rm-np.is-busy::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
  animation: rm-sweep 0.95s ease-in-out infinite;
}

@media (max-width: 480px) {
  .v-remote .rm-np {
    gap: 12px;
    min-height: 84px;
  }

  .v-remote .rm-np .ch-badge-lg,
  .v-remote .rm-np-tile {
    width: 78px;
    height: 54px;
    border-radius: 13px;
  }

  .v-remote .rm-np .ch-badge-lg .ch-call {
    font-size: 12px;
  }

  .v-remote .rm-np .ch-badge-lg .ch-num {
    font-size: 18px;
  }

  .v-remote .rm-np-title {
    font-size: 17.5px;
  }

  .v-remote .rm-np-app {
    font-size: 21px;
  }

  .v-remote .rm-np-sub {
    font-size: 13px;
  }

  .v-remote .rm-np-star {
    width: 40px;
    height: 40px;
  }
}

/* ================================================== favorites strip (narrow) */
.v-remote .rm-strip {
  margin: 0 -4px;
}

.v-remote .rm-strip-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.v-remote .rm-strip-toggle {
  cursor: pointer;
}

.v-remote .rm-strip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0;
}

.v-remote .rm-strip-count:empty {
  display: none;
}

.v-remote .rm-strip-caret {
  transition: transform 0.25s var(--ease);
}

.v-remote .rm-strip.collapsed .rm-strip-caret {
  transform: rotate(-90deg);
}

.v-remote .rm-strip-scroll {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  max-height: 140px;
  padding: 2px 4px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  transition: max-height 0.28s var(--ease), opacity 0.2s;
}

.v-remote .rm-strip-scroll::-webkit-scrollbar {
  display: none;
}

.v-remote .rm-strip.collapsed .rm-strip-scroll {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

.v-remote .rm-strip-hint {
  display: flex;
  align-items: center;
  flex: none;
  align-self: center;
  gap: 4px;
  max-width: 220px;
  padding: 0 10px;
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.35;
  white-space: normal;
}

.v-remote .rm-strip-hint .icon {
  color: var(--warning);
}

/* Channel tiles (strip + landscape grid) */
.v-remote .rm-fav {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: none;
  gap: 6px;
  width: 80px;
  padding: 7px 4px 6px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s var(--ease);
}

.v-remote .rm-fav.pressed {
  background: var(--surface-2);
  transform: scale(0.94);
}

.v-remote .rm-fav.is-tuning .ch-badge {
  animation: rm-pulse 0.9s ease-in-out infinite;
}

.v-remote .rm-fav-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 650;
}

.v-remote .rm-fav-add-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 44px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 11px;
  color: var(--text-dim);
}

.v-remote .rm-fav-add.pressed .rm-fav-add-ic {
  border-color: var(--accent);
  color: var(--accent-text);
}

/* ============================================================ remote body */
.v-remote .rm-body {
  position: relative;
  display: grid;
  gap: var(--rm-gap);
  width: 100%;
  padding: 28px 16px 20px;
  border: 1px solid var(--body-border);
  border-radius: 36px;
  background: var(--body-bg);
  box-shadow: var(--body-shadow);
}

/* "IR" LED — blinks on every key sent, red on a failure. */
.v-remote .rm-led {
  position: absolute;
  top: 11px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: var(--led-off);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.35);
}

.v-remote .rm-led.tx {
  animation: rm-led 0.26s ease-out;
}

.v-remote .rm-led.err {
  background: var(--danger);
  box-shadow: 0 0 10px 1px rgba(var(--danger-rgb), 0.8);
}

/* ------------------------------------------------------------------ keys */
.v-remote .rm-key {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  height: var(--k);
  padding: 0 4px;
  border: 1px solid var(--key-border);
  border-radius: var(--key-radius);
  background: var(--key-bg);
  color: var(--text);
  box-shadow: var(--key-shadow);
  font-size: calc(15px * var(--remote-scale));
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.09s var(--ease), box-shadow 0.12s, background 0.12s, color 0.12s;
}

.v-remote .rm-key .icon {
  flex: none;
  transition: transform 0.09s var(--ease);
}

.v-remote .rm-key-text {
  white-space: nowrap;
}

.v-remote .rm-cap {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
  font-size: calc(10.5px * var(--remote-scale));
  font-weight: 750;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.v-remote .rm-key.pressed {
  transform: scale(0.93) translateY(1px);
  background: var(--key-bg-press);
  color: var(--accent-text);
  box-shadow: var(--key-shadow-press);
}

.v-remote .rm-key.pressed .rm-cap {
  color: var(--accent-text);
}

@media (hover: hover) and (pointer: fine) {
  .v-remote .rm-key:hover {
    border-color: var(--border-strong);
  }
}

.v-remote .rm-key-sm {
  height: calc(var(--k) * 0.82);
}

/* Power */
.v-remote .rm-power {
  color: var(--danger);
  background:
    radial-gradient(80% 90% at 50% 0%, rgba(var(--danger-rgb), 0.16), transparent 75%),
    var(--key-bg);
}

.v-remote .rm-power .rm-cap {
  color: rgba(var(--danger-rgb), 0.9);
}

.v-remote .rm-power.pressed {
  color: var(--danger);
  background: rgba(var(--danger-rgb), 0.24);
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(var(--danger-rgb), 0.55), 0 0 24px -4px rgba(var(--danger-rgb), 0.75);
}

.v-remote .rm-power.pressed .rm-cap {
  color: var(--danger);
}

/* ---------------------------------------------------------- full layout */
.v-remote .rm-full {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "top"
    "nav"
    "play"
    "colors"
    "num";
}

/* Missing areas (a TV set without a number pad) leave no empty row behind. */
.v-remote .rm-full.no-num {
  grid-template-areas:
    "top"
    "nav"
    "play"
    "colors";
}

/* --n = number of keys in the row (6 for receivers; TV sets show only the keys they have). */
.v-remote .rm-top {
  grid-area: top;
  display: grid;
  grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 400px) {
  .v-remote .rm-top {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .v-remote .rm-top[data-n="1"],
  .v-remote .rm-top[data-n="2"],
  .v-remote .rm-top[data-n="4"] {
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  }
}

/* D-pad + rocker */
.v-remote .rm-nav {
  grid-area: nav;
  display: grid;
  grid-template-columns: var(--ring) var(--k);
  grid-template-rows: var(--ring) auto;
  grid-template-areas:
    "dpad rock"
    "under prev";
  gap: 14px 16px;
  justify-self: center;
}

.v-remote .rm-dpad {
  grid-area: dpad;
  width: var(--ring);
  height: var(--ring);
}

.v-remote .rm-ring {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--key-border);
  border-radius: 50%;
  background: var(--ring-bg);
  box-shadow: var(--key-shadow), inset 0 -10px 24px rgba(0, 0, 0, 0.12);
  transform: perspective(700px);
  transition: transform 0.14s var(--ease);
}

.v-remote .rm-ring::before {
  /* The groove between the ring and the OK button. */
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56%;
  height: 56%;
  margin: -28% 0 0 -28%;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--key-border), 0 0 0 1px rgba(0, 0, 0, 0.12);
  pointer-events: none;
}

.v-remote .rm-ring[data-tilt="up"] {
  transform: perspective(700px) rotateX(7deg);
}

.v-remote .rm-ring[data-tilt="down"] {
  transform: perspective(700px) rotateX(-7deg);
}

.v-remote .rm-ring[data-tilt="left"] {
  transform: perspective(700px) rotateY(-7deg);
}

.v-remote .rm-ring[data-tilt="right"] {
  transform: perspective(700px) rotateY(7deg);
}

.v-remote .rm-dir {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.v-remote .rm-dir-up {
  top: 0;
  left: 22%;
  width: 56%;
  height: 31%;
  align-items: flex-start;
  padding-top: 7%;
}

.v-remote .rm-dir-down {
  bottom: 0;
  left: 22%;
  width: 56%;
  height: 31%;
  align-items: flex-end;
  padding-bottom: 7%;
}

.v-remote .rm-dir-left {
  top: 22%;
  left: 0;
  width: 31%;
  height: 56%;
  justify-content: flex-start;
  padding-left: 7%;
}

.v-remote .rm-dir-right {
  top: 22%;
  right: 0;
  width: 31%;
  height: 56%;
  justify-content: flex-end;
  padding-right: 7%;
}

.v-remote .rm-dir.pressed {
  transform: none;
  color: var(--accent-text);
}

.v-remote .rm-dir.pressed .icon {
  transform: scale(0.86);
}

.v-remote .rm-dir .icon {
  transition: transform 0.09s var(--ease);
}

.v-remote .rm-dir-up.pressed {
  background: radial-gradient(70% 95% at 50% 0%, rgba(var(--accent-rgb), 0.42), transparent 72%);
}

.v-remote .rm-dir-down.pressed {
  background: radial-gradient(70% 95% at 50% 100%, rgba(var(--accent-rgb), 0.42), transparent 72%);
}

.v-remote .rm-dir-left.pressed {
  background: radial-gradient(95% 70% at 0% 50%, rgba(var(--accent-rgb), 0.42), transparent 72%);
}

.v-remote .rm-dir-right.pressed {
  background: radial-gradient(95% 70% at 100% 50%, rgba(var(--accent-rgb), 0.42), transparent 72%);
}

@media (hover: hover) and (pointer: fine) {
  .v-remote .rm-dir:hover {
    color: var(--text);
  }
}

.v-remote .rm-ok {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40%;
  height: 40%;
  margin: -20% 0 0 -20%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent-2) 0%, var(--accent) 100%);
  color: var(--accent-contrast);
  box-shadow: 0 12px 26px -8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.32), inset 0 -4px 10px rgba(0, 0, 0, 0.18);
  font-family: var(--font-display);
  font-size: calc(20px * var(--remote-scale));
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.09s var(--ease), box-shadow 0.12s, filter 0.12s;
}

.v-remote .rm-ok.pressed {
  transform: scale(0.92);
  filter: brightness(0.94);
  box-shadow: 0 4px 12px -6px var(--accent-glow), inset 0 3px 8px rgba(0, 0, 0, 0.25);
}

/* Channel rocker */
.v-remote .rm-rocker {
  grid-area: rock;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: var(--k);
  height: var(--ring);
  overflow: hidden;
  border: 1px solid var(--key-border);
  border-radius: calc(var(--k) / 2);
  background: var(--key-bg);
  box-shadow: var(--key-shadow);
  transform: perspective(500px);
  transition: transform 0.14s var(--ease);
}

.v-remote .rm-rocker[data-tilt="up"] {
  transform: perspective(500px) rotateX(10deg);
}

.v-remote .rm-rocker[data-tilt="down"] {
  transform: perspective(500px) rotateX(-10deg);
}

.v-remote .rm-rock {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.v-remote .rm-rock.pressed {
  transform: none;
  color: var(--accent-text);
}

.v-remote .rm-rock-up.pressed {
  background: radial-gradient(100% 80% at 50% 0%, rgba(var(--accent-rgb), 0.42), transparent 80%);
}

.v-remote .rm-rock-down.pressed {
  background: radial-gradient(100% 80% at 50% 100%, rgba(var(--accent-rgb), 0.42), transparent 80%);
}

.v-remote .rm-rock .icon {
  transition: transform 0.09s var(--ease);
}

.v-remote .rm-rock.pressed .icon {
  transform: scale(0.86);
}

.v-remote .rm-rock-label {
  flex: none;
  margin: 0 10px;
  padding: 5px 0;
  border-top: 1px solid var(--key-border);
  border-bottom: 1px solid var(--key-border);
  color: var(--text-faint);
  font-size: calc(11px * var(--remote-scale));
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

.v-remote .rm-under {
  grid-area: under;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.v-remote .rm-under[data-n="1"] {
  grid-template-columns: minmax(0, 1fr);
}

/* No Prev key (LG TVs): Back / Exit take the whole row under the D-pad and rocker. */
.v-remote .rm-nav.no-prev {
  grid-template-areas:
    "dpad rock"
    "under under";
}

.v-remote .rm-prev {
  grid-area: prev;
  border-radius: calc(var(--k) / 2);
}

.v-remote .rm-prev .rm-key-text {
  color: var(--text-dim);
  font-size: calc(11.5px * var(--remote-scale));
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v-remote .rm-prev.pressed .rm-key-text {
  color: var(--accent-text);
}

/* Playback */
.v-remote .rm-play {
  grid-area: play;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.v-remote .rm-play .rm-key {
  height: calc(var(--k) * 0.8);
  border-radius: 15px;
}

.v-remote .rm-play [data-k="rew"] { order: 1; }
.v-remote .rm-play [data-k="play"] { order: 2; }
.v-remote .rm-play [data-k="pause"] { order: 3; }
.v-remote .rm-play [data-k="ffwd"] { order: 4; }
.v-remote .rm-play [data-k="replay"] { order: 5; }
.v-remote .rm-play [data-k="stop"] { order: 6; }
.v-remote .rm-play [data-k="record"] { order: 7; }
.v-remote .rm-play [data-k="advance"] { order: 8; }

/* TV sets have fewer playback keys (no replay / skip ahead). */
.v-remote .rm-play[data-n="6"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.v-remote .rm-play[data-n="1"],
.v-remote .rm-play[data-n="2"],
.v-remote .rm-play[data-n="3"],
.v-remote .rm-play[data-n="5"] {
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
}

.v-remote .rm-rec {
  color: var(--danger);
}

.v-remote .rm-rec.pressed {
  color: var(--danger);
}

/* Color keys + format */
.v-remote .rm-colors {
  grid-area: colors;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.4fr);
  gap: 10px;
}

.v-remote .rm-colors.no-format {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.v-remote .rm-color,
.v-remote .rm-format {
  height: calc(var(--k) * 0.62);
  border-radius: 14px;
}

.v-remote .rm-color::before {
  content: "";
  width: 52%;
  height: 7px;
  border-radius: 4px;
  background: var(--c);
  box-shadow: 0 0 12px -1px var(--c);
}

.v-remote .rm-color-red { --c: #ff4d5e; }
.v-remote .rm-color-green { --c: #2fd27a; }
.v-remote .rm-color-yellow { --c: #ffcd2e; }
.v-remote .rm-color-blue { --c: #3d8bff; }

.v-remote .rm-color.pressed {
  background: var(--key-bg);
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--c), 0 0 22px -4px var(--c);
}

.v-remote .rm-format {
  flex-direction: row;
  gap: 6px;
  color: var(--text-dim);
  font-size: calc(13px * var(--remote-scale));
}

.v-remote .rm-format.pressed {
  color: var(--accent-text);
}

/* ---------------------------------------------------------- number pad */
.v-remote .rm-numpad {
  grid-area: num;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.v-remote .rm-entry {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: calc(var(--k) * 1.02);
  padding: 6px 44px 8px;
  overflow: hidden;
  border-radius: 18px;
  background: var(--lcd-bg);
  box-shadow: var(--lcd-shadow);
  text-align: center;
  transition: box-shadow 0.2s;
}

.v-remote .rm-entry-num {
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  color: var(--text);
  font-family: var(--font-display);
  font-size: calc(28px * var(--remote-scale));
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  line-height: 1.1;
}

.v-remote .rm-entry.is-empty .rm-entry-num {
  color: var(--text-faint);
  letter-spacing: 0.1em;
}

.v-remote .rm-entry-hint {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.3;
}

.v-remote .rm-entry.is-tuning .rm-entry-num {
  color: var(--accent-text);
  animation: rm-pulse 1s ease-in-out infinite;
}

.v-remote .rm-entry.is-ok {
  box-shadow: var(--lcd-shadow), 0 0 0 1px rgba(var(--success-rgb), 0.45);
}

.v-remote .rm-entry.is-ok .rm-entry-num,
.v-remote .rm-entry.is-ok .rm-entry-hint {
  color: var(--success);
}

.v-remote .rm-entry.is-err {
  box-shadow: var(--lcd-shadow), 0 0 0 1px rgba(var(--danger-rgb), 0.45);
}

.v-remote .rm-entry.is-err .rm-entry-num,
.v-remote .rm-entry.is-err .rm-entry-hint {
  color: var(--danger);
}

.v-remote .rm-entry.shake {
  animation: rm-shake 0.36s ease-in-out;
}

.v-remote .rm-entry-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.12s, transform 0.1s var(--ease);
}

.v-remote .rm-entry-clear.pressed {
  background: var(--surface-3);
  transform: scale(0.9);
}

/* Auto-tune countdown: fills during the 1.8 s wait after the last digit. */
.v-remote .rm-entry-timer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
}

.v-remote .rm-entry-timer > span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 0 8px var(--accent-glow);
}

.v-remote .rm-entry-timer.run > span {
  animation: rm-countdown 1.8s linear forwards;
}

.v-remote .rm-digits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.v-remote .rm-digit {
  flex-direction: row;
  gap: 6px;
  height: calc(var(--k) * 0.82);
  font-family: var(--font-display);
  font-size: calc(24px * var(--remote-scale));
  font-weight: 600;
}

.v-remote .rm-digit-fn {
  color: var(--text-dim);
}

.v-remote .rm-go {
  border-color: transparent;
  background: linear-gradient(180deg, var(--accent-2) 0%, var(--accent) 100%);
  color: var(--accent-contrast);
  box-shadow: 0 10px 22px -10px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  font-family: var(--font);
  font-size: calc(16px * var(--remote-scale));
  font-weight: 750;
}

.v-remote .rm-go.pressed {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 4px 12px -6px var(--accent-glow), inset 0 2px 6px rgba(0, 0, 0, 0.22);
}

/* ---------------------------------------------------------- simple layout */
.v-remote .rm-simple {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "top"
    "ch"
    "num";
}

.v-remote .rm-simple.no-num {
  grid-template-areas:
    "top"
    "ch";
}

.v-remote .rm-s-top {
  grid-area: top;
  display: grid;
  grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr));
  gap: 12px;
}

.v-remote .rm-s-top .rm-key {
  height: calc(var(--k) * 1.12);
  border-radius: 20px;
}

.v-remote .rm-s-top .rm-cap {
  font-size: calc(11.5px * var(--remote-scale));
}

.v-remote .rm-s-chs {
  grid-area: ch;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.v-remote .rm-s-ch {
  gap: 6px;
  height: calc(var(--k) * 1.75);
  border-radius: 26px;
}

.v-remote .rm-s-ch .rm-key-text {
  font-size: calc(17px * var(--remote-scale));
  font-weight: 800;
  letter-spacing: 0.06em;
}

/* Side by side on phones (− left, + right); stacked + over − on wider screens. */
.v-remote .rm-s-down {
  order: -1;
}

.v-remote .rm-simple .rm-digit {
  height: var(--k);
}

@media (min-width: 700px) {
  .v-remote .rm-simple {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-areas:
      "top top"
      "ch num";
    column-gap: 26px;
    padding: 30px 24px 24px;
  }

  .v-remote .rm-s-chs {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr 1fr;
  }

  .v-remote .rm-s-down {
    order: 0;
  }

  .v-remote .rm-s-ch {
    height: auto;
    min-height: calc(var(--k) * 1.75);
  }

  .v-remote .rm-simple.no-num {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "top"
      "ch";
  }

  .v-remote .rm-simple.no-num .rm-s-chs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .v-remote .rm-simple.no-num .rm-s-down {
    order: -1;
  }
}

/* ------------------------------------------------- wide (iPad and up) */
@media (min-width: 700px) {
  .v-remote .rm-full {
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-areas:
      "top top"
      "nav num"
      "play play"
      "colors colors";
    column-gap: 28px;
    padding: 30px 24px 24px;
  }

  .v-remote .rm-full .rm-numpad {
    align-self: start;
  }

  .v-remote .rm-full.no-num {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "top"
      "nav"
      "play"
      "colors";
  }

  .v-remote .rm-play,
  .v-remote .rm-play[data-n] {
    grid-template-columns: repeat(var(--n, 8), minmax(0, 1fr));
  }

  .v-remote .rm-play [data-k="replay"] { order: 1; }
  .v-remote .rm-play [data-k="rew"] { order: 2; }
  .v-remote .rm-play [data-k="play"] { order: 3; }
  .v-remote .rm-play [data-k="pause"] { order: 4; }
  .v-remote .rm-play [data-k="ffwd"] { order: 5; }
  .v-remote .rm-play [data-k="advance"] { order: 6; }
  .v-remote .rm-play [data-k="stop"] { order: 7; }
  .v-remote .rm-play [data-k="record"] { order: 8; }
}

/* ================================================= landscape side panel */
.v-remote .rm-side-card {
  overflow: hidden;
}

.v-remote .rm-side-card .card-header {
  min-height: 50px;
  padding: 8px 10px 8px 16px;
}

.v-remote .rm-side-card .card-header h3 {
  font-size: 16px;
}

.v-remote .rm-side-ic {
  color: var(--text-dim);
}

.v-remote .rm-side-ic-fav {
  color: var(--warning);
}

.v-remote .rm-side-body {
  padding: 10px 8px 12px;
}

.v-remote .rm-side-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  max-height: 44vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.v-remote .rm-side-grid .rm-fav {
  width: auto;
  min-width: 0;
}

.v-remote .rm-side-hint {
  margin: 8px 8px 0;
  color: var(--text-faint);
  font-size: 12.5px;
  line-height: 1.4;
}

.v-remote .rm-side-pad {
  margin: 0;
  padding: 14px 16px 16px;
}

.v-remote .rm-recent {
  max-height: 34vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.v-remote .rm-recent-item {
  min-height: 54px;
  padding: 7px 6px 7px 14px;
}

.v-remote .rm-recent-item .li-title {
  font-size: 15px;
}

.v-remote .rm-recent-item .li-sub {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.v-remote .rm-recent-item.is-tuning .ch-badge {
  animation: rm-pulse 0.9s ease-in-out infinite;
}

.v-remote .rm-recent-star {
  color: var(--text-faint);
}

.v-remote .rm-recent-star.on {
  color: var(--warning);
}

/* TV-set-only TVs: apps grid + inputs list instead of favorites / recents. */
.v-remote .rm-side-apps {
  max-height: 52vh;
}

.v-remote .rm-side-apps .rm-app {
  width: auto;
}

.v-remote .rm-side-inputs {
  max-height: 30vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.v-remote .rm-side-inputs .rm-input {
  min-height: 52px;
  padding: 7px 14px;
}

@media (hover: hover) and (pointer: fine) {
  .v-remote .rm-side-grid,
  .v-remote .rm-recent,
  .v-remote .rm-side-inputs {
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
  }
}

/* ================================================== TV strip (TV sets) */
.v-remote .rm-tvbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px 12px;
  border: 1px solid var(--body-border);
  border-radius: 26px;
  background: var(--body-bg);
  box-shadow: var(--body-shadow);
}

.v-remote .rm-tv-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 30px;
  padding: 0 2px 0 4px;
  color: var(--text-dim);
  font-size: 13.5px;
}

.v-remote .rm-tv-tag {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 5px;
  height: 22px;
  padding: 0 8px 0 7px;
  border-radius: 11px;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v-remote .rm-tv-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 700;
}

.v-remote .rm-tv-now {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v-remote .rm-tv-now::before {
  content: "·";
  margin-right: 8px;
  color: var(--text-faint);
}

.v-remote .rm-tv-head .spacer {
  flex: 1 1 auto;
}

.v-remote .rm-tv-level {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 7px;
  height: 30px;
  padding: 0 11px 0 9px;
  border: 0;
  border-radius: 15px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.v-remote .rm-tv-level.is-tap {
  cursor: pointer;
  transition: background 0.12s, transform 0.1s var(--ease);
}

.v-remote .rm-tv-level.is-tap.pressed {
  background: var(--surface-3);
  transform: scale(0.96);
}

.v-remote .rm-tv-level-ic {
  display: flex;
  color: var(--text-dim);
}

.v-remote .rm-tv-level.is-muted {
  background: rgba(var(--warning-rgb), 0.16);
  color: var(--warning);
}

.v-remote .rm-tv-level.is-muted .rm-tv-level-ic {
  color: inherit;
}

.v-remote .rm-tv-meter {
  position: relative;
  width: 46px;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--surface-3);
}

.v-remote .rm-tv-meter > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  transition: width 0.25s var(--ease);
}

.v-remote .rm-tv-keys {
  display: grid;
  grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr));
  gap: 8px;
}

.v-remote .rm-tv-keys .rm-key {
  height: calc(var(--k) * 0.86);
  border-radius: 15px;
}

.v-remote .rm-tv-off {
  color: var(--danger);
}

.v-remote .rm-tv-off .rm-cap,
.v-remote .rm-tv-off.pressed .rm-cap {
  color: rgba(var(--danger-rgb), 0.9);
}

.v-remote .rm-tv-off.pressed {
  color: var(--danger);
}

/* Mute is on. */
.v-remote .rm-key.is-on {
  background:
    radial-gradient(80% 90% at 50% 0%, rgba(var(--warning-rgb), 0.2), transparent 75%),
    var(--key-bg);
  color: var(--warning);
}

.v-remote .rm-key.is-on .rm-cap {
  color: var(--warning);
}

@media (max-width: 480px) {
  .v-remote .rm-tvbar {
    padding: 9px 9px 10px;
    border-radius: 22px;
  }

  .v-remote .rm-tv-keys {
    gap: 6px;
  }

  .v-remote .rm-tv-keys .rm-key {
    padding: 0 2px;
    border-radius: 13px;
  }

  .v-remote .rm-tv-keys .rm-cap {
    font-size: calc(9.5px * var(--remote-scale));
    letter-spacing: 0.03em;
  }

  .v-remote .rm-tv-meter {
    width: 34px;
  }
}

/* ============================== TV-set sheets: inputs, apps, volume (body-level) */
.rm-sheet {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rm-sheet-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.4;
}

.rm-sheet-search {
  flex: none;
}

.rm-sheet-more {
  align-self: center;
}

.rm-input {
  min-height: 56px;
}

.rm-input.is-busy {
  opacity: 1;
}

.rm-input-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
}

.rm-input-check {
  color: var(--accent-text);
  opacity: 0;
  transition: opacity 0.15s;
}

.rm-input.is-current .rm-input-ic {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.rm-input.is-current .li-title {
  color: var(--accent-text);
}

.rm-input.is-current .rm-input-check {
  opacity: 1;
}

.rm-input.is-busy .rm-input-ic,
.rm-app.is-busy .rm-app-ic {
  animation: rm-pulse 0.9s ease-in-out infinite;
}

.rm-apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 4px;
}

.rm-app {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 10px 4px 8px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, transform 0.1s var(--ease);
}

.rm-app.pressed {
  background: var(--surface-2);
  transform: scale(0.95);
}

.rm-app:disabled {
  cursor: default;
}

.rm-app-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 17px;
  background: var(--app-color, var(--accent));
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 18px -10px rgba(0, 0, 0, 0.7);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.15s;
}

.rm-app-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 650;
}

.rm-app.is-current .rm-app-ic {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.6), 0 8px 18px -10px rgba(0, 0, 0, 0.7);
}

.rm-app.is-current .rm-app-name {
  color: var(--accent-text);
}

@media (hover: hover) and (pointer: fine) {
  .rm-app:hover {
    background: var(--surface-2);
  }
}

/* Volume slider (LG) */
.rm-vol {
  align-items: center;
  gap: 18px;
  padding: 6px 0 4px;
}

.rm-vol-val {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

.rm-vol-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 520px;
}

.rm-vol-step {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
}

.rm-vol-range {
  --pct: 0%;
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  touch-action: pan-y;
}

.rm-vol-range:focus {
  outline: none;
}

.rm-vol-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) var(--pct), var(--surface-3) var(--pct));
}

.rm-vol-range::-webkit-slider-thumb {
  width: 30px;
  height: 30px;
  margin-top: -11px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.06);
  -webkit-appearance: none;
  appearance: none;
}

.rm-vol-range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--accent-soft), 0 2px 8px rgba(0, 0, 0, 0.35);
}

.rm-vol-range::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
}

.rm-vol-range::-moz-range-progress {
  height: 8px;
  border-radius: 4px;
  background: var(--accent);
}

.rm-vol-range::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.rm-vol-mute {
  min-width: 150px;
}

/* Busy buttons (Turn on / Retry in the banner) */
.v-remote .btn.is-busy {
  opacity: 1;
}

.v-remote .btn.is-busy > * {
  opacity: 0;
}

.v-remote .btn.is-busy::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2.5px solid rgba(127, 140, 170, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: lc-spin 0.8s linear infinite;
}

.v-remote .btn-primary.is-busy::after {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
}

/* ============================================================= animation */
@keyframes rm-led {
  0%,
  45% {
    background: var(--accent-2);
    box-shadow: 0 0 12px 2px var(--accent-glow);
  }

  100% {
    background: var(--led-off);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.35);
  }
}

@keyframes rm-countdown {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@keyframes rm-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.45;
  }
}

@keyframes rm-blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.25;
  }
}

@keyframes rm-shake {
  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-7px);
  }

  40% {
    transform: translateX(6px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(2px);
  }
}

@keyframes rm-pop {
  0% {
    transform: scale(0.6);
  }

  60% {
    transform: scale(1.18);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes rm-sweep {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(300%);
  }
}
