:root {
  --ink: #161a14;
  --muted: #626c5b;
  --line: rgba(140, 200, 11, 0.26);
  --panel: #fffdf6;
  --panel-soft: #f6f0df;
  --page: #ede7d6;
  --field: #5f870a;
  --field-dark: #050505;
  --field-soft: #e7f5bf;
  --orange: #ff6a00;
  --lime: #8cc80b;
  --gold: #f2c14e;
  --soil: #9a6428;
  --sky: #4f7f8f;
  --good: #1f8f2e;
  --red: #f4c1ad;
  --red-ink: #89341f;
  --shadow: 0 14px 34px rgba(54, 43, 29, 0.12);
  --soft-shadow: 0 10px 24px rgba(54, 43, 29, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  background:
    radial-gradient(circle at 10% 6%, rgba(140, 200, 11, 0.2), transparent 24rem),
    radial-gradient(circle at 92% 12%, rgba(255, 106, 0, 0.15), transparent 24rem),
    linear-gradient(180deg, rgba(5, 5, 5, 0.08), rgba(255, 106, 0, 0.08) 280px, transparent 520px),
    var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 96px auto auto 50%;
  z-index: 0;
  width: min(760px, 82vw);
  aspect-ratio: 1;
  background: url("../assets/trailblazer-logo.png") center / contain no-repeat;
  opacity: 0.045;
  transform: translateX(-50%);
  pointer-events: none;
}

.app-shell,
.site-footer {
  position: relative;
  z-index: 1;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 253, 246, 0.22);
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(12px);
  padding: 11px 30px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fffdf6;
  font-weight: 950;
  text-decoration: none;
}

.brand-link img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}

.site-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.site-links a {
  border: 1px solid rgba(255, 253, 246, 0.38);
  border-radius: 999px;
  padding: 8px 12px;
  color: #fffdf6;
  font-size: 0.88rem;
  font-weight: 850;
  text-decoration: none;
}

.site-links a.active,
.site-links a:hover,
.site-links a:focus-visible {
  background: var(--lime);
  color: var(--field-dark);
  outline: 0;
}

.app-shell {
  width: min(1420px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  border-radius: 8px;
  padding: 24px;
  background: linear-gradient(135deg, #050505, #253707 58%, #ff6a00);
  color: #fffdf6;
  box-shadow: var(--shadow);
}

.topbar p {
  margin: 6px 0 0;
  color: #efe8d4;
  font-weight: 700;
}

.eyebrow {
  display: block;
  margin: 0 0 4px;
  color: var(--lime);
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 5vw, 4.4rem);
  line-height: 0.94;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.28rem;
}

.dashboard-logo {
  width: clamp(90px, 11vw, 140px);
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.42));
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.home-link,
.feedback-button,
.version-note,
.primary,
button {
  border: 1px solid rgba(140, 200, 11, 0.42);
  border-radius: 999px;
  background: #fffdf6;
  padding: 10px 14px;
  color: var(--field-dark);
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
}

.primary {
  background: var(--lime);
}

.dashboard-intro,
.panel,
.how-to-card,
.quick-menu,
.site-footer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.96);
  box-shadow: var(--shadow);
}

.panel {
  overflow: visible;
}

.dashboard-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.62fr);
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  border-left: 5px solid var(--orange);
  padding: 16px;
}

.dashboard-intro span {
  display: block;
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.dashboard-intro strong {
  display: block;
  margin-top: 5px;
  color: var(--field-dark);
  font-size: clamp(1.05rem, 1.5vw, 1.36rem);
  line-height: 1.25;
}

.dashboard-intro p {
  margin: 0;
  border-left: 4px solid var(--lime);
  padding-left: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.4;
}

.tool-info-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: start;
  margin-top: 14px;
}

.how-to-card,
.quick-menu {
  padding: 12px 14px;
}

.how-to-card summary,
.quick-menu summary {
  cursor: pointer;
  color: var(--field-dark);
  font-weight: 950;
}

.how-to-card ol {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-weight: 720;
  line-height: 1.45;
}

.quick-menu {
  display: none;
  margin-top: 14px;
}

.quick-menu nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.quick-menu a {
  border-radius: 999px;
  background: var(--field-soft);
  padding: 8px 11px;
  color: var(--field-dark);
  font-size: 0.88rem;
  font-weight: 850;
  text-decoration: none;
}

.planner-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 14px;
  margin-top: 16px;
}

.panel {
  padding: 0;
}

.results-panel {
  grid-column: 1 / -1;
}

#priceInputs {
  grid-column: 1 / -1;
}

.step-panel {
  position: relative;
  border-top: 5px solid var(--lime);
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.98), rgba(251, 246, 229, 0.96));
}

.soil-panel {
  border-top-color: var(--soil);
}

.vendor-panel {
  border-top-color: var(--orange);
}

.recommendation-panel {
  border-top-color: var(--field-dark);
  background:
    linear-gradient(135deg, rgba(5, 5, 5, 0.06), rgba(140, 200, 11, 0.08)),
    rgba(255, 253, 246, 0.98);
}

.section-title {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(140, 200, 11, 0.2);
  padding: 16px 18px 13px;
}

.section-title h2 {
  margin: 0;
}

.section-title button:not(.help-button) {
  margin-left: auto;
}

.step-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(5, 5, 5, 0.12);
  border-radius: 999px;
  background: var(--field-dark);
  padding: 7px 10px;
  color: #fffdf6;
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  padding: 18px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

input,
select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffef9;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 1rem;
  font-weight: 760;
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(140, 200, 11, 0.34);
  outline-offset: 2px;
}

.unit-input {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) minmax(58px, auto);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffef9;
}

.unit-input input {
  min-width: 0;
  border: 0;
  background: transparent;
}

.unit-input span {
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.budget-control {
  max-width: 360px;
  margin: 18px 18px 14px;
}

.vendor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 18px 18px;
}

.vendor-card {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 11px;
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(255, 106, 0, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 244, 224, 0.7), rgba(255, 253, 246, 0.98) 120px),
    #fffef9;
  box-shadow: var(--soft-shadow);
  padding: 16px;
}

.vendor-card legend {
  border-radius: 999px;
  background: var(--orange);
  padding: 6px 10px;
  color: #fffdf6;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.vendor-card label {
  min-width: 0;
  font-size: 0.88rem;
}

.vendor-card label:first-of-type input {
  min-height: 46px;
  font-size: 1.02rem;
}

.vendor-note {
  margin: -4px 18px 18px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 740;
  line-height: 1.4;
}

.upload-box {
  margin: 18px 18px 12px;
  border: 1px dashed rgba(140, 200, 11, 0.55);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(140, 200, 11, 0.14), transparent),
    #fffef9;
  padding: 16px;
}

.upload-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: -2px 18px 12px;
}

.upload-actions span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.upload-note {
  margin: 0 18px 0;
  border: 1px solid rgba(140, 200, 11, 0.24);
  border-left: 5px solid var(--lime);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.9);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.help-button {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: 22px;
  min-width: 22px;
  height: 18px;
  margin-left: 4px;
  place-items: center;
  border: 1px solid rgba(117, 89, 12, 0.36);
  border-radius: 4px;
  background:
    repeating-linear-gradient(0deg, rgba(117, 89, 12, 0.12) 0 1px, transparent 1px 4px),
    linear-gradient(135deg, #fff1a9, #d6bf54);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 238, 0.62),
    0 1px 2px rgba(54, 43, 29, 0.12);
  color: transparent;
  font-size: 12px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
  vertical-align: middle;
}

.help-button::before {
  content: "?";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--field-dark);
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  transform: translateY(-1px);
}

.help-button::after {
  content: attr(data-help);
  position: absolute;
  z-index: 120;
  left: 0;
  bottom: calc(100% + 8px);
  display: none;
  width: min(290px, 82vw);
  border: 1px solid rgba(140, 200, 11, 0.45);
  border-radius: 8px;
  background: #fffdf6;
  box-shadow: 0 14px 34px rgba(5, 5, 5, 0.22);
  padding: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  pointer-events: none;
  text-transform: none;
}

.help-button:hover::after,
.help-button:focus-visible::after,
.help-button.is-open::after {
  display: block;
}

.empty-state,
.result-card,
.warning-card,
.mix-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf6;
  padding: 14px;
}

.empty-state {
  margin: 18px;
  min-height: 180px;
  display: grid;
  place-items: center;
  border-style: dashed;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 850;
  text-align: center;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.result-card span,
.mix-row span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.result-card strong,
.mix-row strong {
  display: block;
  margin-top: 4px;
  font-size: 1.3rem;
}

.result-card {
  background:
    linear-gradient(180deg, #fffdf6, #f8f2de);
  box-shadow: var(--soft-shadow);
}

.result-card.featured {
  grid-column: span 2;
  border-color: rgba(31, 143, 46, 0.38);
  background:
    linear-gradient(135deg, rgba(31, 143, 46, 0.12), rgba(255, 253, 246, 0.96));
}

.result-card.featured strong {
  color: var(--good);
  font-size: clamp(1.45rem, 2.7vw, 2.25rem);
}

.result-card.warn strong {
  color: var(--orange);
}

.result-card.danger strong {
  color: var(--red-ink);
}

.nutrient-chart {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid rgba(140, 200, 11, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(140, 200, 11, 0.08), rgba(255, 253, 246, 0.96));
  box-shadow: var(--soft-shadow);
  padding: 14px;
}

.chart-head {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: start;
}

.chart-head span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.chart-head strong {
  display: block;
  margin-top: 2px;
  color: var(--field-dark);
  font-size: 1.2rem;
}

.chart-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 740;
  line-height: 1.35;
}

.chart-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.chart-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.chart-legend i {
  width: 18px;
  height: 8px;
  border-radius: 999px;
}

.target-swatch {
  background: rgba(5, 5, 5, 0.2);
}

.plan-swatch {
  background: var(--lime);
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(82px, 0.22fr) minmax(180px, 1fr) minmax(128px, 0.3fr);
  gap: 10px;
  align-items: center;
  border-top: 1px solid rgba(140, 200, 11, 0.16);
  padding-top: 9px;
}

.chart-label strong {
  display: block;
  color: var(--field-dark);
  font-size: 1.05rem;
  line-height: 1;
}

.chart-label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.chart-bars {
  display: grid;
  gap: 5px;
}

.bar-line {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.08);
}

.bar-line span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
}

.bar-line.target span {
  background: rgba(5, 5, 5, 0.28);
}

.bar-line.supplied span {
  background: var(--lime);
}

.chart-row.watch .bar-line.supplied span {
  background: var(--orange);
}

.chart-row.short .bar-line.supplied span {
  background: var(--red-ink);
}

.chart-values {
  display: grid;
  gap: 2px;
  justify-items: end;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
  text-align: right;
}

.chart-values strong {
  color: var(--field-dark);
  font-size: 0.9rem;
}

.chart-values em {
  color: var(--good);
  font-style: normal;
  font-weight: 950;
}

.chart-row.watch .chart-values em {
  color: var(--orange);
}

.chart-row.short .chart-values em {
  color: var(--red-ink);
}

.recommendation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: 14px;
  padding: 18px;
}

.mix-list {
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid rgba(5, 5, 5, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.05), rgba(140, 200, 11, 0.08)),
    rgba(255, 253, 246, 0.84);
  padding: 12px;
}

.mix-list::before {
  content: "Recommended mix";
  color: var(--field-dark);
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
}

.mix-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.vendor-comparison {
  margin: 0 18px 18px;
}

.vendor-comparison h3 {
  margin: 0 0 10px;
  color: var(--field-dark);
  font-size: 1.05rem;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.vendor-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fffdf6, #f8f2de);
  box-shadow: var(--soft-shadow);
  padding: 12px;
}

.vendor-result.best {
  border-color: rgba(140, 200, 11, 0.78);
  box-shadow:
    inset 0 0 0 2px rgba(140, 200, 11, 0.24),
    var(--soft-shadow);
}

.vendor-result-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.vendor-result-head strong {
  color: var(--field-dark);
  font-size: 1rem;
}

.vendor-result-head span {
  border-radius: 999px;
  background: var(--lime);
  padding: 4px 8px;
  color: var(--field-dark);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.vendor-result dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.vendor-result dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(140, 200, 11, 0.16);
  padding-top: 6px;
}

.vendor-result dt,
.vendor-result dd {
  margin: 0;
}

.vendor-result dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.vendor-result dd {
  color: var(--field-dark);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: right;
}

.warning-card {
  margin-top: 12px;
  border-left: 5px solid var(--orange);
  background:
    linear-gradient(90deg, rgba(255, 106, 0, 0.08), rgba(255, 253, 246, 0.96));
  color: var(--muted);
  font-weight: 740;
  line-height: 1.42;
}

.recommendation-panel > .warning-card {
  margin: 0 18px 18px;
}

.site-footer {
  display: grid;
  gap: 6px;
  margin-top: 22px;
  padding: 16px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.4;
}

.site-footer a {
  color: var(--field-dark);
  font-weight: 950;
}

@media (max-width: 1050px) {
  .planner-grid,
  .recommendation-layout,
  .vendor-grid,
  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .vendor-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .site-nav,
  .topbar,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-intro,
  .tool-info-bar {
    grid-template-columns: 1fr;
  }

  .quick-menu {
    display: block;
  }

  .app-shell {
    width: min(100% - 22px, 1420px);
    padding-top: 14px;
  }

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

  .result-card.featured {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .results-grid,
  .mix-row,
  .chart-head,
  .chart-row,
  .vendor-card {
    grid-template-columns: 1fr;
  }

  .chart-values {
    justify-items: start;
    text-align: left;
  }

  .unit-input {
    grid-template-columns: minmax(0, 1fr) minmax(54px, auto);
  }
}
