body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Optional wider container */
@media (min-width: 1200px) {
  .container { max-width: 1500px; }
}

.navbar-logo { height: 32px; width: auto; }

/* Status bar minimalist */
.status-bar {
  background: #121416;
  color: #d6d9dd;
  border-bottom: 1px solid #1e2226;
}
.status-bar #statusText {
  font-size: 0.85rem;
  line-height: 1.2;
}
.status-bar .btn-link {
  color: #d6d9dd;
}
.status-bar .btn-link:hover,
.status-bar .btn-link:focus {
  color: #0d6efd;
  text-decoration: none;
}

/* Settings toggle (single consolidated block) */
.settings-toggle-btn {
  width: 3rem;
  height: 3rem;
  padding: 0.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-decoration: none;
  border: none;
  outline: none;
  margin-right: 0.25rem;
}
.settings-toggle-btn:hover,
.settings-toggle-btn:focus { color: #0d6efd; text-decoration: none; }
.settings-toggle-btn:focus-visible {
  box-shadow: 0 0 0 0.15rem rgba(13,110,253,0.45);
}
.settings-toggle-btn.active {
  background-color: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

/* Record button floating */
.record-btn {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 3.0rem;
  z-index: 1050;
}

/* Add recording (listening) state */
.record-btn.recording {
  background-color: #dc3545;
  border-color: #dc3545;
  animation: pulse 1.4s ease-in-out infinite;
}
.record-btn.recording:hover,
.record-btn.recording:focus {
  background-color: #bb2d3b;
  border-color: #b02a37;
}

/* Disabled state for record button */
.record-btn:disabled,
.record-btn.disabled {
  background-color: #6c757d;
  border-color: #6c757d;
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(220,53,69,0.55); }
  50% { box-shadow: 0 0 0 0.75rem rgba(220,53,69,0); }
}

/* Ensure bottom space for button */
main { padding-bottom: 4.5rem; }

/* Live spectrogram canvas */
.live-spectrogram-canvas {
  width: 100%;
  height: 35vh; 
  display: block;
  background: #000;
  image-rendering: pixelated;
  cursor: crosshair;
}
.spectrogram-full {
  width: 100%;
  background: #020617;
}
.spectrogram-full .live-spectrogram-canvas { height: 35vh; }
@media (min-width: 992px) {
  .spectrogram-full .live-spectrogram-canvas { height: 35vh; }
}

/* Settings layout */
.settings-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 768px) {
  .settings-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

.form-range-value { font-variant-numeric: tabular-nums; }

.geo-status {
  font-size: 0.875rem;
  color: rgba(148,163,184,0.9);
}

.container > .row.text-center + .d-flex,
.container > .row.text-center { margin-bottom: 1.5rem; }

/* Drawer overlay */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1040;
}
.settings-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Drawer panel */
.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(100%, 380px);
  background: #ffffff;
  box-shadow: none;
  transform: translateX(100%);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 3000; /* above record button */
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  overflow-y: auto;            /* vertical scroll */
  overscroll-behavior: contain;/* prevent bounce chaining */
  -webkit-overflow-scrolling: touch;
}
.settings-drawer.open { 
  transform: translateX(0); 
  box-shadow: -16px 0 40px rgba(15,23,42,0.2);
}
.settings-drawer-header { margin-bottom: 1.25rem; }
.settings-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Dim / disable record button when drawer open (optional) */
body.drawer-open .record-btn {
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.2s;
}
