.tool-hero--modular-cars {
  background: radial-gradient(ellipse at 82% 40%, #674c31, #323223 46%, #1b231d 82%);
}

.car-tabs, .car-columns, .car-fields, .car-module-list, .car-part-list {
  display: grid;
  gap: .75rem;
}

.car-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 1rem 0; }
.car-columns { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
.car-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: .65rem 0; }
.car-panel {
  min-width: 0;
  padding: clamp(.75rem, 2vw, 1.25rem);
  border: 1px solid #465747;
  border-radius: .75rem;
  background: #19241d;
  scroll-margin-top: 6rem;
}
.car-panel + .car-panel, .car-columns + .car-panel { margin-top: .75rem; }
.car-columns > .car-panel { margin: 0; }
.car-panel h2, .car-panel h3, .car-part h3 { color: #f0f1e5; margin: 0 0 .45rem; }
.car-panel p { color: #c6d1c3; margin: .55rem 0; }
.car-tabs a, .car-primary, .car-actions button, .car-module-list button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 44px;
  padding: .35rem .6rem;
  border: 1px solid #66755e;
  border-radius: .45rem;
  color: #edf4e8;
  background: #29382b;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.car-tabs a[aria-current], .car-actions button[aria-pressed="true"], .car-primary {
  background: #d5cd9f;
  color: #222619;
  border-color: #d5cd9f;
}
.car-tabs img, .car-fact img { width: clamp(29px, 8vw, 46px); height: auto; flex: none; }
.car-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.car-actions [data-car-size] { justify-content: center; min-width: 44px; }
.car-presets button { font-size: .87rem; }
.car-track {
  margin: .75rem 0;
  padding: .55rem;
  border: 1px solid #6d654b;
  border-radius: .6rem;
  background: linear-gradient(#202922, #19241d 70%, #292e24);
}
.car-track > div {
  display: flex;
  justify-content: space-between;
  position: relative;
  gap: .5rem;
  margin-bottom: .45rem;
  color: #e8d6a5;
  font-size: .86rem;
}
.car-track > div::after {
  content: '';
  flex: 1;
  align-self: center;
  order: -1;
  height: 1px;
  background: #817856;
}
.car-track > div > span:first-child { order: -2; }
#car-rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: .36rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
#car-rail[data-capacity="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#car-rail[data-capacity="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.car-module, .car-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  min-width: 0;
  padding: .4rem .28rem;
  border-radius: .45rem;
  border: 1px solid #60745e;
  background: linear-gradient(#303e30, #253329);
  text-align: center;
  overflow-wrap: anywhere;
}
.car-module { padding: 0; }
.car-module[data-span="2"] { grid-column: span 2; }
.car-module button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: .3rem;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 74px;
  padding: .4rem .12rem;
  border: 1px solid transparent;
  border-radius: .4rem;
  background: transparent;
  color: #f2f2e6;
  font: inherit;
  font-size: clamp(.69rem, 2.7vw, .9rem);
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.car-module button[aria-pressed="true"] { border-color: #e2d3a3; background: #4b502e; color: #fff3cb; }
.car-module img { width: min(100%, 88px); height: auto; filter: drop-shadow(0 4px 4px #121813); }
.car-slot { justify-content: center; min-height: 7.5rem; border-style: dashed; color: #c0c9bb; background: #243126; }
#car-module-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: .65rem;
  padding: .45rem .65rem;
  border: 1px solid #54624b;
  border-radius: .45rem;
  background: #27352a;
}
#car-module-editor a { grid-column: 1 / -1; color: #e8dec4; }
#car-module-editor label { display: flex; align-items: center; gap: .35rem; min-height: 44px; }
#car-module-editor input { accent-color: #cacf9d; }
.car-module-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: .24rem; }
.car-module-controls button {
  min-width: 44px;
  min-height: 44px;
  padding: .2rem;
  border-radius: .35rem;
  border: 1px solid #75836c;
  color: #edf2e4;
  background: #2b3b2e;
  font: inherit;
  cursor: pointer;
}
.car-module-controls button:disabled { opacity: .45; cursor: default; }
.car-usage, .car-part dd, .car-power dd, .car-cost strong { font-variant-numeric: tabular-nums; }
.car-usage { font-weight: 750; }
.car-panel .car-status { color: #e2ebd9; }
.car-panel .car-status:empty { display: none; }
.car-panel .car-status[data-level="attention"], .car-panel .car-status[data-level="invalid"],
.car-power [data-low="true"] { color: #ffce9e; }
.car-panel .car-status[data-level="good"] { color: #cde4aa; }
.car-module-list, .car-part-list, .car-cost { padding: 0; list-style: none; margin: .7rem 0; }
.car-module-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.car-choice {
  display: grid;
  grid-template-columns: minmax(42px, .32fr) minmax(0, 1fr);
  align-items: center;
  gap: .4rem .65rem;
  padding: .5rem;
  border: 1px solid #526450;
  border-radius: .5rem;
  background: #26352a;
}
.car-choice img { width: 100%; height: auto; }
.car-choice a, .car-part a, .car-walkthrough a, .car-related a, .car-cost a, .car-bench a { color: #e8dec4; }
.car-choice a, .car-part a, .car-cost a { overflow-wrap: anywhere; }
.car-choice small { display: block; color: #bdc9b7; }
.car-choice button { grid-column: 2; width: fit-content; }
.car-panel label, .car-fields label { display: grid; gap: .25rem; min-width: 0; }
.car-panel input:not([type="checkbox"]), .car-fields input, .car-fields select {
  display: block;
  width: 100%;
  min-height: 44px;
  min-width: 0;
  padding: .42rem .55rem;
  border: 1px solid #6b7763;
  border-radius: .4rem;
  color: #f1f5ec;
  background: #131e17;
  font: inherit;
}
#car-find { max-width: 29rem; }
.car-counters > div, .car-part-name, .car-fact { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.car-counters label { flex: 1; }
.car-counters img { width: clamp(37px, 11vw, 68px); height: auto; }
.car-part-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.car-part {
  min-width: 0;
  padding: .75rem;
  border: 1px solid #526450;
  border-radius: .6rem;
  background: #243329;
}
.car-part-name img { width: clamp(43px, 12vw, 62px); height: auto; }
.car-part-name a { font-size: .85rem; }
.car-part dl, .car-power { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; margin: .3rem 0; }
.car-part dl div, .car-power div { padding: .4rem .55rem; border-radius: .4rem; background: #16271e; }
.car-part dt, .car-power dt { font-size: .85rem; color: #d3dfcb; }
.car-part dd, .car-power dd { margin: 0; color: #e5edc3; font-weight: 750; font-size: 1.2rem; }
.car-cost li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .55rem;
  margin-bottom: .4rem;
  padding: .4rem;
  border: 1px solid #526450;
  border-radius: .4rem;
  background: #27352b;
}
.car-cost strong { color: #e5edc3; }
.car-related { display: flex; flex-wrap: wrap; gap: .65rem 1rem; align-items: center; padding: 0; margin: .8rem 0; list-style: none; }
.car-walkthrough { margin-top: .8rem; }
.car-walkthrough ol { padding-inline-start: 1.25rem; margin-bottom: .1rem; }
.car-walkthrough li + li { margin-top: .7rem; }
.car-panel :focus-visible, .car-tabs :focus-visible, .car-part :focus-visible { outline: 2px solid #f4d093; outline-offset: 2px; }
[data-car-controls][hidden], [data-car-controls] [hidden] { display: none !important; }

@media (max-width: 850px) {
  .car-module-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 690px) {
  .car-columns, .car-part-list { grid-template-columns: minmax(0, 1fr); }
  .car-tabs { gap: .35rem; }
  .car-tabs a { flex-direction: column; justify-content: center; text-align: center; font-size: .82rem; }
}
@media (max-width: 390px) {
  .car-module-list { grid-template-columns: minmax(0, 1fr); }
  .car-choice { grid-template-columns: 60px minmax(0, 1fr) auto; }
  .car-choice button { grid-column: 3; }
  .car-counters > div { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: no-preference) {
  .car-module img { animation: car-arrive 200ms ease-out both; }
  .car-track > div span:first-child { animation: car-indicator 4s ease-in-out infinite; }
  .car-tabs a, .car-actions button { transition: border-color .18s, background-color .18s; }
  @keyframes car-arrive { from { opacity: .45; translate: 0 5px; } }
  @keyframes car-indicator { 50% { color: #fff1b9; } }
}
