:root {
  --bg: #f4f6f3;
  --panel: #ffffff;
  --ink: #101815;
  --muted: #64716b;
  --line: #dfe5df;
  --green: #48cf7a;
  --green-dark: #17633c;
  --red: #d34b45;
  --graphite: #1c2422;
  --shadow: 0 20px 55px rgba(28, 36, 34, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  min-height: 100vh;
}

.hero {
  position: relative;
  min-height: 390px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #17201d;
  color: #fff;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 16, 14, 0.93) 0%, rgba(10, 16, 14, 0.6) 42%, rgba(10, 16, 14, 0.14) 100%),
    linear-gradient(0deg, rgba(10, 16, 14, 0.88), rgba(10, 16, 14, 0) 55%);
}

.hero-media img,
.vehicle-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-content {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 96px;
}

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

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.lead {
  max-width: 520px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.15rem;
  line-height: 1.6;
}

.workspace {
  width: min(1120px, calc(100% - 32px));
  margin: -54px auto 64px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.2fr);
  gap: 22px;
}

.panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(223, 229, 223, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.input-panel {
  padding: 22px;
}

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

.panel-heading h2,
.result-panel h2 {
  margin-bottom: 0;
  font-size: 1.5rem;
  letter-spacing: 0;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbf8;
  color: var(--graphite);
  cursor: pointer;
}

.lookup-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  margin-bottom: 18px;
  background: #eef2ed;
  border-radius: 8px;
}

.tab-button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.tab-button.is-active {
  background: var(--graphite);
  color: #fff;
}

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

.mode-section {
  display: none;
}

.mode-section.is-active {
  display: grid;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(72, 207, 122, 0.18);
}

.full {
  grid-column: 1 / -1;
}

.primary-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--green-dark);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.hint {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.hint.is-error {
  color: var(--red);
}

.stage-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.stage-option {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  cursor: pointer;
}

.stage-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.stage-option span {
  margin: 0;
}

.stage-option strong {
  font-size: 1.4rem;
}

.stage-option:has(input:checked) {
  border-color: var(--green);
  background: #edfff3;
  box-shadow: inset 0 0 0 1px var(--green);
}

.result-panel {
  padding: 20px;
}

.vehicle-card {
  display: grid;
  grid-template-columns: 178px 1fr;
  gap: 18px;
  align-items: center;
}

.vehicle-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: #18211e;
}

#vehicleEngine {
  margin: 8px 0 0;
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.metric {
  min-height: 128px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.metric span,
.gain-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin: 12px 0 4px;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1;
}

.metric small {
  color: var(--muted);
  font-weight: 700;
}

.metric.accent {
  background: var(--graphite);
  color: #fff;
}

.metric.accent small,
.metric.accent span {
  color: rgba(255, 255, 255, 0.72);
}

.gain-strip {
  margin-top: 16px;
  padding: 18px;
  border-radius: 8px;
  background: #eef2ed;
}

.gain-strip strong {
  display: block;
  margin: 7px 0 12px;
  font-size: 1.55rem;
}

.gain-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #d7ded6;
}

.gain-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--red));
  transition: width 180ms ease;
}

.notes {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 4px solid var(--green);
  background: #f8faf7;
  color: var(--muted);
  line-height: 1.55;
}

.notes p {
  margin: 0;
}

@media (max-width: 880px) {
  .hero {
    min-height: 340px;
  }

  .hero-content {
    padding-bottom: 84px;
  }

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

@media (max-width: 620px) {
  .workspace,
  .hero-content {
    width: min(100% - 20px, 1120px);
  }

  .input-panel,
  .result-panel {
    padding: 14px;
  }

  .lookup-tabs,
  .stage-group,
  .metrics,
  .form-grid,
  .vehicle-card {
    grid-template-columns: 1fr;
  }

  .vehicle-card {
    align-items: start;
  }

  .vehicle-image {
    width: 100%;
  }
}
