/**
 * DVR command menu (Select Day / Theme / Display / Debug / About) and its
 * submenus. Menu-item icons are replaced with the app's existing inline-SVG
 * language (they were emoji — the ONE inconsistency in the icon system that
 * was safe to fix: these five are static markup, not server-driven like the
 * sensor-list glyphs). JS only toggles .visible/.active classes here; the
 * open/close/hover mechanics are untouched.
 */

.pbMenuBtn {
  height: 32px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline);
  background: var(--ink-850);
  color: var(--ink-100);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background var(--ease-standard), border-color var(--ease-standard), transform var(--ease-standard);
}
.pbMenuBtn:hover { border-color: var(--hairline-strong); background: var(--ink-800); }
.pbMenuBtn:active, .pbMenuBtn.open {
  background: var(--accent-live-dim);
  border-color: var(--accent-live-line);
  transform: scale(0.96);
}

.pbMenu {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: var(--space-2);
  min-width: 210px;
  background: var(--ink-900);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  padding: var(--space-2) 0;
  z-index: var(--z-dropdown);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity var(--ease-standard), transform var(--ease-standard);
  touch-action: none;
  overscroll-behavior: none;
}
.pbMenu.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

.pbMenuItem {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  color: var(--ink-100);
  font-size: var(--text-md);
  transition: background var(--ease-standard);
  position: relative;
  user-select: none;
}
.pbMenuItem:hover { background: var(--accent-live-dim); }
.pbMenuItem:active { background: var(--accent-live-dim); filter: brightness(1.3); }
.pbMenuItem.active .pbMenuLabel { color: var(--accent-live); }
.pbMenuIcon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-500);
  flex-shrink: 0;
}
.pbMenuIcon svg { width: 17px; height: 17px; display: block; }
.pbMenuLabel { flex: 1; }
.pbMenuArrow {
  color: var(--ink-600);
  font-size: 18px;
  font-weight: 300;
  margin-right: var(--space-2);
}
.pbMenuSub:hover .pbMenuArrow { color: var(--accent-live); }
.pbMenuCheck {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
}
.pbMenuCheck.checked {
  background: var(--accent-live);
  border-color: var(--accent-live);
  color: var(--ink-950);
  box-shadow: 0 0 8px var(--accent-live-line);
}
.pbMenuCheck.checked::after { content: "✓"; font-weight: var(--weight-bold); }

.pbMenuDivider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline-strong), transparent);
  margin: var(--space-2) var(--space-3);
}

.pbMenuSub { position: relative; }
.pbSubmenu {
  position: absolute;
  right: calc(100% + 2px);
  top: 0;
  min-width: 190px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--ink-900);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  padding: var(--space-2) 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s, visibility 0s 0.15s;
  touch-action: none;
  overscroll-behavior: none;
}
.pbSubmenu.visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.1s, visibility 0s;
}
.pbSubmenu.visible::before {
  content: "";
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: 100%;
  width: 20px;
  pointer-events: auto;
}
.pbSubmenuItem {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  color: var(--ink-100);
  font-size: var(--text-md);
  transition: background var(--ease-standard);
  user-select: none;
}
.pbSubmenuItem:hover { background: var(--accent-live-dim); }
.pbSubmenuItem:active { background: var(--accent-live-dim); filter: brightness(1.3); }
.pbSubmenuItem.active { background: var(--accent-live-dim); color: var(--accent-live); }
.pbSubmenuItem.active::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: var(--radius-pill);
  margin-right: var(--space-1);
  background: var(--accent-live);
  box-shadow: 0 0 6px var(--accent-live-line);
}

.pbSubmenuSliders { padding: var(--space-3) var(--space-4); min-width: 210px; }
.pbSliderRow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--ink-100);
  font-size: var(--text-sm);
  padding: var(--space-2) 0;
  cursor: default;
}
.pbSliderRow span { min-width: 32px; color: var(--ink-500); }
.pbSliderRow input[type="range"] {
  flex: 1;
  width: 120px;
  accent-color: var(--accent-live);
  touch-action: none;
}
