:root {
  --calculator-ink: #17324d;
  --calculator-teal: #079c96;
  --calculator-green: #27bd7f;
  --calculator-sky: #dff8f5;
  --calculator-blue: #2775c9;
}

.life-calculator-page {
  background:
    radial-gradient(circle at 10% 8%, rgba(62, 207, 172, 0.14), transparent 27rem),
    radial-gradient(circle at 90% 18%, rgba(65, 145, 230, 0.12), transparent 30rem),
    var(--bg);
}

.calculator-header p {
  max-width: 720px;
  margin-inline: auto;
}

.calculator-tabs {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 7px;
  margin-bottom: 18px;
  border: 1px solid rgba(7, 156, 150, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-sm);
}

.calculator-tab {
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 11px;
  padding: 10px 16px;
  color: var(--calculator-ink);
  background: transparent;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.calculator-tab-panel[hidden] {
  display: none !important;
}

.calculator-tab:hover {
  text-decoration: none;
  background: rgba(7, 156, 150, 0.08);
}

.calculator-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--calculator-teal), var(--calculator-green));
  box-shadow: 0 6px 18px rgba(7, 156, 150, 0.22);
}

.fuel-tab.active {
  background: linear-gradient(135deg, #ef5a36, #c72e24);
  box-shadow: 0 6px 18px rgba(199, 46, 36, 0.24);
}

.exchange-tab.active { background: linear-gradient(135deg, #087fdb, #7357c8); box-shadow: 0 6px 18px rgba(73, 87, 190, 0.24); }
.exchange-pair { display: flex; align-items: end; justify-content: center; gap: 14px; margin: 8px auto 18px; }
.exchange-pair label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.exchange-pair select { min-width: 180px; }
.exchange-swap { width: 42px; height: 42px; border: 0; border-radius: 50%; color: #fff; background: #087fdb; font-size: 22px; cursor: pointer; }
.exchange-data-status { color: var(--muted); font-size: 12px; }
.exchange-range-toolbar { display: flex; justify-content: center; gap: 6px; margin-bottom: 8px; }
.exchange-range-toolbar button { padding: 7px 14px; border: 1px solid rgba(8,127,219,.22); border-radius: 999px; color: var(--calculator-ink); background: rgba(255,255,255,.65); cursor: pointer; }
.exchange-range-toolbar button.active { color: #fff; background: #087fdb; }
.exchange-plot-wrap { position: relative; width: 100%; height: 390px; min-width: 0; overflow: hidden; contain: layout paint; }
.exchange-rate-plot { width: 100%; height: 100%; min-width: 0; }
.exchange-drag-marker { position: absolute; z-index: 8; top: 20px; bottom: 42px; width: 28px; padding: 0; border: 0; transform: translateX(-50%); color: #087fdb; background: transparent; cursor: ew-resize; touch-action: none; }
.exchange-drag-marker::after { content: ""; position: absolute; top: 20px; bottom: 0; left: 50%; width: 3px; border-radius: 3px; transform: translateX(-50%); background: currentColor; box-shadow: 0 0 0 1px rgba(255,255,255,.8); }
.exchange-drag-marker span { position: relative; z-index: 1; display: grid; width: 24px; height: 24px; margin: 0 auto; place-items: center; border: 2px solid currentColor; border-radius: 50%; background: var(--surface); font-size: 12px; font-weight: 900; }
.exchange-drag-marker.marker-b { color: #e36b2c; }
.exchange-drag-marker:hover span, .exchange-drag-marker:focus-visible span, .exchange-drag-marker.dragging span { color: #fff; background: #087fdb; outline: none; }
.exchange-drag-marker.marker-b:hover span, .exchange-drag-marker.marker-b:focus-visible span, .exchange-drag-marker.marker-b.dragging span { background: #e36b2c; }
.exchange-chart-help { margin: 4px 0 14px; color: var(--muted); font-size: 12px; text-align: center; }
.exchange-marker-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.exchange-marker-card { display: grid; gap: 6px; padding: 12px; border-left: 4px solid #087fdb; border-radius: 10px; background: rgba(8,127,219,.06); font-weight: 800; }
.exchange-marker-card.marker-b { border-color: #e36b2c; background: rgba(227,107,44,.06); }
.exchange-marker-card small { color: var(--muted); font-weight: 500; }
.exchange-input-grid { margin-top: 18px; }
.exchange-result-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.exchange-result-grid > div { display: grid; gap: 5px; padding: 12px; border-radius: 10px; background: rgba(8,127,219,.06); }
.exchange-result-grid [hidden] { display: none !important; }
.exchange-result-grid #exchangeAssumptionField { align-content: start; }
.exchange-result-grid #exchangeAssumptionField label { color: var(--muted); font-size: 12px; }
.exchange-result-grid #exchangeAssumptionField input { width: 100%; }
.exchange-result-grid span { color: var(--muted); font-size: 12px; }
.exchange-result-grid strong { min-width: 0; color: var(--calculator-ink); font-size: 18px; overflow-wrap: anywhere; }
.exchange-results, .exchange-result-grid, .exchange-result-grid > div { min-width: 0; }
.exchange-result-grid .exchange-actual-result { grid-column: 1 / -1; }
.exchange-result-grid .exchange-assumed-result { grid-column: 1 / -1; }
.exchange-result-grid strong.loss { color: #ba2d28; }
.exchange-result-grid strong.gain { color: #087c57; }
.exchange-actual-result small, .exchange-formula-note { color: var(--muted); font-size: 12px; }

.ev-visual-card {
  position: relative;
  padding: 0;
  overflow: hidden;
  border-color: rgba(31, 135, 181, 0.18);
  background: #f9fdfd;
}

.ev-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1983 / 793;
  min-height: 330px;
  overflow: hidden;
  container-type: inline-size;
}

.ev-stage-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.visual-input {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4cqw;
  padding: 0.45cqw 0.65cqw;
  border: 1px solid rgba(39, 117, 201, 0.2);
  border-radius: 1cqw;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(18, 64, 100, 0.13);
  backdrop-filter: blur(6px);
}

.visual-input label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  transform: translateX(-50%);
  padding: 0.18cqw 0.65cqw;
  border-radius: 999px;
  color: #16445f;
  background: rgba(232, 252, 248, 0.92);
  font-size: clamp(8px, 1cqw, 12px);
  font-weight: 800;
  white-space: nowrap;
}

.visual-input input {
  width: 7cqw;
  min-width: 0;
  padding: 0.18cqw 0.25cqw;
  border: 0;
  outline: 0;
  color: #153552;
  background: transparent;
  font-size: clamp(11px, 1.8cqw, 21px);
  font-weight: 800;
  text-align: center;
}

.visual-input span {
  color: #4e7188;
  font-size: clamp(8px, 1.1cqw, 13px);
  font-weight: 800;
}

.battery-input {
  left: 29.8%;
  top: 63.3%;
  width: 14.7%;
  height: 10.5%;
}

.charger-input {
  left: 75.3%;
  top: 40.2%;
  width: 9.7%;
  height: 11.2%;
}

.fuel-tank-input {
  left: 33.7%;
  top: 57.2%;
  width: 10.4%;
  height: 9.5%;
}

.fuel-rate-input {
  left: 75.4%;
  top: 38.5%;
  width: 10.2%;
  height: 12.4%;
}

.fuel-tank-pulse {
  left: 23.2%;
  top: 54.8%;
  width: 22.5%;
  height: 15.5%;
  border-color: rgba(255, 166, 45, 0.76);
  animation-name: fuel-breathe;
}

.fuel-pump-glow {
  left: 77.6%;
  top: 27.6%;
  background: radial-gradient(circle, rgba(255, 183, 69, 0.68), transparent 68%);
}

.fuel-range-control {
  left: 23.2%;
  top: 72%;
  width: 22.5%;
}

.fuel-range-control .dual-range-fill,
.fuel-range-control .dual-range input::-webkit-slider-thumb {
  background: linear-gradient(90deg, #ffb12e, #e4472e);
}

.fuel-range-control .dual-range input::-moz-range-thumb {
  background: #e4472e;
}

@keyframes fuel-breathe {
  0%, 100% { opacity: 0.36; box-shadow: 0 0 8px rgba(255, 151, 32, 0.2); }
  50% { opacity: 0.9; box-shadow: 0 0 24px rgba(255, 151, 32, 0.58); }
}

.battery-pulse {
  position: absolute;
  z-index: 2;
  left: 21.4%;
  top: 59.1%;
  width: 24.2%;
  height: 14.6%;
  border: 3px solid rgba(75, 241, 185, 0.7);
  border-radius: 20px;
  pointer-events: none;
  animation: battery-breathe 2.4s ease-in-out infinite;
}

.charger-glow {
  position: absolute;
  z-index: 2;
  left: 77.1%;
  top: 27.5%;
  width: 4.8%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 255, 189, 0.66), transparent 68%);
  pointer-events: none;
  animation: charger-flash 1.7s ease-in-out infinite;
}

@keyframes battery-breathe {
  0%, 100% { opacity: 0.36; box-shadow: 0 0 8px rgba(38, 225, 162, 0.18); }
  50% { opacity: 0.9; box-shadow: 0 0 24px rgba(38, 225, 162, 0.55); }
}

@keyframes charger-flash {
  0%, 100% { opacity: 0.35; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

.soc-control {
  position: absolute;
  z-index: 4;
  left: 21.2%;
  top: 78.4%;
  width: 24.5%;
  padding: 7px 10px 8px;
  border-radius: 13px;
  color: #16445f;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 16px rgba(18, 64, 100, 0.14);
  backdrop-filter: blur(6px);
}

.soc-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
  font-size: 11px;
  font-weight: 800;
}

.soc-labels span {
  white-space: nowrap;
}

.dual-range {
  position: relative;
  height: 18px;
}

.dual-range-track,
.dual-range-fill {
  position: absolute;
  top: 7px;
  left: 0;
  right: 0;
  height: 5px;
  border-radius: 999px;
  background: #d8e8ec;
}

.dual-range-fill {
  left: 20%;
  right: 20%;
  background: linear-gradient(90deg, #22c78a, #079c96);
}

.dual-range input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  background: transparent;
  pointer-events: none;
}

.dual-range input::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  appearance: none;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--calculator-teal);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
  cursor: grab;
}

.dual-range input::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--calculator-teal);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
  cursor: grab;
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
}

.calculator-panel {
  min-width: 0;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading h2,
.panel-heading h3 {
  margin: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  min-width: 0;
}

.field label {
  display: block;
  margin-bottom: 5px;
  color: #294b63;
  font-size: 13px;
  font-weight: 750;
}

.field .input,
.sample-input {
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
}

.field .input:disabled {
  color: #89959d;
  background: #e8ecef;
  cursor: not-allowed;
}

.field-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.field-error,
[aria-invalid="true"] {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

.sample-input {
  width: 100%;
  min-height: 174px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  font: 14px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.sample-input:focus {
  outline: 0;
  border-color: var(--calculator-teal);
  box-shadow: 0 0 0 3px rgba(7, 156, 150, 0.12);
}

.sample-help {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.sample-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.sample-save-panel,
.sample-library-panel {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(7, 156, 150, 0.2);
  border-radius: 12px;
  background: rgba(239, 252, 249, 0.72);
}

.sample-save-panel > label {
  display: block;
  margin-bottom: 6px;
  color: #294b63;
  font-size: 13px;
  font-weight: 750;
}

.sample-save-row {
  display: flex;
  gap: 8px;
}

.sample-name-input {
  min-width: 0;
}

.sample-library-status {
  margin: 0 0 9px;
  font-size: 12px;
}

.sample-library-list {
  display: grid;
  gap: 9px;
  max-height: 420px;
  overflow-y: auto;
}

.saved-sample-card {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(150px, 1.3fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
}

.saved-sample-name {
  min-width: 0;
  color: #21465e;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.saved-sample-curve {
  display: block;
  width: 100%;
  height: 64px;
  border-radius: 7px;
  background: #f5fbfa;
}

.saved-sample-buttons {
  display: flex;
  gap: 5px;
}

.saved-sample-delete {
  color: var(--danger);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  grid-column: 1 / -1;
  padding: 11px 12px;
  border: 1px solid rgba(7, 156, 150, 0.2);
  border-radius: 12px;
  background: rgba(223, 248, 245, 0.5);
}

.switch-copy strong,
.switch-copy small {
  display: block;
}

.switch-copy small {
  color: var(--muted);
}

.toggle {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 27px;
}

.toggle input {
  position: absolute;
  opacity: 0;
}

.toggle span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #b7c4ca;
  cursor: pointer;
  transition: 0.2s;
}

.toggle span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: 0.2s;
}

.toggle input:checked + span {
  background: var(--calculator-teal);
}

.toggle input:checked + span::after {
  transform: translateX(21px);
}

.advanced-card {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(247, 250, 250, 0.72);
}

.advanced-card summary {
  padding: 13px 15px;
  color: #31566f;
  font-weight: 800;
  cursor: pointer;
}

.advanced-content {
  padding: 0 15px 15px;
}

.calculation-status {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 46px;
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  color: #1e4d75;
  background: #eff6ff;
}

.calculation-status.error {
  color: #991b1b;
  border-color: #fecaca;
  background: #fff1f2;
}

.calculation-status.warning {
  color: #854d0e;
  border-color: #fde68a;
  background: #fffbeb;
}

.calculation-status.success {
  color: #166534;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.status-spinner {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 2px solid rgba(7, 156, 150, 0.25);
  border-top-color: var(--calculator-teal);
  border-radius: 50%;
  animation: status-spin 0.75s linear infinite;
}

@keyframes status-spin { to { transform: rotate(360deg); } }

.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.metric-button {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #35566c;
  background: rgba(255, 255, 255, 0.8);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.metric-button.active {
  color: #fff;
  border-color: var(--calculator-teal);
  background: var(--calculator-teal);
}

.surface-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.surface-grid.compare {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.surface-plot {
  width: 100%;
  min-width: 0;
  height: 520px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.68);
}

.surface-grid.compare .surface-plot {
  height: 400px;
}

.optimal-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.optimal-heading {
  margin-bottom: 8px;
}

.optimal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.optimal-grid.compare {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.optimal-grid.all {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.optimal-plot {
  width: 100%;
  min-width: 0;
  height: 340px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.68);
}

.detail-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin-top: 13px;
}

.detail-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(7, 156, 150, 0.16);
  border-radius: 11px;
  background: rgba(239, 252, 249, 0.68);
}

.detail-item span,
.detail-item strong {
  display: block;
}

.detail-item span {
  color: var(--muted);
  font-size: 11px;
}

.detail-item strong {
  margin-top: 3px;
  color: #17445d;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.fit-card {
  margin-top: 18px;
}

#fitPlot,
#fuel-fitPlot {
  width: 100%;
  height: 320px;
}

.privacy-note {
  color: var(--muted);
  font-size: 12px;
}

.life-calculator-page input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.life-calculator-page input[type="number"]::-webkit-inner-spin-button,
.life-calculator-page input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

@media (max-width: 920px) {
  .calculator-grid { grid-template-columns: 1fr; }
  .surface-grid.compare { grid-template-columns: 1fr; }
  .surface-grid.compare .surface-plot { height: 470px; }
  .detail-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .optimal-grid.compare { grid-template-columns: 1fr; }
  .optimal-grid.all { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .ev-stage {
    aspect-ratio: 366 / 690;
    min-height: 0;
    background: #fff;
  }

  .ev-stage::before,
  .ev-stage::after {
    content: "";
    position: absolute;
    z-index: 0;
    left: 0;
    right: 0;
    height: 43.478%;
    background-image: url("/static/images/life-calculator-ev.png");
    background-repeat: no-repeat;
    pointer-events: none;
  }

  .fuel-stage::before,
  .fuel-stage::after {
    background-image: url("/static/images/life-calculator-fuel.png");
  }

  .ev-stage::before {
    top: 0;
    background-size: auto 83.333%;
    background-position: left center;
    border-bottom: 1px solid rgba(7, 156, 150, 0.12);
  }

  .ev-stage::after {
    bottom: 0;
    height: 56.522%;
    background-size: auto 100%;
    background-position: right top;
  }

  .ev-stage-image {
    display: none;
  }

  .battery-input {
    left: 47%;
    top: 26.522%;
    width: 27%;
    height: 6.377%;
  }

  .charger-input {
    left: 38%;
    top: 66.087%;
    width: 27%;
    height: 6.667%;
  }

  .battery-pulse {
    left: 34%;
    top: 25.217%;
    width: 42%;
    height: 6.667%;
  }

  .charger-glow {
    left: 43%;
    top: 58.986%;
    width: 13%;
    height: 9.42%;
  }

  .soc-control {
    left: 29%;
    top: 35.942%;
    width: 50%;
    padding: 1.8cqw 2.5cqw 2cqw;
    border-radius: 3.3cqw;
  }

  .soc-labels {
    gap: 4px;
    font-size: clamp(8px, 2.65cqw, 11px);
  }

  .visual-input {
    gap: 1cqw;
    padding: 1.1cqw 1.6cqw;
    border-radius: 2.8cqw;
  }

  .visual-input label {
    bottom: calc(100% + 1cqw);
    padding: 0.5cqw 1.7cqw;
    font-size: clamp(8px, 2.8cqw, 11px);
  }

  .visual-input input {
    width: 12cqw;
    padding: 0.4cqw;
    font-size: clamp(11px, 4cqw, 17px);
  }

  .visual-input span {
    font-size: clamp(8px, 3cqw, 12px);
  }

  .fuel-tank-input {
    left: 55%;
    top: 24.4%;
    width: 27%;
    height: 6.4%;
  }

  .fuel-rate-input {
    left: 38%;
    top: 65.5%;
    width: 29%;
    height: 6.8%;
  }

  .fuel-tank-pulse {
    left: 39%;
    top: 23.4%;
    width: 44%;
    height: 7.2%;
  }

  .fuel-pump-glow {
    left: 43%;
    top: 58.2%;
  }

  .fuel-range-control {
    left: 38%;
    top: 36.1%;
    width: 48%;
  }

  .dual-range { height: 4.6cqw; }
  .dual-range-track,
  .dual-range-fill { top: 1.8cqw; height: 1.25cqw; }
  .dual-range input { height: 4.6cqw; }
  .dual-range input::-webkit-slider-thumb { width: 4.1cqw; height: 4.1cqw; }
  .dual-range input::-moz-range-thumb { width: 3.5cqw; height: 3.5cqw; }
}

@media (max-width: 720px) {
  .field-grid { grid-template-columns: 1fr; }
  .surface-plot,
  .surface-grid.compare .surface-plot { height: 420px; }
  .detail-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-heading { flex-wrap: wrap; }
  .sample-actions { width: 100%; justify-content: flex-start; }
  .saved-sample-card { grid-template-columns: 1fr; }
  .sample-save-row { align-items: stretch; }
  .exchange-pair { align-items: stretch; flex-direction: column; }
  .exchange-pair select { width: 100%; }
  .exchange-swap { align-self: center; transform: rotate(90deg); }
  .exchange-marker-grid, .exchange-result-grid { grid-template-columns: 1fr; }
  .exchange-plot-wrap { height: 330px; }
}

@media (prefers-reduced-motion: reduce) {
  .battery-pulse,
  .charger-glow,
  .status-spinner { animation: none; }
}
