.simulator-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 70px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumbs a {
  color: var(--brand);
  font-weight: 700;
}

.simulator-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  gap: 52px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 20px 0 34px;
}

.simulator-heading h1 {
  margin: 0;
  color: var(--brand-dark);
  font-size: clamp(40px, 5vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.simulator-heading > div > p:not(.section-kicker) {
  max-width: 690px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.simulator-heading__actions {
  display: grid;
  gap: 10px;
}

.cow {
  min-height: 88px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  border: 1px solid #b9cec2;
  border-radius: 8px;
  background: var(--surface);
  padding: 14px 16px;
}

.cow i {
  grid-row: 1 / 3;
  align-self: stretch;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--brand);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cow b,
.cow small {
  min-width: 0;
  margin-left: 14px;
}

.cow b {
  align-self: end;
  color: var(--ink);
  font-size: 15px;
}

.cow small {
  align-self: start;
  color: var(--muted);
}

.tabs {
  position: sticky;
  top: 83px;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(20, 52, 43, 0.06);
  padding: 6px;
  backdrop-filter: blur(12px);
}

.tabs button {
  min-width: 0;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  padding: 8px 12px;
}

.tabs button span {
  width: 23px;
  height: 23px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #c7d4cd;
  border-radius: 50%;
  font-size: 11px;
}

.tabs button:hover {
  background: var(--surface-soft);
  color: var(--brand);
}

.tabs button.active {
  background: var(--brand);
  color: #fff;
}

.tabs button.active span {
  border-color: rgba(255, 255, 255, 0.4);
}

.tab {
  display: none;
}

.tab.active {
  display: block;
}

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

.card {
  min-width: 0;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(20, 52, 43, 0.05);
  padding: 24px;
}

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

.title h2,
.learn-head h2,
.runbar h2 {
  margin: 3px 0 0;
  color: var(--brand-dark);
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: 0;
}

.title p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
}

.title em,
.runbar em,
.cropcard em {
  color: #6c7d75;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.title > span {
  color: #a3b3aa;
  font-size: 27px;
  font-weight: 900;
}

label {
  display: block;
  margin: 12px 0;
  color: #53685f;
  font-size: 12px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 42px;
  margin-top: 6px;
  border: 1px solid #c5d2ca;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

input:hover,
select:hover {
  border-color: #95aea0;
}

input:focus,
select:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(13, 80, 62, 0.12);
}

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

.explain,
.tip,
.area-check,
.daydetail {
  border-left: 3px solid #9bb9a8;
  border-radius: 4px;
  background: #edf4ef;
  color: #4d645a;
  padding: 12px 14px;
}

.tip {
  margin: 14px 0 0;
}

.primary,
.run {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 10px 16px;
}

.primary:hover,
.run:hover {
  background: var(--brand-dark);
}

.next {
  display: block;
  margin: 20px 0 0 auto;
}

.landmap {
  min-height: 150px;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #e6ebe7;
  overflow: hidden;
}

.land {
  min-width: 2px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  padding: 10px;
  text-align: center;
}

.land.pasture {
  background: #4d9164;
}

.land.arable {
  background: repeating-linear-gradient(100deg, #8f704e 0, #8f704e 12px, #9f8060 12px, #9f8060 24px);
}

.legend {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 2fr 0.7fr 1.15fr 0.9fr auto auto;
  gap: 10px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.field-row .repeat {
  grid-column: 6;
}

.field-row .remove {
  grid-column: 7;
}

.field-row:first-child {
  margin-top: 8px;
}

.field-row label {
  margin: 0;
}

.remove,
.repeat {
  width: 40px;
  height: 42px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
}

.remove {
  background: #fae9e7;
  color: var(--danger);
}

.repeat {
  background: var(--brand-soft);
  color: var(--brand);
}

.crop-meta,
.mix-check {
  grid-column: 1 / -1;
  border-radius: 5px;
  padding: 9px 11px;
  font-size: 12px;
}

.crop-meta {
  background: #f0f4f1;
  color: var(--muted);
}

.mix-check.good {
  background: #e4f3e9;
  color: #236742;
}

.mix-check.warn {
  background: #fff3d8;
  color: #765715;
}

.mix-check.bad,
.area-check.bad {
  background: #fdebea;
  color: #8b3530;
}

.area-check {
  margin: 14px 0 26px;
}

.card > h3 {
  margin: 28px 0 10px;
  color: var(--brand-dark);
  font-size: 18px;
}

.season-head {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-left: 150px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.field-structure {
  margin-top: 5px;
}

.plot-line {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}

.plot-line > b small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}

.plot-track {
  position: relative;
  height: 42px;
  border-radius: 5px;
  background: repeating-linear-gradient(90deg, #edf1ed 0, #edf1ed calc(20% - 1px), #d5ddd7 calc(20% - 1px), #d5ddd7 20%);
  overflow: hidden;
}

.plot-track.multi {
  overflow: hidden;
}

.plot-crop {
  position: absolute;
  top: 3px;
  height: 36px;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  overflow: hidden;
  padding: 3px 7px;
  white-space: nowrap;
}

.plot-crop small {
  display: block;
}

.plot-crop.component {
  height: 25px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 7px;
}

.plot-crop.component b {
  overflow: hidden;
  text-overflow: ellipsis;
}

.plot-crop.component small {
  display: inline;
  opacity: 0.9;
  font-size: 10px;
}

.regrowth-info {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
  color: #52675d;
  font-size: 11px;
}

.regrowth-info span {
  border-radius: 4px;
  background: #edf4ef;
  padding: 3px 7px;
}

.runbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: var(--brand-dark);
  color: #fff;
  padding: 22px 24px;
}

.runbar em {
  color: #e5bd5c;
}

.runbar h2 {
  color: #fff;
}

.run {
  flex: 0 0 auto;
  background: var(--accent);
  color: #18372d;
}

.run:hover {
  background: #e4bb5a;
}

.empty {
  min-height: 210px;
  display: grid;
  place-items: center;
  border: 1px dashed #bdccc3;
  border-radius: 8px;
  color: var(--muted);
  padding: 30px;
  text-align: center;
}

.hidden {
  display: none !important;
}

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

.score {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.score b,
.score small {
  display: block;
}

.score b {
  margin-top: 5px;
  color: var(--brand-dark);
  font-size: 22px;
}

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

.bigcow {
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
  padding: 8px 11px;
}

.healthbar {
  height: 14px;
  margin: 18px 0;
  border-radius: 20px;
  background: #e5ebe7;
  overflow: hidden;
}

.healthbar i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--danger), var(--warning), var(--success));
}

.timeline {
  height: 240px;
  display: flex;
  align-items: end;
  gap: 1px;
  border-bottom: 1px solid #9cad9f;
}

.day {
  min-width: 2px;
  flex: 1;
  cursor: pointer;
}

.day.good,
.key .good {
  background: #4eaa70;
}

.day.low,
.key .low {
  background: var(--warning);
}

.day.danger,
.key .danger {
  background: var(--danger);
}

.key {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.key i {
  width: 10px;
  height: 10px;
  display: inline-block;
  margin: 0 4px 0 9px;
  border-radius: 2px;
}

.key i:first-child {
  margin-left: 0;
}

.daydetail {
  margin-top: 12px;
}

.calendar-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 12px;
  margin: 10px 0;
}

.cal-track {
  position: relative;
  height: 26px;
  border-radius: 5px;
  background: #edf2ee;
}

.cal-bar {
  position: absolute;
  height: 100%;
  border-radius: 5px;
  background: #5d9869;
  color: #fff;
  font-size: 11px;
  overflow: hidden;
  padding: 4px 7px;
  white-space: nowrap;
}

.explain-step {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.explain-step:last-child {
  border-bottom: 0;
}

.explain-step p {
  margin: 6px 0 0;
  color: var(--muted);
}

.learn-head {
  margin: 26px 0 22px;
}

.learn-head h2 {
  font-size: clamp(30px, 4vw, 42px);
}

.learn-head > p:last-child {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
}

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

.cropcard {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.cropcard h3 {
  margin: 5px 0 14px;
  color: var(--brand-dark);
  font-size: 20px;
}

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

.fact {
  min-width: 0;
  border-left: 2px solid #aac1b4;
  background: #f0f5f2;
  padding: 8px 9px;
}

.fact b,
.fact small {
  display: block;
}

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

.safe {
  border-left: 3px solid var(--warning);
  color: #6c5520;
  font-size: 12px;
  padding-left: 9px;
}

.partners {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: 12px;
}

.partners > b,
.partners span {
  display: block;
}

.partners span {
  margin-top: 7px;
  color: var(--muted);
}

.lesson {
  margin-top: 16px;
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.formula-grid > div {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px;
}

.formula-grid code {
  display: block;
  margin: 8px 0;
  background: #eef4ef;
  color: var(--brand);
  font-family: Consolas, monospace;
  overflow-wrap: anywhere;
  padding: 8px;
}

.formula-grid p {
  margin: 0;
  color: var(--muted);
}

.warning {
  margin-top: 16px;
  border-left: 4px solid var(--warning);
  background: #fff2dc;
  padding: 13px 14px;
}

.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.sources a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 980px) {
  .simulator-heading {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .simulator-heading__actions {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
  }

  .cols,
  .cropcards {
    grid-template-columns: 1fr;
  }

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

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

  .field-row .repeat,
  .field-row .remove {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .simulator-main {
    width: min(100% - 28px, 1180px);
    padding-top: 16px;
  }

  .simulator-heading {
    padding: 10px 0 26px;
  }

  .simulator-heading h1 {
    font-size: clamp(38px, 12vw, 50px);
  }

  .simulator-heading__actions {
    grid-template-columns: 1fr;
  }

  .tabs {
    top: 100px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tabs button {
    min-width: 0;
    font-size: 12px;
  }

  .card {
    padding: 18px;
  }

  .title,
  .runbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .title--action .primary,
  .run {
    width: 100%;
  }

  .form2,
  .scores,
  .formula-grid {
    grid-template-columns: 1fr;
  }

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

  .field-row .remove,
  .field-row .repeat {
    width: 100%;
  }

  .season-head {
    margin-left: 0;
  }

  .plot-line,
  .calendar-row {
    grid-template-columns: 1fr;
  }

  .plot-track {
    height: 50px;
  }

  .key {
    white-space: normal;
  }
}

@media (max-width: 430px) {
  .cow {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .next,
  .simulator-heading__actions .button {
    width: 100%;
  }

  .title h2,
  .runbar h2 {
    font-size: 22px;
  }
}
