:root {
  color-scheme: light;
  --paper: #f7f4ed;
  --ink: #16211f;
  --muted: #65736e;
  --line: #d8d0c2;
  --panel: #fffaf1;
  --panel-strong: #ffffff;
  --green: #2f8a68;
  --green-dark: #17604a;
  --yellow: #f4ba42;
  --red: #dc5c46;
  --blue: #2f6f9f;
  --shadow: 0 18px 50px rgba(22, 33, 31, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(47, 138, 104, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(47, 138, 104, 0.07) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
}

button,
a {
  font: inherit;
}

[data-tip] {
  position: relative;
}

[data-tip]::after,
[data-tip]::before {
  position: absolute;
  left: 50%;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

[data-tip]::after {
  content: attr(data-tip);
  bottom: calc(100% + 9px);
  max-width: min(220px, 82vw);
  padding: 6px 8px;
  border: 1px solid rgba(22, 33, 31, 0.12);
  border-radius: 6px;
  color: #fffaf1;
  background: rgba(22, 33, 31, 0.94);
  box-shadow: 0 10px 24px rgba(22, 33, 31, 0.16);
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  transform: translate(-50%, 4px);
}

[data-tip]::before {
  content: "";
  bottom: calc(100% + 4px);
  border: 5px solid transparent;
  border-top-color: rgba(22, 33, 31, 0.94);
  transform: translate(-50%, -1px);
}

[data-tip]:hover::after,
[data-tip]:hover::before,
[data-tip]:focus-visible::after,
[data-tip]:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(22, 33, 31, 0.12);
  background: rgba(247, 244, 237, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, transparent 0 34%, var(--yellow) 34% 52%, transparent 52%),
    linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.module-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.module-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.module-nav a.has-badge-notification::after {
  content: attr(data-badge-count);
  position: absolute;
  top: -6px;
  right: -4px;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border: 2px solid rgba(247, 244, 237, 0.96);
  border-radius: 999px;
  color: #fffaf1;
  background: var(--red);
  box-shadow: 0 6px 16px rgba(220, 92, 70, 0.28);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  animation: badge-notification-pop 240ms ease-out;
}

.module-nav a:hover,
.module-nav a.active {
  color: var(--ink);
  background: rgba(47, 138, 104, 0.11);
}

@keyframes badge-notification-pop {
  from {
    opacity: 0;
    transform: scale(0.55);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

main {
  padding: 28px clamp(16px, 4vw, 56px) 56px;
}

[hidden] {
  display: none !important;
}

.mission-map {
  display: grid;
  gap: 22px;
  max-width: 1680px;
  margin: 0 auto;
}

.mission-intro {
  min-height: 260px;
  display: grid;
  align-content: center;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(244, 186, 66, 0.2), transparent 42%),
    linear-gradient(155deg, #fffaf1 0%, #eef5f1 100%);
  box-shadow: var(--shadow);
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.mission-card {
  min-height: 260px;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 12px;
  padding: 20px;
  border: 1px solid rgba(22, 33, 31, 0.12);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 250, 241, 0.96);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.mission-card:hover {
  transform: translateY(-3px);
  border-color: rgba(47, 138, 104, 0.48);
  box-shadow: 0 22px 42px rgba(22, 33, 31, 0.14);
}

.mission-card:focus-visible,
.mission-back:focus-visible,
.mission-next:focus-visible {
  outline: 3px solid rgba(47, 111, 159, 0.34);
  outline-offset: 3px;
}

.mission-card strong {
  font-size: 1.22rem;
  line-height: 1.15;
}

.mission-card span:not(.mission-icon) {
  color: var(--muted);
  line-height: 1.4;
}

.mission-card b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: #07382b;
  background: rgba(47, 138, 104, 0.14);
}

.mission-meta {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mission-icon {
  display: block;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(22, 33, 31, 0.12);
  border-radius: 8px;
}

.kwh-icon {
  background:
    linear-gradient(90deg, var(--yellow) 0 72%, transparent 72%),
    linear-gradient(90deg, transparent 0 82%, var(--ink) 82% 100%),
    #fff;
}

.badge-icon {
  position: relative;
  background:
    radial-gradient(circle at 50% 42%, var(--yellow) 0 13px, transparent 14px),
    linear-gradient(135deg, rgba(47, 138, 104, 0.18), rgba(47, 111, 159, 0.16)),
    #fff;
}

.badge-icon::before,
.badge-icon::after {
  content: "";
  position: absolute;
  bottom: 9px;
  width: 12px;
  height: 20px;
  background: var(--red);
}

.badge-icon::before {
  left: 17px;
  transform: rotate(18deg);
}

.badge-icon::after {
  right: 17px;
  transform: rotate(-18deg);
}

.mission-back {
  width: fit-content;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(22, 33, 31, 0.14);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
  cursor: pointer;
}

.mission-back:hover {
  border-color: rgba(47, 138, 104, 0.5);
  color: var(--green-dark);
}

.mission-next {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(47, 138, 104, 0.28);
  border-radius: 999px;
  color: #07382b;
  background: rgba(47, 138, 104, 0.14);
  font-weight: 900;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.mission-next:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 138, 104, 0.58);
  background: rgba(47, 138, 104, 0.2);
}

.lab {
  display: grid;
  grid-template-columns: minmax(380px, 0.72fr) minmax(0, 1.9fr);
  gap: 18px;
  max-width: 1680px;
  margin: 0 auto;
}

.lab-panel,
.meter-panel,
.choice-panel,
.result-panel,
.module-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.94);
  box-shadow: var(--shadow);
}

.intro-panel {
  min-height: 440px;
  padding: clamp(24px, 4vw, 42px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 10% 10%, rgba(244, 186, 66, 0.32), transparent 34%),
    linear-gradient(155deg, #fffaf1 0%, #eef5f1 100%);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(2.35rem, 4vw, 4.35rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.lead {
  max-width: 620px;
  color: #34423e;
  font-size: clamp(1rem, 1.55vw, 1.22rem);
  line-height: 1.55;
}

.key-fact {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(47, 138, 104, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.key-fact-value {
  display: grid;
  place-items: center;
  min-width: 88px;
  min-height: 58px;
  border-radius: 6px;
  color: #07382b;
  background: rgba(244, 186, 66, 0.72);
  font-size: 1.25rem;
  font-weight: 900;
}

.key-fact-text {
  color: #31403c;
  line-height: 1.35;
}

.play-area {
  grid-column: span 1;
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 18px;
}

.meter-panel {
  grid-column: 1;
  align-self: start;
  padding: 18px;
}

#energy-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 18 / 11;
  border: 1px solid rgba(22, 33, 31, 0.1);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #eef5f1);
}

.meter-readout {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin: 16px 0 10px;
}

.meter-readout span,
.score-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.meter-readout strong {
  font-size: 1.45rem;
}

.meter-bar {
  display: flex;
  gap: 0;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7dfd2;
}

.meter-bar.over-budget {
  box-shadow: 0 0 0 3px rgba(220, 92, 70, 0.14);
}

.meter-segment {
  display: block;
  flex-basis: 0;
  height: 100%;
  min-width: 0;
  background: var(--segment-color);
  transition: flex-grow 180ms ease;
}

.meter-segment + .meter-segment {
  border-left: 1px solid rgba(255, 255, 255, 0.42);
}

.meter-segment-empty {
  background: #e7dfd2;
}

.score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.score-row div {
  padding: 12px;
  border-radius: 6px;
  background: rgba(47, 111, 159, 0.08);
}

.score-row strong {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
}

.secondary-button {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(22, 33, 31, 0.16);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

.secondary-button:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

.mode-button {
  margin-bottom: 8px;
}

.mode-button.active {
  border-color: rgba(220, 92, 70, 0.42);
  color: #6f241b;
  background: rgba(220, 92, 70, 0.12);
}

.game-status {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(47, 138, 104, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.game-status span {
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.game-status strong {
  justify-self: end;
  font-size: 1.05rem;
}

.game-status p {
  grid-column: 1 / -1;
  margin: 0;
  color: #34423e;
  font-size: 0.92rem;
  line-height: 1.35;
}

.choice-panel {
  grid-column: 2;
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 12px;
}

.activity-card {
  min-height: 166px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(22, 33, 31, 0.12);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel-strong);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.activity-card:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 138, 104, 0.5);
  box-shadow: 0 12px 28px rgba(22, 33, 31, 0.1);
}

.activity-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.activity-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--activity-color);
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.08);
}

.activity-quantity {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(22, 33, 31, 0.12);
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(47, 138, 104, 0.1);
  font-weight: 900;
}

.activity-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.activity-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.activity-cost {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(22, 33, 31, 0.1);
  font-weight: 800;
}

.activity-cost span:last-child {
  color: var(--green-dark);
}

.activity-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.round-button {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid rgba(22, 33, 31, 0.13);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.round-button:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 138, 104, 0.55);
}

.round-button:disabled {
  cursor: not-allowed;
  opacity: 0.34;
  transform: none;
}

.plus-button {
  color: #063d2f;
  background: rgba(47, 138, 104, 0.14);
}

.minus-button {
  color: #6f241b;
  background: rgba(220, 92, 70, 0.1);
}

.result-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(300px, 1.15fr);
  gap: 18px;
  padding: 22px;
}

.result-panel .mission-next {
  grid-column: 1 / -1;
}

.result-panel p {
  color: #34423e;
  line-height: 1.5;
}

.timeline {
  display: grid;
  gap: 8px;
  min-height: 108px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(22, 33, 31, 0.1);
  border-radius: 6px;
  background: #fff;
}

.timeline-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #fff;
  background: var(--green);
  font-weight: 900;
}

.timeline strong {
  font-size: 0.94rem;
}

.timeline span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.module-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.55fr) minmax(0, 1.45fr);
  gap: 18px;
  max-width: 1680px;
  margin: 18px auto 0;
  scroll-margin-top: 88px;
}

.module-heading,
.science-panel,
.control-panel,
.option-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.94);
  box-shadow: var(--shadow);
}

.module-heading {
  min-height: 360px;
  padding: clamp(22px, 3vw, 34px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.module-heading p:not(.eyebrow) {
  max-width: 560px;
  color: #34423e;
  line-height: 1.55;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
}

.efficiency-game {
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
}

.option-list,
.control-panel,
.science-panel {
  padding: 18px;
}

.option-list {
  display: grid;
  gap: 10px;
}

.option-button {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px 12px;
  align-items: center;
  min-height: 82px;
  padding: 14px;
  border: 1px solid rgba(22, 33, 31, 0.12);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.option-button span {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--option-color);
}

.option-button strong {
  line-height: 1.2;
}

.option-button small {
  grid-column: 2;
  color: var(--muted);
  line-height: 1.35;
}

.option-button:hover,
.option-button.selected {
  border-color: rgba(47, 138, 104, 0.55);
  background: rgba(47, 138, 104, 0.08);
}

.science-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.energy-animation {
  min-height: 150px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(22, 33, 31, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(47, 138, 104, 0.08), transparent 32%),
    #fff;
}

.energy-animation > .animation-node,
.energy-animation > .animation-targets {
  display: none;
}

.animation-node {
  display: grid;
  place-items: center;
  min-height: 54px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(244, 186, 66, 0.68);
  font-weight: 900;
}

.animation-targets {
  display: grid;
  gap: 10px;
}

.useful-node {
  color: #07382b;
  background: rgba(47, 138, 104, 0.18);
}

.loss-node {
  color: #6f241b;
  background: rgba(220, 92, 70, 0.16);
}

.particle-field {
  min-height: 190px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(47, 138, 104, 0.12), rgba(244, 186, 66, 0.14), rgba(220, 92, 70, 0.08)),
    linear-gradient(0deg, rgba(22, 33, 31, 0.05) 1px, transparent 1px);
  background-size: auto, 100% 24px;
}

.stream-track {
  position: relative;
  min-width: 100%;
  height: 168px;
}

.stream-line {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 82px;
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(47, 138, 104, 0.24), rgba(244, 186, 66, 0.2)),
    #e7dfd2;
}

.stream-labels {
  position: absolute;
  inset: 18px 0 auto;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: start;
  text-align: center;
}

.stream-labels span {
  position: relative;
  min-height: 42px;
  display: grid;
  place-items: start center;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.1;
}

.stream-labels span::after {
  content: "";
  position: absolute;
  top: 56px;
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(22, 33, 31, 0.24);
  background: #fff;
}

.stream-particle {
  position: absolute;
  left: var(--from);
  top: calc(83px + var(--lane));
  width: 9px;
  height: 9px;
  border-radius: 999px;
  animation-delay: var(--delay);
  animation-duration: 2.2s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

.stream-useful {
  background: var(--green);
  box-shadow: 0 0 10px rgba(47, 138, 104, 0.5);
  animation-name: streamUseful;
}

.stream-loss {
  background: var(--red);
  box-shadow: 0 0 10px rgba(220, 92, 70, 0.45);
  animation-name: streamLoss;
}

.stream-loss-label {
  position: absolute;
  top: 128px;
  transform: translateX(-50%);
  color: #6f241b;
  font-size: 0.82rem;
  font-weight: 900;
}

@keyframes streamUseful {
  0% {
    left: var(--from);
    opacity: 0;
    transform: translate(-50%, 0) scale(0.75);
  }
  12% {
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  100% {
    left: var(--to);
    opacity: 0.25;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes streamLoss {
  0% {
    left: var(--from);
    opacity: 0;
    transform: translate(-50%, 0) scale(0.75);
  }
  18% {
    opacity: 1;
  }
  100% {
    left: var(--to);
    opacity: 0;
    transform: translate(-50%, var(--drop)) scale(0.62);
  }
}

.conversion-track {
  min-width: 100%;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(112px, 1fr);
  align-items: start;
}

.conversion-step {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 46px 46px;
  gap: 5px;
  min-height: 150px;
  padding: 10px 10px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  animation: stageReveal 380ms ease both;
  animation-delay: var(--stage-delay, 0s);
}

.conversion-step::after {
  content: "";
  position: absolute;
  top: 70px;
  right: -12px;
  width: 24px;
  height: 2px;
  background: rgba(22, 33, 31, 0.22);
}

.conversion-step:last-child::after {
  display: none;
}

.conversion-step strong,
.conversion-step span {
  display: block;
}

.conversion-step span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.bead-lane {
  display: flex;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
}

.loss-drop {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: start;
  min-height: 42px;
  padding-top: 2px;
}

.loss-drop div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 20px;
}

.loss-drop small {
  color: #6f241b;
  font-weight: 900;
}

.energy-bead {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  animation-duration: 1.4s;
  animation-delay: var(--delay);
  animation-iteration-count: infinite;
  animation-timing-function: cubic-bezier(0.3, 0.8, 0.5, 1);
}

.green-bead {
  background: var(--green);
  box-shadow: 0 0 10px rgba(47, 138, 104, 0.55);
  animation-name: beadForward;
}

.red-bead {
  background: var(--red);
  box-shadow: 0 0 10px rgba(220, 92, 70, 0.45);
  animation-name: beadLoss;
}

@keyframes stageReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes beadForward {
  0% {
    transform: translateX(-8px) scale(0.8);
    opacity: 0.4;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translateX(14px) scale(1);
    opacity: 1;
  }
}

@keyframes beadLoss {
  0% {
    transform: translate(0, 0) scale(0.8);
    opacity: 0.4;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translate(0, 22px) scale(0.55);
    opacity: 0.15;
  }
}

.flow-stack {
  display: grid;
  gap: 10px;
}

.flow-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.72fr) minmax(150px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(22, 33, 31, 0.1);
  border-radius: 8px;
  background: #fff;
}

.flow-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
}

.flow-bar {
  display: flex;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7dfd2;
}

.flow-useful {
  background: linear-gradient(90deg, var(--green), var(--yellow));
}

.flow-loss {
  background: rgba(220, 92, 70, 0.8);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.metric-grid div {
  padding: 14px;
  border-radius: 8px;
  background: rgba(47, 111, 159, 0.08);
}

.metric-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.metric-grid strong {
  font-size: 1.35rem;
}

.science-note {
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(47, 138, 104, 0.18);
  border-radius: 8px;
  color: #31403c;
  background: rgba(255, 255, 255, 0.64);
  line-height: 1.5;
}

.range-control {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(22, 33, 31, 0.1);
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

.range-control + .range-control {
  margin-top: 10px;
}

.range-control input {
  width: 100%;
  accent-color: var(--green);
}

.range-control strong {
  color: var(--green-dark);
}

.explain-card {
  margin: 10px 0;
  padding: 14px;
  border: 1px solid rgba(47, 138, 104, 0.18);
  border-radius: 8px;
  background: rgba(47, 138, 104, 0.08);
}

.explain-card strong {
  color: var(--green-dark);
}

.explain-card p {
  margin: 8px 0 0;
  color: #34423e;
  font-size: 0.92rem;
  line-height: 1.45;
}

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

.storage-chart {
  min-height: 150px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(22, 33, 31, 0.1);
  border-radius: 8px;
  background: #fff;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.chart-head strong {
  line-height: 1.15;
}

.chart-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.day-curve {
  min-height: 100px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  align-items: end;
  padding-top: 8px;
  border-top: 1px solid rgba(22, 33, 31, 0.08);
}

.curve-column {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.curve-bars {
  height: 82px;
  display: flex;
  gap: 4px;
  align-items: end;
}

.curve-bars span {
  width: 12px;
  min-height: 3px;
  border-radius: 999px 999px 3px 3px;
}

.solar-bar {
  background: var(--yellow);
}

.demand-bar {
  background: var(--blue);
}

.curve-column small,
.coverage-labels,
.balance-legend,
.cost-row {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.coverage-gauge,
.storage-balance {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7dfd2;
}

.coverage-gauge span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--green));
  transition: width 180ms ease;
}

.coverage-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.storage-balance {
  display: flex;
}

.storage-balance span {
  min-width: 0;
  height: 100%;
}

.storage-balance span + span {
  border-left: 1px solid rgba(255, 255, 255, 0.55);
}

.balance-legend {
  display: grid;
  gap: 6px;
}

.balance-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.balance-legend b {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.cost-bars {
  display: grid;
  gap: 9px;
}

.cost-row {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 8px;
  align-items: center;
}

.cost-row div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7dfd2;
}

.cost-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.storage-day {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.storage-block {
  min-height: 134px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, var(--storage-color), rgba(22, 33, 31, 0.8));
}

.storage-block span,
.storage-block small {
  font-weight: 800;
}

.storage-block strong {
  font-size: 1.65rem;
}

.mix-controls {
  display: grid;
  gap: 10px;
}

.mix-range {
  border-left: 6px solid var(--mix-color);
}

.mix-range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mix-range-head label {
  line-height: 1.2;
}

.lock-button {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(22, 33, 31, 0.14);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.lock-button::before,
.lock-button::after {
  content: "";
  position: absolute;
  left: 50%;
  border: 2px solid currentColor;
}

.lock-button::before {
  top: 15px;
  width: 13px;
  height: 9px;
  border-radius: 3px;
  transform: translateX(-50%);
}

.lock-button::after {
  top: 7px;
  width: 10px;
  height: 9px;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  transform: translateX(8px);
}

.lock-button span::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 23px;
  width: 2px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.lock-button:hover {
  border-color: rgba(47, 138, 104, 0.5);
  color: var(--green-dark);
}

.mix-range.locked {
  border-color: rgba(22, 33, 31, 0.18);
  background: rgba(255, 255, 255, 0.72);
}

.mix-range.locked input {
  cursor: not-allowed;
  opacity: 0.52;
}

.mix-range.locked .lock-button {
  color: #07382b;
  border-color: rgba(47, 138, 104, 0.42);
  background: rgba(47, 138, 104, 0.14);
}

.mix-range.locked .lock-button::after {
  transform: translateX(-50%) rotate(0deg);
}

.mix-range.locked .lock-button span::before {
  display: none;
}

.mix-donut {
  width: min(260px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  border: 1px solid rgba(22, 33, 31, 0.12);
  box-shadow: inset 0 0 0 38px rgba(255, 250, 241, 0.94);
}

.mix-donut span {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 900;
}

.car-icon {
  position: relative;
  background:
    linear-gradient(0deg, transparent 0 58%, rgba(47, 111, 159, 0.2) 58% 100%),
    #fff;
}

.car-icon::before,
.car-icon::after {
  content: "";
  position: absolute;
}

.car-icon::before {
  left: 8px;
  right: 8px;
  top: 22px;
  height: 16px;
  border-radius: 12px 16px 7px 7px;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.car-icon::after {
  left: 13px;
  bottom: 10px;
  width: 28px;
  height: 8px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 4px 4px, var(--ink) 0 4px, transparent 4px),
    radial-gradient(circle at 24px 4px, var(--ink) 0 4px, transparent 4px);
}

.vehicle-section {
  grid-template-columns: 1fr;
}

.vehicle-section .module-heading {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) minmax(280px, 1fr) auto;
  gap: 8px 22px;
  align-items: center;
}

.vehicle-section .module-heading .eyebrow {
  grid-column: 1 / -1;
  margin: 0;
}

.vehicle-section .module-heading h2,
.vehicle-section .module-heading p:not(.eyebrow) {
  margin: 0;
}

.vehicle-section .module-heading p:not(.eyebrow) {
  max-width: none;
}

.vehicle-section .mission-back {
  justify-self: end;
  margin-top: 0;
}

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

.vehicle-controls,
.vehicle-panel {
  align-self: start;
}

.vehicle-name-control {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(22, 33, 31, 0.1);
  border-radius: 8px;
  background: #fff;
  font-weight: 900;
}

.vehicle-name-control input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(22, 33, 31, 0.14);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(247, 244, 237, 0.45);
  font: inherit;
}

.vehicle-missions {
  display: grid;
  gap: 8px;
}

.vehicle-builder {
  display: grid;
  gap: 14px;
}

.vehicle-choice-group {
  display: grid;
  gap: 8px;
}

.vehicle-select-control {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(22, 33, 31, 0.1);
  border-radius: 8px;
  background: #fff;
}

.vehicle-select-control span {
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.vehicle-select-control select {
  width: 100%;
  min-height: 42px;
  padding: 0 38px 0 12px;
  border: 1px solid rgba(22, 33, 31, 0.14);
  border-radius: 6px;
  color: var(--ink);
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%),
    rgba(247, 244, 237, 0.45);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 12px) 18px,
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  font: inherit;
  font-weight: 850;
  appearance: none;
  cursor: pointer;
}

.vehicle-select-control select:disabled {
  color: rgba(22, 33, 31, 0.45);
  background:
    linear-gradient(45deg, transparent 50%, rgba(103, 116, 111, 0.45) 50%),
    linear-gradient(135deg, rgba(103, 116, 111, 0.45) 50%, transparent 50%),
    rgba(235, 231, 222, 0.55);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 12px) 18px,
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  cursor: not-allowed;
}

.vehicle-select-control small,
.vehicle-selected-card span,
.vehicle-selected-card small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.vehicle-selected-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(47, 138, 104, 0.18);
  border-radius: 8px;
  background: rgba(47, 138, 104, 0.07);
}

.vehicle-selected-card strong {
  line-height: 1.15;
}

.vehicle-selected-card.empty {
  border-color: rgba(22, 33, 31, 0.1);
  background: rgba(247, 244, 237, 0.55);
}

.vehicle-showroom {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(220px, 1.1fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(22, 33, 31, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(0deg, rgba(47, 138, 104, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 111, 159, 0.08) 1px, transparent 1px),
    #fff;
  background-size: 24px 24px;
}

.vehicle-visual {
  position: relative;
  min-height: 170px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.2) 0 58%, rgba(22, 33, 31, 0.08) 58% 100%),
    linear-gradient(120deg, rgba(244, 186, 66, 0.14), rgba(47, 111, 159, 0.12));
}

.car-body,
.car-cabin,
.car-wheel {
  position: absolute;
  display: block;
}

.car-body {
  left: 10%;
  right: 10%;
  bottom: 44px;
  height: 48px;
  border-radius: 32px 42px 14px 14px;
  background: linear-gradient(90deg, var(--vehicle-color, var(--green)), var(--vehicle-accent, var(--blue)));
  box-shadow: inset 0 -12px 0 rgba(0, 0, 0, 0.12);
}

.car-cabin {
  left: 34%;
  bottom: 84px;
  width: 30%;
  height: 36px;
  border-radius: 26px 26px 4px 4px;
  background: rgba(255, 255, 255, 0.72);
  border: 3px solid rgba(22, 33, 31, 0.18);
}

.car-wheel {
  bottom: 30px;
  width: 36px;
  height: 36px;
  border: 7px solid var(--ink);
  border-radius: 50%;
  background: #fff;
}

.car-wheel.front {
  right: 18%;
}

.car-wheel.rear {
  left: 18%;
}

.vehicle-visual.tested .car-body {
  animation: vehiclePulse 520ms ease 3;
}

.vehicle-summary span {
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.vehicle-summary strong {
  display: block;
  margin: 6px 0;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  line-height: 1;
}

.vehicle-summary p {
  margin: 0;
  color: #34423e;
  line-height: 1.45;
}

.vehicle-chain {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(22, 33, 31, 0.1);
  border-radius: 8px;
  background: #fff;
}

.vehicle-chain-empty {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px dashed rgba(22, 33, 31, 0.2);
  border-radius: 8px;
  background: rgba(247, 244, 237, 0.55);
}

.vehicle-chain-empty span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.vehicle-step {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.vehicle-step span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.vehicle-step strong {
  display: block;
  line-height: 1.15;
}

.vehicle-step small {
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.vehicle-step-track {
  position: relative;
  display: flex;
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7dfd2;
}

.vehicle-step-track i {
  display: block;
  height: 100%;
}

.vehicle-useful {
  background: linear-gradient(90deg, var(--green), var(--yellow));
}

.vehicle-loss {
  background: rgba(220, 92, 70, 0.78);
}

.vehicle-bead {
  position: absolute;
  top: 4px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 138, 104, 0.25);
  opacity: 0;
}

.vehicle-chain.testing .vehicle-bead {
  animation: vehicleBead 1.35s linear both;
}

.vehicle-chain.testing .vehicle-step:nth-child(2) .vehicle-bead {
  animation-delay: 160ms;
}

.vehicle-chain.testing .vehicle-step:nth-child(3) .vehicle-bead {
  animation-delay: 320ms;
}

.vehicle-chain.testing .vehicle-step:nth-child(4) .vehicle-bead {
  animation-delay: 480ms;
}

.vehicle-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.vehicle-actions .secondary-button {
  width: auto;
  padding: 0 18px;
}

.vehicle-actions .secondary-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.vehicle-card,
.vehicle-badge-panel,
.garage-panel {
  padding: 16px;
  border: 1px solid rgba(22, 33, 31, 0.1);
  border-radius: 8px;
  background: #fff;
}

.vehicle-badge-panel {
  display: grid;
  gap: 12px;
}

.badge-page-panel {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.vehicle-badge-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

.vehicle-badge-header strong {
  display: block;
  margin-top: 4px;
  font-size: 1.1rem;
}

.vehicle-badge-menu {
  display: grid;
  gap: 5px;
  min-width: 150px;
}

.vehicle-badge-menu span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.vehicle-badge-menu select {
  min-height: 38px;
  padding: 0 34px 0 10px;
  border: 1px solid rgba(22, 33, 31, 0.14);
  border-radius: 6px;
  color: var(--ink);
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%),
    rgba(247, 244, 237, 0.45);
  background-position:
    calc(100% - 16px) 16px,
    calc(100% - 10px) 16px,
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  font: inherit;
  font-weight: 850;
  appearance: none;
}

.badge-rack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.badge-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(22, 33, 31, 0.1);
  border-radius: 8px;
  background: rgba(247, 244, 237, 0.48);
}

.badge-card.active {
  border-color: rgba(47, 138, 104, 0.45);
  box-shadow: 0 0 0 3px rgba(47, 138, 104, 0.1);
}

.badge-card.locked {
  opacity: 0.66;
}

.badge-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: #fff;
  background: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 950;
}

.badge-card.green .badge-symbol {
  background: var(--green);
}

.badge-card.blue .badge-symbol {
  background: var(--blue);
}

.badge-card.yellow .badge-symbol {
  color: var(--ink);
  background: var(--yellow);
}

.badge-card.red .badge-symbol {
  background: var(--red);
}

.badge-card.brown .badge-symbol {
  background: #9a5b34;
}

.badge-card.locked .badge-symbol {
  color: var(--muted);
  background: #e4ddd0;
}

.badge-card strong {
  display: block;
  line-height: 1.15;
}

.badge-mission {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.badge-card small {
  display: block;
  margin-top: 3px;
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.badge-card.locked small {
  color: var(--muted);
}

.badge-card p,
.badge-empty {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.badge-empty {
  margin: 0;
}

.vehicle-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.6fr) minmax(0, 1.4fr);
  gap: 16px;
}

.vehicle-card h2 {
  margin-bottom: 8px;
}

.vehicle-medal {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #07382b;
  background: rgba(244, 186, 66, 0.48);
  font-weight: 900;
}

.vehicle-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.vehicle-card dl div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
}

.vehicle-card dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.vehicle-card dd {
  margin: 0;
  color: #34423e;
  line-height: 1.35;
}

.garage-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.garage-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.garage-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(22, 33, 31, 0.1);
  border-radius: 8px;
  background: rgba(47, 111, 159, 0.08);
}

.garage-item span {
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.garage-item small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.3;
}

@keyframes vehiclePulse {
  50% {
    transform: translateX(5px);
  }
}

@keyframes vehicleBead {
  0% {
    left: 0;
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    left: calc(100% - 8px);
    opacity: 0.25;
  }
}

.next-modules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1680px;
  margin: 18px auto 0;
}

.module-card {
  min-height: 240px;
  padding: 22px;
}

.module-card p {
  color: var(--muted);
  line-height: 1.5;
}

.module-icon {
  display: block;
  width: 56px;
  height: 56px;
  margin-bottom: 24px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(22, 33, 31, 0.12);
}

.loss-icon {
  background:
    linear-gradient(90deg, var(--green) 0 42%, transparent 42%),
    linear-gradient(90deg, transparent 0 54%, var(--yellow) 54% 70%, transparent 70%),
    linear-gradient(90deg, transparent 0 78%, var(--red) 78% 100%),
    #fff;
}

.storage-icon {
  background:
    linear-gradient(0deg, var(--blue) 0 45%, transparent 45%),
    linear-gradient(90deg, transparent 18%, rgba(47, 111, 159, 0.22) 18% 82%, transparent 82%),
    #fff;
}

.mix-icon {
  background:
    conic-gradient(from 90deg, var(--green), var(--yellow), var(--blue), var(--red), var(--green));
}

@media (min-width: 901px) and (max-width: 1280px) {
  .meter-panel {
    position: sticky;
    top: 86px;
    max-height: calc(100vh - 106px);
    overflow: auto;
  }
}

@media (max-width: 1120px) {
  .lab {
    grid-template-columns: 1fr;
  }

  .module-section {
    grid-template-columns: 1fr;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 900px) {
  .meter-panel {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
  }

  .intro-panel {
    min-height: 320px;
  }
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  main {
    padding-top: 18px;
  }

  .play-area,
  .game-layout,
  .vehicle-layout,
  .vehicle-showroom,
  .vehicle-card,
  .result-panel,
  .next-modules {
    grid-template-columns: 1fr;
  }

  .choice-panel {
    grid-column: auto;
  }

  .meter-panel {
    position: static;
  }

  .activity-grid {
    grid-template-columns: 1fr;
  }

  .flow-row {
    grid-template-columns: 1fr;
  }

  .vehicle-step {
    grid-template-columns: 1fr;
  }

  .vehicle-section .module-heading {
    grid-template-columns: 1fr;
  }

  .vehicle-section .module-heading .eyebrow {
    grid-column: auto;
  }

  .vehicle-section .mission-back {
    justify-self: start;
  }

  .vehicle-badge-header {
    align-items: stretch;
    flex-direction: column;
  }

  .vehicle-badge-menu {
    min-width: 0;
  }

  .storage-visuals {
    grid-template-columns: 1fr;
  }

  .energy-animation {
    grid-template-columns: 1fr;
  }

  .conversion-track {
    min-width: 680px;
  }
}

@media (max-width: 520px) {
  .key-fact {
    grid-template-columns: 1fr;
  }

  .module-nav {
    width: 100%;
  }

  .module-nav a {
    min-height: 34px;
    padding: 0 10px;
  }

  .result-panel,
  .choice-panel,
  .meter-panel,
  .module-card,
  .vehicle-card,
  .vehicle-badge-panel,
  .garage-panel {
    padding: 14px;
  }

  .garage-list {
    grid-template-columns: 1fr;
  }

  .vehicle-card dl div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
