:root {
  --ink: #101a38;
  --navy: #0b3fc1;
  --paper: #f4f7ff;
  --card: #ffffff;
  --line: #cfd8ef;
  --red: #ed1c24;
  --amber: #ffffff;
  --teal: #1554d1;
  --muted: #64708e;
  --shadow: 0 18px 50px rgba(11, 63, 193, 0.1);
}

.svg-sprite { display:none;
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .72;
  transition: opacity .16s ease, transform .16s ease;
}

.sidebar nav button:hover .nav-icon,
.sidebar nav button.active .nav-icon,
.nav-group.has-active > .nav-group-toggle .nav-icon {
  opacity: 1;
}

.sidebar nav button:hover .nav-icon {
  transform: translateX(1px);
}

.brand-mark img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 7px;
}

.auth-screen {
  background:
    linear-gradient(100deg, rgba(3, 12, 34, .95) 0%, rgba(5, 23, 67, .82) 42%, rgba(4, 14, 36, .38) 100%),
    url("./home-track-bg-v1.jpg") center / cover no-repeat;
}

.sidebar {
  background: linear-gradient(180deg, #092f91, #0b3fc1);
}

.nav-group {
  display: flex;
  flex-direction: column;
}

.nav-group-toggle {
  width: 100%;
}

.nav-group-toggle b {
  margin-left: auto;
  color: rgba(255,255,255,.48);
  font-size: 14px;
  line-height: 1;
  transition: transform .2s ease;
}

.nav-group.open .nav-group-toggle b {
  transform: rotate(180deg);
}

.nav-group.has-active > .nav-group-toggle {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.nav-group.has-active > .nav-group-toggle i {
  color: #fff;
}

.nav-submenu {
  display: flex;
  max-height: 0;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 0 18px;
  overflow: hidden;
  opacity: 0;
  transition: max-height .22s ease, opacity .18s ease, padding .22s ease;
}

.nav-group.open .nav-submenu {
  max-height: 150px;
  padding-top: 4px;
  padding-bottom: 7px;
  opacity: 1;
}

.sidebar .nav-submenu button {
  min-height: 34px;
  padding: 8px 10px;
  font-size: 11px;
}

.sidebar .nav-submenu .nav-icon {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
}

.sidebar .nav-submenu button i {
  font-size: 8px;
}

.mobile-nav-layer {
  display: none;
}

.primary {
  border-color: #0b3fc1;
  background: #0b3fc1;
}

.primary:hover {
  background: #ed1c24;
  border-color: #ed1c24;
}

.page-actions,
.record-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.record-actions {
  flex-direction: row !important;
  justify-content: flex-end;
}

.edit-button {
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid rgba(11,63,193,.28);
  background: #edf3ff;
  color: var(--navy);
  font-size: 10px;
  font-weight: 800;
}

.record-actions .danger {
  min-height: 32px;
  padding: 7px 10px;
}

.record-card.garage-card {
  padding: 0;
  overflow: hidden;
}

.garage-card-body {
  display: flex;
  min-height: 235px;
  flex-direction: column;
  padding: 21px;
}

.garage-kit-image {
  height: 210px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f2f5fc);
}

.garage-kit-meta {
  display: grid;
  gap: 3px;
  margin: 8px 0 12px;
  padding: 9px 10px;
  border-left: 3px solid var(--red);
  background: #f2f5fc;
}

.garage-kit-meta b {
  color: var(--navy);
  font-size: 10px;
  letter-spacing: .05em;
}

.garage-kit-meta span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.garage-card-body > p {
  margin-bottom: 0;
}

.garage-card-body > footer {
  margin-top: auto;
}

.dialog-form label > small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.4;
}

.stat-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 20px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  text-align: left;
  appearance: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.stat-card:last-child { border-right:0; }
.stat-card span { font-size:10px; color:var(--muted); }
.stat-card b { font-size:34px; color:var(--navy); line-height:1.2; }
.stat-card small { font-size:10px; color:var(--muted); }
.stat-card::after { content:"›"; position:absolute; right:13px; bottom:12px; color:var(--navy); font-size:20px; font-weight:900; opacity:.22; transition:opacity .16s ease, transform .16s ease; }
.stat-card:hover,
.stat-card:focus-visible { z-index:1; background:#f7f9ff; box-shadow:inset 0 -4px 0 var(--navy); outline:0; transform:translateY(-2px); }
.stat-card:hover::after,
.stat-card:focus-visible::after { opacity:1; transform:translateX(2px); }
.stat-card:active { transform:translateY(0); }
.stat-card.accent:hover,
.stat-card.accent:focus-visible { background:#d8171e; box-shadow:inset 0 -4px 0 #fff; }
.stat-card.accent::after { color:#fff; }

.stat-grid .accent,
.sidebar-user > .user-avatar-button {
  background: #ed1c24;
  color: #ffffff;
  font-size: 14px;
}

@media (max-width: 1150px) and (min-width: 761px) {
  .stat-card:nth-child(3n) { border-right:0; }
  .stat-card:nth-child(-n+3) { border-bottom:1px solid var(--line); }
}

.user-avatar-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background-position: center;
  background-size: cover;
  color: #ffffff;
  font-weight: 900;
}

.feature-card.dark,
.track-verdict,
.tuning-order {
  background: #0b3fc1;
}

.track-verdict b {
  color: #ffffff;
}

#page-dashboard > .page-head {
  position: relative;
  min-height: 290px;
  padding: 38px 42px;
  overflow: hidden;
  background:
    linear-gradient(95deg, rgba(3, 12, 34, .96) 0%, rgba(4, 23, 68, .82) 45%, rgba(4, 17, 46, .18) 100%),
    url("./home-track-bg-v1.jpg") center / cover no-repeat;
  color: #ffffff;
  box-shadow: 0 22px 55px rgba(5, 22, 65, .24);
}

#page-dashboard > .page-head .eyebrow {
  color: #ff4249;
}

#page-dashboard > .page-head h2 {
  max-width: 520px;
  font-size: clamp(44px, 6vw, 78px);
  line-height: .98;
  text-shadow: 0 4px 24px rgba(0, 0, 0, .28);
}

#page-dashboard > .page-head h2 em {
  color: #ffffff;
}

#page-dashboard > .page-head .primary {
  align-self: flex-end;
  border-color: var(--red);
  background: var(--red);
  box-shadow: 0 12px 28px rgba(237, 28, 36, .34);
}

.next-step-card,
.install-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 24px 26px;
  border: 1px solid #b8c9ef;
  background: linear-gradient(110deg, #ffffff, #edf3ff);
  box-shadow: var(--shadow);
}

.next-step-card span,
.install-card span,
.guide-hero > div > span {
  color: var(--red);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
}

.next-step-card h3,
.install-card h3 {
  margin: 5px 0;
  font-size: 20px;
}

.next-step-card p,
.install-card p,
.guide-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.next-step-card button,
.install-card button {
  flex: 0 0 auto;
}

.guide-hero {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 30px;
  align-items: center;
  margin-bottom: 18px;
  padding: 34px;
  background: var(--navy);
  color: #ffffff;
}

.guide-hero h3 {
  margin: 10px 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.15;
}

.guide-hero p {
  color: rgba(255, 255, 255, .72);
}

.guide-progress {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.guide-progress b {
  font-size: 44px;
  line-height: 1;
}

.guide-progress span {
  margin-top: 5px;
  color: rgba(255, 255, 255, .7);
  font-size: 10px;
}

.guide-progress i {
  height: 5px;
  margin-top: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, .2);
}

.guide-progress em {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
  transition: width .25s ease;
}

.guide-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.guide-steps article {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  min-height: 205px;
  padding: 25px;
  border: 1px solid var(--line);
  background: var(--card);
}

.guide-steps article > span {
  color: #b9c4df;
  font-size: 28px;
  font-weight: 900;
}

.guide-steps small {
  color: var(--red);
  font-size: 9px;
  font-weight: 900;
}

.guide-steps h3 {
  margin: 5px 0 8px;
  font-size: 20px;
}

.guide-steps p {
  min-height: 44px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.guide-steps article.done {
  border-color: #8bb1ff;
  background: #f3f7ff;
}

.guide-steps article.done > span {
  color: var(--navy);
}

.guide-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 42px 0 16px;
}

.guide-section-head h3 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
}

.guide-section-head p:not(.eyebrow) {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.guide-section-head > a {
  flex: 0 0 auto;
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
}

.basics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.basics-grid article {
  min-height: 190px;
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.basics-grid article > b {
  float: right;
  color: #dbe3f4;
  font-size: 25px;
}

.basics-grid article > span {
  display: block;
  color: var(--red);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
}

.basics-grid h4 {
  margin: 28px 0 7px;
  font-size: 18px;
}

.basics-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

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

.chassis-guide-grid article {
  display: flex;
  min-height: 370px;
  flex-direction: column;
  padding: 23px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--chassis);
  background: var(--card);
}

.chassis-guide-grid header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.chassis-guide-grid header strong {
  color: var(--chassis);
  font-size: 30px;
}

.chassis-guide-grid header span,
.chassis-guide-grid p,
.chassis-guide-grid dd {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.chassis-guide-grid h4 {
  margin: 28px 0 8px;
  font-size: 18px;
}

.chassis-guide-grid dl {
  display: grid;
  gap: 7px;
  margin: 12px 0 20px;
}

.chassis-guide-grid dl div {
  display: grid;
  grid-template-columns: 44px 1fr;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.chassis-guide-grid dt {
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
}

.chassis-guide-grid dd {
  margin: 0;
}

.chassis-guide-grid button {
  width: 100%;
  margin-top: auto;
}

.beginner-rule {
  display: grid;
  grid-template-columns: 170px 1fr auto;
  align-items: center;
  gap: 24px;
  margin-top: 12px;
  padding: 22px 24px;
  background: var(--navy);
  color: #fff;
}

.beginner-rule > b {
  color: #ff4249;
  font-size: 16px;
}

.beginner-rule p {
  margin: 0;
  color: rgba(255,255,255,.74);
  font-size: 11px;
  line-height: 1.65;
}

.beginner-rule p strong { color: #fff; }
.beginner-rule .primary { border-color: var(--red); background: var(--red); }

.catalog-tabs {
  display: flex;
  width: fit-content;
  margin-bottom: 14px;
  border: 1px solid var(--navy);
}

.catalog-tabs button {
  min-width: 130px;
  padding: 11px 18px;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-size: 11px;
  font-weight: 900;
}

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

.catalog-panel { display: none; }
.catalog-panel.active { display: block; }

.kit-advisor {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(520px, 1.6fr);
  align-items: end;
  gap: 32px;
  padding: 26px;
  background: linear-gradient(115deg, #071b53, var(--navy));
  color: #fff;
}

.kit-advisor h3 { margin: 4px 0 7px; font-size: 25px; }
.kit-advisor p:not(.eyebrow) { margin: 0; color: rgba(255,255,255,.68); font-size: 11px; line-height: 1.55; }
.kits-toolbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kits-toolbar label { color: rgba(255,255,255,.72); }
.kits-toolbar select { border-color: rgba(255,255,255,.24); background: #fff; color: var(--ink); }
.catalog-note { margin: 12px 0; color: var(--muted); font-size: 10px; }
.catalog-image { position:relative; display:block; overflow:hidden; background:#fff; color:inherit; text-decoration:none; }
.catalog-image img { display:block; width:100%; height:100%; object-fit:contain; transition:transform .2s ease; }
.catalog-image:hover img { transform:scale(1.025); }
.catalog-image small { position:absolute; right:7px; bottom:7px; padding:4px 6px; border:1px solid rgba(11,63,193,.12); background:rgba(255,255,255,.9); color:#4d5f86; font-size:7px; font-weight:800; letter-spacing:.04em; }
.catalog-image.image-missing { min-height:120px; background:linear-gradient(135deg,#f4f6fb,#e8edf8); }
.catalog-image.image-missing::before { content:"商品图暂不可用"; position:absolute; inset:0; display:grid; place-items:center; color:var(--muted); font-size:10px; font-weight:800; }

.custom-kit-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 150px 120px auto;
  align-items: end;
  gap: 10px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-top: 0;
  background: #ffffff;
}

.custom-kit-form > div {
  display: flex;
  align-self: center;
  flex-direction: column;
  gap: 4px;
}

.custom-kit-form > div b { font-size: 14px; }
.custom-kit-form > div span,
.custom-kit-form > small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.custom-kit-form > button { min-height: 40px; }
.custom-kit-form > small { grid-column: 2 / -1; }

.kit-catalog { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kit-card { display:grid; grid-template-columns:minmax(190px, .72fr) minmax(0, 1fr); min-height:470px; overflow:hidden; border:1px solid var(--line); background:var(--card); box-shadow:var(--shadow); }
.kit-visual { position:relative; display:flex; flex-direction:column; gap:12px; padding:14px; background:linear-gradient(180deg,#fff 0%,#f3f6fc 100%); border-right:4px solid var(--kit-color); }
.kit-image { flex:1; min-height:300px; border:1px solid #edf0f6; }
.kit-identity { display:flex; align-items:flex-end; justify-content:space-between; gap:8px; padding-top:9px; border-top:1px solid var(--line); }
.kit-identity span { color:var(--kit-color); font-size:34px; font-weight:900; letter-spacing:-.06em; }
.kit-identity b { color:var(--navy); font-size:10px; }
.kit-visual > em { position:absolute; top:0; right:0; padding:7px 9px; background:var(--red); font-size:9px; font-style:normal; font-weight:900; }
.kit-copy { display:flex; flex-direction:column; padding:22px; }
.kit-copy > header { display:flex; justify-content:space-between; gap:10px; color:var(--red); font-size:9px; font-weight:900; letter-spacing:.08em; }
.kit-copy > header strong { color:var(--kit-color); }
.kit-copy h3 { margin:13px 0 3px; font-size:20px; line-height:1.25; }
.kit-copy > small { color:var(--muted); font-size:9px; }
.kit-copy > p { margin:13px 0 8px; font-size:11px; line-height:1.6; }
.kit-copy ul { margin:0 0 10px; padding-left:17px; color:var(--muted); font-size:10px; line-height:1.65; }
.kit-tradeoff,.kit-included { margin-bottom:9px; padding:9px 10px; background:#f2f5fc; color:var(--muted); font-size:9px; line-height:1.5; }
.kit-tradeoff b { color:var(--ink); }
.kit-upgrades { display:flex; flex-wrap:wrap; align-items:center; gap:5px; margin-top:auto; }
.kit-upgrades > b { width:100%; margin-bottom:3px; color:var(--muted); font-size:9px; }
.kit-upgrades button { padding:5px 7px; border:1px solid var(--line); background:#fff; color:var(--navy); font-size:8px; font-weight:800; }
.kit-upgrades button i { display:inline-grid; width:14px; height:14px; place-items:center; margin-right:3px; border-radius:50%; background:var(--navy); color:#fff; font-style:normal; }
.kit-copy footer { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:15px; padding-top:13px; border-top:1px solid var(--line); }
.kit-copy footer a { color:var(--navy); font-size:10px; font-weight:800; }
.kit-card.custom-kit { border-color:#9ab5ef; }
.kit-remove { padding:8px 4px; font-weight:800; }
.part-card { min-height:340px; padding:0; overflow:hidden; }
.part-image { height:176px; border-bottom:1px solid var(--line); }
.part-card > header { padding:14px 16px 0; }
.part-card > h3 { margin:12px 16px 6px; }
.part-card > p { margin:0 16px; }
.part-card > p + p { margin-top:5px; }
.part-card > footer { padding:14px 16px 16px; }
.config-kit { grid-column:1 / -1; min-height:95px!important; background:#edf3ff; border-left:4px solid var(--navy); }
.config-kit .text-button { margin:0; padding:0; font-size:9px; }

.run-card {
  grid-template-columns: 100px 1fr 110px 110px auto;
  align-items: start;
}

.run-delete {
  grid-column: 5;
  grid-row: 1;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(237,28,36,.35);
  background: #fff5f5;
  font-weight: 800;
}

.step-status {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 5px 7px;
  background: #edf1f9;
  color: var(--muted);
  font-size: 9px;
}

.done .step-status {
  background: var(--navy);
  color: #ffffff;
}

.welcome-modal {
  width: min(520px, calc(100% - 24px));
  border-radius: 14px;
}

.welcome-content {
  position: relative;
  padding: 34px;
}

.welcome-content h2 {
  margin: 7px 0 24px;
  font-size: 32px;
}

.welcome-close {
  position: absolute;
  top: 17px;
  right: 17px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 25px;
}

.welcome-content ol {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: welcome;
}

.welcome-content li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 14px 16px;
  background: #f3f6fc;
  counter-increment: welcome;
}

.welcome-content li b::before {
  content: "0" counter(welcome) "  ";
  color: var(--red);
}

.welcome-content li span {
  color: var(--muted);
  font-size: 10px;
}

.welcome-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(280px, .75fr) minmax(360px, 1.25fr);
  gap: 16px;
  align-items: start;
}

.profile-card,
.profile-password {
  padding: 30px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.profile-card {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.profile-avatar-preview {
  width: 124px;
  height: 124px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 7px solid #ffffff;
  border-radius: 50%;
  background: var(--red) center / cover no-repeat;
  color: #ffffff;
  font-size: 40px;
  font-weight: 900;
  box-shadow: 0 0 0 2px var(--navy), 0 18px 42px rgba(11, 63, 193, .18);
}

.profile-avatar-preview.has-image,
.user-avatar-button.has-image {
  color: transparent;
}

.profile-card h3,
.profile-password h3 {
  margin: 5px 0;
  font-size: 27px;
}

.profile-actions {
  display: flex;
  gap: 8px;
}

.profile-card > small {
  max-width: 330px;
  color: var(--muted);
  line-height: 1.5;
}

.profile-password {
  display: grid;
  gap: 16px;
}

.profile-password > p {
  margin-top: -8px;
}

.detail-button,
.setup-history-row button,
.detail-section button {
  border: 0;
  background: none;
  color: var(--navy);
  font-size: 10px;
  font-weight: 800;
}

.car-detail-modal {
  width: min(920px, calc(100% - 32px));
}

.car-detail-shell {
  gap: 20px;
}

.car-detail-summary,
.setup-heading,
.detail-section-title,
.setup-history-row,
.detail-run-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.car-detail-summary {
  padding: 18px;
  color: #fff;
  background: var(--navy);
}

.car-detail-summary > div > span {
  display: inline-grid;
  min-width: 46px;
  min-height: 34px;
  place-items: center;
  margin-bottom: 10px;
  background: var(--red);
  font-weight: 900;
}

.car-detail-summary h4,
.car-detail-summary p,
.current-setup-card h4,
.current-setup-card p,
.detail-section h4 {
  margin: 0;
}

.car-detail-summary p,
.setup-heading small,
.detail-section-title small,
.setup-history-row small,
.detail-run-row small {
  color: var(--muted);
  font-size: 10px;
}

.car-detail-summary p {
  margin-top: 5px;
  color: rgba(255,255,255,.65);
}

.current-setup-card,
.setup-empty,
.detail-section {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--card);
}

.current-setup-card {
  box-shadow: inset 4px 0 0 var(--red);
}

.setup-heading span {
  color: var(--red);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
}

.setup-heading h4 {
  margin: 3px 0;
  font-size: 22px;
}

.setup-spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 16px;
  background: var(--line);
  border: 1px solid var(--line);
}

.setup-spec-grid > div {
  min-height: 72px;
  padding: 12px;
  background: #fff;
}

.setup-spec-grid span,
.setup-spec-grid b {
  display: block;
}

.setup-spec-grid span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
}

.setup-spec-grid b {
  font-size: 11px;
  line-height: 1.45;
}

.detail-section-title {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.setup-history-row,
.detail-run-row {
  min-height: 58px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.setup-history-row:last-child,
.detail-run-row:last-child {
  border-bottom: 0;
}

.setup-history-row > div:first-child,
.detail-run-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.current-badge {
  padding: 4px 7px;
  color: #fff;
  background: var(--red);
  font-size: 9px;
  font-weight: 900;
}

.detail-run-row time {
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
}

.setup-modal {
  width: min(760px, calc(100% - 32px));
}

.check-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
}

.check-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--red);
}

@media (max-width: 760px) {
  .page-actions { width:100%; }
  .page-actions button { flex:1; min-height:42px; }
  body {
    overflow-x: hidden;
  }

  .app-shell {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .main {
    width: 100%;
  }

  .mobile-top {
    height: 56px;
    padding: 0 16px;
    background: rgba(11, 63, 193, 0.96);
    backdrop-filter: blur(14px);
  }

  .mobile-top .brand-mark {
    justify-content: flex-start;
  }

  .mobile-top .brand-mark img {
    width: 30px;
    height: 30px;
  }

  .mobile-top .brand-mark {
    gap: 8px;
  }

  .mobile-top .brand-mark b {
    font-size: 13px;
  }

  .mobile-actions {
    display: flex;
    gap: 4px;
  }

  .mobile-actions button {
    min-width: 38px;
    min-height: 38px;
    padding: 7px 6px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-actions button:active {
    background: #ed1c24;
    border-color: #ed1c24;
  }

  .mobile-actions button.active {
    background: #ed1c24;
    border-color: #ed1c24;
  }

  .next-step-card,
  .install-card {
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
    padding: 20px;
  }

  .next-step-card button,
  .install-card button {
    width: 100%;
    min-height: 44px;
  }

  .guide-hero {
    grid-template-columns: 1fr;
    padding: 24px 20px;
  }

  .guide-progress {
    text-align: left;
  }

  .guide-steps {
    grid-template-columns: 1fr;
  }

  .guide-section-head { align-items:flex-start; flex-direction:column; gap:8px; margin-top:34px; }
  .basics-grid { grid-template-columns:1fr 1fr; }
  .basics-grid article { min-height:175px; padding:17px; }
  .chassis-guide-grid { display:flex; gap:10px; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; }
  .chassis-guide-grid article { flex:0 0 82vw; min-height:345px; scroll-snap-align:start; }
  .beginner-rule { grid-template-columns:1fr; gap:10px; padding:20px; }
  .beginner-rule button { width:100%; min-height:44px; }
  .catalog-tabs { width:100%; }
  .catalog-tabs button { flex:1; min-width:0; }
  .kit-advisor { grid-template-columns:1fr; gap:18px; padding:20px 16px; }
  .kits-toolbar { grid-template-columns:1fr; }
  .custom-kit-form { grid-template-columns:1fr; padding:18px 16px; border-top:1px solid var(--line); }
  .custom-kit-form > small { grid-column:auto; }
  .custom-kit-form > button { width:100%; min-height:44px; }
  .kit-catalog { grid-template-columns:1fr; }
  .kit-card { grid-template-columns:1fr; min-height:0; }
  .kit-visual { min-height:235px; padding:12px; border-right:0; border-bottom:4px solid var(--kit-color); }
  .kit-image { min-height:190px; height:190px; }
  .kit-identity span { font-size:28px; }
  .kit-copy { padding:17px 14px; }
  .kit-copy h3 { font-size:17px; }
  .kit-copy footer { align-items:stretch; flex-direction:column; }
  .kit-copy footer .primary { width:100%; }

  .guide-steps article {
    grid-template-columns: 38px 1fr;
    min-height: 0;
    padding: 20px 16px;
  }

  .guide-steps article > span {
    font-size: 22px;
  }

  .guide-steps article button {
    width: 100%;
    min-height: 42px;
  }

  .step-status {
    top: 13px;
    right: 13px;
  }

  .welcome-content {
    padding: 28px 20px 22px;
  }

  .welcome-content h2 {
    padding-right: 20px;
    font-size: 28px;
  }

  .welcome-content li {
    grid-template-columns: 1fr;
  }

  .welcome-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .profile-card,
  .profile-password {
    padding: 22px 18px;
  }

  .profile-actions {
    width: 100%;
    flex-direction: column;
  }

  .sidebar {
    inset: auto 0 0 0;
    width: 100%;
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 0 6px env(safe-area-inset-bottom);
    transform: none;
    background: rgba(8, 35, 108, 0.97);
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(18px);
  }

  .sidebar.open {
    transform: none;
  }

  .sidebar > .brand-mark,
  .sidebar-user {
    display: none;
  }

  .sidebar nav {
    flex: 1;
    min-width: 0;
    flex-direction: row;
    align-items: stretch;
    gap: 2px;
    padding: 4px 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .sidebar nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar nav > .mobile-top-only {
    display: none;
  }

  .sidebar nav > button:not(.mobile-top-only),
  .sidebar nav > .nav-group {
    flex: 1 1 25%;
    min-width: 0;
  }

  .sidebar nav > .nav-group {
    height: 58px;
    min-height: 58px;
    align-self: center;
    justify-content: center;
    scroll-snap-align: center;
  }

  .sidebar .nav-group > .nav-group-toggle {
    flex: 0 0 58px;
    width: 100%;
    height: 58px;
    min-height: 58px;
  }

  .sidebar .nav-group-toggle b {
    display: none;
  }

  .sidebar .nav-submenu,
  .sidebar .nav-group.open .nav-submenu {
    display: none;
  }

  .sidebar nav button {
    flex: 0 0 76px;
    min-height: 58px;
    padding: 6px 4px;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    border-radius: 8px;
    scroll-snap-align: center;
    text-align: center;
    font-size: 10px;
    line-height: 1.15;
  }

  .sidebar nav button i {
    font-size: 8px;
  }

  .sidebar nav button:hover {
    background: transparent;
    color: rgba(255,255,255,.7);
  }

  .sidebar nav button.active {
    background: #ed1c24;
    color: #ffffff;
  }

  .sidebar .nav-group.has-active > .nav-group-toggle,
  .sidebar .nav-group.mobile-open > .nav-group-toggle {
    background: #ed1c24;
    color: #ffffff;
  }

  .sidebar.submenu-open nav > button.active,
  .sidebar.submenu-open .nav-group.has-active:not(.mobile-open) > .nav-group-toggle {
    background: transparent;
    color: rgba(255,255,255,.7);
  }

  .sidebar.submenu-open nav > button.active i,
  .sidebar.submenu-open .nav-group.has-active:not(.mobile-open) > .nav-group-toggle i {
    color: rgba(255,255,255,.32);
  }

  .sidebar.submenu-open ~ .main .mobile-actions button.active {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.65);
  }

  .sidebar nav button.active i {
    color: #ffffff;
  }

  .mobile-nav-layer {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    pointer-events: none;
  }

  .mobile-nav-scrim {
    position: absolute;
    inset: 0 0 calc(68px + env(safe-area-inset-bottom));
    border: 0;
    background: rgba(7, 16, 38, .28);
    opacity: 0;
    transition: opacity .2s ease;
  }

  .mobile-nav-sheet {
    position: absolute;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 12px;
    max-width: 430px;
    margin: 0 auto;
    padding: 10px;
    border: 1px solid rgba(11,63,193,.16);
    border-radius: 18px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 22px 65px rgba(3,14,42,.28);
    opacity: 0;
    transform: translateY(24px) scale(.98);
    transform-origin: bottom center;
    transition: opacity .18s ease, transform .22s cubic-bezier(.2,.8,.2,1);
  }

  .mobile-nav-sheet::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 16px;
    height: 16px;
    background: #ffffff;
    transform: translateX(-50%) rotate(45deg);
  }

  .mobile-nav-layer.open .mobile-nav-scrim,
  .mobile-nav-layer.open .mobile-nav-sheet {
    pointer-events: auto;
    opacity: 1;
  }

  .mobile-nav-layer.open .mobile-nav-sheet {
    transform: none;
  }

  .mobile-nav-sheet header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 8px 10px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-nav-sheet header div {
    display: flex;
    flex-direction: column;
  }

  .mobile-nav-sheet header small {
    color: var(--red);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .12em;
  }

  .mobile-nav-sheet header b {
    margin-top: 2px;
    font-size: 17px;
  }

  .mobile-nav-sheet header button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #eef3ff;
    color: var(--navy);
    font-size: 23px;
  }

  #mobile-nav-items {
    display: grid;
    gap: 5px;
    padding-top: 8px;
  }

  #mobile-nav-items button {
    display: flex;
    min-height: 49px;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border: 0;
    border-radius: 11px;
    background: #f4f7ff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    text-align: left;
  }

  #mobile-nav-items button > span {
    flex: 1;
  }

  #mobile-nav-items .nav-icon {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
    color: var(--navy);
    opacity: 1;
  }

  #mobile-nav-items button.active .nav-icon {
    color: #ffffff;
  }

  #mobile-nav-items button.active {
    background: var(--navy);
    color: #ffffff;
  }

  #mobile-nav-items button i {
    color: var(--red);
    font-size: 21px;
    font-style: normal;
  }

  .page {
    width: 100%;
    padding: 24px 12px 36px;
  }

  .page-head {
    min-height: 0;
    margin-bottom: 22px;
    flex-direction: column;
    gap: 16px;
  }

  #page-dashboard > .page-head {
    min-height: 270px;
    padding: 28px 20px 22px;
    justify-content: flex-end;
    background-position: 61% center;
  }

  #page-dashboard > .page-head h2 {
    max-width: 260px;
    font-size: 45px;
  }

  #page-dashboard > .page-head .primary {
    align-self: stretch;
    background: var(--red);
  }

  .page-head > button {
    width: 100%;
    min-height: 46px;
  }

  .page-head h2 {
    font-size: 36px;
  }

  .stat-grid {
    display: flex;
    width: calc(100% + 12px);
    margin-right: -12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    border-right: 0;
    scrollbar-width: none;
  }

  .stat-grid::-webkit-scrollbar {
    display: none;
  }

  .stat-card {
    flex: 0 0 132px;
    min-height: 112px;
    border-right: 1px solid var(--line) !important;
    scroll-snap-align: start;
  }

  .dashboard-grid {
    gap: 12px;
    margin-top: 12px;
  }

  .feature-card {
    min-height: 220px;
    padding: 22px;
  }

  .feature-card h3 {
    margin-top: 26px;
    font-size: 23px;
  }

  .panel {
    padding: 16px;
    box-shadow: none;
  }

  .result-column {
    padding: 0;
  }

  input,
  select,
  textarea {
    min-height: 46px;
    font-size: 16px;
  }

  input[type="range"] {
    min-height: 32px;
  }

  .track-verdict {
    padding: 16px;
  }

  .profile-tabs {
    width: 100%;
    flex-direction: row;
  }

  .profile-tabs button {
    flex: 1;
    min-height: 42px;
    padding: 8px 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 0;
  }

  .chassis-list {
    display: flex;
    gap: 8px;
    padding: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .chassis-list::-webkit-scrollbar {
    display: none;
  }

  .chassis-card {
    flex: 0 0 142px;
    min-height: 135px;
    scroll-snap-align: start;
  }

  .build-lead {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 14px;
  }

  .build-lead > div {
    min-width: calc(100% - 70px);
  }

  .build-lead > button {
    width: 100%;
    min-height: 42px;
  }

  .recommend-grid article {
    min-height: 84px;
    padding: 14px;
  }

  .toolbar {
    padding: 12px;
    gap: 8px;
  }

  .parts-catalog,
  .card-list {
    gap: 10px;
  }

  .part-card,
  .record-card {
    min-height: 0;
    padding: 18px;
  }

  .part-card { padding:0; }
  .part-image { height:210px; }

  .part-card footer button,
  .part-card footer a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }

  .data-list,
  .run-list {
    border: 0;
    background: transparent;
    gap: 10px;
  }

  .data-row {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--card);
  }

  .data-row > strong,
  .data-row > div {
    grid-column: 1;
  }

  .data-row > .record-actions {
    grid-column: 2;
    grid-row: 1;
    flex-direction: column !important;
    align-items: stretch;
  }

  .data-row > a,
  .data-row > button {
    grid-column: 2;
    grid-row: 1;
    min-height: 38px;
  }

  .run-card {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--card);
  }

  .run-card time {
    grid-column: 1 / -1;
  }

  .run-card .advice {
    grid-column: 1 / -1;
    margin-top: 4px;
  }

  .run-delete {
    grid-column: 2;
    grid-row: 2;
    min-height: 40px;
    align-self: start;
  }

  dialog {
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }

  .dialog-form {
    max-height: 92dvh;
    padding: 22px 16px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  .dialog-form header {
    position: sticky;
    top: -22px;
    z-index: 2;
    margin: -22px -16px 2px;
    padding: 18px 16px 12px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
  }

  .dialog-form header button {
    width: 44px;
    height: 44px;
  }

  .toast {
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: 12px;
    text-align: center;
  }
}

@media (max-width: 760px) {
  .car-detail-modal,
  .setup-modal {
    width: 100%;
  }

  .car-detail-shell {
    gap: 14px;
  }

  .car-detail-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .car-detail-summary .primary {
    width: 100%;
  }

  .setup-spec-grid {
    grid-template-columns: 1fr 1fr;
  }

  .setup-history-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .setup-history-row .record-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

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

  .basics-grid article {
    min-height: 150px;
  }

  .page-head h2 {
    font-size: 32px;
  }

  .auth-card {
    padding: 24px 18px;
  }

  .auth-card h1 {
    font-size: 36px;
  }

  .sidebar nav button {
    flex-basis: 72px;
  }

  .sidebar nav button > .nav-icon {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
    opacity: .82;
  }

}
