/* Self-hosted fonts. Generated by tools/vendor-fonts.mjs; do not edit. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/inter-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/inter-cyrillic.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/inter-greek.woff2) format('woff2');
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/inter-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/lora-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}

@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/lora-cyrillic.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/lora-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}

@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/lora-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/lora-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url(../fonts/nunito-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url(../fonts/nunito-cyrillic.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url(../fonts/nunito-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url(../fonts/nunito-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url(../fonts/nunito-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-cyrillic.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* Design tokens and color-scheme overrides */

:root {
  --bg-base: #000000;
  --bg-surface: #0a0a0b;
  --bg-elevated: #17171a;
  --bg-hover: rgba(255, 255, 255, 0.06);
  --bg-active: rgba(255, 255, 255, 0.1);
  --accent: #ff6b00;
  --accent-rgb: 255, 107, 0;
  --accent-hover: #ff8533;
  --accent-soft: rgba(255, 107, 0, 0.14);
  --accent-glow: 0 0 0 3px rgba(255, 107, 0, 0.2);
  --text: #ffffff;
  --text-muted: #a3a3a3;
  --text-faint: #6b6b6b;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --boost: #ff4d4d;
  --focus: #ff8533;
  --radius-frame: 10px;
  --radius-inner: 6px;
  --radius-pill: 999px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --header-h: 48px;
  --search-panel-w: 300px;
  --playlist-panel-w: 320px;
  --glass-bg: rgba(20, 20, 22, 0.42);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-blur: blur(22px) saturate(170%) brightness(1.05);
  --glass-blur-sm: blur(16px) saturate(160%);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  --glass-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.22);
  --glass-inner-glow: inset 0 0 40px rgba(255, 255, 255, 0.03);
  --menu-bg: rgba(20, 20, 22, 0.58);
  --dd-bg: #17171a;
  --dd-fg: #ffffff;
  --dd-selected-fg: #1a1200;
  --caption-font-family: 'Inter', sans-serif;
  --loop-a: #4ade80;
  --loop-b: #f87171;
  --bookmark: #60a5fa;
}

@media (prefers-color-scheme: light) {
  :root:not([data-scheme]) {
    --bg-base: #f5f4f1;
    --bg-surface: #ffffff;
    --bg-elevated: #ecebe7;
    --bg-hover: rgba(0, 0, 0, 0.05);
    --bg-active: rgba(0, 0, 0, 0.08);
    --text: #1a1a1c;
    --text-muted: #4d4d55;
    --text-faint: #7a7a82;
    --border: rgba(0, 0, 0, 0.07);
    --border-strong: rgba(0, 0, 0, 0.14);
    --menu-bg: rgba(255, 255, 255, 0.58);
    --glass-bg: rgba(255, 255, 255, 0.42);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.85);
    --glass-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.06);
    --glass-inner-glow: inset 0 0 40px rgba(255, 255, 255, 0.3);
    --dd-bg: #ffffff;
    --dd-fg: #1a1a1c;
  }
}

:root[data-scheme='light'] {
  color-scheme: light;
  --bg-base: #f5f4f1;
  --bg-surface: #ffffff;
  --bg-elevated: #ecebe7;
  --bg-hover: rgba(0, 0, 0, 0.05);
  --bg-active: rgba(0, 0, 0, 0.08);
  --text: #1a1a1c;
  --text-muted: #4d4d55;
  --text-faint: #7a7a82;
  --border: rgba(0, 0, 0, 0.07);
  --border-strong: rgba(0, 0, 0, 0.14);
  --menu-bg: rgba(255, 255, 255, 0.58);
  --glass-bg: rgba(255, 255, 255, 0.42);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --glass-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.06);
  --glass-inner-glow: inset 0 0 40px rgba(255, 255, 255, 0.3);
  --dd-bg: #ffffff;
  --dd-fg: #1a1a1c;
}

:root[data-scheme='dark'] {
  color-scheme: dark;
}

/* Reset, accessibility helpers, buttons, sliders and tooltips */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 127, 127, 0.25) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(127, 127, 127, 0.25);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
  background-clip: content-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  transition-delay: 0ms !important;
  scroll-behavior: auto !important;
}

html.reduce-motion .center-flash.pulse {
  animation: none !important;
  opacity: 0 !important;
}

.sr-only,
.visually-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden],
svg[hidden],
path[hidden] {
  display: none !important;
}

html.mv-boot .app {
  display: none !important;
}

html.mv-boot #mvView {
  display: flex !important;
}

:focus {
  outline: none;
}

body.input-keyboard :focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

body.input-mouse :focus-visible,
body:not(.input-keyboard):focus-visible {
  outline: none;
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 1000;
  padding: 8px 14px;
  background: var(--accent);
  color: #1a1200;
  border-radius: var(--radius-inner);
  font-weight: 600;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 8px;
}

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}

input[type='range']::-webkit-slider-thumb:hover {
  transform: scale(1.12);
}

input[type='range']::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.ghost-btn,
.tb-btn,
.icon-btn,
.mv-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  border-radius: var(--radius-inner);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition:
    color 0.14s ease,
    background 0.14s ease,
    border-color 0.14s ease;
  white-space: nowrap;
  flex: 0 0 auto;
  position: relative;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.ghost-btn:hover,
.tb-btn:hover,
.icon-btn:hover,
.mv-btn-ghost:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.ghost-btn.active,
.tb-btn.active,
.icon-btn.active,
.ghost-btn[aria-pressed='true'],
.icon-btn[aria-pressed='true'] {
  color: var(--accent);
  background: var(--accent-soft);
}

.icon-btn.icon-only,
.ghost-btn.icon-only {
  padding: 0;
  width: 32px;
}

.icon-btn.danger {
  color: var(--danger);
}

.icon-btn.danger:hover {
  color: #fff;
  background: var(--danger-soft);
}

[data-tip] {
  position: relative;
}

[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.94);
  color: #fff;
  padding: 6px 10px;
  border-radius: var(--radius-inner);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 60;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.control-bar[data-layout='classic'] [data-tip]:hover::after,
.control-bar[data-layout='classic'] [data-tip]:focus-visible::after,
.control-bar[data-layout='standard'] [data-tip]:hover::after,
.control-bar[data-layout='standard'] [data-tip]:focus-visible::after {
  top: auto;
  bottom: calc(100% + 10px);
}

/* App shell, top bar, stage, overlays and badges */

.app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: calc(var(--header-h) + env(safe-area-inset-top));
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top) 14px 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 5;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: flex;
  align-items: center;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
}

.brand-accent {
  color: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 48px;
}

.topbar-actions .ghost-btn {
  height: 36px;
}

.tb-count {
  background: var(--accent);
  color: #1a1200;
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font-variant-numeric: tabular-nums;
}

.workspace {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  position: relative;
}

.stage {
  position: relative;
  flex: 1 1 auto;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  max-width: 420px;
  padding: 32px;
  color: var(--text-muted);
}

/* The stage is always black, so its empty state and drop hint keep the dark palette when the system theme is light. */
.empty-state,
.drop-zone {
  --text: #ffffff;
  --text-muted: #a3a3a3;
  --text-faint: #6b6b6b;
  --border-strong: rgba(255, 255, 255, 0.12);
  --bg-elevated: #17171a;
}

.empty-glyph {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 12px;
  background: var(--bg-elevated);
}

.empty-state h1 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.empty-sub {
  font-size: 11.5px !important;
  color: var(--text-faint);
  margin-top: 14px !important;
  letter-spacing: 0.01em;
}

.file-label {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: #1a1200;
  padding: 10px 22px;
  border-radius: var(--radius-inner);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.14s ease;
  margin: 12px 0;
}

.file-label:hover {
  background: var(--accent-hover);
}

.stage.has-media .empty-state {
  display: none;
}

.drop-zone {
  position: absolute;
  inset: 0;
  background: rgba(255, 107, 0, 0.06);
  border: 1.5px dashed var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.18s ease,
    visibility 0.18s ease;
  z-index: 20;
  color: var(--accent);
  pointer-events: none;
}

.drop-zone.active {
  opacity: 1;
  visibility: visible;
}

.drop-zone h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

#video {
  width: 100%;
  height: 100%;
  object-fit: scale-down;
  display: none;
  background: #000;
  transition: transform 0.2s ease;
  will-change: transform;
  transform: translateZ(0);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.stage.has-media #video {
  display: block;
}

.stage.shader-active #video {
  visibility: hidden;
}

.stage,
.shader-canvas {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.shader-canvas {
  position: absolute;
  pointer-events: none;
  z-index: 4;
  background: #000;
  display: none;
  transition: transform 0.2s ease;
}

.stage.shader-active .shader-canvas {
  display: block;
}

.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 5;
  color: var(--text-muted);
  font-size: 12.5px;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.resume-toast {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-frame);
  padding: 10px 12px 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  z-index: 30;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.5),
    var(--glass-highlight),
    var(--glass-shadow),
    var(--glass-inner-glow);
  max-width: calc(100% - 24px);
}

.resume-toast-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.resume-countdown {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  min-width: 14px;
  text-align: center;
}

.resume-toast-actions button {
  padding: 5px 11px;
  border-radius: var(--radius-inner);
  font-size: 12px;
  font-weight: 600;
}

#resumeYes {
  background: var(--accent);
  color: #1a1200;
}

#resumeNo {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.center-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  min-width: 64px;
  min-height: 64px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  z-index: 15;
}

.center-flash-icon {
  display: flex;
  color: #fff;
}

.center-flash-icon svg {
  width: 24px;
  height: 24px;
}

.center-flash-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
}

.center-flash-label:empty {
  display: none;
}

.center-flash.pulse {
  animation: flashPulse 2.2s ease forwards;
}

.center-flash.pos-left {
  left: 25%;
}

.center-flash.pos-right {
  left: 75%;
}

@keyframes flashPulse {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.85);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

.hold-speed-badge {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #1a1200;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  z-index: 26;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}

.action-badge {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  z-index: 27;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.45),
    var(--glass-highlight),
    var(--glass-inner-glow);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
  pointer-events: none;
  white-space: nowrap;
}

.action-badge.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.action-badge .action-badge-icon {
  display: flex;
  color: var(--accent);
}

.action-badge .action-badge-icon svg {
  width: 14px;
  height: 14px;
}

.action-badge .action-badge-text {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-badge .action-badge-label {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
}

.action-badge .action-badge-value {
  color: var(--text);
  font-weight: 700;
}

.action-badge.is-active .action-badge-value {
  color: var(--accent);
}

.silence-skip-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  z-index: 26;
  pointer-events: none;
}

.ab-loop-badge {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--loop-a);
  padding: 6px 12px 6px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  z-index: 28;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

.ab-loop-badge.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.ab-loop-badge .ab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--loop-a);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
  animation: abPulse 1.6s ease-in-out infinite;
}

.ab-loop-badge .ab-range-tag {
  color: var(--loop-a);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ab-loop-badge .ab-time {
  color: rgba(255, 255, 255, 0.95);
  font-variant-numeric: tabular-nums;
}

.ab-loop-badge .ab-sep {
  color: rgba(255, 255, 255, 0.35);
}

.ab-loop-badge .ab-remaining {
  color: rgba(255, 255, 255, 0.6);
}

@keyframes abPulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(74, 222, 128, 0.08);
  }
}

.volume-overlay {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-frame);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease;
  z-index: 25;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.5),
    var(--glass-highlight),
    var(--glass-inner-glow);
}

.volume-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.volume-overlay-bar {
  position: relative;
  width: 96px;
  height: 4px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 2px;
}

.volume-overlay-mark {
  position: absolute;
  top: -3px;
  left: 50%;
  width: 1px;
  height: 10px;
  background: rgba(255, 255, 255, 0.3);
}

.volume-overlay-fill {
  position: relative;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  max-width: 100%;
}

.volume-overlay.boosted .volume-overlay-fill {
  background: var(--boost);
}

.volume-overlay.muted .volume-overlay-fill {
  background: var(--danger);
  width: 0 !important;
}

.volume-overlay-text {
  min-width: 32px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.volume-overlay.boosted .volume-overlay-text {
  color: var(--boost);
}

.volume-overlay-icon {
  display: flex;
}

.volume-overlay-icon svg {
  width: 18px;
  height: 18px;
}

.volume-overlay.boosted .volume-overlay-icon {
  color: var(--boost);
}

.captions-cue {
  position: absolute;
  left: 50%;
  bottom: var(--caption-bottom, 84px);
  transform: translateX(-50%);
  max-width: 80%;
  text-align: center;
  background: var(--caption-bg, rgba(0, 0, 0, 0.7));
  color: var(--caption-color, #fff);
  padding: var(--caption-pad, 4px 12px);
  border-radius: var(--radius-inner);
  font-size: var(--caption-size, 16px);
  line-height: 1.4;
  text-shadow: var(--caption-shadow, none);
  font-family: var(--caption-font-family, inherit);
  z-index: 10;
  display: none;
  white-space: pre-line;
  font-weight: 500;
}

.captions-cue.visible {
  display: block;
}

.captions-cue.native-hidden {
  display: none !important;
}

video::cue {
  background: rgba(0, 0, 0, 0.7);
  font-size: 1.1em;
}

.app.topbar-hidden .topbar {
  min-height: 0;
  height: 0;
  padding: 0;
  border-bottom: none;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.topbar-reveal {
  position: fixed;
  top: 0;
  right: 14px;
  z-index: 6;
  width: 36px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  pointer-events: none;
}

.topbar-reveal.visible,
.topbar-reveal:focus-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.topbar-reveal:hover {
  color: var(--text);
}

.app.fullscreen .topbar-reveal {
  display: none;
}

@media (hover: none) {
  .topbar-reveal:not([hidden]) {
    opacity: 0.75;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* Control bar, scrubber and stage title */

.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 16px 14px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  transform: translateY(calc(100% + 26px));
  opacity: 0;
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s ease;
  z-index: 12;
  pointer-events: none;
}

.controls.visible {
  transform: translateY(0);
  opacity: 1;
}

.controls.standard-layout {
  padding: 0;
  justify-content: stretch;
  align-items: flex-end;
  padding-bottom: env(safe-area-inset-bottom);
}

.control-bar {
  width: 100%;
  max-width: 860px;
  background:
    radial-gradient(140% 160% at 50% -20%, rgba(var(--accent-rgb), 0.14), transparent 62%), rgba(18, 17, 20, 0.58);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 22px;
  padding: 7px 16px 5px;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.55),
    0 5px 14px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    inset 0 0 44px rgba(255, 255, 255, 0.035);
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: auto;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    border-radius 0.2s ease;
  transform: translateZ(0);
  position: relative;
  isolation: isolate;
  overflow: visible;
}

.control-bar:hover {
  border-color: rgba(var(--accent-rgb), 0.36);
}

.control-bar[data-layout='classic'] {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 14px;
  min-height: 48px;
  overflow: visible;
}

.control-bar[data-layout='classic'] .cb-top,
.control-bar[data-layout='classic'] .cb-bottom {
  display: contents;
}

.control-bar[data-layout='classic'] .cb-transport {
  order: 1;
  flex: 0 0 auto;
}

.control-bar[data-layout='classic'] #currentTime {
  order: 2;
  flex: 0 0 auto;
  min-width: 44px;
}

.control-bar[data-layout='classic'] #progressContainer {
  order: 3;
  flex: 1 1 auto;
  min-width: 120px;
}

.control-bar[data-layout='classic'] #duration {
  order: 4;
  flex: 0 0 auto;
  min-width: 44px;
}

.control-bar[data-layout='classic'] .volume-container {
  order: 5;
  flex: 0 0 auto;
}

.control-bar[data-layout='classic'] .cb-actions {
  order: 6;
  flex: 0 0 auto;
}

.control-bar[data-layout='classic'] .cb-minimal-time {
  display: none !important;
}

.control-bar[data-layout='classic'] .cb-time {
  font-size: 11.5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
}

.control-bar[data-layout='classic'] #currentTime {
  justify-content: flex-end;
}

.control-bar[data-layout='classic'] #duration {
  justify-content: flex-start;
}

.control-bar[data-layout='classic'] .scrubber {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
  transition: height 0.12s ease;
}

.control-bar[data-layout='classic'] .scrubber:hover,
.control-bar[data-layout='classic'] .scrubber:focus-visible {
  height: 6px;
}

.control-bar[data-layout='classic'] .scrubber-fill {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.45);
}

.control-bar[data-layout='classic'] .scrubber-buffered {
  background: rgba(255, 255, 255, 0.34);
}

.control-bar[data-layout='classic'] .btn-play {
  background: var(--accent);
  color: #1a1200;
  width: 34px;
  height: 34px;
}

.control-bar[data-layout='classic'] .btn-play:hover {
  background: var(--accent-hover);
  color: #1a1200;
}

.control-bar[data-layout='classic'] .btn-play svg {
  width: 16px;
  height: 16px;
}

.control-bar[data-layout='standard'] {
  max-width: none;
  width: 100%;
  border-radius: 0;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 14px;
  border: none;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  min-height: 64px;
}

.control-bar[data-layout='standard'] .cb-top,
.control-bar[data-layout='standard'] .cb-bottom {
  display: contents;
}

.control-bar[data-layout='standard'] .cb-transport {
  order: 1;
  flex: 0 0 auto;
  gap: 4px;
}

.control-bar[data-layout='standard'] .volume-container {
  order: 2;
  flex: 0 0 auto;
}

.control-bar[data-layout='standard'] #currentTime {
  order: 3;
  flex: 0 0 auto;
  min-width: 44px;
}

.control-bar[data-layout='standard'] #progressContainer {
  order: 4;
  flex: 1 1 auto;
  min-width: 120px;
}

.control-bar[data-layout='standard'] #duration {
  order: 5;
  flex: 0 0 auto;
  min-width: 44px;
}

.control-bar[data-layout='standard'] .cb-actions {
  order: 6;
  flex: 0 0 auto;
}

.control-bar[data-layout='standard'] .cb-minimal-time {
  display: none !important;
}

.control-bar[data-layout='standard'] .cb-time {
  font-size: 12.5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.85),
    0 0 8px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  font-weight: 500;
}

.control-bar[data-layout='standard'] #currentTime {
  justify-content: flex-end;
}

.control-bar[data-layout='standard'] #duration {
  justify-content: flex-start;
}

.control-bar[data-layout='standard'] .btn {
  width: 40px;
  height: 40px;
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.85),
    0 0 10px rgba(0, 0, 0, 0.55);
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.1s ease;
}

.control-bar[data-layout='standard'] .btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.control-bar[data-layout='standard'] .btn:active {
  transform: scale(0.94);
}

.control-bar[data-layout='standard'] .btn svg {
  width: 20px;
  height: 20px;
}

.control-bar[data-layout='standard'] .btn-play {
  width: 48px;
  height: 48px;
  margin: 0 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.control-bar[data-layout='standard'] .btn-play:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.control-bar[data-layout='standard'] .btn-play:active {
  transform: scale(0.96);
}

.control-bar[data-layout='standard'] .btn-play svg {
  width: 22px;
  height: 22px;
}

.control-bar[data-layout='standard'] .scrubber {
  height: 5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
  transition: height 0.12s ease;
}

.control-bar[data-layout='standard'] .scrubber:hover,
.control-bar[data-layout='standard'] .scrubber:focus-visible {
  height: 7px;
}

.control-bar[data-layout='standard'] .scrubber-fill {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.45);
}

.control-bar[data-layout='standard'] .scrubber-buffered {
  background: rgba(255, 255, 255, 0.4);
}

.control-bar[data-layout='standard'] .volume-slider {
  height: 4px;
  background: rgba(255, 255, 255, 0.28);
}

.control-bar[data-layout='minimal'] {
  flex-direction: column;
  gap: 2px;
  border-radius: 22px;
  padding: 7px 16px 5px;
  max-width: 860px;
}

.control-bar[data-layout='minimal'] .cb-minimal-time {
  display: none;
}

.control-bar[data-layout='minimal'] .cb-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.control-bar[data-layout='minimal'] .volume-container {
  justify-self: start;
  min-width: 0;
}

.control-bar[data-layout='minimal'] .cb-transport {
  justify-self: center;
}

.control-bar[data-layout='minimal'] .cb-actions {
  justify-self: end;
}

.control-bar[data-layout='minimal'] .cb-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px 1px;
}

.control-bar[data-layout='minimal'] .scrubber {
  height: 3px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 2px;
  transition: height 0.12s ease;
}

.control-bar[data-layout='minimal'] .scrubber:hover,
.control-bar[data-layout='minimal'] .scrubber:focus-visible {
  height: 5px;
}

.control-bar[data-layout='minimal'] .scrubber-fill {
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
}

.control-bar[data-look='glass'] {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.025) 100%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  backdrop-filter: blur(8px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.28),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.45),
    inset 0 -1px 1px rgba(0, 0, 0, 0.12);
}

.control-bar[data-look='glass'] .cb-time,
.control-bar[data-look='glass'] .btn,
.control-bar[data-look='glass'] .btn-speed {
  text-shadow:
    0 1px 4px rgba(0, 0, 0, 0.85),
    0 0 10px rgba(0, 0, 0, 0.4);
}

.control-bar[data-look='glass'] .cb-time {
  color: rgba(255, 255, 255, 0.98);
}

.control-bar[data-look='glass'] .scrubber {
  background: rgba(255, 255, 255, 0.3);
}

.control-bar[data-look='glass'] .scrubber-buffered {
  background: rgba(255, 255, 255, 0.42);
}

.control-bar[data-look='solid'] {
  background: #000000;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.65),
    0 5px 14px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.control-bar[data-look='solid'][data-layout='standard'] {
  background: transparent;
  border: none;
  box-shadow: none;
}

.control-bar[data-look='glass'][data-layout='standard'] {
  background: transparent;
  border: none;
  box-shadow: none;
}

.control-bar[data-layout='standard'][data-look='frost'],
.control-bar[data-layout='standard'][data-look='glass'],
.control-bar[data-layout='standard'][data-look='solid'] {
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
}

[data-look='glass'].captions-menu,
[data-look='glass'].settings-menu,
[data-look='glass'].subtitle-settings-popover,
[data-look='glass'].speed-menu,
[data-look='glass'].mv-popover-menu,
.mv-view[data-look='glass'] .mv-toolbar,
.mv-view[data-look='glass'] .mv-tile-header,
.mv-view[data-look='glass'] .mv-tile-controls {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.035) 100%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  backdrop-filter: blur(12px) saturate(180%);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.26),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.45),
    inset 0 -1px 1px rgba(0, 0, 0, 0.1);
}

.mv-view[data-look='glass'] .mv-toolbar {
  border-bottom-color: rgba(255, 255, 255, 0.16);
}

[data-look='solid'].captions-menu,
[data-look='solid'].settings-menu,
[data-look='solid'].subtitle-settings-popover,
[data-look='solid'].speed-menu,
[data-look='solid'].mv-popover-menu,
.mv-view[data-look='solid'] .mv-toolbar,
.mv-view[data-look='solid'] .mv-tile-header,
.mv-view[data-look='solid'] .mv-tile-controls {
  background: #000000;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.mv-view[data-look='solid'] .mv-toolbar {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

@media (prefers-color-scheme: light) {
  :where(:root:not([data-scheme])) [data-look='glass'].captions-menu,
  :where(:root:not([data-scheme])) [data-look='glass'].settings-menu,
  :where(:root:not([data-scheme])) [data-look='glass'].subtitle-settings-popover,
  :where(:root:not([data-scheme])) [data-look='glass'].speed-menu,
  :where(:root:not([data-scheme])) [data-look='glass'].mv-popover-menu,
  :where(:root:not([data-scheme])) .mv-view[data-look='glass'] .mv-toolbar,
  :where(:root:not([data-scheme])) .mv-view[data-look='glass'] .mv-tile-header,
  :where(:root:not([data-scheme])) .mv-view[data-look='glass'] .mv-tile-controls,
  :where(:root:not([data-scheme])) .control-bar[data-look='glass']:not([data-layout='standard']) {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.48) 100%);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow:
      0 10px 30px rgba(0, 0, 0, 0.1),
      inset 0 1px 1.5px rgba(255, 255, 255, 0.9),
      inset 0 -1px 1px rgba(0, 0, 0, 0.06);
  }
  :where(:root:not([data-scheme])) .control-bar[data-look='glass']:not([data-layout='standard']) .cb-time,
  :where(:root:not([data-scheme])) .control-bar[data-look='glass']:not([data-layout='standard']) .btn,
  :where(:root:not([data-scheme])) .control-bar[data-look='glass']:not([data-layout='standard']) .btn-speed {
    text-shadow:
      0 1px 2px rgba(255, 255, 255, 0.9),
      0 1px 3px rgba(0, 0, 0, 0.18);
  }
}

:where(:root[data-scheme='light']) [data-look='glass'].captions-menu,
:where(:root[data-scheme='light']) [data-look='glass'].settings-menu,
:where(:root[data-scheme='light']) [data-look='glass'].subtitle-settings-popover,
:where(:root[data-scheme='light']) [data-look='glass'].speed-menu,
:where(:root[data-scheme='light']) [data-look='glass'].mv-popover-menu,
:where(:root[data-scheme='light']) .mv-view[data-look='glass'] .mv-toolbar,
:where(:root[data-scheme='light']) .mv-view[data-look='glass'] .mv-tile-header,
:where(:root[data-scheme='light']) .mv-view[data-look='glass'] .mv-tile-controls,
:where(:root[data-scheme='light']) .control-bar[data-look='glass']:not([data-layout='standard']) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.48) 100%);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.1),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.9),
    inset 0 -1px 1px rgba(0, 0, 0, 0.06);
}
:where(:root[data-scheme='light']) .control-bar[data-look='glass']:not([data-layout='standard']) .cb-time,
:where(:root[data-scheme='light']) .control-bar[data-look='glass']:not([data-layout='standard']) .btn,
:where(:root[data-scheme='light']) .control-bar[data-look='glass']:not([data-layout='standard']) .btn-speed {
  text-shadow:
    0 1px 2px rgba(255, 255, 255, 0.9),
    0 1px 3px rgba(0, 0, 0, 0.18);
}

.cb-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  min-width: 0;
}

.cb-transport {
  display: flex;
  align-items: center;
  gap: 2px;
  justify-self: center;
}

.cb-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  justify-self: end;
}

.control-bar .btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transition:
    background 0.14s ease,
    color 0.14s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-bar .btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.control-bar .btn[aria-pressed='true'],
.control-bar .btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.control-bar .btn svg {
  width: 15px;
  height: 15px;
}

.control-bar .btn-play {
  width: 36px;
  height: 36px;
  color: #fff;
  margin: 0 4px;
}

.control-bar .btn-play:hover {
  background: rgba(255, 255, 255, 0.16);
}

.control-bar .btn-play .icon-play,
.control-bar .btn-play .icon-pause {
  width: 17px;
  height: 17px;
}

.control-bar .btn-speed {
  width: auto !important;
  min-width: 38px;
  height: 26px;
  padding: 0 9px !important;
  border-radius: var(--radius-pill) !important;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  font-variant-numeric: tabular-nums;
  background: transparent;
}

.control-bar .btn-speed:hover {
  background: rgba(255, 255, 255, 0.12);
}

.control-bar .btn-speed.is-modified {
  color: var(--accent);
  background: var(--accent-soft);
}

.control-bar[data-layout='standard'] .btn-speed {
  width: auto !important;
  min-width: 46px;
  height: 32px;
  padding: 0 10px !important;
  border-radius: var(--radius-pill) !important;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.96);
  font-variant-numeric: tabular-nums;
  background: transparent;
}

.control-bar[data-layout='standard'] .btn-speed:hover {
  background: rgba(255, 255, 255, 0.16);
}

.control-bar[data-layout='standard'] .btn-speed.is-modified {
  background: var(--accent-soft);
  color: var(--accent);
}

.control-bar[data-layout='classic'] .btn-speed {
  width: auto !important;
  min-width: 38px;
  height: 26px;
  padding: 0 9px !important;
  border-radius: var(--radius-pill) !important;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  font-variant-numeric: tabular-nums;
  background: transparent;
}

.control-bar[data-layout='classic'] .btn-speed:hover {
  background: rgba(255, 255, 255, 0.14);
}

.control-bar[data-layout='classic'] .btn-speed.is-modified {
  background: var(--accent-soft);
  color: var(--accent);
}

.control-bar .volume-slider {
  width: 72px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
}

.control-bar .volume-slider::-webkit-slider-thumb {
  width: 10px;
  height: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.cb-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px 1px;
}

.cb-time {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 8ch;
  text-align: left;
  cursor: pointer;
  user-select: none;
  transition: color 0.14s ease;
  letter-spacing: 0.01em;
  flex: 0 0 auto;
}

.cb-time:last-child {
  text-align: right;
}

.cb-time:hover {
  color: #fff;
}

.control-bar .scrubber {
  flex: 1 1 auto;
  min-width: 0;
  height: 3px;
  margin: 0;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  transition: height 0.12s ease;
}

.control-bar .scrubber:hover,
.control-bar .scrubber:focus-visible {
  height: 5px;
}

/* Expanded 24px hit area via an invisible pseudo-element; the visible line is unchanged */

.control-bar .scrubber::before {
  content: '';
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: 0;
  right: 0;
  pointer-events: auto;
  cursor: pointer;
  z-index: 0;
}

.control-bar .scrubber-buffered {
  background: rgba(255, 255, 255, 0.34);
  border-radius: 2px;
  z-index: 1;
}

.control-bar .scrubber-fill {
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
  transition: background 0.2s ease;
  z-index: 1;
}

.control-bar .scrubber.ab-active .scrubber-fill {
  background: linear-gradient(to right, var(--loop-a) 0%, var(--loop-a) 100%);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.55);
}

.control-bar .scrubber.ab-active .scrubber-handle {
  background: var(--loop-a);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.55),
    0 0 0 3px rgba(74, 222, 128, 0.35);
}

.control-bar .scrubber-handle {
  width: 10px;
  height: 10px;
  background: #fff;
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.7);
  opacity: 1;
  transform: translate(-50%, -50%);
  z-index: 5;
}

.control-bar .scrubber:hover .scrubber-handle {
  width: 12px;
  height: 12px;
}

.scrubber {
  position: relative;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 3px;
  cursor: pointer;
}

.scrubber-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 3px;
  width: 0%;
}

.scrubber-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 3px;
  width: 0%;
}

.scrubber-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  border-radius: 50%;
}

.scrubber-tooltip {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 4px 8px;
  border-radius: var(--radius-inner);
  font-size: 11px;
  font-family: var(--font-mono);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  pointer-events: none;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 30;
}

.control-bar .scrubber:hover .scrubber-tooltip {
  opacity: 1;
  visibility: visible;
}

.control-bar .scrubber.scrubbing .scrubber-tooltip {
  opacity: 1;
  visibility: visible;
}

.control-bar .scrubber.scrubbing {
  height: 6px;
}

.scrubber-ab-range {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(74, 222, 128, 0.22);
  pointer-events: none;
  z-index: 2;
  border-left: 2px solid var(--loop-a);
  border-right: 2px solid var(--loop-b);
  box-shadow: inset 0 0 6px rgba(74, 222, 128, 0.25);
}

.scrubber-ab-duration {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.92);
  color: var(--loop-a);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}

.scrubber-marker {
  position: absolute;
  top: -3px;
  width: 3px;
  height: calc(100% + 6px);
  pointer-events: none;
  z-index: 3;
  border-radius: 2px;
}

.scrubber-marker.a {
  background: var(--loop-a);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
}

.scrubber-marker.b {
  background: var(--loop-b);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.7);
}

.scrubber-marker::before {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.88);
}

.scrubber-marker.a::before {
  content: 'A';
  color: var(--loop-a);
}

.scrubber-marker.b::before {
  content: 'B';
  color: var(--loop-b);
}

.bookmark-marker {
  position: absolute;
  top: -2px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  background: var(--bookmark);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.7);
  z-index: 4;
  cursor: pointer;
  pointer-events: auto;
}

.bookmark-marker:hover {
  transform: scale(1.5);
}

.scrubber-thumb {
  width: 152px;
  height: 86px;
  border-radius: var(--radius-inner);
  border: 1px solid var(--border-strong);
  background: #000;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.6);
}

.stage-title {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
  pointer-events: none;
  z-index: 16;
  max-width: 62%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.stage-title.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.stage-title-hidden .stage-title {
  display: none !important;
}

/* Search and playlist side panels */

.search-panel,
.playlist-panel {
  flex: 0 0 auto;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  will-change: transform;
  contain: layout style;
}

.search-panel {
  width: var(--search-panel-w);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  margin-right: calc(var(--search-panel-w) * -1);
  transition:
    transform 0.24s ease,
    margin-right 0.24s ease;
}

.search-panel.open {
  transform: translateX(0);
  margin-right: 0;
}

.playlist-panel {
  width: var(--playlist-panel-w);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  margin-left: calc(var(--playlist-panel-w) * -1);
  transition:
    transform 0.24s ease,
    margin-left 0.24s ease;
}

.playlist-panel.open {
  transform: translateX(0);
  margin-left: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 10px 14px;
  gap: 8px;
  flex: 0 0 auto;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-right: auto;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.panel-head-actions .icon-btn {
  width: 26px;
  height: 26px;
  padding: 0;
}

.panel-head-actions .icon-btn.text-btn {
  width: auto;
  padding: 0 8px;
  font-size: 11.5px;
}

.panel-head-tabs {
  padding: 12px 12px 6px;
  gap: 6px;
  border-bottom: none;
}

.panel-head-tabs .segmented-tabs {
  flex: 1 1 auto;
  padding: 3px;
}

.panel-head-tabs .icon-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  flex: 0 0 auto;
}

.panel-head-tabs .search-tab {
  flex: 1;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  transition:
    background 0.14s ease,
    color 0.14s ease;
}

.panel-head-tabs .search-tab.active {
  background: var(--bg-active);
  color: var(--text);
  font-weight: 600;
}

.search-bar-row {
  padding: 0 12px 6px;
  flex: 0 0 auto;
}

#searchInput {
  width: 100%;
  margin: 0;
  background: var(--bg-elevated);
  border: 1px solid transparent;
  border-radius: var(--radius-inner);
  color: var(--text);
  padding: 8px 12px;
  font-size: 12.5px;
  outline: none;
  font-family: inherit;
  height: 34px;
}

#searchInput:focus {
  border-color: var(--accent);
}

#searchInput::placeholder {
  color: var(--text-faint);
}

.panel-toolbar {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}

.panel-search {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid transparent;
  border-radius: var(--radius-inner);
  padding: 0 10px;
  min-width: 0;
  color: var(--text-faint);
  height: 32px;
}

.panel-search:focus-within {
  border-color: var(--accent);
  color: var(--text-muted);
}

.panel-search input {
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: none;
  color: var(--text);
  padding: 0;
  font-size: 12.5px;
  outline: none;
  font-family: inherit;
  height: 100%;
}

.panel-search input::placeholder {
  color: var(--text-faint);
}

.segmented-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-elevated);
  border-radius: var(--radius-inner);
  padding: 3px;
  flex: 0 0 auto;
}

.segmented-tabs button {
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition:
    background 0.14s ease,
    color 0.14s ease;
}

.segmented-tabs button.active {
  background: var(--bg-active);
  color: var(--text);
  font-weight: 600;
}

.search-tab-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.search-tab-content[hidden] {
  display: none;
}

.search-status {
  padding: 4px 14px 4px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  min-height: 16px;
  flex: 0 0 auto;
}

.search-results,
.chapter-list {
  list-style: none;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding: 4px 8px 14px;
  -webkit-overflow-scrolling: touch;
}

.search-result-item,
.chapter-item {
  padding: 9px 10px;
  border-radius: var(--radius-inner);
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 3px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition:
    background 0.12s ease,
    border-color 0.14s ease;
}

.search-result-item:hover,
.chapter-item:hover {
  background: var(--bg-hover);
}

.search-result-item.active,
.chapter-item.active {
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.22) inset;
}

.search-result-item.active .sr-text,
.chapter-item.active .sr-text {
  color: var(--text);
}

.sr-timestamp {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent);
  padding: 3px 6px;
  background: var(--accent-soft);
  border-radius: 4px;
  white-space: nowrap;
  min-width: 52px;
  text-align: center;
  font-weight: 500;
}

.sr-body {
  flex: 1 1 auto;
  min-width: 0;
}

.sr-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sr-text mark {
  background: rgba(255, 107, 0, 0.32);
  color: var(--text);
  border-radius: 3px;
  padding: 0 3px;
}

.chapter-item .sr-text {
  color: var(--text);
  font-weight: 500;
  -webkit-line-clamp: 2;
}

.chapter-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-elevated), #16161a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-faint);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chapter-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.panel-empty {
  padding: 40px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  color: var(--text-faint);
}

.panel-empty-glyph {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  margin-bottom: 2px;
}

.panel-empty-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.panel-empty-desc {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-faint);
  max-width: 240px;
}

.search-empty,
.playlist-empty,
.playlist-no-results {
  padding: 34px 22px;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.55;
}

#playlistSort {
  background: var(--bg-elevated);
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  border-radius: var(--radius-inner);
  padding: 0 22px 0 8px;
  outline: none;
  cursor: pointer;
  max-width: 116px;
  font-family: inherit;
  height: 32px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2385858b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 11px;
}

#playlistSort option {
  background: var(--dd-bg);
  color: var(--dd-fg);
}

.playlist-stats {
  padding: 8px 14px 0;
  font-size: 10.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

.playlist-list {
  list-style: none;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px;
  -webkit-overflow-scrolling: touch;
}

.playlist-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px;
  border-radius: var(--radius-inner);
  cursor: pointer;
  margin-bottom: 3px;
  border: 1px solid transparent;
  min-width: 0;
  overflow: hidden;
  transition: background 0.12s ease;
}

.playlist-item:hover {
  background: var(--bg-hover);
}

.playlist-item.playing {
  background: rgba(255, 107, 0, 0.06);
}

.playlist-item.playing::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}

.pi-thumb {
  position: relative;
  width: 80px;
  height: 45px;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.pi-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
}

.pi-thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-elevated), #16161a);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.pi-index-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 5px;
  border-radius: 3px;
  line-height: 1.3;
  pointer-events: none;
}

.playlist-item.playing .pi-index-badge {
  background: var(--accent);
  color: #1a1200;
}

.pi-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  background: rgba(0, 0, 0, 0.4);
  transition: opacity 0.14s ease;
  font-size: 15px;
  pointer-events: none;
}

.playlist-item:hover .pi-thumb-play {
  opacity: 1;
}

.playlist-item.playing .pi-thumb-play {
  opacity: 0.9;
  background: rgba(0, 0, 0, 0.25);
}

.pi-body {
  flex: 1 1 auto;
  min-width: 0;
}

.pi-name {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  min-width: 0;
  margin-bottom: 2px;
}

.pi-meta {
  font-size: 10.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pi-progress {
  position: relative;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
  display: none;
}

.pi-progress.is-active {
  display: block;
}

.pi-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.25s linear;
}

.pi-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.playlist-item:hover .pi-actions,
.playlist-item:focus-within .pi-actions {
  opacity: 1;
}

.pi-actions button {
  width: 24px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  border-radius: 4px;
  font-size: 12px;
}

.pi-actions button:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.pi-actions .pi-remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.playlist-panel.has-items .playlist-empty {
  display: none;
}

.playlist-panel:not(.has-items) .playlist-list {
  display: none;
}

.playlist-panel:not(.has-items) .playlist-toolbar,
.playlist-panel:not(.has-items) .playlist-stats {
  display: none;
}

/* Popover menus, settings pages, toggles and equalizer rows */

.popover {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.captions-menu,
.settings-menu,
.subtitle-settings-popover,
.speed-menu,
.mv-popover-menu {
  position: fixed;
  background: var(--menu-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-frame);
  padding: 5px;
  z-index: 550;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.65),
    0 4px 12px rgba(0, 0, 0, 0.4),
    var(--glass-highlight),
    var(--glass-shadow),
    var(--glass-inner-glow);
  overflow: hidden auto;
}

.captions-menu {
  min-width: 232px;
  max-width: 280px;
  max-height: min(66vh, 480px);
  padding: 6px;
}

.settings-menu {
  min-width: 300px;
  max-width: 340px;
  max-height: min(78vh, 600px);
}

.subtitle-settings-popover {
  min-width: 300px;
  max-width: 340px;
  max-height: min(78vh, 600px);
}

.speed-menu {
  min-width: 100px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.speed-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 11px;
  border-radius: var(--radius-inner);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  transition: background 0.12s ease;
}

.speed-menu button:hover {
  background: var(--bg-hover);
}

.speed-menu button.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.settings-page[hidden] {
  display: none;
}

.settings-page.anim-in {
  animation: settingsPageIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes settingsPageIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  border-radius: var(--radius-inner);
  transition: background 0.14s ease;
}

.settings-back-btn:hover {
  background: var(--bg-hover);
}

.settings-back-btn svg {
  color: var(--text-muted);
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
}

.settings-nav-item {
  position: relative;
}

.settings-nav-item .nav-chevron {
  color: var(--text-faint) !important;
  margin-left: 2px;
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
}

.settings-section {
  padding: 4px 2px 2px;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section-title {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 5px 10px 3px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.settings-section-title > span:last-child {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  font-weight: 500;
}

.settings-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 2px;
  border: none;
  width: auto;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.settings-row-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-inner);
  font-size: 12.5px;
  color: var(--text);
  text-align: left;
  font-weight: 500;
  transition: background 0.14s ease;
}

.settings-item:hover {
  background: var(--bg-hover);
}

.settings-item svg {
  flex: 0 0 auto;
  color: var(--text-muted);
  width: 14px;
  height: 14px;
}

.settings-item kbd {
  margin-left: auto;
  font-size: 9.5px;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-faint);
  font-weight: 500;
}

.settings-item .toggle-switch {
  margin-left: auto;
}

.settings-item .settings-value {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
}

.settings-item.active {
  color: var(--accent);
}

.settings-item.active svg {
  color: var(--accent);
}

.settings-item .settings-label {
  flex: 1;
}

.settings-segment {
  display: flex;
  gap: 2px;
  background: var(--bg-elevated);
  border-radius: var(--radius-inner);
  padding: 2px;
}

.settings-segment button {
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  transition:
    background 0.14s ease,
    color 0.14s ease;
  min-width: 28px;
  flex: 1;
}

.settings-segment button.active {
  background: var(--bg-active);
  color: var(--text);
  font-weight: 600;
}

#videoFitGroup,
#videoRatioGroup,
#controlLayoutGroup,
#controlLookGroup {
  width: 100%;
}

#videoFitGroup button,
#videoRatioGroup button,
#controlLayoutGroup button,
#controlLookGroup button {
  font-size: 10.5px;
  padding: 6px 3px;
  min-width: 0;
}

select.settings-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-elevated);
  border: 1px solid transparent;
  color: var(--text);
  font-size: 11.5px;
  font-family: inherit;
  font-weight: 500;
  border-radius: var(--radius-inner);
  padding: 5px 26px 5px 9px;
  outline: none;
  cursor: pointer;
  min-width: 88px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b5b5ba' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 12px 12px;
  color-scheme: dark;
}

select.settings-select option {
  background-color: var(--dd-bg);
  color: var(--dd-fg);
}

.settings-sub {
  margin: 2px 3px 4px;
  padding: 4px 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-inner);
}

.settings-slider {
  padding: 5px 10px 8px;
}

.settings-slider label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 500;
}

.settings-slider label span:last-child {
  font-family: var(--font-mono);
  color: var(--text-faint);
  font-size: 10.5px;
}

.settings-slider input[type='range'] {
  width: 100%;
}

.settings-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.settings-toggle-row .settings-toggle-label {
  font-size: 12.5px;
  color: var(--text);
  font-weight: 500;
}

.settings-toggle-row .settings-toggle-desc {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.4;
  margin-top: 2px;
}

.settings-toggle-row[aria-disabled='true'] {
  opacity: 0.55;
  pointer-events: none;
}

.delay-control {
  display: flex;
  align-items: stretch;
  gap: 3px;
  background: var(--bg-elevated);
  border-radius: var(--radius-inner);
  padding: 3px;
  margin-top: 3px;
}

.delay-control button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  min-width: 74px;
}

.delay-control button .delay-btn-arrow {
  font-size: 13px;
  line-height: 1;
}

.delay-control .delay-value-box {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-active);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  min-width: 52px;
}

.font-row {
  display: flex;
  gap: 6px;
  padding: 3px 7px 6px;
}

.font-row button {
  flex: 1;
  padding: 8px 6px;
  border-radius: var(--radius-inner);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
}

.font-row button.active {
  background: var(--bg-active);
  color: var(--text);
  font-weight: 600;
}

.color-swatches {
  display: flex;
  gap: 7px;
  padding: 4px 10px 9px;
  flex-wrap: wrap;
}

.color-swatches button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--swatch);
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
  position: relative;
}

.color-swatches button.active {
  border-color: var(--text);
  box-shadow:
    0 0 0 2px var(--menu-bg),
    0 0 0 4px var(--text);
}

.color-swatches button.picker {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
}

.color-swatches button.picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.color-swatches button.picker svg {
  width: 13px;
  height: 13px;
}

.cm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border-radius: var(--radius-inner);
  font-size: 12px;
  color: var(--text-muted);
}

.cm-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.cm-item.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.cm-item.active > span:first-child {
  flex: 1 1 auto;
}

.cm-empty {
  padding: 10px 10px;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.45;
}

.cm-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cm-list:empty {
  display: none;
}

.cm-remove {
  color: var(--text-faint);
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  margin-left: auto;
}

.cm-remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.cm-upload {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 3px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--accent);
  cursor: pointer;
  border-radius: var(--radius-inner);
  text-decoration: none;
  font-weight: 500;
  text-align: left;
  background: transparent;
}

.cm-upload:hover {
  background: var(--bg-hover);
}

.cm-upload svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.2s ease;
  flex: 0 0 auto;
  flex-shrink: 0;
  pointer-events: none;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.on .toggle-switch,
[aria-checked='true'] .toggle-switch,
[aria-pressed='true'] .toggle-switch {
  background: var(--accent);
}

.on .toggle-switch::after,
[aria-checked='true'] .toggle-switch::after,
[aria-pressed='true'] .toggle-switch::after {
  transform: translateX(14px);
}

.eq-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
}

.eq-row label {
  width: 44px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.eq-row input[type='range'] {
  flex: 1;
}

.eq-row span {
  width: 40px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Hover preview, shortcuts modal, keyboard keys and fullscreen */

.pi-preview {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  width: 250px;
  aspect-ratio: 16/9;
  border-radius: var(--radius-inner);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity 0.14s ease,
    transform 0.14s ease;
}

.pi-preview.visible {
  opacity: 1;
  transform: translateX(0);
}

.pi-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.modal {
  background: var(--menu-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-frame);
  width: 92%;
  max-width: 520px;
  max-height: 82vh;
  max-height: 82dvh;
  overflow-y: auto;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.75),
    var(--glass-highlight),
    var(--glass-shadow),
    var(--glass-inner-glow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(18, 17, 20, 0.55);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-frame) var(--radius-frame) 0 0;
  z-index: 1;
}

.modal-head h2 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}

.modal-close {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-inner);
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shortcut-grid {
  padding: 8px 18px 0;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}

.shortcut-item:last-child {
  border-bottom: none;
}

.shortcut-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  flex: 0 0 auto;
}

.shortcut-icon svg {
  width: 16px;
  height: 16px;
}

.shortcut-label {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.shortcut-label svg {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.shortcut-item kbd {
  flex: 0 0 auto;
}

.shortcut-note {
  margin: 6px 18px 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-faint);
}

kbd {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text);
  font-weight: 500;
}

.app.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 999;
}

.app.fullscreen .topbar {
  display: none;
}

.modal > .modal-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 36px);
  margin: 0 18px 18px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
}

.modal > .modal-action[hidden] {
  display: none;
}

.modal > .modal-action .tb-btn-label {
  display: inline;
}

/* Multi-view wall */

.mv-view {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
}

.mv-toolbar {
  flex: 0 0 auto;
  min-height: calc(var(--header-h) + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: env(safe-area-inset-top) 12px 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 10000;
}

.mv-view.mv-bar-hidden .mv-toolbar {
  min-height: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  opacity: 0;
  overflow: hidden;
  border: none !important;
  pointer-events: none;
}

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

.mv-cluster-left {
  justify-content: flex-start;
}

.mv-cluster-center {
  justify-content: center;
}

.mv-cluster-right {
  justify-content: flex-end;
  gap: 2px;
}

.mv-cluster .icon-btn {
  padding: 0 9px;
  height: 30px;
  gap: 6px;
}

.mv-cluster .icon-btn.icon-only {
  width: 30px;
  padding: 0;
}

.mv-cluster .icon-btn svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.mv-back-anchor {
  height: 30px;
  padding: 0 10px;
  gap: 8px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid transparent;
}

.mv-back-anchor .mv-back-name {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text);
}

.mv-back-anchor .mv-back-sep {
  color: var(--text-faint);
  font-size: 12px;
}

.mv-back-anchor .mv-back-mode {
  color: var(--accent);
  font-weight: 600;
  font-size: 12.5px;
}

.mv-ingest {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  height: 30px;
  background: var(--bg-elevated);
  border-radius: var(--radius-inner);
  border: 1px solid var(--border);
  min-width: 0;
}

.mv-ingest .icon-btn {
  height: 26px;
  padding: 0 9px;
  border-radius: 4px;
  font-size: 12px;
}

.mv-ingest label.icon-btn {
  cursor: pointer;
}

.mv-url-form {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 130px;
  max-width: 180px;
}

.mv-url-form input {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 0 30px 0 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  outline: none;
}

.mv-url-form input::placeholder {
  color: var(--text-faint);
}

.mv-url-form input:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.35);
}

.mv-url-submit {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  color: var(--text-faint);
}

.mv-url-submit svg {
  width: 13px;
  height: 13px;
}

.mv-segmented {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  height: 30px;
  background: var(--bg-elevated);
  border-radius: var(--radius-inner);
  border: 1px solid var(--border);
}

.mv-seg {
  height: 26px;
  padding: 0 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mv-seg[aria-selected='true'] {
  background: var(--accent);
  color: #1a1200;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.mv-seg-divider {
  width: 1px;
  height: 14px;
  background: var(--border-strong);
  margin: 0 2px;
}

.mv-cols-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.mv-cols-stepper button {
  width: 22px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

#mvColsValue {
  width: 20px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  user-select: none;
}

.mv-cluster .icon-btn .mv-btn-label {
  font-size: 11.5px;
  font-weight: 500;
}

.mv-popover-menu {
  position: fixed !important;
  min-width: 250px;
  max-width: 320px;
  max-height: min(70vh, 500px);
  z-index: 10500;
  top: auto;
  bottom: auto;
  left: auto;
  right: 12px;
}

.mv-canvas {
  position: relative;
  flex: 1 1 auto;
  overflow: auto;
  background: #000;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom);
}

.mv-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  color: var(--text-faint);
  padding: 40px;
}

.mv-empty-glyph {
  color: var(--accent);
  margin-bottom: 10px;
  opacity: 0.9;
}

.mv-empty h2 {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 600;
}

.mv-empty p {
  font-size: 12.5px;
  max-width: 380px;
  line-height: 1.55;
}

.mv-canvas.has-tiles .mv-empty {
  display: none;
}

.mv-canvas.mv-mode-split {
  display: grid;
  gap: var(--mv-gap, 4px);
  padding: var(--mv-gap, 4px);
}

.mv-canvas.mv-mode-grid {
  overflow: hidden;
}

.mv-canvas.mv-mode-grid .mv-tile {
  position: absolute;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition:
    left 0.2s ease,
    top 0.2s ease,
    width 0.2s ease,
    height 0.2s ease;
}

.mv-canvas.mv-mode-canvas {
  overflow: hidden;
}

.mv-tile {
  position: relative;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius-frame);
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  contain: layout style paint;
}

.mv-mode-canvas .mv-tile {
  position: absolute;
  border-radius: var(--radius-frame);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.mv-mode-canvas .mv-tile.resizing,
.mv-mode-canvas .mv-tile.dragging {
  transition: none !important;
  will-change: left, top, width, height;
}

.mv-tile-header {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  min-height: 34px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  color: var(--text-muted);
  z-index: 3;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  pointer-events: none;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    var(--glass-highlight),
    var(--glass-inner-glow);
}

.mv-canvas.mv-mode-canvas .mv-tile-header {
  cursor: grab;
}

.mv-canvas.mv-mode-canvas .mv-tile.dragging .mv-tile-header {
  cursor: grabbing;
}

.mv-tile.mv-tile-chrome-visible .mv-tile-header,
.mv-tile:has(:focus-visible) .mv-tile-header {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mv-tile-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 500;
  line-height: 1.2;
}

.mv-tile-badge {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}

.mv-tile-actions {
  display: flex;
  gap: 2px;
  align-items: center;
  flex: 0 0 auto;
}

.mv-tile-actions button {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
}

.mv-tile-actions button.is-active {
  color: var(--accent);
}

.mv-tile-actions .mv-tile-remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.mv-tile-actions button:disabled,
.mv-tile-controls button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.mv-tile.mv-tile-active {
  border-color: transparent;
}

.mv-tile.mv-tile-active.mv-tile-chrome-visible,
.mv-tile.mv-tile-active:hover {
  border-color: var(--accent);
}

.mv-tile-controls {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
  padding: 5px 8px;
  min-height: 40px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    var(--glass-highlight),
    var(--glass-inner-glow);
}

.mv-tile.mv-tile-chrome-visible .mv-tile-controls,
.mv-tile:has(:focus-visible) .mv-tile-controls {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mv-tile-group {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  min-width: 0;
}

.mv-tile-group-scrub {
  flex: 1 1 auto;
  gap: 6px;
  min-width: 0;
}

.mv-tile-group-end {
  gap: 2px;
  flex: 0 0 auto;
}

.mv-tile-controls button {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
}

.mv-tile-controls button svg {
  width: 15px;
  height: 15px;
}

.mv-tile-controls button.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.mv-tile-controls .mv-tile-play {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
}

.mv-tile-speed {
  width: auto !important;
  padding: 0 9px !important;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 36px;
  border-radius: var(--radius-pill) !important;
  background: rgba(255, 255, 255, 0.06);
}

.mv-tile-time {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding: 0 2px;
}

.mv-tile-time-sep {
  color: var(--text-faint);
  margin: 0 2px;
}

.mv-tile-scrub {
  position: relative;
  flex: 1 1 28px;
  min-width: 24px;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.mv-tile-scrub::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
}

.mv-tile-scrub-fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 4px;
  width: 0%;
  transform: translateY(-50%);
  border-radius: 2px;
  background: var(--accent);
  pointer-events: none;
  transition: width 0.05s linear;
}

.mv-tile-scrub-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.35);
  opacity: 0;
  transition: opacity 0.14s ease;
}

.mv-tile-scrub:hover .mv-tile-scrub-handle {
  opacity: 1;
}

.mv-tile-scrub.is-disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.mv-tile-volume {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
}

.mv-tile-volslider {
  width: 52px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--vol-pct, 100%),
    rgba(255, 255, 255, 0.22) var(--vol-pct, 100%),
    rgba(255, 255, 255, 0.22) 100%
  );
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
}

.mv-tile-volslider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  border: none;
  cursor: grab;
}

.mv-tile-volslider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.mv-tile.mv-tile-compact .mv-tile-volslider {
  display: none;
}

.mv-tile.mv-tile-compact .mv-tile-time-sep {
  display: none;
}

.mv-tile.mv-tile-compact .mv-tile-time {
  font-size: 9.5px;
}

.mv-tile.mv-tile-compact .mv-tile-speed {
  min-width: 30px;
  padding: 0 6px !important;
  font-size: 9.5px;
}

.mv-tile.mv-tile-compact .mv-tile-controls {
  padding: 4px 6px;
  gap: 3px;
}

.mv-tile.mv-tile-compact .mv-tile-controls button {
  width: 26px;
  height: 26px;
}

.mv-tile.mv-tile-compact .mv-tile-controls .mv-tile-play {
  width: 30px;
  height: 30px;
}

.mv-tile.mv-tile-tiny .mv-tile-header {
  padding: 3px 5px 3px 8px;
  min-height: 24px;
  font-size: 10px;
  gap: 4px;
}

.mv-tile.mv-tile-tiny .mv-tile-badge {
  display: none;
}

.mv-tile.mv-tile-tiny .mv-tile-actions {
  gap: 0;
}

.mv-tile.mv-tile-tiny .mv-tile-actions button {
  width: 20px;
  height: 20px;
}

.mv-tile.mv-tile-tiny .mv-tile-actions button svg {
  width: 11px;
  height: 11px;
}

.mv-tile.mv-tile-tiny .mv-tile-controls {
  padding: 3px 5px;
  gap: 2px;
  min-height: 28px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border-radius: 14px;
}

.mv-tile.mv-tile-tiny .mv-tile-controls button {
  width: 22px;
  height: 22px;
}

.mv-tile.mv-tile-tiny .mv-tile-controls button svg {
  width: 11px;
  height: 11px;
}

.mv-tile.mv-tile-tiny .mv-tile-controls .mv-tile-play {
  width: 24px;
  height: 24px;
}

.mv-tile.mv-tile-tiny .mv-tile-volslider {
  display: none;
}

.mv-tile.mv-tile-tiny .mv-tile-speed {
  display: none;
}

.mv-tile.mv-tile-tiny .mv-tile-abloop {
  display: none;
}

.mv-tile.mv-tile-tiny .mv-tile-time {
  font-size: 8.5px;
  padding: 0;
}

.mv-tile.mv-tile-tiny .mv-tile-time-sep {
  display: none;
}

.mv-tile.mv-tile-tiny .mv-tile-scrub {
  height: 16px;
  min-width: 20px;
  flex: 1 1 20px;
}

.mv-tile.mv-tile-tiny .mv-tile-scrub::before {
  height: 3px;
}

.mv-tile.mv-tile-tiny .mv-tile-scrub-fill {
  height: 3px;
}

.mv-tile.mv-tile-tiny .mv-tile-scrub-handle {
  width: 10px;
  height: 10px;
}

.mv-tile-body {
  position: relative;
  flex: 1 1 auto;
  background: #000;
  overflow: hidden;
}

.mv-tile-body video,
.mv-tile-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  object-fit: contain;
  background: #000;
}

.mv-tile-body video {
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: manipulation;
}

.mv-tile-popout-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
  background: #101012;
}

.mv-tile-yt-holder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #08080a;
  color: var(--text-faint);
  font-size: 12.5px;
  text-align: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.mv-tile-yt-holder.has-player {
  padding: 0;
  display: block;
  background: #000;
}

.mv-tile-body-yt > .mv-tile-yt-holder > iframe {
  position: absolute !important;
  top: -8% !important;
  left: -2.5% !important;
  width: 105% !important;
  height: 116% !important;
  border: 0 !important;
  pointer-events: none !important;
}

.mv-tile-body-yt .mv-tile-yt-holder {
  background: #000;
}

.mv-tile-yt-holder::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent);
  animation: ytSpin 0.9s linear infinite;
  pointer-events: none;
}

.mv-tile-yt-holder.has-player::after {
  display: none;
}

@keyframes ytSpin {
  to {
    transform: rotate(360deg);
  }
}

.mv-tile-yt-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: #101012;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.mv-tile-yt-error strong {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}

.mv-resize-handle {
  position: absolute;
  z-index: 4;
  opacity: 0;
  transition:
    opacity 0.14s ease,
    background 0.14s ease;
}

.mv-tile:hover .mv-resize-handle,
.mv-tile:focus-within .mv-resize-handle,
.mv-tile.resizing .mv-resize-handle {
  opacity: 1;
}

.mv-resize-handle.corner {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
}

.mv-resize-handle.corner svg {
  pointer-events: none;
}

.mv-resize-handle[data-dir='se'] {
  right: 3px;
  bottom: 3px;
  cursor: nwse-resize;
}

.mv-resize-handle[data-dir='nw'] {
  left: 3px;
  top: 3px;
  cursor: nwse-resize;
}

.mv-resize-handle[data-dir='ne'] {
  right: 3px;
  top: 3px;
  cursor: nesw-resize;
}

.mv-resize-handle[data-dir='sw'] {
  left: 3px;
  bottom: 3px;
  cursor: nesw-resize;
}

.mv-resize-handle[data-dir='ne'] svg,
.mv-resize-handle[data-dir='nw'] svg,
.mv-resize-handle[data-dir='sw'] svg {
  transform: rotate(90deg);
}

.mv-resize-handle.edge {
  background: transparent;
}

.mv-resize-handle.edge:hover {
  background: rgba(255, 107, 0, 0.35);
}

.mv-resize-handle[data-dir='n'] {
  top: 0;
  left: 12px;
  right: 12px;
  height: 6px;
  cursor: ns-resize;
}

.mv-resize-handle[data-dir='s'] {
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 6px;
  cursor: ns-resize;
}

.mv-resize-handle[data-dir='w'] {
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 6px;
  cursor: ew-resize;
}

.mv-resize-handle[data-dir='e'] {
  right: 0;
  top: 12px;
  bottom: 12px;
  width: 6px;
  cursor: ew-resize;
}

.mv-canvas:not(.mv-mode-canvas) .mv-resize-handle {
  display: none;
}

.mv-bar-tab {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -100%);
  z-index: 501;
  width: 60px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  opacity: 0;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  pointer-events: none;
}

.mv-bar-tab svg {
  width: 18px;
  height: 18px;
}

.mv-bar-tab:hover {
  color: var(--text);
}

.mv-view.mv-bar-hidden .mv-bar-tab.visible,
.mv-view.mv-bar-hidden .mv-bar-tab:focus-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .mv-view.mv-bar-hidden .mv-bar-tab {
    transform: translate(-50%, 0);
    opacity: 0.75;
    pointer-events: auto;
  }
}

.mv-divider {
  width: 1px;
  height: 20px;
  background: var(--border-strong);
  margin: 0 4px;
}

/* A tile in fullscreen is a plain video surface: no frame or accent border, and the controls and pointer hide when idle. */
.mv-tile:fullscreen,
.mv-tile.mv-tile-active:fullscreen {
  border-width: 0;
  border-radius: 0;
  box-shadow: none;
  outline: none;
}

.mv-tile:fullscreen:not(.mv-tile-chrome-visible),
.mv-tile:fullscreen:not(.mv-tile-chrome-visible) * {
  cursor: none;
}

/* Reordering tiles and resizing panes in the grid and split layouts. */
.mv-canvas:not(.mv-mode-canvas) .mv-tile-header {
  cursor: grab;
}

.mv-tile.mv-reordering {
  z-index: 60 !important;
  opacity: 0.92;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65);
  transition: none !important;
  will-change: transform;
}

.mv-canvas[data-reordering] {
  user-select: none;
}

.mv-canvas[data-reordering] .mv-tile-header {
  cursor: grabbing;
}

.mv-slot-ghost {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-frame);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.mv-gutters {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.mv-gutter {
  position: absolute;
  pointer-events: auto;
  touch-action: none;
  outline: none;
}

.mv-gutter-v {
  cursor: col-resize;
}

.mv-gutter-h {
  cursor: row-resize;
}

.mv-gutter::after {
  content: '';
  position: absolute;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.mv-gutter-v::after {
  top: 0;
  bottom: 0;
  left: calc(50% - 1px);
  width: 2px;
}

.mv-gutter-h::after {
  left: 0;
  right: 0;
  top: calc(50% - 1px);
  height: 2px;
}

.mv-gutter:hover::after,
.mv-gutter:focus-visible::after,
.mv-gutter.is-active::after {
  opacity: 0.9;
}

.mv-canvas[data-resizing] .mv-tile {
  transition: none !important;
}

/* Horizontal playlist carousel */

.playlist-carousel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 16px 92px;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 11;
  pointer-events: none;
  display: flex;
  justify-content: center;
  transform: translateY(100%);
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s ease;
}

.playlist-carousel.open {
  transform: translateY(0);
  opacity: 1;
}

.playlist-carousel[hidden] {
  display: none;
}

.plc-shell {
  width: 100%;
  max-width: 1200px;
  border-radius: 18px;
  padding: 14px 18px 18px;
  pointer-events: auto;
  position: relative;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.playlist-carousel[data-look='frost'] .plc-shell,
.playlist-carousel:not([data-look]) .plc-shell {
  background:
    radial-gradient(140% 160% at 50% -20%, rgba(var(--accent-rgb), 0.1), transparent 62%), rgba(15, 14, 18, 0.88);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.playlist-carousel[data-look='glass'] .plc-shell {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.035) 100%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.45),
    inset 0 -1px 1px rgba(0, 0, 0, 0.1);
}

.playlist-carousel[data-look='solid'] .plc-shell {
  background: #000;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

@media (prefers-color-scheme: light) {
  :where(:root:not([data-scheme])) .playlist-carousel[data-look='glass'] .plc-shell {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.48) 100%);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow:
      0 24px 60px rgba(0, 0, 0, 0.1),
      inset 0 1px 1.5px rgba(255, 255, 255, 0.9),
      inset 0 -1px 1px rgba(0, 0, 0, 0.06);
  }
}

:where(:root[data-scheme='light']) .playlist-carousel[data-look='glass'] .plc-shell {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.48) 100%);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.1),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.9),
    inset 0 -1px 1px rgba(0, 0, 0, 0.06);
}

.plc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.plc-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  position: relative;
}

.plc-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.14s ease;
}

.plc-title:hover {
  background: rgba(255, 255, 255, 0.06);
}

.plc-title svg {
  color: var(--text-muted);
  transition: transform 0.16s ease;
}

.plc-title[aria-expanded='true'] svg {
  transform: rotate(180deg);
}

.plc-head-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.plc-sort {
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-family: inherit;
  font-weight: 500;
  border-radius: 6px;
  padding: 6px 24px 6px 10px;
  outline: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2385858b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 11px;
  transition:
    background-color 0.14s ease,
    color 0.14s ease;
}

.plc-sort:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.plc-sort option {
  background: var(--dd-bg);
  color: var(--dd-fg);
}

.playlist-carousel[data-look='glass'] .plc-sort {
  background-color: rgba(255, 255, 255, 0.14);
}

.playlist-carousel[data-look='solid'] .plc-sort {
  background-color: rgba(255, 255, 255, 0.08);
}

/* List popup renders upward and is clamped to the viewport */

.plc-list-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  top: auto;
  left: 0;
  width: 380px;
  max-height: min(60vh, 520px);
  background: var(--menu-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.65),
    var(--glass-highlight);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 30;
}

@media (max-height: 720px) {
  .plc-list-popup {
    max-height: 46vh;
  }
}

.playlist-carousel[data-look='solid'] .plc-list-popup {
  background: #000;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.plc-list-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-faint);
  flex: 0 0 auto;
}

.plc-list-search input {
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: none;
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  font-family: inherit;
  padding: 0;
  height: 22px;
}

.plc-list-search input::placeholder {
  color: var(--text-faint);
}

.plc-list {
  list-style: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
}

.plc-list-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background 0.12s ease,
    border-color 0.12s ease;
  user-select: none;
}

.plc-list-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.plc-list-item.playing {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.35);
}

.plc-list-item.drag-over {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
}

.plc-list-item[draggable='true'] {
  cursor: grab;
}

.plc-list-item[draggable='true']:active {
  cursor: grabbing;
}

.plc-list-thumb {
  width: 52px;
  height: 30px;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
  flex: 0 0 auto;
  position: relative;
}

.plc-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.plc-list-thumb-fb {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-elevated), #16161a);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}

.plc-list-body {
  flex: 1 1 auto;
  min-width: 0;
}

.plc-list-name {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.plc-list-meta {
  font-size: 10.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.plc-list-remove {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  opacity: 0;
  transition:
    opacity 0.14s ease,
    background 0.14s ease,
    color 0.14s ease;
}

.plc-list-item:hover .plc-list-remove,
.plc-list-item:focus-within .plc-list-remove {
  opacity: 1;
}

.plc-list-remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* Fluid track scrolling for trackpad, wheel and touch gestures */

.plc-body {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.plc-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 2px 6px;
  flex: 1 1 auto;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.plc-track.no-snap {
  scroll-snap-type: none;
  scroll-behavior: auto;
}

.plc-track::-webkit-scrollbar {
  display: none;
}

.plc-card {
  flex: 0 0 auto;
  width: 260px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font-family: inherit;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
  scroll-snap-align: start;
  position: relative;
  outline: none;
}

.plc-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

.plc-card:active {
  transform: scale(0.985);
}

.plc-card.playing {
  border-color: rgba(var(--accent-rgb), 0.75);
  background: rgba(var(--accent-rgb), 0.08);
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.35),
    0 8px 28px rgba(var(--accent-rgb), 0.2);
}

.plc-card.dragging {
  opacity: 0.5;
}

.plc-card.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.4);
}

.plc-card[draggable='true'] {
  cursor: grab;
}

.plc-card[draggable='true']:active {
  cursor: grabbing;
}

.plc-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
}

.plc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.plc-thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a1e, #0f0f12);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
}

.plc-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.3;
  letter-spacing: 0.02em;
  max-width: calc(100% - 44px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plc-card.playing .plc-badge {
  background: var(--accent);
  color: #1a1200;
}

.plc-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.plc-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.25s linear;
}

.plc-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  opacity: 0;
  transition: opacity 0.16s ease;
  pointer-events: none;
}

.plc-card:hover .plc-play-overlay {
  opacity: 1;
}

.plc-card.playing .plc-play-overlay {
  opacity: 0;
}

.plc-play-overlay svg {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.plc-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition:
    opacity 0.16s ease,
    background 0.16s ease,
    transform 0.1s ease;
  z-index: 4;
  font-size: 12px;
  padding: 0;
}

.plc-card:hover .plc-remove,
.plc-card:focus-within .plc-remove {
  opacity: 1;
}

.plc-remove:hover {
  background: var(--danger);
  border-color: var(--danger);
}

.plc-remove:active {
  transform: scale(0.92);
}

.plc-info {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.plc-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.plc-more {
  display: none;
}

.plc-nav {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  transition:
    background 0.14s ease,
    opacity 0.14s ease;
  padding-bottom: 3px;
}

.plc-nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.plc-nav[disabled] {
  opacity: 0.25;
  pointer-events: none;
}

.plc-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 160px;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}

/* Small-screen and reduced-motion overrides */

@media (max-width: 760px) {
  .playlist-carousel {
    padding: 0 8px 76px;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }
  .plc-shell {
    padding: 12px 14px 14px;
    border-radius: 14px;
  }
  .plc-card {
    width: 210px;
  }
  .plc-name {
    font-size: 12.5px;
  }
  .plc-desc {
    font-size: 11px;
  }
  .plc-nav {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
  .plc-list-popup {
    width: 320px;
  }
  .plc-sort {
    font-size: 11px;
    padding: 5px 22px 5px 9px;
  }
}

@media (max-width: 1000px) {
  .search-panel,
  .playlist-panel {
    position: fixed;
    top: calc(var(--header-h) + env(safe-area-inset-top));
    bottom: 0;
    margin: 0;
    z-index: 60;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.7);
    width: 320px;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .search-panel {
    left: 0;
    transform: translateX(-100%);
  }
  .search-panel.open {
    transform: translateX(0);
  }
  .playlist-panel {
    right: 0;
    transform: translateX(100%);
  }
  .playlist-panel.open {
    transform: translateX(0);
  }
  .topbar-actions .tb-btn .tb-btn-label {
    display: none;
  }
  .tb-btn {
    padding: 6px 9px;
  }
  .mv-back-anchor .mv-back-name,
  .mv-back-anchor .mv-back-sep {
    display: none;
  }
  .mv-ingest .icon-btn .mv-ingest-label {
    display: none;
  }
  .mv-ingest .icon-btn {
    padding: 0 7px;
  }
  .mv-url-form {
    max-width: 120px;
  }
  .mv-cluster .icon-btn .mv-btn-label {
    display: none;
  }
}

@media (max-width: 760px) {
  .controls {
    padding: 0 10px 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .controls.standard-layout {
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .control-bar {
    border-radius: 18px;
    padding: 6px 12px 4px;
    max-width: 100%;
  }
  .control-bar[data-layout='classic'] {
    border-radius: 14px;
    gap: 6px;
    padding: 6px 10px;
    min-height: 44px;
  }
  .control-bar[data-layout='classic'] .cb-time {
    font-size: 10px;
    min-width: 38px;
    height: 30px;
  }
  .control-bar[data-layout='classic'] .volume-slider {
    display: none;
  }
  .control-bar[data-layout='standard'] {
    border-radius: 0;
    gap: 4px;
    padding: 8px 10px 10px;
    min-height: 56px;
  }
  .control-bar[data-layout='standard'] .btn {
    width: 34px;
    height: 34px;
  }
  .control-bar[data-layout='standard'] .btn svg {
    width: 17px;
    height: 17px;
  }
  .control-bar[data-layout='standard'] .btn-play {
    width: 42px;
    height: 42px;
    margin: 0 2px;
  }
  .control-bar[data-layout='standard'] .btn-play svg {
    width: 20px;
    height: 20px;
  }
  .control-bar[data-layout='standard'] .btn-speed {
    height: 28px;
    min-width: 40px;
    font-size: 11px;
  }
  .control-bar[data-layout='standard'] .cb-time {
    font-size: 11px;
    min-width: 40px;
    height: 30px;
  }
  .control-bar[data-layout='standard'] .volume-slider {
    display: none;
  }
  .control-bar[data-layout='minimal'] {
    border-radius: 18px;
  }
  .control-bar .volume-slider {
    width: 56px;
  }
  .cb-time {
    font-size: 10.5px;
    min-width: 8ch;
  }
  .control-bar .btn-play {
    width: 32px;
    height: 32px;
  }
  .control-bar .btn {
    width: 26px;
    height: 26px;
  }
  .stage-title {
    font-size: 13px;
    top: 14px;
  }
  .empty-state {
    padding: 20px;
  }
  .empty-state h1 {
    font-size: 16px;
  }
  .empty-state p {
    font-size: 12px;
  }
  .empty-sub {
    font-size: 10.5px !important;
  }
  .captions-menu,
  .settings-menu,
  .subtitle-settings-popover,
  .mv-popover-menu {
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom) - env(safe-area-inset-top)) !important;
  }
  .speed-menu {
    min-width: 140px;
  }
  .mv-toolbar {
    padding: 0 8px;
    gap: 4px;
    min-height: 44px;
  }
  .mv-cluster {
    gap: 3px;
  }
  .mv-cluster .icon-btn {
    padding: 0 7px;
    height: 28px;
    gap: 4px;
  }
  .mv-cluster .icon-btn.icon-only {
    width: 28px;
    height: 28px;
  }
  .mv-cluster .icon-btn svg {
    width: 14px;
    height: 14px;
  }
  .mv-ingest {
    height: 28px;
    gap: 2px;
    padding: 2px;
  }
  .mv-ingest .icon-btn {
    height: 24px;
    padding: 0 6px;
    font-size: 11px;
  }
  .mv-ingest .icon-btn svg {
    width: 13px;
    height: 13px;
  }
  .mv-url-form {
    max-width: 100px;
    flex: 1 1 80px;
  }
  .mv-url-form input {
    height: 24px;
    font-size: 11px;
    padding: 0 26px 0 8px;
  }
  .mv-url-submit {
    width: 20px;
    height: 20px;
  }
  .mv-url-submit svg {
    width: 12px;
    height: 12px;
  }
  .mv-segmented {
    height: 28px;
    padding: 2px;
  }
  .mv-seg {
    height: 24px;
    padding: 0 7px;
    font-size: 10.5px;
  }
  .mv-cols-stepper {
    display: none !important;
  }
  .mv-seg-divider {
    display: none !important;
  }
  .mv-divider {
    height: 16px;
    margin: 0 2px;
  }
  .mv-back-anchor {
    padding: 0 8px;
    height: 28px;
    gap: 5px;
  }
}

@media (max-width: 600px) {
  .search-panel,
  .playlist-panel {
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
    border: none;
  }
  .search-panel {
    transform: translateX(-100%);
  }
  .playlist-panel {
    transform: translateX(100%);
  }
  .panel-head {
    padding-top: 14px;
  }
  #mvSyncStartBtn,
  #mvSleepBtn,
  .mv-divider {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .control-bar[data-layout='classic'] .volume-container {
    display: none;
  }
  .control-bar[data-layout='standard'] .volume-container {
    display: none;
  }
  .control-bar[data-layout='minimal'] .volume-slider {
    display: none;
  }
  .resume-toast {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .resume-toast-actions {
    justify-content: flex-end;
  }
  .empty-state {
    padding: 16px;
  }
}

@media (max-width: 420px) {
  .brand-name {
    display: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  .control-bar .btn {
    width: 34px;
    height: 34px;
  }
  .control-bar .btn-play {
    width: 42px;
    height: 42px;
  }
  .control-bar .btn svg {
    width: 18px;
    height: 18px;
  }
  .control-bar .btn-play .icon-play,
  .control-bar .btn-play .icon-pause {
    width: 20px;
    height: 20px;
  }
  .control-bar .btn-speed {
    min-width: 44px;
    height: 30px;
    font-size: 12px;
  }
  .control-bar .scrubber {
    height: 6px;
  }
  .control-bar .scrubber-handle {
    width: 14px;
    height: 14px;
    opacity: 1;
  }
  .control-bar[data-layout='standard'] .btn {
    width: 44px;
    height: 44px;
  }
  .control-bar[data-layout='standard'] .btn-play {
    width: 54px;
    height: 54px;
  }
  .mv-tile-scrub {
    height: 32px;
  }
  .mv-tile-scrub::before {
    height: 5px;
  }
  .mv-tile-scrub-fill {
    height: 5px;
  }
  .mv-tile-scrub-handle {
    width: 16px;
    height: 16px;
    opacity: 1;
  }
  .mv-tile-controls button {
    width: 36px;
    height: 36px;
  }
  .mv-tile-controls button svg {
    width: 18px;
    height: 18px;
  }
  .mv-resize-handle {
    opacity: 1;
  }
  .pi-actions {
    opacity: 1;
  }
  .plc-remove {
    opacity: 1;
  }
  .plc-list-remove {
    opacity: 1;
  }
  .ghost-btn,
  .icon-btn {
    height: 36px;
  }
  .icon-btn.icon-only {
    width: 36px;
  }
  .mv-cluster .icon-btn {
    height: 34px;
  }
  .mv-cluster .icon-btn.icon-only {
    width: 34px;
  }
  .segmented-tabs button {
    padding: 7px 12px;
    font-size: 12px;
  }
  .search-tab {
    padding: 8px 10px !important;
    font-size: 12px !important;
  }
  .settings-item,
  .settings-toggle-row {
    padding: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Debug tools panel (Ctrl+Shift+D). It is built on demand, so these rules cost nothing until it is opened. */
.peko-debug {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2147483000;
  width: min(320px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-frame);
  background: var(--bg-elevated);
  color: var(--text);
  font: 12px/1.45 var(--font-body);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.peko-debug[hidden] {
  display: none;
}

.peko-debug header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.peko-debug button {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.peko-debug button:hover,
.peko-debug button:focus-visible {
  border-color: var(--accent);
}

.peko-debug-actions {
  display: grid;
  gap: 6px;
}

.peko-debug-status {
  min-height: 1.5em;
  margin: 8px 0 0;
  color: var(--accent);
}

.peko-debug-note {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.peko-debug-outline {
  position: fixed;
  z-index: 2147482999;
  pointer-events: none;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
