:is(.anytv-devices-view, .anytv-devices-detail, .anytv-devices-options, .anytv-devices-playlists) {
  --anytv-device-surface: #1b1a2a;
  --anytv-device-base: #151421;
  --anytv-device-border: #393548;
  --anytv-device-text: #f6f1f8;
  --anytv-device-muted: #b9b2c8;
  --anytv-device-coral: #ff9992;
  --anytv-device-focus: #ffaaa4;
  color: var(--anytv-device-text);
}

.anytv-devices-view, .anytv-devices-results, .anytv-devices-detail, .anytv-devices-options {
  display: grid;
  align-content: start;
  min-inline-size: 0;
  gap: 12px;
}

.anytv-devices-view { gap: clamp(12px, 2vw, 20px); }

.anytv-devices-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(10px, 2vw, 19px);
  min-inline-size: 0;
  padding: clamp(13px, 2.5vw, 26px);
  border: 1px solid #433345;
  border-radius: 20px;
  background: radial-gradient(ellipse at 100% 0, rgb(255 106 114 / 17%), transparent 60%),
    linear-gradient(120deg, #242235, #181725 76%);
  box-shadow: inset 0 1px rgb(255 232 246 / 7%);
}

.anytv-devices-heading h1 { font-size: clamp(1.48rem, 4vw, 2.38rem); }
.anytv-devices-heading p { margin-block-start: 4px; color: var(--anytv-device-muted); font-size: clamp(.77rem, 1.9vw, .91rem); }

.anytv-devices-count {
  justify-self: start;
  padding: 6px 9px;
  border: 1px solid #624453;
  border-radius: 999px;
  background: #392735;
  color: #ffd5d1;
  font-size: .73rem;
  font-weight: 680;
  text-align: center;
  overflow-wrap: anywhere;
}

.anytv-devices-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 9px; }
.anytv-devices-search-group { display: grid; min-inline-size: 0; gap: 5px; }
.anytv-devices-search-group > label { color: var(--anytv-device-muted); font-size: .78rem; font-weight: 640; }

.anytv-devices-search {
  display: flex;
  align-items: center;
  border-color: var(--anytv-device-border);
  border-radius: 14px;
  background: var(--anytv-device-base);
  box-shadow: none;
}

.anytv-devices-search:focus-within { border-color: #c76e79; box-shadow: 0 0 0 3px rgb(255 120 126 / 14%); }
.anytv-devices-search > input { flex: 1 1 auto; min-inline-size: 0; color: var(--anytv-device-text); }
.anytv-devices-search > input::placeholder { color: #aca3ba; }
.anytv-devices-search > .icon-btn { flex: 0 0 44px; --control-top: #482c3a; --control-bottom: #30202e; --control-edge: #734453; --control-hover: #c37681; color: #ffd1cc; }
.anytv-devices-search > .search-clear { --control-top: #242235; --control-bottom: #1b1a2a; --control-edge: #403a50; --control-hover: #786780; color: var(--anytv-device-muted); }
.anytv-devices-toolbar > .btn { min-block-size: 52px; }

.anytv-devices-list { display: grid; min-inline-size: 0; gap: 7px; }
.anytv-devices-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-inline-size: 0;
  min-block-size: 66px;
  padding: 6px;
  border: 1px solid var(--anytv-device-border);
  border-radius: 15px;
  background: linear-gradient(115deg, var(--anytv-device-surface), var(--anytv-device-base));
  box-shadow: inset 0 1px rgb(255 234 250 / 5%);
}

.anytv-devices-open, .anytv-devices-options-button, .anytv-devices-option, .anytv-devices-copy {
  min-inline-size: 0;
  min-block-size: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: start;
}

:is(.anytv-devices-open, .anytv-devices-options-button, .anytv-devices-option, .anytv-devices-copy):disabled { opacity: .6; cursor: default; }
:is(.anytv-devices-view, .anytv-devices-detail, .anytv-devices-options) :where(button, input):focus-visible {
  outline: 2px solid var(--anytv-device-focus);
  outline-offset: 2px;
}

.anytv-devices-open {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "platform identity details" "platform status details";
  align-items: center;
  justify-items: start;
  column-gap: clamp(6px, 2vw, 15px);
  row-gap: 4px;
  padding: 5px;
}

.anytv-devices-open > .anytv-devices-platform { grid-area: platform; }
.anytv-devices-open > .anytv-devices-status { grid-area: status; }
.anytv-devices-identity { display: grid; grid-area: identity; gap: 2px; min-inline-size: 0; max-inline-size: 100%; }
.anytv-devices-identity .mac { font-size: clamp(.68rem, 3.6vw, 1rem); font-weight: 720; line-height: 1.25; overflow-wrap: anywhere; }
.anytv-devices-model { color: var(--anytv-device-muted); font-size: .76rem; line-height: 1.35; overflow-wrap: anywhere; }

.anytv-devices-platform {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  inline-size: 40px;
  block-size: 40px;
  border: 1px solid #674452;
  border-radius: 12px;
  background: linear-gradient(145deg, #4a2c3a, #302336);
  color: #ffb6ae;
}

.anytv-devices-platform.is-branded {
  inline-size: 46px;
  padding: 3px;
  overflow: hidden;
  border-color: #d5dded;
  border-radius: 10px;
  background: #f8faff;
  color: #445474;
  box-shadow: inset 0 1px #fff, 0 2px 5px #080b1829;
}
.anytv-devices-platform.is-branded > img {
  inline-size: 100%;
  block-size: 100%;
  min-inline-size: 0;
  min-block-size: 0;
  object-fit: contain;
}

.anytv-devices-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-inline-size: 100%;
  padding: 3px 7px;
  border: 1px solid #4c624d;
  border-radius: 999px;
  background: #27382f;
  color: #bbecd1;
  font-size: .68rem;
  font-weight: 670;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.anytv-devices-status::before { inline-size: 5px; block-size: 5px; flex: 0 0 auto; border-radius: 50%; background: currentColor; content: ""; }
.anytv-devices-status[data-tone="amber"] { border-color: #654e3b; background: #392d27; color: #ffdaa8; }
.anytv-devices-status[data-tone="danger"] { border-color: #704650; background: #452b37; color: #ffc1ba; }

.anytv-devices-details-label, .anytv-devices-options-button { display: inline-flex; align-items: center; justify-content: center; }
.anytv-devices-details-label { grid-area: details; gap: 4px; color: var(--anytv-device-coral); font-size: 0; }
.anytv-devices-details-label svg, .anytv-devices-option-arrow svg { inline-size: 17px; block-size: 17px; }
.anytv-devices-options-button {
  min-inline-size: 44px;
  gap: 5px;
  padding: 5px;
  border-color: #453c52;
  background: #252238;
  color: #e5d9ef;
  font-size: .78rem;
  font-weight: 650;
}

.anytv-devices-options-button > span { display: none; }
.anytv-devices-options-button > svg { inline-size: 18px; block-size: 18px; }
.anytv-devices-row:focus-within { border-color: #9b6377; }

:dir(rtl) :is(.anytv-devices-details-label, .anytv-devices-option-arrow) > svg { transform: scaleX(-1); }
.anytv-devices-pages { display: flex; justify-content: center; }
.anytv-devices-pager { inline-size: min(100%, 16rem); grid-template-columns: auto minmax(48px, 1fr) auto; }
.anytv-devices-pager > bdi { color: var(--anytv-device-muted); font-weight: 650; }

.anytv-devices-empty, .anytv-devices-error {
  display: grid;
  justify-items: center;
  align-content: center;
  min-block-size: 124px;
  gap: 8px;
  padding: 15px;
  border: 1px solid var(--anytv-device-border);
  border-radius: 15px;
  background: var(--anytv-device-base);
  text-align: center;
}

.anytv-devices-empty h2 { font-size: 1rem; }
.anytv-devices-empty p { color: var(--anytv-device-muted); }
.anytv-devices-error { justify-items: start; text-align: start; }

.anytv-devices-detail-hero {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #574053;
  border-radius: 16px;
  background: radial-gradient(ellipse at 100% 0, rgb(255 110 120 / 16%), transparent 65%), #222032;
}

:is(.anytv-devices-row, .anytv-devices-detail-hero)[data-platform="tizen"] { --device-platform-tint: #6c9df31f; --device-platform-edge: #4a5572; }
:is(.anytv-devices-row, .anytv-devices-detail-hero)[data-platform="webos"] { --device-platform-tint: #eb81ae22; --device-platform-edge: #604559; }
:is(.anytv-devices-row, .anytv-devices-detail-hero):is([data-platform="titan"], [data-platform="fire"]) { --device-platform-tint: #ffb3851e; --device-platform-edge: #64514e; }
:is(.anytv-devices-row, .anytv-devices-detail-hero)[data-platform="android"] { --device-platform-tint: #7eddb41c; --device-platform-edge: #445d5a; }
:is(.anytv-devices-row, .anytv-devices-detail-hero)[data-platform="ios"] { --device-platform-tint: #adc8ee1f; --device-platform-edge: #4b5872; }
:is(.anytv-devices-row, .anytv-devices-detail-hero)[data-platform="vidaa"] { --device-platform-tint: #76c6e320; --device-platform-edge: #425a70; }
:is(.anytv-devices-row, .anytv-devices-detail-hero)[data-platform="roku"] { --device-platform-tint: #bc93f522; --device-platform-edge: #58486e; }
:is(.anytv-devices-row, .anytv-devices-detail-hero)[data-platform="zeasn"] { --device-platform-tint: #91b9de1e; --device-platform-edge: #485771; }
:is(.anytv-devices-row, .anytv-devices-detail-hero) { --device-platform-origin: 0%; }
[dir="rtl"] :is(.anytv-devices-row, .anytv-devices-detail-hero) { --device-platform-origin: 100%; }
.anytv-devices-row:where([data-platform]:not([data-platform="unknown"])) {
  border-color: var(--device-platform-edge, var(--anytv-device-border));
  background: radial-gradient(ellipse at var(--device-platform-origin) 50%, var(--device-platform-tint, transparent), transparent 62%),
    linear-gradient(115deg, var(--anytv-device-surface), var(--anytv-device-base));
}
.anytv-devices-detail-hero[data-platform]:not([data-platform="unknown"]) {
  border-color: var(--device-platform-edge, #574053);
  background: radial-gradient(ellipse at var(--device-platform-origin) 0, var(--device-platform-tint, transparent), transparent 72%), #222032;
}

.anytv-devices-detail-title { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.anytv-devices-detail-title strong { font-size: 1rem; overflow-wrap: anywhere; }
.anytv-devices-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 7px 10px;
  border-color: #594459;
  background: #181624;
}

.anytv-devices-copy .mac { color: #fff5fa; font-size: clamp(.84rem, 3.9vw, 1.16rem); font-weight: 750; overflow-wrap: anywhere; }
.anytv-devices-copy > span { display: inline-flex; align-items: center; gap: 6px; color: var(--anytv-device-coral); font-size: .75rem; font-weight: 680; }
.anytv-devices-copy svg { inline-size: 17px; block-size: 17px; }

.anytv-devices-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.anytv-devices-facts > div, .anytv-devices-note, .anytv-devices-playlists > .option-list > article {
  padding: 11px;
  border: 1px solid var(--anytv-device-border);
  border-radius: 13px;
  background: var(--anytv-device-surface);
}

.anytv-devices-facts dt, .anytv-devices-note h3 { display: flex; align-items: center; gap: 6px; color: var(--anytv-device-muted); font-size: .78rem; font-weight: 650; }
.anytv-devices-facts dt svg, .anytv-devices-note h3 svg { inline-size: 17px; block-size: 17px; color: var(--anytv-device-coral); }
.anytv-devices-facts dd { margin: 4px 0 0; font-size: .88rem; font-weight: 700; overflow-wrap: anywhere; }
.anytv-devices-note p { margin-block-start: 5px; font-size: .85rem; }

.anytv-devices-options { gap: 8px; }
.anytv-devices-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-block-size: 62px;
  padding: 8px;
  border-color: var(--anytv-device-border);
  border-radius: 13px;
  background: var(--anytv-device-surface);
}

.anytv-devices-option :is(strong, small) { display: block; overflow-wrap: anywhere; }
.anytv-devices-option strong { font-size: .9rem; }
.anytv-devices-option small { margin-block-start: 2px; color: var(--anytv-device-muted); font-size: .75rem; }
.anytv-devices-option-arrow { color: var(--anytv-device-coral); }
.anytv-devices-option[data-tone="danger"] strong { color: #ffb9b3; }

@media (max-width: 559px) {
  .anytv-devices-heading { grid-template-columns: auto minmax(0, 1fr); }
  .anytv-devices-count { grid-column: 2; }
  .anytv-devices-toolbar > .btn { inline-size: 48px; padding-inline: 0; }
  .anytv-devices-toolbar > .btn > span { display: none; }
}

@media (max-width: 349px) {
  .anytv-devices-open { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "platform identity" "platform status"; }
  .anytv-devices-platform.is-branded { inline-size: 44px; }
  .anytv-devices-details-label { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  .anytv-devices-copy > span > span { display: none; }
}

@media (min-width: 800px) {
  .anytv-devices-heading > .anytv-devices-platform { inline-size: 53px; block-size: 53px; }
  .anytv-devices-open {
    grid-template-columns: auto minmax(0, 1fr) minmax(75px, .32fr) auto;
    grid-template-areas: "platform identity status details";
    padding-inline: 8px;
  }
  .anytv-devices-details-label { font-size: .76rem; }
  .anytv-devices-options-button { padding-inline: 9px; }
  .anytv-devices-options-button > span { display: inline; }
}

@media (hover: hover) {
  .anytv-devices-row:hover { border-color: #715064; }
  :is(.anytv-devices-open, .anytv-devices-options-button, .anytv-devices-option, .anytv-devices-copy):hover:not(:disabled) {
    border-color: #86586c;
    background: #312538;
  }
}
