.zone-site-dock {
  position: fixed;
  z-index: 905;
  inset: auto auto max(6px, env(safe-area-inset-bottom)) 50%;
  transform: translateX(-50%);
  display: flex;
  direction: rtl;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--zone-line, #3d3d3d);
  border-radius: 16px;
  background: var(--zone-panel, #222);
  box-shadow: 0 8px 28px #0008;
}

.zone-site-dock :is(a, button) {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--zone-muted, #b3b3b3);
  cursor: pointer;
  touch-action: manipulation;
}

.zone-site-dock a,
.zone-site-dock button[aria-pressed="true"] {
  border-color: #567741;
  background: #253925;
  color: #adf186;
}

.zone-site-dock :is(a, button):hover { background: #304738; color: #d9ffc6; }
.zone-site-dock :is(a, button):focus-visible { outline: 2px solid #adf186; outline-offset: 1px; }
.zone-site-dock svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.zone-site-dock-status {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(310px, 90vw);
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--zone-control, #2a2a2a);
  color: #fff;
  text-align: center;
  font: 14px/1.5 system-ui, sans-serif;
}
body.in-theater-mode .zone-site-dock { display: none; }

@property --zone-frame-color {
  syntax: '<color>';
  inherits: true;
  initial-value: #70a9ff;
}

html[data-zone-frame] {
  --zone-frame-color: var(--zone-frame-first);
  --zone-frame-line: var(--zone-frame-color);
  --zone-frame-icon: #f3f3f3;
}

@supports (color: color-mix(in srgb, red, blue)) {
  html[data-zone-frame] {
    --zone-frame-line: color-mix(in srgb, var(--zone-frame-color) 45%, var(--zone-line, #3d3d3d));
    --zone-frame-icon: color-mix(in srgb, var(--zone-frame-color) 55%, #f3f3f3);
  }
}

@keyframes zone-frame-colors {
  0%, 100% { --zone-frame-color: var(--zone-frame-first); }
  33.333% { --zone-frame-color: var(--zone-frame-second); }
  66.667% { --zone-frame-color: var(--zone-frame-third); }
}

html[data-zone-frame="animated"] {
  --zone-frame-period: 8s;
  animation: zone-frame-colors var(--zone-frame-period) linear infinite;
}

.zone-frame-outline { display: none; }

html[data-zone-frame] .zone-frame-outline {
  display: block;
  position: fixed;
  z-index: 904;
  inset: 2px;
  border: 2px solid var(--zone-frame-color);
  border-radius: 16px;
  pointer-events: none;
}

@supports (background: conic-gradient(red, blue)) and ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  html[data-zone-frame="animated"] .zone-frame-outline {
    box-sizing: border-box;
    padding: 2px;
    border: 0;
    overflow: hidden;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
  }

  html[data-zone-frame="animated"] .zone-frame-outline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150vmax;
    height: 150vmax;
    background: conic-gradient(var(--zone-frame-first), var(--zone-frame-third),
      var(--zone-frame-second), var(--zone-frame-first));
    animation: zone-frame-spin var(--zone-frame-period) linear infinite;
  }
}

@keyframes zone-frame-spin {
  from { transform: translate(-50%, -50%) rotate(0turn); }
  to { transform: translate(-50%, -50%) rotate(1turn); }
}

html[data-zone-frame] :is(.zone-popover, .zone-dialog, .zone-frame-dialog, .home-feature, .home-live-guide,
  .home-channel, .home-app-icon, .app-menu-open, .app-center-card, .zone-card, .zone-channel, .yt-card,
  .lite-launch-card, .radio-card, .chill-scene, .arcade-challenge, .zone-site-dock, .toolbar-app-button,
  .btn-voice-mic, .canvas-player-drawer:not(.theater-mode), .player-settings-panel),
html[data-zone-frame] body.zone-home .zone-home-toolbar .search-input-wrapper {
  border-color: var(--zone-frame-line) !important;
}

html[data-zone-frame] .launcher-icon { box-shadow: inset 0 0 0 1px var(--zone-frame-line); }

html[data-zone-frame] :is(.zone-site-dock a, .zone-site-dock button[aria-pressed="true"], .zone-frame-toggle) {
  border-color: var(--zone-frame-color);
  color: var(--zone-frame-icon);
}

html[data-zone-frame] :is(a[href], button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--zone-frame-color) !important;
  box-shadow: 0 0 0 1px #f3f3f3a0;
}

html[data-zone-frame] body.zone-home .zone-home-toolbar .search-input-wrapper:focus-within {
  border-color: var(--zone-frame-color) !important;
}

.zone-frame-toggle {
  position: fixed;
  z-index: 905;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--zone-line, #3d3d3d);
  border-radius: 14px;
  color: #dce8fd;
  background: var(--zone-panel, #222);
  box-shadow: 0 6px 20px #0008;
  cursor: pointer;
  touch-action: manipulation;
}

.zone-frame-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

body.in-theater-mode .zone-frame-toggle,
html[data-zone-frame] body.in-theater-mode .zone-frame-outline { display: none; }

.zone-frame-dialog {
  position: fixed;
  inset: auto max(12px, env(safe-area-inset-right)) max(64px, calc(env(safe-area-inset-bottom) + 58px)) auto;
  box-sizing: border-box;
  width: min(350px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 80px);
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--zone-line, #3d3d3d);
  border-radius: 20px;
  background: var(--zone-panel, #222);
  color: var(--zone-text, #f3f3f3);
  color-scheme: dark;
  box-shadow: 0 18px 48px #000b;
  font: 700 15px/1.4 var(--font, system-ui, sans-serif);
}

.zone-frame-dialog::backdrop { background: #0003; }
.zone-frame-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.zone-frame-dialog h2 { margin: 0; font-size: 1.2rem; }
.zone-frame-dialog button {
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--zone-line, #3d3d3d);
  border-radius: 10px;
  background: var(--zone-control, #2a2a2a);
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.zone-frame-dialog [data-frame-close] { min-width: 44px; font-size: 1.3rem; }
.zone-frame-dialog button:hover, .zone-frame-toggle:hover { background: var(--zone-hover, #343434); }
.zone-frame-dialog .zone-frame-modes button[aria-pressed="true"] {
  border-color: var(--zone-frame-line);
  color: var(--zone-frame-icon);
  background: #131313;
}

.zone-frame-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 8px; }
.zone-frame-colors { display: grid; gap: 6px; }
.zone-frame-color-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.zone-frame-color-row[hidden] { display: none; }
.zone-frame-color-row label { font-size: .85rem; }
.zone-frame-color-row input[type="range"] {
  display: block;
  appearance: none;
  width: 100%;
  min-width: 0;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}
.zone-frame-color-row input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff6969, #ffff69, #69ff69, #69ffff, #6969ff, #ff69ff, #ff6969);
}
.zone-frame-color-row input[type="range"]::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff6969, #ffff69, #69ff69, #69ffff, #6969ff, #ff69ff, #ff6969);
}
.zone-frame-color-row input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -5px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--zone-frame-sample);
  box-shadow: 0 1px 4px #000a;
}
.zone-frame-color-row input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--zone-frame-sample);
  box-shadow: 0 1px 4px #000a;
}
.zone-frame-color-row input[type="color"] {
  width: 44px;
  height: 44px;
  padding: 5px;
  border: 1px solid var(--zone-line, #3d3d3d);
  border-radius: 10px;
  background: var(--zone-control, #2a2a2a);
  cursor: pointer;
}
.zone-frame-color-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.zone-frame-color-row input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.zone-frame-reset { width: 100%; margin-top: 10px; }

.zone-site-dock{max-width:calc(100vw - 16px);box-sizing:border-box}.zone-site-dock :is(a,button){flex-shrink:0}@media(max-width:420px){.zone-site-dock{gap:2px}.zone-site-dock :is(a,button){width:44px;height:48px}}
