:root {
  --bg-page: #0b1120;
  --bg-surface: #111827;
  --bg-card: #1e293b;
  --border-subtle: rgba(148, 163, 184, 0.18);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

/* Custom fallback layout utilities so PWA stays polished even offline without Tailwind CDN */
.hidden { display: none !important; }
.tricolor-bar {
  height: 3px;
  background: linear-gradient(90deg, #2563eb 0%, #2563eb 33.3%, #f8fafc 33.3%, #f8fafc 66.6%, #ef4444 66.6%, #ef4444 100%);
}

.glass-card {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
}

.transcript-item {
  transition: all 0.22s ease;
  border-left: 3px solid transparent;
}

.transcript-item:hover {
  background: rgba(51, 65, 85, 0.55);
}

.transcript-item.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.22), rgba(99, 102, 241, 0.08));
  border-left-color: #60a5fa;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
}

.speed-pill.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
}

.step-tab.active {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

/* Range slider styling */
input[type="range"].audio-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: #334155;
  outline: none;
  cursor: pointer;
}

input[type="range"].audio-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #60a5fa;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

input[type="range"].audio-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #60a5fa;
  border: 2px solid #ffffff;
  cursor: pointer;
}

/* Custom scrollbar */
.custom-scroll::-webkit-scrollbar {
  width: 6px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

/* Recording pulse */
@keyframes pulse-ring {
  0% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.55); }
  70% { transform: scale(1); box-shadow: 0 0 0 14px rgba(244, 63, 94, 0); }
  100% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.recording-pulse {
  animation: pulse-ring 1.6s infinite;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #475569;
  transition: 0.25s;
  border-radius: 999px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider {
  background-color: #10b981;
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}
