@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,600;0,9..40,700;1,9..40,500&display=swap");

/* ============================================================
   Voltage vs Amps — Premium EV Lab (light + dark)
   Mobile-first, glassmorphism, neon accents
   ============================================================ */

:root {
  --bg: #0b1220;
  --bg-elevated: rgba(15, 23, 42, 0.72);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(148, 163, 184, 0.18);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --danger: #fb7185;
  --warn: #fbbf24;
  --ok: #34d399;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --neon-glow: 0 0 24px rgba(34, 211, 238, 0.35);
}

body.light {
  color-scheme: light;
  --bg: #f0f4ff;
  --bg-elevated: rgba(255, 255, 255, 0.78);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --text-muted: #475569;
  --accent: #0284c7;
  --accent-2: #7c3aed;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #059669;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  --neon-glow: 0 0 20px rgba(2, 132, 199, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Native selects / scrollbars follow dark UI in most browsers */
  color-scheme: dark;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(34, 211, 238, 0.12), transparent),
    radial-gradient(900px 500px at 100% 0%, rgba(167, 139, 250, 0.12), transparent), var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.light {
  background: radial-gradient(1000px 500px at 0% 0%, rgba(14, 165, 233, 0.08), transparent),
    radial-gradient(800px 400px at 100% 10%, rgba(124, 58, 237, 0.06), transparent), var(--bg);
}

.wrapper {
  max-width: min(1400px, 100%);
  width: 100%;
  margin-inline: auto;
  /* top | right | bottom | left */
  padding: 16px max(12px, env(safe-area-inset-right, 0px)) 48px max(12px, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}

.guy1 {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* ---------- Header ---------- */
.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.glass {
  background: var(--bg-elevated);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--neon-glow);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.brand-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-sub {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.chip-btn,
.theme-toggle {
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s;
}

.chip-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--neon-glow);
}

.theme-toggle {
  padding: 6px 12px;
  gap: 10px;
}

.theme-toggle input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.theme-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.secondary-btn {
  background: transparent;
}

/* ---------- Dashboard grid ---------- */
.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr) minmax(0, 300px);
  gap: 18px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.dashboard > * {
  min-width: 0;
  max-width: 100%;
}

.panel {
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel-title {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.subheading {
  margin: 20px 0 10px;
  font-size: 0.9rem;
  font-weight: 700;
}

.field-label {
  display: block;
  margin-top: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.value-pill {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  margin-top: 8px;
  height: 10px;
  border-radius: 999px;
  accent-color: var(--accent);
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.25), rgba(167, 139, 250, 0.25));
}

.select,
.num-input {
  width: 100%;
  max-width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-size: 0.95rem;
}

.glass-input {
  backdrop-filter: blur(8px);
}

/* Dark mode: closed select + dropdown list readable (OS menus follow color-scheme + option colors in Chromium) */
body:not(.light) select.select,
body:not(.light) select.glass-input {
  background-color: #0f172a;
  color: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.4);
}

body:not(.light) select option,
body:not(.light) select optgroup {
  background-color: #0f172a;
  color: #f1f5f9;
}

body:not(.light) .num-input {
  background-color: #0f172a;
  color: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.4);
}

body.light select.select,
body.light select.glass-input {
  background-color: #ffffff;
  color: #0f172a;
}

body.light select option,
body.light select optgroup {
  background-color: #ffffff;
  color: #0f172a;
}

#toolContent {
  max-width: 100%;
  min-width: 0;
}

.custom-pack {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
}

.hidden {
  display: none !important;
}

.hint {
  margin: 16px 0 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  flex: 1 1 auto;
  min-width: calc(50% - 8px);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.pill-btn.is-active {
  border-color: var(--accent);
  box-shadow: var(--neon-glow);
  background: rgba(34, 211, 238, 0.12);
}

body.light .pill-btn.is-active {
  background: rgba(2, 132, 199, 0.1);
}

.sticky-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  position: sticky;
  bottom: 12px;
  padding-top: 8px;
}

.sticky-actions button {
  margin-top: 0;
}

.btn-primary,
.btn-warn,
.btn-danger,
.btn-muted {
  padding: 12px 16px;
  border: none;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition: transform 0.12s ease, filter 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.35);
}

.btn-warn {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #be123c);
}

.btn-muted {
  background: #475569;
  color: #f8fafc;
}

.btn-primary:hover,
.btn-warn:hover,
.btn-danger:hover,
.btn-muted:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.full-width {
  width: 100%;
  margin-top: 12px;
}

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 10%, transparent 11%);
  transform: scale(10);
  opacity: 0;
  transition: opacity 0.4s, transform 0.2s;
}

.ripple:active::after {
  opacity: 1;
  transform: scale(0);
  transition: 0s;
}

/* ---------- Motor stage ---------- */
.motor-stage {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 180px);
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.motor {
  position: relative;
  width: min(200px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.35);
  display: grid;
  place-items: center;
  transition: box-shadow 0.3s ease, filter 0.3s ease, border-color 0.3s;
  overflow: hidden;
}

.motor-rotor {
  width: 72%;
  height: 72%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #1e293b, #334155, #0f172a, #334155);
  border: 4px dashed rgba(34, 211, 238, 0.45);
  box-shadow: inset 0 0 24px rgba(34, 211, 238, 0.2);
}

.motor-coils {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 2px solid rgba(167, 139, 250, 0.35);
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.25);
  pointer-events: none;
}

.motor-hub {
  position: absolute;
  width: 22%;
  height: 22%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f8fafc, #64748b);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.motor.is-running .motor-rotor {
  animation: spin var(--spin-dur, 2s) linear infinite;
}

.motor.is-stressed {
  box-shadow: 0 0 32px rgba(251, 113, 133, 0.55), var(--neon-glow);
  border-color: rgba(251, 113, 133, 0.65);
}

.motor.is-running.is-blur .motor-rotor {
  filter: blur(0.6px);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.torque-meter {
  padding: 12px 14px;
  border-radius: 14px;
}

.meter-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.torque-track {
  margin-top: 8px;
  height: 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.35);
  overflow: hidden;
}

body.light .torque-track {
  background: rgba(15, 23, 42, 0.08);
}

.torque-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}

.glass-inset {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
}

/* ---------- KPI grid ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  width: 100%;
  min-width: 0;
}

.kpi-card {
  padding: 12px 14px;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--neon-glow);
}

.kpi-wide {
  grid-column: 1 / -1;
}

.kpi-split {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 700px) {
  .kpi-split {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- Battery ---------- */
.battery-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}

.battery {
  flex: 1;
  position: relative;
  height: 22px;
  overflow: hidden;
}

.battery-level {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #22c55e, #a3e635);
  transition: width 0.35s linear;
  border-radius: inherit;
}

.battery-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: pulse-glow 2.2s ease-in-out infinite;
  opacity: 0.5;
}

.motor-running .battery-glow {
  opacity: 0.85;
}

@keyframes pulse-glow {
  0%,
  100% {
    transform: translateX(-40%);
  }
  50% {
    transform: translateX(40%);
  }
}

.battery-pct {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 3.2rem;
  text-align: right;
}

.warning-stack {
  min-height: 2.5rem;
}

.warning {
  color: var(--danger);
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 6px;
  animation: warn-pulse 1.8s ease-in-out infinite;
}

.warning-secondary {
  color: var(--warn);
  font-weight: 600;
  animation: none;
}

@keyframes warn-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}

/* ---------- Chart ---------- */
.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-top: 8px;
}

.scroll-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tab-btn {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn.is-active {
  color: var(--text);
  border-color: var(--glass-border);
  background: var(--glass);
  box-shadow: var(--neon-glow);
}

.compare-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
}

.chart-shell {
  padding: 8px;
  margin-top: 8px;
  position: relative;
}

.chart-shell canvas {
  width: 100% !important;
  height: auto !important;
  max-height: 320px;
  display: block;
}

.export-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 8px;
}

.explanation {
  margin-top: 12px;
  padding: 14px 16px;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.65;
}

/* ---------- Side panel ---------- */
.preset-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preset-btn {
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.preset-btn:hover {
  border-color: var(--accent);
  box-shadow: var(--neon-glow);
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 8px;
}

.session-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  font-size: 0.82rem;
}

.session-chip button {
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

/* ---------- Toast ---------- */
.toast-host {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: none;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toast-in 0.35s ease;
}

body.light .toast {
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Scaler ---------- */
.scaler-control {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  padding: 10px 16px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  font-size: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: var(--shadow);
}

body.light .scaler-control {
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
}

.scaler-control input {
  width: 140px;
  accent-color: var(--accent);
}

/* ---------- SEO article ---------- */
.seo-article {
  margin-top: 32px;
  padding: 28px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.seo-article h2 {
  margin-top: 0;
  font-size: 1.5rem;
}

.seo-article p {
  color: var(--text-muted);
  max-width: 72ch;
}

.seo-article code {
  font-family: var(--mono);
  background: var(--glass);
  padding: 2px 6px;
  border-radius: 6px;
}

.disclaimer {
  font-size: 0.85rem;
  font-style: italic;
}

/* ---------- Tool extras / popups (legacy-compatible) ---------- */
.tool-extra-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0 8px;
}

.tool-toggle-btn {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--glass-border);
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tool-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--neon-glow);
}

.legal-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.legal-popup-box {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: popIn 0.35s ease;
}

.legal-popup-icon {
  font-size: 42px;
  margin-bottom: 12px;
}

.legal-popup-box h3 {
  margin: 0 0 14px;
  font-size: 24px;
  color: #111827;
}

.legal-popup-box p {
  color: #4b5563;
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 14px;
}

.legal-popup-box button {
  margin-top: 10px;
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 14px 24px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  min-height: 100vh;
}

.popup-overlay.active {
  display: flex;
  animation: fadeIn 0.25s ease;
}

.popup-box {
  width: 100%;
  max-width: 720px;
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  position: relative;
  animation: popIn 0.28s ease;
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--glass-border);
}

.popup-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: var(--glass);
  font-size: 18px;
  cursor: pointer;
  color: var(--text);
}

textarea {
  width: 100%;
  min-height: 160px;
  margin-top: 12px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--glass);
  color: var(--text);
}

.copy-btn {
  margin-top: 14px;
  background: var(--ok);
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}

.similar-tools {
  background: transparent;
}

#similarToolsList {
  list-style: none;
  padding: 0;
  margin: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Light body class (sync with JS) ---------- */
body.light {
  color: var(--text);
}

body.light .legal-popup-box {
  background: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .dashboard {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .panel--side {
    grid-column: 1 / -1;
  }

  .motor-stage {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .kpi-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr));
  }

  .dashboard {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel--controls {
    order: 1;
  }

  .panel--main {
    order: 2;
  }

  .panel--side {
    order: 3;
  }

  .sticky-actions {
    position: sticky;
    bottom: 72px;
    background: linear-gradient(to top, var(--bg), transparent);
    padding-bottom: 8px;
    margin-inline: 0;
    padding-inline: 0;
  }

  input[type="range"] {
    min-height: 44px;
  }

  .pill-btn {
    min-height: 44px;
  }

  .scaler-control {
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
