:root {
  --bg: #010304;
  --bg2: #02131f;
  --panel: #051018;
  --panel-2: #081824;
  --text: #e9fbff;
  --muted: #8db6c7;
  --accent: #00c9ff;
  --accent-2: #f6ff00;
  --danger: #ff6b8f;
  --ok: #33ffaa;
  --line: rgba(0, 210, 255, 0.55);
  --line-soft: rgba(0, 210, 255, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 10%, rgba(0, 201, 255, 0.18), transparent 28%),
    radial-gradient(circle at 88% 85%, rgba(246, 255, 0, 0.1), transparent 22%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  overflow: hidden;
}

.kicker {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-2);
  font-weight: 700;
}

h1 {
  margin: 2px 0 0;
  font-size: clamp(0.75rem, 1vw, 0.92rem);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.app-topbar {
  margin: 2px 3px;
  padding: 3px 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  background: transparent;
  box-shadow: none;
  border-color: transparent;
}

.app-topbar.frame {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.frame {
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(3, 12, 20, 0.96), rgba(2, 8, 14, 0.98));
  box-shadow:
    0 0 0 1px rgba(0, 201, 255, 0.18) inset,
    0 0 14px rgba(0, 201, 255, 0.22);
}

.topbar-brand {
  min-width: 0;
}

.topbar-brand .kicker {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}

.top-search-form {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 4px;
  position: relative;
}

.top-search-form-hidden {
  display: none !important;
}

.search-input-wrapper {
  position: relative;
  min-width: 0;
}

.top-search-form input {
  min-height: 32px;
  padding: 4px 8px;
  font-size: 0.75rem;
  width: 100%;
}

.top-search-form button {
  min-height: 32px;
  padding: 4px 6px;
  font-size: 0.72rem;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(2, 8, 14, 0.95);
  border: 2px solid var(--accent);
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.autocomplete-dropdown.hidden {
  display: none;
}

.autocomplete-item {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(0, 201, 255, 0.1);
  cursor: pointer;
  font-size: 0.73rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s;
}

.autocomplete-item:hover {
  background: rgba(0, 201, 255, 0.15);
}

.topbar-actions {
  display: grid;
  grid-auto-flow: column;
  align-items: center;
  justify-self: end;
  gap: 4px;
  position: relative;
}

.pix-top-summary {
  display: grid;
  gap: 1px;
  min-height: 32px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 184, 107, 0.24);
  border-radius: 10px;
  background: rgba(255, 184, 107, 0.06);
  color: rgba(255, 235, 214, 0.82);
  line-height: 1.05;
}

.pix-top-label,
.pix-top-meta,
.pix-top-hint,
.pix-top-value {
  margin: 0;
}

.pix-top-label {
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 214, 168, 0.72);
}

.pix-top-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffd6a8;
}

.pix-top-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.58rem;
  color: rgba(255, 239, 219, 0.72);
}

.pix-top-hint {
  font-size: 0.54rem;
  color: rgba(255, 239, 219, 0.52);
}

.credits-hud {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 9px;
  border: 2px solid rgba(246, 255, 0, 0.65);
  border-radius: 6px;
  background: rgba(246, 255, 0, 0.12);
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  cursor: default;
}

.credits-hud.selected {
  background: rgba(246, 255, 0, 0.85);
  border-color: #f6ff00;
  color: #111;
  transform: scale(1.08);
  box-shadow: 0 0 10px rgba(246, 255, 0, 0.6);
}

.menu-btn {
  min-height: 32px;
  padding: 4px 6px;
  font-size: 1rem;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: linear-gradient(180deg, rgba(3, 12, 20, 0.98), rgba(2, 8, 14, 1));
  border: 2px solid var(--accent);
  border-radius: 6px;
  min-width: 140px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

.menu-dropdown.hidden {
  display: none !important;
}

.menu-item {
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.75rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.menu-item:hover {
  background: rgba(0, 201, 255, 0.2);
}

.menu-kiosk-indicator {
  padding: 6px 12px;
  font-size: 0.65rem;
  color: var(--accent-2);
  border-bottom: 1px solid rgba(0, 201, 255, 0.1);
}

.kiosk-indicator {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(2, 12, 24, 0.7);
}

body.kiosk-mode .kiosk-indicator {
  border-color: rgba(215, 255, 49, 0.75);
  color: var(--accent-2);
}

.jukebox-layout {
  height: calc(100dvh - 96px);
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.8fr);
  gap: 8px;
  padding: 0 6px 6px;
}

.screen-left,
.screen-right {
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.public-access-card {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(3, 10, 18, 0.5);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32);
}

.public-access-copy {
  min-width: 0;
}

.public-access-hint {
  margin: 0;
  color: rgba(234, 245, 255, 0.96);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
}

.public-access-track,
.public-access-timeline {
  display: none;
}

.public-access-track {
  margin: 6px 0 0;
  color: rgba(234, 245, 255, 0.96);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  max-width: min(34vw, 320px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.public-access-timeline {
  margin-top: 8px;
  display: none;
  align-items: center;
  gap: 8px;
  min-width: min(32vw, 280px);
}

.public-access-time {
  color: rgba(234, 245, 255, 0.76);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.public-access-progress {
  position: relative;
  flex: 1 1 auto;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.public-access-progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(0, 200, 255, 0.92), rgba(215, 255, 49, 0.92));
}

.public-access-qr-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: 1px solid rgba(246, 255, 0, 0.35);
  border-radius: 10px;
  background: rgba(247, 251, 255, 0.96);
}

.public-access-qr {
  width: 72px;
  height: 72px;
  display: block;
  object-fit: contain;
}

body:not(.video-focus-mode) .public-access-card.public-access-card-visible {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  z-index: 30;
  transform: translate(-50%, -50%);
  display: grid !important;
  justify-items: center;
  gap: 12px;
  min-width: min(420px, calc(100vw - 40px));
  padding: 18px;
  border-radius: 22px;
  background: rgba(2, 8, 14, 0.82);
  border-color: rgba(125, 234, 255, 0.24);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}

body:not(.video-focus-mode) .public-access-card.public-access-card-visible .public-access-copy {
  justify-items: center;
  text-align: center;
}

body:not(.video-focus-mode) .public-access-card.public-access-card-visible .public-access-hint {
  font-size: 0.92rem;
  letter-spacing: 0.08em;
}

body:not(.video-focus-mode) .public-access-card.public-access-card-visible .public-access-qr-shell {
  padding: 10px;
  border-radius: 16px;
}

body:not(.video-focus-mode) .public-access-card.public-access-card-visible .public-access-qr {
  width: 190px;
  height: 190px;
}

body.kiosk-mode .frame {
  border-width: 3px;
}

body.video-focus-mode {
  overflow: hidden;
}

body.video-focus-mode .app-topbar,
body.video-focus-mode .screen-left {
  opacity: 0.04;
  pointer-events: none;
  filter: blur(1px);
}

body.video-focus-mode .screen-right {
  position: fixed;
  inset: 0;
  z-index: 10000;
  padding: 0;
  border: none;
  border-radius: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(0, 200, 255, 0.24), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(215, 255, 49, 0.18), transparent 36%),
    linear-gradient(180deg, #01050a, #020914);
}

body.video-focus-mode .queue-panel {
  position: relative;
  margin-top: 0;
  width: 100%;
  height: 100dvh;
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
}

body.video-focus-mode .player-shell {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: #000;
  box-shadow: none;
}

body.video-focus-mode .jukebox-video {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  border: none;
  border-radius: 0;
  object-fit: contain;
  margin: 0;
  box-shadow: none;
}

body.video-focus-mode .youtube-embed-player,
body.video-focus-mode .youtube-embed-player iframe {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  border: none;
  border-radius: 0;
  margin: 0;
  box-shadow: none;
}

body.video-focus-mode #resume-video-btn {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2;
}

body.video-focus-mode .panel-title,
body.video-focus-mode .player-hint,
body.video-focus-mode .status,
body.video-focus-mode .queue-list,
body.video-focus-mode .queue-now-playing {
  display: none;
}

body.video-focus-mode #pix-modal:not(.hidden) {
  z-index: 999999 !important;
}

body.video-focus-mode .public-access-card {
  right: 16px;
  bottom: 16px;
  max-width: min(48vw, 520px);
}

body.video-focus-mode .public-access-track,
body.video-focus-mode .public-access-timeline {
  display: flex;
}

body.video-focus-mode .public-access-track {
  display: block;
}

body.video-focus-mode .public-access-hint {
  font-size: 0.62rem;
}

body.legacy-tv-browser.video-focus-mode .app-topbar,
body.legacy-tv-browser.video-focus-mode .screen-left {
  display: none;
}

body.legacy-tv-browser.video-focus-mode .screen-right,
body.legacy-tv-browser.video-focus-mode .queue-panel,
body.legacy-tv-browser.video-focus-mode .player-shell {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100vh;
  padding: 0;
  margin: 0;
  background: #000;
  filter: none;
}

body.legacy-tv-browser.video-focus-mode .video-scrim {
  display: none;
}

body.legacy-tv-browser.video-focus-mode .jukebox-video,
body.legacy-tv-browser.video-focus-mode .youtube-embed-player,
body.legacy-tv-browser.video-focus-mode .youtube-embed-player iframe {
  background: #000;
}

body.legacy-tv-browser.video-focus-mode .public-access-card {
  position: absolute;
  right: 16px;
  bottom: 16px;
  background: rgba(0, 0, 0, 0.78);
  border-color: rgba(255, 255, 255, 0.22);
  backdrop-filter: none;
  box-shadow: none;
}

.settings-panel {
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 12px;
  background: rgba(3, 11, 18, 0.96);
  margin-bottom: 10px;
  display: grid;
  gap: 8px;
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 16px;
}

.settings-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(1, 6, 10, 0.8);
  backdrop-filter: blur(4px);
}

.settings-dialog {
  position: relative;
  z-index: 1;
  width: min(780px, calc(100vw - 24px));
  max-height: calc(100vh - 28px);
  overflow: hidden;
  display: grid;
  gap: 10px;
  padding: 12px;
  background: rgba(3, 11, 18, 0.98);
}

.settings-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.settings-dialog-header h3 {
  margin: 0;
}

.settings-auth-view {
  display: grid;
  gap: 8px;
}

.settings-dialog .settings-panel {
  margin-bottom: 0;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

.floating-settings {
  position: fixed;
  top: 82px;
  right: 12px;
  z-index: 50;
  width: min(380px, calc(100vw - 24px));
}

.pix-settings-panel {
  top: 96px;
  right: min(404px, calc(100vw - 24px));
  max-height: calc(100vh - 118px);
  overflow-y: auto;
}

.settings-panel h4 {
  margin: 0;
}

.settings-label {
  font-size: 0.92rem;
  color: var(--muted);
}

.settings-note {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.9rem;
  font-weight: 600;
}

.settings-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.settings-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.search-settings-summary {
  margin: 6px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  padding: 12px 14px;
  border: 2px solid var(--accent-2);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 20%, rgba(246, 255, 0, 0.18), transparent 55%),
    linear-gradient(180deg, rgba(8, 22, 30, 0.98), rgba(6, 18, 24, 0.98));
  box-shadow:
    0 0 0 1px rgba(246, 255, 0, 0.2) inset,
    0 0 16px rgba(246, 255, 0, 0.25);
}

.search-loading-text {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.84rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 800;
}

.search-spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid rgba(0, 201, 255, 0.25);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: search-spin 0.7s linear infinite;
  box-shadow: 0 0 10px rgba(0, 201, 255, 0.35);
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.featured-panel {
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 8px;
  background: linear-gradient(180deg, rgba(4, 14, 21, 0.98), rgba(6, 22, 32, 0.98));
  margin-bottom: 8px;
}

.featured-head,
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.list-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.featured-label,
.list-kicker {
  display: inline-block;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.featured-counter {
  color: var(--muted);
  font-size: 0.78rem;
}

.featured-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.featured-card {
  padding: 0;
  border: 2px solid var(--line-soft);
  border-radius: 6px;
  overflow: hidden;
  background: #09131a;
  min-height: 0;
}

.featured-card:hover {
  border-color: var(--accent);
}

.featured-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #111;
}

.featured-caption {
  display: block;
  padding: 4px 6px;
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--text);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-title {
  margin: 4px 0 0;
  font-size: 1.2rem;
  color: var(--text);
  text-transform: uppercase;
}

.screen-left {
  overflow: hidden;
}

.search-results {
  margin-top: 0;
  display: grid;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  align-content: start;
}

.search-item {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
  border: 2px solid rgba(0, 201, 255, 0.22);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(7, 16, 23, 0.96), rgba(4, 9, 14, 0.98));
  padding: 5px;
  align-items: center;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.search-thumb {
  width: 76px;
  height: 76px;
  border-radius: 2px;
  object-fit: cover;
  background: rgba(15, 23, 42, 0.8);
}

.search-info {
  min-width: 0;
}

.search-title {
  margin: 0 0 4px;
  font-size: 0.94rem;
  color: var(--accent-2);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid rgba(246, 255, 0, 0.55);
  color: #0b1418;
  background: var(--accent-2);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.downloaded-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(51, 255, 170, 0.15);
  border: 1px solid rgba(51, 255, 170, 0.65);
  color: var(--ok);
  vertical-align: middle;
}

.search-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item.selected,
.search-item:hover {
  border-color: var(--accent-2);
  background: linear-gradient(180deg, rgba(9, 20, 28, 0.98), rgba(7, 16, 22, 1));
}

#open-search-btn.selected,
#open-search-btn:hover {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(246, 255, 0, 0.28) inset;
}

input,
button {
  border-radius: 3px;
  border: 2px solid rgba(0, 201, 255, 0.35);
  padding: 10px 12px;
  font: inherit;
}

input {
  background: rgba(0, 8, 18, 0.84);
  color: var(--text);
}

button {
  background: linear-gradient(180deg, #e8ecef, #c9d6dc);
  color: #031118;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
  text-transform: uppercase;
}

button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.status {
  min-height: 20px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 4px;
  background: rgba(2, 10, 20, 0.95);
  border: 2px solid transparent;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.status.error {
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.35);
}

.status.ok {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.35);
}

.pairing-code-banner {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 2px dashed rgba(246, 255, 0, 0.75);
  background: rgba(246, 255, 0, 0.12);
  color: #f6ff00;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

.result {
  margin-top: 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(2, 10, 20, 0.88);
  border: 1px solid var(--line);
  overflow: auto;
}

.video-title {
  margin: 0 0 8px;
  font-size: 1rem;
}

.video-cover {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.panel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.panel h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.queue-panel {
  margin-top: 0;
  border: 2px solid rgba(0, 200, 255, 0.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 15% 0%, rgba(0, 200, 255, 0.13), transparent 38%),
    linear-gradient(180deg, rgba(3, 15, 28, 0.98), rgba(2, 9, 18, 0.98));
  padding: 10px;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
}

.panel-title::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px rgba(215, 255, 49, 0.65);
}

#clear-queue-btn {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.72rem;
}

.queue-now-playing {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 2px solid rgba(0, 200, 255, 0.35);
  border-radius: 4px;
  background: rgba(1, 11, 21, 0.84);
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
}

.jukebox-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 52dvh;
  object-fit: cover;
  border-radius: 4px;
  border: 0;
  background: #000;
  margin-bottom: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.youtube-embed-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 52dvh;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
  margin-bottom: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.youtube-embed-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.player-shell {
  position: relative;
  border: 2px solid rgba(0, 200, 255, 0.3);
  border-radius: 6px;
  padding: 8px;
  background:
    radial-gradient(circle at 75% 10%, rgba(0, 200, 255, 0.18), transparent 45%),
    linear-gradient(180deg, rgba(5, 16, 29, 0.9), rgba(2, 10, 18, 0.88));
  box-shadow:
    0 0 0 1px rgba(0, 200, 255, 0.18) inset,
    0 12px 24px rgba(0, 0, 0, 0.35);
  margin-bottom: 10px;
}

#resume-video-btn {
  width: 100%;
  margin-bottom: 0;
  border: 1px solid rgba(0, 200, 255, 0.55);
  background: linear-gradient(90deg, rgba(0, 200, 255, 0.28), rgba(215, 255, 49, 0.28));
  color: #eaf5ff;
}

.player-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.queue-list {
  max-height: none;
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 4px;
  padding-right: 4px;
  align-content: start;
}

.queue-list::-webkit-scrollbar {
  width: 8px;
}

.queue-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 200, 255, 0.55), rgba(215, 255, 49, 0.4));
  border-radius: 999px;
}

.queue-item {
  position: relative;
  border: 2px solid rgba(0, 200, 255, 0.25);
  border-radius: 4px;
  padding: 8px;
  text-align: left;
  background: linear-gradient(180deg, rgba(2, 12, 22, 0.9), rgba(2, 10, 18, 0.78));
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 120ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.queue-item:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 200, 255, 0.48);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.queue-item.active {
  border-color: rgba(215, 255, 49, 0.75);
  box-shadow:
    0 0 0 1px rgba(215, 255, 49, 0.25) inset,
    0 0 18px rgba(215, 255, 49, 0.18);
}

.queue-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, var(--accent-2), #dfff31aa);
}

.search-results::-webkit-scrollbar,
.queue-list::-webkit-scrollbar {
  width: 10px;
}

.search-results::-webkit-scrollbar-thumb,
.queue-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 200, 255, 0.7), rgba(246, 255, 0, 0.45));
  border-radius: 999px;
}

.links-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.links-list a,
.action-link,
.secondary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 10px;
  padding: 10px 12px;
  text-decoration: none;
  font-weight: 600;
}

.links-list a {
  border: 1px solid rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.1);
  color: #7ee5f5;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.action-link {
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.12);
  color: #ffd977;
}

.secondary-btn {
  border: 1px solid rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.12);
  color: #b8f3fa;
}

.ghost-btn {
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.55);
  color: var(--text);
}

#open-search-btn {
  min-height: 36px;
  padding: 8px 12px;
  justify-content: flex-start;
  gap: 8px;
  white-space: nowrap;
  line-height: 1;
}

#open-search-btn .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.result a:hover {
  filter: brightness(1.12);
}

.transcript-meta {
  margin: 10px 0 6px;
  color: var(--muted);
}

.transcript-box {
  width: 100%;
  min-height: 130px;
  background: rgba(0, 8, 18, 0.84);
  color: var(--text);
  border: 1px solid rgba(0, 200, 255, 0.35);
  border-radius: 6px;
  padding: 10px;
  resize: vertical;
  font: inherit;
  line-height: 1.45;
}

.hidden {
  display: none;
}

@media (max-width: 720px) {
  .app-topbar {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 4px 6px;
  }

  .topbar-brand h1 {
    font-size: clamp(0.65rem, 2vw, 0.85rem);
  }

  .top-search-form {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .topbar-actions {
    grid-auto-flow: column;
  }

  .pix-settings-panel {
    right: 12px;
    top: 140px;
    width: min(380px, calc(100vw - 24px));
  }

  .menu-dropdown {
    right: 0;
  }

  .jukebox-layout {
    grid-template-columns: 1fr;
    height: auto;
    padding: 0 6px 6px;
    gap: 6px;
  }

  .screen-left,
  .screen-right {
    min-height: unset;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .form-inline {
    grid-template-columns: 1fr;
  }

  .search-head {
    flex-direction: column;
    align-items: stretch;
  }

  .search-item {
    grid-template-columns: 1fr;
  }

  .search-thumb {
    width: 100%;
    height: 150px;
  }

  .jukebox-video {
    max-height: 260px;
  }

  .featured-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .links-list {
    grid-template-columns: 1fr;
  }

  .action-row {
    grid-template-columns: 1fr;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
    color: rgba(233, 251, 255, 0.9);

@keyframes search-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Keyboard Virtual Styles */
.keyboard-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
}

.keyboard-modal.hidden {
  display: none !important;
}

.pix-modal {
  position: fixed;
  inset: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  pointer-events: auto;
}

.pix-modal.hidden {
  display: none !important;
}

.pix-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.pix-modal-dialog {
  position: relative;
  width: min(460px, calc(100vw - 26px));
  padding: 14px;
  display: grid;
  gap: 10px;
}

.pix-modal-dialog h3 {
  margin: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pix-modal-amount,
.pix-modal-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.machine-lock-modal {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.machine-lock-modal.hidden {
  display: none !important;
}

.machine-lock-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.machine-lock-dialog {
  position: relative;
  width: min(520px, calc(100vw - 24px));
  padding: 18px;
  display: grid;
  gap: 10px;
  text-align: center;
}

.machine-lock-dialog h3 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.machine-lock-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.machine-lock-code {
  margin: 4px auto 0;
  min-width: 170px;
  padding: 12px 16px;
  border: 2px dashed rgba(246, 255, 0, 0.8);
  border-radius: 8px;
  background: rgba(246, 255, 0, 0.12);
  color: var(--accent-2);
  font-weight: 800;
  font-size: 1.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.pix-modal-qr {
  width: min(280px, 82vw);
  justify-self: center;
  border: 2px solid var(--accent-2);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.pix-modal-copy {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: rgba(0, 14, 21, 0.9);
  color: var(--text);
  padding: 8px;
}

/* Terminal redesign */
body {
  background:
    radial-gradient(circle at 14% 18%, rgba(0, 201, 255, 0.16), transparent 22%),
    radial-gradient(circle at 82% 10%, rgba(255, 138, 31, 0.12), transparent 20%),
    linear-gradient(180deg, #010409 0%, #05101a 100%);
}

.app-topbar {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 60;
  margin: 0;
  padding: 10px 12px;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.2fr) auto;
  gap: 12px;
  border: 1px solid rgba(125, 234, 255, 0.24);
  background: linear-gradient(180deg, rgba(3, 12, 20, 0.74), rgba(5, 14, 24, 0.58));
  backdrop-filter: blur(18px);
  box-shadow:
    0 10px 42px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(162, 236, 255, 0.08) inset;
}

.frame {
  border: 1px solid rgba(125, 234, 255, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(5, 14, 24, 0.76), rgba(3, 10, 18, 0.68));
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.topbar-brand .kicker {
  color: #9ceeff;
}

.topbar-brand h1 {
  font-size: clamp(0.92rem, 1.45vw, 1.15rem);
  letter-spacing: 0.12em;
}

.top-search-form {
  grid-template-columns: minmax(0, 1fr) 60px;
  align-items: stretch;
}

.top-search-form input,
.top-search-form button,
.topbar-actions .ghost-btn,
.topbar-actions .secondary-btn {
  min-height: 44px;
  border-radius: 14px;
}

.top-search-form input {
  border: 1px solid rgba(156, 238, 255, 0.18);
  background: linear-gradient(180deg, rgba(1, 8, 16, 0.88), rgba(4, 14, 23, 0.92));
  color: var(--text);
  padding: 10px 14px;
}

.top-search-form button {
  padding: 10px 12px;
}

.autocomplete-dropdown {
  top: calc(100% + 6px);
  border: 1px solid rgba(125, 234, 255, 0.22);
  border-radius: 16px;
  background: rgba(3, 10, 18, 0.94);
  backdrop-filter: blur(16px);
}

.autocomplete-item {
  padding: 10px 12px;
  font-size: 0.82rem;
}

.topbar-actions {
  gap: 8px;
}

.credits-hud {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(246, 255, 0, 0.35);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(246, 255, 0, 0.14), rgba(246, 255, 0, 0.08));
  color: #f6ff9c;
}

.menu-btn {
  width: 44px;
}

.menu-dropdown {
  top: calc(100% + 10px);
  border: 1px solid rgba(125, 234, 255, 0.18);
  border-radius: 18px;
  background: rgba(3, 12, 20, 0.94);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
}

.menu-item,
.menu-kiosk-indicator {
  font-size: 0.78rem;
}

.jukebox-layout {
  position: relative;
  height: 100dvh;
  padding: 0;
  display: block;
}

.screen-right {
  position: absolute;
  inset: 0;
  padding: 0;
}

.screen-left {
  position: absolute;
  top: 86px;
  left: 16px;
  bottom: 18px;
  z-index: 30;
  width: min(390px, calc(100vw - 32px));
  padding: 16px 14px 14px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(5, 15, 24, 0.88), rgba(4, 10, 18, 0.82));
}

.list-head {
  align-items: center;
  gap: 12px;
}

.list-head-actions {
  gap: 6px;
  align-items: center;
}

.list-kicker,
.featured-counter,
.dock-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.list-title {
  margin-top: 4px;
  font-size: 0.96rem;
  line-height: 1.08;
  letter-spacing: 0.02em;
  color: rgba(236, 248, 255, 0.92);
  text-transform: none;
}

.search-settings-summary {
  margin: 8px 0 10px;
  color: rgba(233, 251, 255, 0.68);
}

.search-results {
  margin-top: 6px;
  padding-right: 6px;
  gap: 10px;
  perspective: none;
  scroll-snap-type: none;
  overflow-x: hidden;
  overflow-y: auto;
}

.search-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(125, 234, 255, 0.14);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(8, 22, 32, 0.92), rgba(4, 11, 19, 0.96));
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  transform: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  align-items: center;
}

.search-item:nth-child(odd) {
  transform: none;
}

.search-item:nth-child(even) {
  transform: none;
}

.search-item.selected,
.search-item:hover {
  border-color: rgba(246, 255, 0, 0.64);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(246, 255, 0, 0.2) inset;
}

.search-thumb {
  width: 84px;
  height: 84px;
  border-radius: 14px;
}

.search-title {
  font-size: 0.9rem;
  color: rgba(247, 255, 179, 0.94);
  text-transform: none;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.search-meta {
  font-size: 0.75rem;
  color: rgba(221, 234, 242, 0.68);
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
}

.featured-grid {
  margin-top: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.featured-card {
  border: 1px solid rgba(125, 234, 255, 0.12);
  border-radius: 18px;
  background: rgba(4, 12, 20, 0.7);
}

.featured-thumb {
  border-radius: 16px 16px 0 0;
}

.queue-panel {
  position: relative;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  height: 100%;
  overflow: hidden;
}

.player-shell {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: #000;
  box-shadow: none;
}

.video-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(1, 6, 10, 0.62) 0%, rgba(1, 6, 10, 0.14) 28%, rgba(1, 6, 10, 0.14) 72%, rgba(1, 6, 10, 0.58) 100%),
    linear-gradient(180deg, rgba(1, 6, 10, 0.48) 0%, rgba(1, 6, 10, 0) 24%, rgba(1, 6, 10, 0.4) 100%);
}

.jukebox-video,
.youtube-embed-player {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  border-radius: 0;
  margin: 0;
  box-shadow: none;
}

.jukebox-video {
  object-fit: cover;
}

.youtube-embed-player iframe {
  width: 100%;
  height: 100%;
}

#resume-video-btn {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 4;
  width: auto;
  border-radius: 18px;
}

.terminal-dock {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  width: min(470px, calc(100vw - 450px));
  min-width: 360px;
  padding: 16px;
  display: grid;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(4, 12, 20, 0.82), rgba(5, 14, 24, 0.62)),
    radial-gradient(circle at top right, rgba(125, 234, 255, 0.08), transparent 40%);
  backdrop-filter: blur(18px);
}

.dock-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 12px;
  align-items: start;
}

.dock-now-playing-block {
  min-width: 0;
}

.panel-title {
  margin: 0 0 4px;
  margin: 6px 0 8px;
  font-size: 1rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 10px 12px;
  border: 1px solid rgba(125, 234, 255, 0.16);
  border-radius: 16px;
  margin: 0;
  background: rgba(255, 255, 255, 0.04);
  text-transform: none;
  white-space: nowrap;
}
  text-overflow: ellipsis;

.pix-inline-card {
  padding: 14px;
  border: 1px solid rgba(255, 184, 107, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 138, 31, 0.16), rgba(255, 138, 31, 0.08)),
    rgba(255, 255, 255, 0.03);
}

.pix-inline-value {
  margin: 8px 0 4px;
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffd6a8;
}

.pix-inline-meta {
  margin: 0;
  display: grid;
  gap: 4px;
  color: rgba(255, 239, 219, 0.84);
  font-size: 0.78rem;
}

.pix-inline-hint {
  margin: 10px 0 0;
  color: rgba(255, 239, 219, 0.68);
  font-size: 0.76rem;
  line-height: 1.35;
}

.status {
  margin: 0;
  min-height: 0;
  border: 1px solid rgba(125, 234, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  text-transform: none;
}

.pairing-code-banner {
  margin: 0;
  border: 1px dashed rgba(246, 255, 0, 0.54);
  border-radius: 16px;
  background: rgba(246, 255, 0, 0.08);
}

.queue-shell {
  display: grid;
  gap: 10px;
}

.queue-shell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.queue-shell-copy {
  margin: 6px 0 0;
  color: rgba(233, 251, 255, 0.62);
  font-size: 0.78rem;
}

.queue-list {
  max-height: 200px;
  padding-right: 6px;
  gap: 8px;
}

.queue-item {
  border: 1px solid rgba(125, 234, 255, 0.14);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
}

.queue-item.active {
  border-color: rgba(246, 255, 0, 0.62);
}

.public-access-card {
  display: none !important;
  position: static;
  right: auto;
  bottom: auto;
  max-width: none;
  padding: 12px;
  border: 1px solid rgba(125, 234, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.public-access-card.public-access-card-visible {
  display: grid !important;
}

.public-access-track,
.public-access-timeline {
  display: flex;
}

.public-access-track {
  display: block;
  max-width: none;
}

.public-access-qr-shell {
  border-radius: 16px;
}

.player-hint {
  display: none;
}

body.video-focus-mode .app-topbar,
body.video-focus-mode .screen-left {
  opacity: 0.03;
  pointer-events: none;
}

body.video-focus-mode .terminal-dock > :not(.public-access-card) {
  opacity: 0.03;
  pointer-events: none;
}

body.video-focus-mode .screen-right,
body.video-focus-mode .queue-panel,
body.video-focus-mode .player-shell {
  position: absolute;
  inset: 0;
}

body.video-focus-mode .public-access-card {
  display: grid !important;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 6;
  width: min(430px, calc(100vw - 36px));
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1200px) {
  .screen-left {
    width: min(340px, calc(100vw - 32px));
  }

  .terminal-dock {
    width: min(420px, calc(100vw - 380px));
    min-width: 320px;
  }
}

@media (max-width: 900px) {
  .app-topbar {
    grid-template-columns: 1fr;
  }

  .jukebox-layout {
    overflow: auto;
  }

  .screen-right {
    position: relative;
    min-height: 100dvh;
  }

  .screen-left {
    position: relative;
    top: 88px;
    left: auto;
    right: auto;
    bottom: auto;
    width: calc(100% - 24px);
    margin: 0 12px 16px;
    min-height: 46dvh;
  }

  .terminal-dock {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    min-width: 0;
  }

  .dock-topline {
    grid-template-columns: 1fr;
  }

  .jukebox-video,
  .youtube-embed-player {
    object-fit: cover;
  }
}

@media (max-width: 720px) {
  .app-topbar {
    top: 8px;
    left: 8px;
    right: 8px;
    padding: 10px;
  }

  .screen-left {
    top: 118px;
    width: calc(100% - 16px);
    margin: 0 8px 12px;
    padding: 14px 12px;
  }

  .search-item,
  .search-item:nth-child(odd),
  .search-item:nth-child(even),
  .search-item.selected,
  .search-item:hover {
    grid-template-columns: 84px 1fr;
    transform: none;
  }

  .search-thumb {
    width: 84px;
    height: 84px;
  }

  .featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .terminal-dock {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 12px;
  }

  .queue-list {
    max-height: 160px;
  }
}

.keyboard-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
}

.keyboard-dialog {
  position: relative;
  background: linear-gradient(180deg, rgba(3, 12, 20, 0.98), rgba(2, 8, 14, 1));
  border: 3px solid var(--accent);
  border-radius: 12px 12px 0 0;
  padding: 12px;
  max-width: 100%;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 -4px 20px rgba(0, 201, 255, 0.3);
}

.keyboard-header {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.keyboard-display {
  flex: 1;
  padding: 10px 12px;
  background: rgba(5, 16, 24, 0.9);
  border: 2px solid var(--accent);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  min-height: 44px;
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyboard-display-empty {
  color: var(--muted);
}

.keyboard-close-btn {
  padding: 8px 12px;
  background: rgba(255, 107, 143, 0.15);
  border: 2px solid var(--danger);
  border-radius: 8px;
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: all 0.2s;
}

.keyboard-close-btn:hover {
  background: rgba(255, 107, 143, 0.3);
}

.keyboard-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.keyboard-row {
  display: grid;
  grid-template-columns: repeat(10, minmax(32px, 1fr));
  gap: 4px;
}

.keyboard-suggestions-row {
  margin-bottom: 2px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: minmax(40px, auto);
}

.keyboard-suggestion-btn {
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(246, 255, 0, 0.35);
  background: linear-gradient(135deg, rgba(246, 255, 0, 0.2), rgba(246, 255, 0, 0.08));
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

.keyboard-suggestion-btn:hover {
  border-color: rgba(246, 255, 0, 0.7);
  background: linear-gradient(135deg, rgba(246, 255, 0, 0.32), rgba(246, 255, 0, 0.14));
}

.keyboard-suggestion-btn.keyboard-focused {
  border: 2px solid #f6ff00;
  background: linear-gradient(135deg, rgba(246, 255, 0, 0.55), rgba(0, 201, 255, 0.28));
  color: #031118;
  text-shadow: none;
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    0 0 0 1px rgba(246, 255, 0, 0.35) inset,
    0 0 16px rgba(246, 255, 0, 0.45),
    0 0 24px rgba(0, 201, 255, 0.28);
}

.keyboard-key {
  min-height: 40px;
  padding: 6px 4px;
  background: linear-gradient(135deg, rgba(0, 201, 255, 0.15), rgba(0, 201, 255, 0.05));
  border: 1px solid rgba(0, 201, 255, 0.3);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.keyboard-key:hover {
  background: linear-gradient(135deg, rgba(0, 201, 255, 0.3), rgba(0, 201, 255, 0.15));
  border-color: rgba(0, 201, 255, 0.6);
  box-shadow: 0 0 10px rgba(0, 201, 255, 0.2);
}

.keyboard-key:active {
  transform: scale(0.95);
  background: rgba(0, 201, 255, 0.4);
}

.keyboard-key.keyboard-focused {
  background: linear-gradient(135deg, rgba(0, 201, 255, 0.5), rgba(246, 255, 0, 0.3));
  border: 2px solid var(--accent);
  box-shadow: 0 0 15px rgba(0, 201, 255, 0.6), inset 0 0 10px rgba(0, 201, 255, 0.2);
  transform: scale(1.05);
}

.keyboard-backspace {
  grid-column: span 1;
  background: rgba(255, 107, 143, 0.15);
  border-color: rgba(255, 107, 143, 0.3);
  color: var(--danger);
}

.keyboard-backspace:hover {
  background: rgba(255, 107, 143, 0.3);
  border-color: rgba(255, 107, 143, 0.6);
}

.keyboard-space {
  grid-column: 1 / -1;
  min-height: 45px;
  background: linear-gradient(135deg, rgba(246, 255, 0, 0.2), rgba(246, 255, 0, 0.05));
  border-color: rgba(246, 255, 0, 0.4);
  color: var(--accent-2);
  font-weight: 700;
}

.keyboard-space:hover {
  background: linear-gradient(135deg, rgba(246, 255, 0, 0.3), rgba(246, 255, 0, 0.15));
  border-color: rgba(246, 255, 0, 0.7);
}

.keyboard-submit {
  grid-column: 1 / -1;
  min-height: 50px;
  background: linear-gradient(135deg, rgba(0, 201, 255, 0.25), rgba(0, 201, 255, 0.1));
  border: 2px solid var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

.keyboard-submit:hover {
  background: linear-gradient(135deg, rgba(0, 201, 255, 0.4), rgba(0, 201, 255, 0.2));
  box-shadow: 0 0 15px rgba(0, 201, 255, 0.4);
}

@media (max-width: 720px) {
  .keyboard-dialog {
    width: 100%;
    border-radius: 12px;
    max-height: 90vh;
  }

  .keyboard-key {
    min-height: 44px;
    font-size: 0.85rem;
  }

  .keyboard-submit {
    grid-column: 1 / -1;
  }
}

/* Playback layout refinements */
.terminal-dock {
  width: min(660px, calc(100vw - 390px));
  min-width: 400px;
  padding: 14px;
  gap: 10px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(4, 12, 20, 0.82), rgba(5, 14, 24, 0.64)),
    radial-gradient(circle at top left, rgba(246, 255, 0, 0.08), transparent 34%),
    radial-gradient(circle at top right, rgba(125, 234, 255, 0.12), transparent 42%);
}

.dock-topline {
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 10px;
}

.dock-now-playing-block {
  padding: 6px 8px;
  border: 0;
  border-radius: 10px;
  background: rgba(3, 12, 20, 0.18);
  box-shadow: none;
}

.queue-now-playing {
  padding: 11px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  font-size: 0.88rem;
  line-height: 1.35;
}

.queue-now-playing-compact {
  display: none;
}

.playback-status-stack {
  display: grid;
  gap: 8px;
  align-content: stretch;
}

.status,
.pairing-code-banner {
  padding: 10px 12px;
  border-radius: 12px;
  backdrop-filter: blur(12px);
}

.status {
  min-height: 62px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(125, 234, 255, 0.08);
  color: rgba(233, 251, 255, 0.78);
}

.dock-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.queue-shell,
.public-access-card {
  border-radius: 14px;
}

.queue-shell {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.queue-shell-head {
  margin: 0;
  padding: 0;
  align-items: flex-start;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.queue-shell-copy {
  display: block;
  margin: 0 0 6px;
  font-size: 0.56rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(210, 244, 255, 0.48);
}

body.video-focus-mode .queue-shell-copy {
  display: none;
}

body.video-focus-mode .dock-lower-grid,
body.video-focus-mode .queue-shell {
  display: none !important;
}

body.video-focus-mode .terminal-dock {
  display: none !important;
}

.queue-list {
  max-height: 210px;
  padding-right: 6px;
}

.queue-item {
  padding: 9px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.queue-item.active {
  box-shadow: 0 0 18px rgba(246, 255, 0, 0.12);
}

.public-access-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.public-access-copy {
  display: grid;
  gap: 6px;
}

.public-access-track {
  font-size: 0.84rem;
}

.public-access-qr-shell {
  min-width: 92px;
}

@media (max-width: 1200px) {
  .terminal-dock {
    width: min(580px, calc(100vw - 350px));
    min-width: 350px;
  }

  .dock-lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .dock-topline,
  .dock-lower-grid {
    grid-template-columns: 1fr;
  }

  .public-access-card {
    grid-template-columns: 1fr;
  }

  .pix-top-summary {
    display: none;
  }

  .terminal-dock {
    padding: 12px;
  }

  .status {
    min-height: 52px;
  }

  .public-access-qr-shell {
    min-width: 0;
    width: fit-content;
  }
}

@media (max-width: 720px) {
  .terminal-dock {
    min-width: 0;
    border-radius: 16px;
  }

  .dock-now-playing-block,
  .queue-shell,
  .pix-inline-card {
    padding: 10px;
    border-radius: 12px;
  }

  .public-access-card {
    padding: 0;
    border-radius: 0;
  }

  .queue-list {
    max-height: 150px;
  }
}

  /* Floating notifications */
  .top-notification-layer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 89;
    pointer-events: none;
  }

  .playback-status-stack {
    display: block;
  }

  .status {
    position: fixed;
    top: 74px;
    right: 12px;
    z-index: 90;
    width: min(340px, calc(100vw - 24px));
    min-height: 0;
    padding: 12px 14px;
    border: 1px solid rgba(125, 234, 255, 0.16);
    border-radius: 14px;
    background: rgba(4, 14, 24, 0.82);
    color: rgba(233, 251, 255, 0.92);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(14px);
    opacity: 0;
    transform: translate3d(0, -14px, 0) scale(0.98);
    transition: opacity 0.22s ease, transform 0.24s ease;
    pointer-events: none;
  }

  .status:empty {
    display: none;
  }

  .status.status-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }

  .status.status-hiding {
    opacity: 0;
    transform: translate3d(0, -10px, 0) scale(0.98);
  }

  .status.ok {
    border-color: rgba(51, 255, 170, 0.34);
    background: rgba(7, 28, 20, 0.84);
  }

  .status.error {
    border-color: rgba(255, 107, 143, 0.34);
    background: rgba(36, 10, 19, 0.86);
  }

  .status.warning {
    border-color: rgba(246, 255, 0, 0.34);
    background: rgba(35, 34, 8, 0.86);
  }

  body.video-focus-mode .terminal-dock > :not(.public-access-card):not(.playback-status-stack) {
    opacity: 0.03;
    pointer-events: none;
  }

  @media (max-width: 720px) {
    .status {
      top: 72px;
      right: 10px;
      width: min(320px, calc(100vw - 20px));
      padding: 10px 12px;
      font-size: 0.82rem;
    }
  }
