/* ── Panel (mobile-first: off-screen drawer) ── */
.panel {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 300px;
  height: 100%;
  padding: 20px;
  padding-right: 36px; /* leave room for the handle */
  background: #111827;
  border-right: 1px solid #1f2937;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}
.panel.open {
  transform: translateX(0);
}

/* ── Drag handle ── */
.panel-handle {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 101;
  width: 24px;
  height: 48px;
  background: #1e293b;
  border: 1px solid #334155;
  border-left: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 1rem;
  transition: left 0.3s ease;
  touch-action: none;
}
.panel.open ~ .panel-handle {
  left: 300px;
}

/* ── Scrim overlay behind open panel ── */
.panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.45);
}
.panel-overlay.visible {
  display: block;
}

/* ── Desktop: panel always visible, no overlay ── */
@media (min-width: 901px) {
  .panel {
    position: relative;
    transform: none;
    transition: none;
    width: 320px;
    min-width: 320px;
    padding-right: 20px;
  }
  .panel-handle {
    display: none;
  }
  .panel-overlay {
    display: none !important;
  }
}

/* ── Accordions ── */
.accordion {
  margin-top: 12px;
  border: 1px solid #1f2937;
  border-radius: 8px;
  overflow: hidden;
}

.accordion-header {
  padding: 10px 14px;
  background: #1e293b;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.accordion-header::-webkit-details-marker {
  display: none;
}

.accordion-header::before {
  content: '▸';
  display: inline-block;
  transition: transform 0.15s ease;
  font-size: 0.8rem;
}

.accordion[open] > .accordion-header::before {
  transform: rotate(90deg);
}

.accordion-body {
  padding: 12px 14px;
}

/* ── Overlay toggles ── */
.overlay-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.92rem;
  color: #cbd5e1;
  cursor: pointer;
}

.overlay-toggle input {
  accent-color: #38bdf8;
}

.overlay-hint {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.4;
}

/* ── Opacity sliders ── */
.opacity-sliders {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}
.opacity-slider-label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: center;
  font-size: 0.88rem;
  color: #cbd5e1;
}
.opacity-slider-label input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: #38bdf8;
  cursor: pointer;
}
.opacity-value {
  font-size: 0.78rem;
  color: #94a3b8;
  min-width: 32px;
  text-align: right;
}

