.panel {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 3;
  width: 292px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.panel-backdrop { display: none; }
.panel .panel-section h3 { font-weight: 400; }
.panel-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid #45658b;
  border-radius: 10px;
  background: #0b1c31;
}
.panel-button {
  min-height: 36px;
  width: 100%;
  padding: 5px;
  border: 1px solid #45658b;
  border-radius: 8px;
  background: #193453;
  color: var(--text-secondary);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  box-shadow: inset 0 1px 0 #ffffff0d;
}
.panel-button:enabled:hover, .panel-button[aria-pressed="true"] {
  border-color: #78a4d5;
  background: #254b75;
}
.panel-button[aria-pressed="true"] { border-color: #9acbff; color: var(--text-primary); }
/* Each selector has one outline around its three choices. */
.panel-options .panel-button {
  height: var(--row-height);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
}
.panel-options .panel-button:enabled:hover { background: #193453; }
.panel-options .panel-button[aria-pressed="true"] { background: #254b75; }
.density-options .panel-button { position: relative; cursor: pointer; }
.density-options input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  appearance: none;
  border: 0;
  border-radius: inherit;
  cursor: pointer;
}
.density-options input:hover { background: #193453; }
.density-options input:checked { background: #254b75; }
.density-options span { position: relative; pointer-events: none; }
.density-options input:checked + span { color: var(--text-primary); }
@media (forced-colors: active) {
  .density-options input:checked { border: 2px solid Highlight; }
}
.panel-button:disabled { opacity: .45; }
#manualControls, #automaticControls { margin-top: 12px; }
.panel .source-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.panel .toggle-row { min-height: 33px; cursor: pointer; }
.panel select {
  width: 100%;
  min-height: 36px;
  margin: 4px 0 0;
  padding: 5px 8px;
  border: 1px solid #45658b;
  border-radius: 8px;
  color: var(--text-primary);
  background: #08162b;
  font: inherit;
  font-size: 12px;
}
@media (max-width: 750px), (max-height: 500px) and (max-width: 950px) {
  .panel { width: min(320px, 100%); }
  .panel-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 2;
    border: 0;
    background: rgba(2, 8, 20, .48);
  }
}
@media (pointer: coarse) {
  .panel-button, .panel select, .panel .toggle-row { min-height: 44px; }
  .panel .control-label, .panel .toggle-row, .panel-button { font-size: 12px; }
  .panel select { font-size: 16px; }
}
