:root {
  --ink: #f5f7f7;
  --muted: #9aa8b2;
  --bg: #0b1016;
  --panel: #151d25;
  --panel-2: #101720;
  --line: #2f3b46;
  --lime: #078fd1;
  --amber: #e32636;
  --steel: #c8ced1;
  --dark: #080c11;
  --race-red: #e32636;
  --race-blue: #078fd1;
  --race-navy: #173a73;
  --race-silver: #c8ced1;
  --radius: 22px;
}

/* Multi-vehicle race-day session */
.home-count-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px; }
.home-count-choice, .home-discipline-choice { min-height: 72px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: rgba(11, 24, 33, .74); text-align: left; cursor: pointer; }
.home-count-choice { display: grid; place-items: center; font-size: 25px; font-weight: 800; text-align: center; }
.home-count-choice small, .home-discipline-choice small, .home-multi-setup-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
.home-count-choice.selected, .home-discipline-choice.selected { border-color: var(--race-blue); background: rgba(0, 132, 199, .13); box-shadow: inset 0 0 0 1px rgba(0, 132, 199, .35); }
.home-discipline-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.home-discipline-choice strong { display: block; margin-bottom: 6px; font-size: 17px; }
.home-stage-actions { display: flex; justify-content: space-between; gap: 10px; }
.home-multi-vehicle-picker, .home-multi-setup-list { display: grid; gap: 12px; }
.home-multi-vehicle-picker label, .home-multi-setup-card label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.home-picker-warning { min-height: 20px; margin: 0; color: var(--muted); font-size: 12px; }
.home-multi-setup-card { display: grid; grid-template-columns: minmax(150px, .85fr) minmax(210px, 1.15fr); gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.home-multi-setup-card:last-child { border-bottom: 0; }
.home-multi-setup-card p { grid-column: 2; margin: -8px 0 0; color: #8fc6e1; font-size: 12px; }
.crew-active-title { min-width: 0; flex: 1; }
.crew-session-eyebrow { display: block; margin-bottom: 3px; color: #62c8f4; font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.crew-active-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-save-status { flex-shrink: 0; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #89d6a8; background: rgba(77, 181, 119, .12); font-size: 11px; font-weight: 850; }
.crew-conversation-prompt { flex-shrink: 0; padding: 5px 0 2px; }
.crew-conversation-prompt h2 { margin: 0; font-size: 14px; font-weight: 650; line-height: 1.25; letter-spacing: -.01em; }
.crew-race-vehicle-dialog { width: min(480px, calc(100% - 24px)); max-width: none; padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: transparent; }
.crew-race-vehicle-dialog::backdrop { background: rgba(2, 7, 11, .78); backdrop-filter: blur(5px); }
.crew-race-vehicle-sheet { display: grid; gap: 12px; padding: 16px; border: 1px solid #405463; border-radius: 20px; background: #101b24; box-shadow: 0 18px 55px #000b; }
.crew-race-vehicle-sheet > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crew-race-vehicle-sheet > header span { color: #62c8f4; font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.crew-race-vehicle-sheet h2 { margin: 2px 0 0; font-size: 19px; }
.crew-sheet-close { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; color: #d9e4eb; background: #1d2c37; font-size: 26px; line-height: 1; }
.crew-race-vehicle-list { display: grid; gap: 6px; }
.crew-race-vehicle-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 58px; padding: 9px 12px; border: 1px solid #314553; border-radius: 13px; color: #dce6ed; background: #0c151c; text-align: left; }
.crew-race-vehicle-option.active { border-color: #28aeea; background: #102838; }
.crew-race-vehicle-option span { min-width: 0; display: grid; gap: 2px; }
.crew-race-vehicle-option strong, .crew-race-vehicle-option small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-race-vehicle-option strong { font-size: 15px; }
.crew-race-vehicle-option small { color: #a9bac5; font-size: 11px; }
.crew-race-vehicle-option b { color: #89d6a8; }

@media (max-width: 700px) {
  .home-session-progress { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .home-session-progress span { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 7px; }
  .home-discipline-grid, .home-multi-setup-card { grid-template-columns: 1fr; }
  .home-multi-setup-card p { grid-column: 1; margin-top: -6px; }
  .crew-race-vehicle-dialog { width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .crew-race-vehicle-sheet { padding: 16px 14px max(18px, env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0; border-bottom: 0; }
}

/* Race palette cleanup: remove the legacy green-tinted surfaces. */
.home-action-panel,
.vehicle-card { background: linear-gradient(150deg, #18222c, #10171f); }
.home-session-progress span b { background: #26323c; }
.home-session-progress span.active b,
.surface-icon,
.vehicle-monogram,
.sheet-step > span { background: var(--race-blue); color: #fff; }
.session-summary,
.surface-card,
.service-card,
.garage-card,
.configuration-row,
.sheet-step,
.setup-version-row,
.history-row,
.preference-add-grid,
.account-status > div { background: #0d151d; }
.track-directory-card { background: #121a22; cursor: pointer; }
.track-banner { background: linear-gradient(145deg, #27333d, #17232c); }
.track-banner.other { background: linear-gradient(135deg, #263541, #151e27); }
.track-meta span,
.configuration-tags span,
.import-table th,
.mirror-toggle,
.pill-picker,
.ai-connection,
.chat-sources a,
.calc-strip,
.setup-check { background: #0b1219; }
.track-notes-panel,
.setup-record-panel,
.imported-fields-panel { border-color: #3c5364; }
.import-progress > div { background: #26333d; }
.confidence-pill { background: #233541; color: #dce7ee; }
.setup-working-status { border-color: #3d5363; background: #0d151d; }
.setup-section[open] > summary { background: #17212a; }
.setup-field-list input[readonly] { background: #0d151d; color: #bcc8cf; }
.pill-calculator { border-color: #354c5e; background: linear-gradient(145deg, #0b1219, #111d27); }
.pill-option { border-color: #34434f; background: #151e26; }
.pill-option:hover,
.pill-option.active { background: #172d3c; }
.pill-results { border-color: #30414e; background: #30414e; }
.pill-results > div { background: #101923; }
.conversation-context { background: #101b24; color: #c7d1d7; }
.chat-thread { background: #090f15; }
.chat-message.assistant { background: #17212a; border-color: #2f414f; color: #d0d8dd; }
.chat-recommendation { border-color: #3e5b70; background: #101c25; }
.chat-recommendation .trade,
.chat-recommendation .test,
.recommendation-run-action { border-color: #2e3d48; }
.data-summary article { background: #131c24; }
.data-table td { border-color: #26313a; }
.empty-state,
.preference-empty { border-color: #3b4b57; }
.preference-card { border-color: #344754; background: linear-gradient(145deg, #111a23, #0d141b); }
.preference-badge { background: #1b2833; color: #b7c3ca; }

* { box-sizing: border-box; }
html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-x: clip;
  background:
    radial-gradient(circle at 88% 0, rgba(7, 143, 209, .22) 0, transparent 28%),
    radial-gradient(circle at 12% 100%, rgba(227, 38, 54, .12) 0, transparent 32%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.app-shell, main, .page { min-width: 0; max-width: 100%; }
img, svg, video, canvas, input, select, textarea { max-width: 100%; }
.account-onboarding {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px 18px;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  background: radial-gradient(circle at 82% 8%, rgba(7, 143, 209, .22), transparent 31%), linear-gradient(145deg, #080c11, #111a24 58%, #0b1016);
}
.account-onboarding[hidden] { display: none; }
.onboarding-active .topbar, .onboarding-active .app-shell { display: none; }
.onboarding-card {
  width: min(720px, 100%);
  border: 1px solid #334c62;
  border-radius: 28px;
  background: linear-gradient(150deg, rgba(25, 36, 47, .98), rgba(13, 19, 26, .98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
  padding: clamp(26px, 5vw, 52px);
}
.onboarding-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 38px; }
.onboarding-brand .brand-wordmark { width: min(340px, 76vw); }
.onboarding-brand b, .onboarding-brand small { display: block; }
.onboarding-brand b {
  font-family: "Titillium Web", Inter, ui-sans-serif, system-ui, sans-serif;
  font-style: italic;
  font-size: 17px;
  letter-spacing: .08em;
}
.onboarding-brand small {
  color: var(--muted);
  font-family: "Titillium Web", Inter, ui-sans-serif, system-ui, sans-serif;
  font-style: italic;
  font-size: 8px;
  letter-spacing: .18em;
  margin-top: 2px;
}
.onboarding-card h1 { font-size: clamp(38px, 7vw, 68px); line-height: .95; letter-spacing: -.055em; margin: 18px 0; max-width: 620px; }
.onboarding-card > p { color: #bdc5be; line-height: 1.65; max-width: 600px; margin: 0 0 28px; }
.onboarding-fields { margin-bottom: 22px; }
.onboarding-actions { display: grid; gap: 13px; }
.onboarding-actions small { color: var(--muted); line-height: 1.5; text-align: center; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }

.topbar {
  height: 76px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 34px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 16, 22, .92);
  backdrop-filter: blur(16px);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--race-red) 0 28%, #f4f6f7 28% 35%, var(--race-blue) 35% 72%, transparent 72%);
  opacity: .9;
  pointer-events: none;
}
.brand {
  border: 0;
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: block;
  border-radius: 8px;
  object-fit: contain;
  flex: 0 0 auto;
}
.brand-copy { display: block; }
.brand-wordmark {
  width: 205px;
  height: auto;
  display: block;
  object-fit: contain;
}
.brand b { display: block; font-family: "Titillium Web", Inter, ui-sans-serif, system-ui, sans-serif; font-style: italic; font-size: 17px; letter-spacing: .08em; }
.brand small { display: block; color: var(--muted); font-family: "Titillium Web", Inter, ui-sans-serif, system-ui, sans-serif; font-style: italic; font-size: 8px; letter-spacing: .18em; margin-top: 2px; }
.context-pill {
  margin: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  padding: 9px 14px;
  border-radius: 999px;
  color: #d9ddd8;
  font-size: 12px;
}
.context-pill span {
  width: 7px;
  height: 7px;
  background: var(--lime);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--lime);
}

.app-shell { display: grid; grid-template-columns: 180px 1fr; }
.rail {
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  border-right: 1px solid var(--line);
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rail button {
  border: 0;
  background: transparent;
  color: #858d86;
  text-align: left;
  padding: 13px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 750;
}
.rail button.active { background: linear-gradient(90deg, rgba(7, 143, 209, .2), rgba(7, 143, 209, .05)); color: #62c8f4; box-shadow: inset 3px 0 var(--race-blue); }

main { padding: 48px clamp(28px, 5vw, 82px) 80px; max-width: 1540px; width: auto; min-width: 0; }
.page { display: none; }
.page.active { display: block; animation: rise .28s ease; }
@keyframes rise { from { opacity: .2; transform: translateY(8px); } }
.eyebrow { color: var(--lime); font-weight: 850; letter-spacing: .18em; font-size: 10px; margin-bottom: 12px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.hero.compact { align-items: center; }
.hero h1 { font-size: clamp(43px, 5vw, 74px); letter-spacing: -.055em; line-height: .95; margin: 0 0 14px; max-width: 820px; }
.hero.compact h1 { font-size: clamp(38px, 4vw, 58px); }
.hero p { color: var(--muted); max-width: 680px; font-size: 16px; line-height: 1.6; margin: 0; }
.today-card {
  width: 300px;
  flex: 0 0 auto;
  background: linear-gradient(145deg, #1a2530, #111820);
  border: 1px solid #344758;
  border-radius: 18px;
  padding: 20px;
}
.today-card small, .step-label { color: var(--lime); font-size: 9px; font-weight: 900; letter-spacing: .14em; display: block; }
.today-card strong { display: block; margin: 12px 0 4px; }
.today-card span { color: var(--muted); font-size: 12px; }

.primary, .ghost, .icon-button {
  border-radius: 12px;
  cursor: pointer;
  font-weight: 850;
}
.primary { border: 0; background: linear-gradient(135deg, #ef3342, var(--race-red)); color: #fff; padding: 14px 18px; box-shadow: 0 7px 30px rgba(227, 38, 54, .2); }
.primary span { margin-left: 16px; }
.primary.wide { width: 100%; }
.primary.compact { padding: 8px 11px; font-size: 11px; }
.ghost { background: transparent; border: 1px solid #3a4854; color: var(--ink); padding: 10px 15px; }
.ghost.blue-action { background: linear-gradient(135deg, #087fba, #075e91); border-color: #29a9e8; color: #fff; box-shadow: 0 7px 24px rgba(7, 143, 209, .22); }
.ghost.small { padding: 8px 11px; font-size: 11px; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); background: #202a34; font-size: 22px; }
.link-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.disabled { opacity: .4; pointer-events: none; }
.save-state { color: var(--lime); font-size: 10px; white-space: nowrap; }

.panel, .context-bar, .pit-panel {
  background: linear-gradient(150deg, #18222c, #10171f);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel { padding: 25px; margin-bottom: 17px; }
.panel h2 { margin: 0 0 22px; font-size: 20px; }
.panel-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.panel-title h2 { margin: 5px 0 0; }
.panel-title small { color: var(--muted); }
.section-head { margin: 30px 0 15px; }
.section-head.inline { margin-top: 0; }
.garage-vehicle-head, .track-directory-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.garage-vehicle-head #showAddVehicleBtn, .track-directory-head #showAddTrackBtn { flex: 0 0 auto; }
.section-head span { color: var(--muted); font-size: 9px; letter-spacing: .15em; font-weight: 900; }
.section-head h2 { margin: 5px 0 0; font-size: 25px; }
.tag { display: inline-block; font-size: 9px; font-weight: 900; letter-spacing: .11em; padding: 6px 9px; border-radius: 999px; }
.tag.green { background: rgba(7, 143, 209, .14); color: #62c8f4; }
.tag.amber { background: rgba(255, 181, 44, .13); color: var(--amber); }
.tag.steel { background: rgba(174, 184, 177, .12); color: #ced5cf; }

.home-welcome {
  min-height: 190px;
  margin-bottom: 14px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid #40502f;
  border-radius: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  position: relative;
  background: radial-gradient(circle at 90% 10%, rgba(7, 143, 209, .18), transparent 34%), linear-gradient(145deg, #1a2530, #101720 70%);
}
.home-welcome:after { content: "P"; position: absolute; right: 4%; top: -48px; color: rgba(7, 143, 209, .05); font-size: 250px; font-weight: 1000; font-style: italic; line-height: 1; transform: skew(-7deg); pointer-events: none; }
.home-welcome-copy { position: relative; z-index: 1; }
.home-welcome h1 { max-width: 760px; margin: 10px 0 8px; font-size: clamp(40px, 5.2vw, 72px); line-height: .94; letter-spacing: -.055em; }
.home-welcome p { max-width: 650px; margin: 0; color: #b3bbb4; font-size: 16px; line-height: 1.55; }
.home-engineer-status { flex: 0 0 auto; position: relative; z-index: 1; padding: 14px 17px; border: 1px solid rgba(7, 143, 209, .3); border-radius: 15px; display: flex; align-items: center; gap: 11px; background: rgba(8, 13, 19, .62); }
.home-engineer-status > span { width: 9px; height: 9px; border-radius: 50%; background: var(--race-blue); box-shadow: 0 0 14px rgba(7, 143, 209, .8); }
.home-engineer-status strong, .home-engineer-status small { display: block; }
.home-engineer-status strong { font-size: 12px; }
.home-engineer-status small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.activity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.activity-card {
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 21px;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 92% 8%, rgba(7, 143, 209, .16), transparent 38%), linear-gradient(150deg, #182633, #101820);
  transition: .18s ease;
}
.activity-card:hover { transform: translateY(-3px); border-color: #287cab; }
.activity-card:after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 200px; height: 200px; border-radius: 50%; border: 35px solid rgba(255, 255, 255, .025); }
.activity-card h2 { font-size: 25px; letter-spacing: -.035em; margin: 12px 0 6px; }
.activity-card p { color: var(--muted); line-height: 1.45; margin: 0; max-width: 330px; }
.activity-card > b,
.activity-card.practice > b,
.activity-card.maintenance > b { display: block; color: #62c8f4; margin-top: auto; padding-top: 10px; font-size: 11px; }
.activity-card .tag.green,
.activity-card .tag.amber,
.activity-card .tag.steel { background: rgba(7, 143, 209, .14); color: #62c8f4; }
.home-guide-link {
  margin-top: 12px;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #34566d;
  border-radius: 16px;
  color: var(--ink);
  background: radial-gradient(circle at 95% 10%, rgba(7, 143, 209, .13), transparent 34%), #101820;
  text-decoration: none;
  transition: .18s ease;
}
.home-guide-link:hover { border-color: #3a9bce; transform: translateY(-2px); }
.home-guide-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: #081018; background: #62c8f4; font-size: 24px; font-weight: 1000; }
.home-guide-copy { min-width: 0; }
.home-guide-copy small, .home-guide-copy strong, .home-guide-copy span { display: block; }
.home-guide-copy small { margin-bottom: 4px; color: #62c8f4; font-size: 8px; font-weight: 900; letter-spacing: .13em; }
.home-guide-copy strong { font-size: 16px; }
.home-guide-copy span { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.home-guide-link > b { color: #62c8f4; font-size: 10px; white-space: nowrap; }
.track-step { margin-top: 18px; border-color: #34566d; }
.home-session-progress { margin: -4px 0 18px; display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.home-session-progress span { padding: 10px 12px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #747d76; border-right: 1px solid var(--line); font-size: 10px; font-weight: 850; letter-spacing: .04em; }
.home-session-progress span:last-child { border-right: 0; }
.home-session-progress span b { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: #242b26; font-size: 9px; }
.home-session-progress span.active { color: #62c8f4; background: rgba(7, 143, 209, .1); }
.home-session-progress span.active b { background: var(--lime); color: #10140b; }
.home-session-stage { min-width: 0; max-width: 100%; display: grid; gap: 12px; overflow: hidden; }
.home-session-stage > .ghost { justify-self: start; }
.home-stage-context { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #cbd1cb; font-size: 11px; }
.home-track-picker { min-width: 0; max-width: 100%; display: grid; gap: 12px; }
.home-track-search { position: relative; display: block; }
.home-track-search::before { content: "⌕"; position: absolute; left: 14px; top: 50%; translate: 0 -52%; color: var(--race-blue); font-size: 23px; line-height: 1; pointer-events: none; }
.home-track-search input { min-height: 49px; padding-left: 43px; border-color: #34566d; background: #0b141c; font-size: 16px; }
.home-track-list-heading { min-height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #62c8f4; font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.home-track-list-heading button { padding: 5px 0; border: 0; background: transparent; color: #9ecde5; font-size: 9px; font-weight: 800; }
.home-track-results { overflow: hidden; border: 1px solid #34566d; border-radius: 15px; background: #0e1821; }
.home-track-result { min-height: 64px; width: 100%; padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 0; border-bottom: 1px solid #263b4a; background: transparent; color: var(--text); text-align: left; }
.home-track-result:last-child { border-bottom: 0; }
.home-track-result:hover, .home-track-result:focus-visible { background: rgba(7, 143, 209, .1); }
.home-track-result > span:first-child { min-width: 0; display: grid; gap: 4px; }
.home-track-result strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.home-track-result small { color: var(--muted); font-size: 10px; }
.home-track-result-count { min-width: 47px; display: grid; justify-items: center; gap: 1px; color: #62c8f4; font-size: 16px; font-weight: 850; }
.home-track-result-count small { font-size: 7px; letter-spacing: .08em; }
.home-track-empty { padding: 22px 16px; color: var(--muted); font-size: 11px; text-align: center; }
.home-track-browse { width: 100%; min-height: 46px; border-color: var(--race-blue); color: #9bdcff; }
.home-track-back { justify-self: start; padding: 6px 0; border: 0; background: transparent; color: #62c8f4; font-size: 10px; font-weight: 800; }
.home-track-selection { min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: end; border: 1px solid #34566d; border-radius: 16px; background: radial-gradient(circle at 95% 10%, rgba(7, 143, 209, .12), transparent 35%), #0e151d; }
.home-track-selection > .step-label, .home-track-selection h3, .home-track-selection p { grid-column: 1 / -1; }
.home-track-selection h3 { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 23px; }
.home-track-selection p { margin: -4px 0 2px; color: var(--muted); font-size: 10px; }
.home-track-selection label { min-width: 0; color: var(--muted); font-size: 9px; font-weight: 800; }
.home-track-selection select { width: 100%; min-width: 0; max-width: 100%; margin-top: 5px; }
.home-track-selection > .primary { min-height: 42px; }
.home-vehicle-picker {
  padding: 18px;
  border: 1px solid #415032;
  border-radius: 16px;
  background: #0e120f;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "vehicle continue" "detail detail";
  align-items: end;
  gap: 10px 12px;
}
.home-vehicle-picker label { grid-area: vehicle; color: var(--muted); font-size: 9px; font-weight: 800; }
.home-vehicle-picker select { margin-top: 6px; }
.home-vehicle-picker button { grid-area: continue; min-height: 42px; }
.home-vehicle-picker p { grid-area: detail; margin: 0; color: var(--muted); font-size: 11px; }
.track-choice-card { grid-template-columns: 44px minmax(130px, 1fr) minmax(170px, .9fr) auto; }
.track-choice-card label { color: var(--muted); font-size: 9px; font-weight: 800; }
.track-choice-card select { margin-top: 4px; }
.home-setup-offer { min-width: 0; max-width: 100%; padding: clamp(18px, 3vw, 28px); overflow: hidden; border: 1px solid #34566d; border-radius: 18px; background: radial-gradient(circle at 95% 10%, rgba(7, 143, 209, .12), transparent 35%), #0e151d; }
.home-setup-offer h3 { min-width: 0; max-width: 100%; margin: 13px 0 8px; overflow-wrap: anywhere; font-size: clamp(22px, 3vw, 31px); letter-spacing: -.035em; }
.home-setup-offer p { min-width: 0; max-width: 700px; margin: 0; overflow-wrap: anywhere; color: var(--muted); line-height: 1.55; }
.home-setup-actions { min-width: 0; max-width: 100%; margin-top: 18px; display: flex; flex-wrap: wrap; gap: 9px; }
.home-setup-actions button { min-width: 0; max-width: 100%; white-space: normal; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.choice-card {
  border: 1px solid var(--line);
  background: #0e120f;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}
.choice-card:hover { border-color: var(--lime); }
.garage-filters { margin: 0 0 16px; }
.garage-discipline-tabs { min-width: 0; display: flex; flex-wrap: nowrap; gap: 7px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.garage-discipline-tabs::-webkit-scrollbar { display: none; }
.surface-icon { width: 44px; height: 44px; border-radius: 11px; background: var(--lime); color: #14180f; display: grid; place-items: center; font-weight: 1000; }
.choice-card strong, .choice-card small { display: block; }
.choice-card small { color: var(--muted); margin-top: 3px; font-size: 10px; }
.choice-card > b { color: var(--lime); font-size: 10px; }
.home-footer {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.home-footer div { padding: 17px; border-right: 1px solid var(--line); }
.home-footer div:last-child { border-right: 0; }
.home-footer small { display: block; color: var(--muted); font-size: 8px; letter-spacing: .13em; font-weight: 900; margin-bottom: 6px; }

.garage-layout { display: grid; grid-template-columns: 1fr 1.05fr; gap: 18px; align-items: start; }
.vehicle-dialog { width: min(820px, calc(100% - 32px)); max-width: none; max-height: calc(100vh - 48px); margin: auto; padding: 0; border: 0; border-radius: var(--radius); background: transparent; color: var(--ink); overflow: auto; }
.vehicle-dialog:not([open]) { display: none; }
.vehicle-dialog::backdrop { background: rgba(3, 6, 4, .78); backdrop-filter: blur(7px); }
.vehicle-dialog > .panel { margin: 0; border-color: #40596c; box-shadow: 0 28px 90px rgba(0, 0, 0, .58); }
.service-dialog { width: min(760px, calc(100% - 32px)); }
.panel-title-actions { display: flex; align-items: center; gap: 10px; }
.vehicle-form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 17px; }
.vehicle-list { display: grid; gap: 11px; }
.vehicle-card {
  width: 100%;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #181d1a, #111412);
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
}
.vehicle-select {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 18px;
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 15px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}
.vehicle-card.selected { border-color: #287cab; box-shadow: inset 3px 0 var(--race-blue); }
.vehicle-monogram { width: 58px; height: 58px; background: var(--lime); color: #12160d; display: grid; place-items: center; border-radius: 14px; font-weight: 1000; }
.vehicle-copy small, .vehicle-copy strong, .vehicle-copy em { display: block; }
.vehicle-copy small { color: var(--lime); font-size: 8px; letter-spacing: .13em; font-weight: 900; margin-bottom: 5px; }
.vehicle-copy em { color: var(--muted); font-style: normal; font-size: 10px; margin-top: 5px; }
.fluid-summary { display: grid; grid-template-columns: auto auto; gap: 3px 12px; align-items: baseline; text-align: right; }
.fluid-summary small { color: #6f766f; font-size: 7px; letter-spacing: .08em; }
.vehicle-actions-menu { border-top: 1px solid var(--line); background: rgba(5, 8, 6, .22); }
.vehicle-actions-menu > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 7px 12px 7px 16px; color: #adc0cb; font-size: 11px; font-weight: 850; letter-spacing: .05em; cursor: pointer; list-style: none; }
.vehicle-actions-menu > summary::-webkit-details-marker { display: none; }
.vehicle-actions-menu > summary b { display: grid; place-items: center; padding: 2px 4px; color: #29b5f2; font-size: 24px; line-height: 1; transition: transform .18s ease; }
.vehicle-actions-menu[open] > summary b { transform: rotate(45deg); }
.vehicle-actions-menu > summary:focus-visible { outline: 2px solid #36b0ed; outline-offset: -2px; }
.vehicle-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 10px 12px; background: rgba(5, 8, 6, .22); }
@media (max-width: 520px) {
  .vehicle-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .vehicle-actions button { width: 100%; min-height: 42px; }
}
.danger { border: 1px solid #6d3535; background: rgba(156, 54, 54, .12); color: #ff9d9d; border-radius: 12px; cursor: pointer; font-weight: 850; }
.danger.small { padding: 8px 11px; font-size: 11px; }
.maintenance-panel { position: static; }
.maintenance-architecture-note { margin: 0 0 14px; padding: 10px 12px; border: 1px solid rgba(40, 124, 171, .38); border-radius: 10px; background: rgba(40, 124, 171, .1); color: #b8cddb; font-size: 10px; line-height: 1.5; }
.pan-maintenance-fields { margin-bottom: 4px; }
.pan-service-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 2px 0 14px; }
.pan-service-checks label { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .018); line-height: 1.35; }
.pan-service-checks input { width: auto; margin: 1px 0 0; padding: 0; flex: 0 0 auto; }
.resource-actions { display: grid; gap: 9px; }
.resource-actions .link-btn, .resource-actions button { width: 100%; text-align: center; }

label { display: block; color: #a8afa9; font-size: 10px; letter-spacing: .06em; font-weight: 800; margin-bottom: 15px; }
input, select, textarea {
  width: 100%;
  margin-top: 7px;
  background: #0c100d;
  border: 1px solid #343c37;
  border-radius: 10px;
  color: var(--ink);
  padding: 12px;
  font-size: 13px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--race-blue); box-shadow: 0 0 0 2px rgba(7, 143, 209, .14); }
input:disabled, select:disabled, textarea:disabled, button:disabled { opacity: .42; cursor: not-allowed; }
textarea { resize: vertical; }
.field-help { display: block; grid-column: 1 / -1; color: var(--muted); font-size: 9px; line-height: 1.5; margin: -6px 0 10px; }
.two, .three, .five { display: grid; gap: 12px; }
.two { grid-template-columns: repeat(2, 1fr); }
.three { grid-template-columns: repeat(3, 1fr); }
.five { grid-template-columns: repeat(5, 1fr); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .panel { margin-bottom: 0; }
.span-2 { grid-column: 1 / -1; }

.track-directory { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.track-directory-card { border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: #121613; }
.track-directory-card.selected { border-color: #287cab; }
.track-banner { position: relative; isolation: isolate; overflow: hidden; height: 84px; padding: 20px; display: flex; justify-content: space-between; align-items: end; background: linear-gradient(145deg, #27333d, #17232c); }
.track-banner.dirt, .track-banner.asphalt, .track-banner.other { background: linear-gradient(145deg, #27333d, #17232c); }
.track-banner-art { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; }
.track-layout, .track-racing-line { fill: none; vector-effect: non-scaling-stroke; }
.track-layout-muted { stroke: rgba(181, 209, 224, .16); stroke-width: 7; }
.track-layout-secondary { stroke: rgba(199, 224, 236, .25); stroke-width: 3; }
.track-layout-primary { stroke: rgba(103, 194, 235, .6); stroke-width: 5; }
.track-racing-line { stroke: rgba(165, 219, 99, .55); stroke-width: 2; stroke-dasharray: 8 9; }
.track-banner span, .track-banner b { position: relative; z-index: 1; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); }
.track-banner span { color: var(--lime); font-size: 9px; letter-spacing: .15em; font-weight: 900; }
.track-banner b { font-size: 13px; }
.track-directory-copy { padding: 16px 22px; }
.track-directory-copy > small { color: var(--muted); font-size: 8px; letter-spacing: .12em; }
.track-directory-copy h2 { margin: 4px 0 6px; font-size: 25px; }
.track-directory-copy p { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 8px 0; }
.track-directory-copy .configuration-tags { margin: 8px 0; }
.track-directory-copy .track-meta { margin: 10px 0; }
.track-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.track-meta span { padding: 6px 8px; background: #0c0f0d; border: 1px solid var(--line); border-radius: 8px; color: #89918a; font-size: 9px; }
.card-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.track-directory-search { position: relative; display: block; margin: -2px 0 14px; }
.track-directory-search::before { content: "⌕"; position: absolute; z-index: 1; left: 15px; top: 50%; translate: 0 -52%; color: var(--race-blue); font-size: 23px; line-height: 1; pointer-events: none; }
.track-directory-search input { min-height: 50px; padding-left: 44px; border-color: #34566d; border-radius: 13px; background: #0b141c; font-size: 16px; }
.track-directory-card.track-telemetry-card { min-width: 0; border-color: #29495e; border-radius: 18px; background: linear-gradient(145deg, #111d27, #0a1117); transition: border-color .18s ease, transform .18s ease; }
.track-telemetry-card:hover { border-color: #2b8fc2; transform: translateY(-2px); }
.track-telemetry-card.selected { border-color: var(--race-blue); box-shadow: inset 0 0 0 1px rgba(33, 169, 237, .42), 0 16px 42px rgba(0, 0, 0, .18); }
.track-telemetry-card.featured { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(250px, .85fr) minmax(0, 1.15fr); }
.track-telemetry-card .track-banner { height: 142px; min-height: 142px; padding: 18px; align-items: flex-start; background: repeating-linear-gradient(90deg, transparent 0 38px, rgba(33, 169, 237, .05) 39px 40px), repeating-linear-gradient(0deg, transparent 0 38px, rgba(33, 169, 237, .05) 39px 40px), linear-gradient(145deg, #152d3d, #081119); }
.track-telemetry-card.featured .track-banner { height: auto; min-height: 100%; }
.track-telemetry-card .track-banner-art { opacity: .72; }
.track-telemetry-number { position: relative; z-index: 2; color: rgba(255, 255, 255, .09) !important; font-size: clamp(62px, 8vw, 106px) !important; font-weight: 1000 !important; font-style: italic; line-height: .85; letter-spacing: -.08em !important; text-shadow: none !important; }
.track-telemetry-status { position: absolute !important; z-index: 2 !important; right: 16px; top: 16px; padding: 7px 9px 7px 11px; border-left: 3px solid var(--race-red); color: #fff; background: rgba(5, 11, 16, .78); font-size: 9px !important; letter-spacing: .1em; text-transform: uppercase; }
.track-telemetry-card .track-directory-copy { min-width: 0; display: flex; flex-direction: column; }
.track-telemetry-card .track-directory-copy h2 { font-size: clamp(25px, 3vw, 34px); letter-spacing: -.04em; }
.track-telemetry-card .track-directory-copy > p { min-height: 0; }
.track-telemetry-stats { margin: 10px 0 13px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #2e5369; border-bottom: 1px solid #223c4d; }
.track-telemetry-stats > div { min-width: 0; padding: 10px 8px 10px 0; }
.track-telemetry-stats strong, .track-telemetry-stats span { display: block; }
.track-telemetry-stats strong { overflow: hidden; color: #f4f8fa; font-size: 18px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.track-telemetry-stats span { margin-top: 4px; color: #7da7be; font-size: 8px; font-weight: 850; letter-spacing: .1em; }
.track-telemetry-card .track-meta { margin-top: 9px; }
.track-telemetry-card .card-actions { margin-top: auto; padding-top: 4px; }
.track-telemetry-card .track-open { flex: 1 1 180px; min-height: 41px; }
@media (max-width: 900px) {
  .track-telemetry-card.featured { grid-template-columns: 1fr; }
  .track-telemetry-card.featured .track-banner { min-height: 142px; }
}
@media (max-width: 520px) {
  .track-directory-search input { font-size: 16px; }
  .track-telemetry-card .track-directory-copy { padding: 15px; }
  .track-telemetry-card .track-directory-copy h2 { font-size: 25px; }
  .track-telemetry-card .track-open { flex-basis: 100%; }
  .track-telemetry-stats strong { font-size: 16px; }
}
.track-directory-head { margin-bottom: 16px; }
.track-directory-head h1 { margin: 5px 0 0; font-size: clamp(36px, 5vw, 58px); line-height: .95; letter-spacing: -.05em; }
.track-directory-head > div > span { color: #19aeef; }
.track-directory-tools { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 14px; }
.track-directory-filters { min-width: 0; display: flex; gap: 7px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.track-directory-filters::-webkit-scrollbar { display: none; }
.track-filter-chip { min-height: 36px; flex: 0 0 auto; padding: 7px 13px; border: 1px solid #31536a; border-radius: 999px; color: #b7cad5; background: #09131a; font-size: 11px; cursor: pointer; }
.track-filter-chip.active { border-color: #1aaef0; color: #fff; background: #0b2939; box-shadow: inset 0 0 0 1px rgba(26, 174, 240, .18); }
.track-directory-tools .track-directory-search { min-width: 0; margin: 0; }
.track-directory-tools .track-directory-search input { min-height: 42px; margin: 0; }
.track-directory-count { color: #7f9aaa; font-size: 10px; font-weight: 850; letter-spacing: .08em; white-space: nowrap; }
.track-directory { grid-template-columns: 1fr; gap: 11px; }
.track-directory-card.track-pit-board-card { display: grid; grid-template-columns: 92px minmax(0, 1fr); min-width: 0; border-color: #315166; border-radius: 18px; background: #0d1820; transition: border-color .18s ease, transform .18s ease; }
.track-pit-board-card:hover { border-color: #1aaef0; transform: translateY(-1px); }
.track-pit-board-card.selected { border-color: #1aaef0; box-shadow: inset 0 0 0 1px rgba(26, 174, 240, .28); }
.track-pit-board-rail { position: relative; min-height: 166px; overflow: hidden; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px 12px), linear-gradient(160deg, #28ace6, #166486); }
.track-pit-board-rail::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 18%, rgba(255,255,255,.24) 0 1px, transparent 2px), linear-gradient(90deg, transparent 48%, rgba(255,255,255,.1) 49% 51%, transparent 52%); background-size: 15px 15px, 28px 100%; opacity: .48; }
.track-pit-board-rail::after { content: ""; position: absolute; left: -12%; right: -12%; bottom: 14px; height: 28px; transform: rotate(-25deg); background: linear-gradient(180deg, #f4263e 0 42%, #f6f8f9 43% 66%, #06121b 67%); box-shadow: 0 0 18px rgba(0, 0, 0, .22); }
.track-pit-board-content { min-width: 0; padding: 18px 20px 14px; }
.track-pit-board-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; }
.track-pit-board-copy { min-width: 0; }
.track-pit-board-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.track-pit-board-kicker small { color: #9bb4c2; font-size: 9px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.track-pit-board-kicker b { padding: 4px 7px; border-left: 3px solid var(--race-red); color: #fff; background: #091118; font-size: 8px; letter-spacing: .11em; }
.track-pit-board-copy h2 { margin: 7px 0 4px; overflow-wrap: anywhere; font-size: clamp(23px, 3vw, 32px); letter-spacing: -.035em; }
.track-pit-board-copy > p { margin: 0; color: #9cb1bd; font-size: 12px; }
.track-pit-board-stats { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 11px; color: #29b5f2; font-size: 9px; font-weight: 850; letter-spacing: .04em; }
.track-pit-board-stats strong { color: #f5f8fa; }
.track-pit-board-card .track-open { min-width: 84px; min-height: 44px; border: 1px solid #1aaef0; color: #fff; background: #0a1a24; }
.track-pit-board-card .track-open:hover { background: #0b3348; }
.track-pit-board-options { margin-top: 13px; border-top: 1px solid #253b49; }
.track-pit-board-options > summary { display: flex; align-items: center; min-height: 38px; padding-top: 8px; color: #8fa8b6; font-size: 10px; font-weight: 850; letter-spacing: .05em; cursor: pointer; list-style: none; }
.track-pit-board-options > summary::-webkit-details-marker { display: none; }
.track-pit-board-options > summary::after { content: "+"; margin-left: auto; color: #29b5f2; font-size: 18px; }
.track-pit-board-options[open] > summary::after { content: "−"; }
.track-pit-board-options-body { padding: 8px 0 2px; }
.track-pit-board-options-body > p { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
@media (max-width: 720px) {
  .track-directory-tools { grid-template-columns: 1fr auto; }
  .track-directory-filters { grid-column: 1; }
  .track-directory-tools .track-directory-search { grid-column: 1 / -1; grid-row: 2; }
  .track-directory-count { grid-column: 2; grid-row: 1; }
}
@media (max-width: 520px) {
  .track-directory-head { align-items: flex-end; }
  .track-directory-head h1 { font-size: 34px; }
  .track-directory-card.track-pit-board-card { grid-template-columns: 62px minmax(0, 1fr); }
  .track-pit-board-rail { min-height: 178px; }
  .track-pit-board-content { padding: 14px 13px 11px; }
  .track-pit-board-summary { gap: 9px; }
  .track-pit-board-copy h2 { font-size: 23px; }
  .track-pit-board-stats { gap: 6px 9px; font-size: 8px; }
  .track-pit-board-stats span:last-child { flex-basis: 100%; }
  .track-pit-board-card .track-open { min-width: 68px; padding-inline: 10px; }
}
.track-notes-panel { border-color: #465432; }
.track-notes-panel textarea { min-height: 120px; }
.track-notes-dialog { width: min(760px, calc(100% - 32px)); }
.configuration-editor { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; }
.configuration-row { border: 1px solid #39433b; border-radius: 15px; background: #0d110e; padding: 15px; margin: 12px 0; }
.configuration-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.configuration-row-head strong { color: var(--lime); font-size: 11px; letter-spacing: .08em; }
.configuration-tags { display: flex; gap: 7px; flex-wrap: wrap; margin: 12px 0; }
.configuration-tags span { padding: 8px 11px; border: 1px solid #414b43; border-radius: 999px; color: #b9c1ba; font-size: 11px; background: #0b0f0c; }
.setup-record-panel { border-color: #465432; }
.setup-sheet-panel { overflow: hidden; padding: 0; border-color: #344a5b; }
.setup-sheet-toggle { width: 100%; min-height: 94px; padding: 15px 16px; border: 0; color: inherit; background: transparent; text-align: left; }
.setup-sheet-toggle:hover { border-color: transparent; background: rgba(35, 174, 239, .06); transform: none; }
.setup-sheet-toggle:focus-visible { outline: 2px solid #62c8f4; outline-offset: -2px; }
.setup-sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.setup-sheet-copy { min-width: 0; }
.setup-sheet-copy, .setup-sheet-title, .setup-sheet-summary { display: block; }
.setup-sheet-title { margin: 4px 0 3px; font-size: 18px; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.setup-sheet-summary { color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.setup-sheet-right { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.setup-sheet-chevron { width: 18px; color: #92a8b8; font-size: 18px; line-height: 1; text-align: center; transition: transform .18s ease; }
.setup-sheet-toggle[aria-expanded="true"] .setup-sheet-chevron { transform: rotate(180deg); }
.setup-sheet-content { padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.setup-sheet-content[hidden] { display: none; }
.sheet-workflow { display: grid; gap: 8px; margin-bottom: 12px; }
.sheet-step { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #0e130f; }
.sheet-step > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--lime); color: #11160c; font-weight: 1000; }
.sheet-step strong, .sheet-step small { display: block; }
.sheet-step small { color: var(--muted); line-height: 1.45; margin-top: 4px; }
.import-engine-badge { color: #62c8f4; border: 1px solid #35576d; border-radius: 999px; padding: 9px 12px; font-size: 10px; white-space: nowrap; }
.sheet-upload-row { display: grid; grid-template-columns: 1fr auto; gap: 15px; align-items: center; }
.sheet-file-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; flex-wrap: wrap; }
.sheet-file-actions button { min-width: 190px; }
.attached-sheet-row { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.file-drop { margin: 0; min-height: 86px; border: 1px dashed #46677d; border-radius: 14px; background: #0e161e; color: #62c8f4; display: grid; place-items: center; text-align: center; cursor: pointer; padding: 16px; }
.compact-drop { min-height: auto; padding: 12px 16px; white-space: nowrap; font-weight: 850; }
.file-drop.needs-selection { color: var(--amber); border-color: #6b5b32; }
.file-input-hidden { position: fixed; left: -10000px; top: auto; width: 1px; height: 1px; opacity: 0; }
.sheet-file-status small, .sheet-file-status strong, .sheet-file-status span { display: block; }
.sheet-file-status small { color: var(--muted); font-size: 8px; letter-spacing: .12em; font-weight: 900; }
.sheet-file-status strong { margin: 7px 0 4px; }
.sheet-file-status span { color: var(--muted); font-size: 10px; }
.import-progress { margin: 18px 0; border: 1px solid #364b5c; background: #0d141b; border-radius: 14px; padding: 16px; }
.import-progress > div { height: 7px; overflow: hidden; border-radius: 999px; background: #242c25; margin-bottom: 12px; }
.import-progress > div span { display: block; width: 8%; height: 100%; border-radius: inherit; background: var(--lime); transition: width .25s ease; }
.import-progress strong, .import-progress small { display: block; }
.import-progress small { color: var(--muted); margin-top: 5px; }
.import-review { margin-top: 18px; border: 1px solid #46677d; background: #101820; border-radius: 16px; padding: 18px; }
.import-review-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.import-review-head h3 { margin: 5px 0; }
.import-review-head small { color: var(--muted); }
.import-table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; }
.import-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.import-table th, .import-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.import-table tr:last-child td { border-bottom: 0; }
.import-table th { color: var(--muted); font-size: 8px; letter-spacing: .11em; background: #0b0f0c; }
.import-table td { font-size: 11px; }
.import-table td strong { color: var(--lime); }
.import-table td:first-child > span, .import-table td small { display: block; margin-top: 5px; color: var(--muted); }
.import-table select, .import-table input, .import-table textarea { width: 100%; min-width: 170px; margin: 0; }
.import-table textarea { min-height: 72px; resize: vertical; }
.setup-import-error { color: #ff7987 !important; line-height: 1.35; }
.setup-import-excluded { color: var(--muted); font-weight: 800; }
.confidence-pill { display: inline-block; border-radius: 999px; padding: 5px 8px; font-size: 8px; font-weight: 900; letter-spacing: .08em; background: #253025; color: #dce8d7; }
.confidence-pill.medium { color: var(--amber); background: rgba(255,181,44,.1); }
.import-actions { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: end; }
.import-note { margin: 0; }
.last-setup-status { text-align: right; }
.last-setup-status small { display: block; color: var(--muted); font-size: 8px; letter-spacing: .12em; font-weight: 900; }
.last-setup-status strong { display: block; margin-top: 6px; font-size: 11px; color: var(--lime); }
.setup-working-status { display: grid; grid-template-columns: 1.35fr .65fr 1fr; border: 1px solid #4b5840; border-radius: 14px; overflow: hidden; margin-bottom: 18px; background: #0d120e; }
.setup-working-status > div { padding: 14px; border-right: 1px solid var(--line); }
.setup-working-status > div:last-child { border-right: 0; }
.setup-working-status small, .setup-working-status strong, .setup-working-status span { display: block; }
.setup-working-status small { color: var(--muted); font-size: 7px; font-weight: 900; letter-spacing: .12em; }
.setup-working-status strong { color: var(--lime); margin: 6px 0 4px; font-size: 12px; }
.setup-working-status span { color: var(--muted); font-size: 9px; line-height: 1.4; }
.setup-working-status.testing { border-color: #76632f; }
.setup-working-status.testing strong, .setup-working-status.changed strong { color: var(--amber); }
.setup-working-status.unconfirmed { border-color: #4d5250; }
.setup-version-save { display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: end; gap: 12px; }
.setup-version-save label { margin: 0; }
.setup-version-history { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.compact-title { margin-bottom: 12px; }
.compact-title h3 { margin: 5px 0 0; }
.setup-version-list { display: grid; gap: 8px; }
.setup-version-row { display: grid; grid-template-columns: 110px minmax(140px, 1fr) minmax(180px, 1.4fr) auto; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: #0d110e; }
.setup-version-row span, .setup-version-row small { color: var(--muted); font-size: 9px; }
.setup-version-row strong { font-size: 11px; }
.setup-version-row p { margin: 0; color: var(--muted); font-size: 9px; }
.setup-version-row button { padding: 7px 10px; font-size: 9px; }
.setup-save-panel, .setup-versions-panel { overflow: hidden; padding: 0; border-color: #3c5364; }
.setup-save-panel { margin-top: 17px; }
.setup-versions-panel { margin-top: 12px; }
.setup-record-toggle { width: 100%; min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 0; border-radius: inherit; background: transparent; color: inherit; text-align: left; }
.setup-record-toggle:hover { border-color: transparent; background: rgba(35, 174, 239, .06); transform: none; }
.setup-record-toggle:focus-visible { outline: 2px solid #62c8f4; outline-offset: -2px; }
.setup-record-heading { min-width: 0; display: block; }
.setup-record-heading > span, .setup-record-heading > strong, .setup-record-heading > small { display: block; }
.setup-record-heading > strong { margin-top: 4px; font-size: 17px; line-height: 1.25; }
.setup-record-heading > small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.setup-record-right { flex: 0 0 auto; display: flex; align-items: center; gap: 9px; }
.setup-record-action, .setup-record-count { color: var(--race-blue); font-size: 10px; font-weight: 900; letter-spacing: .06em; white-space: nowrap; }
.setup-record-count { padding: 7px 10px; border-radius: 999px; background: rgba(35, 174, 239, .1); }
.setup-record-chevron { width: 18px; color: #92a8b8; font-size: 18px; line-height: 1; text-align: center; transition: transform .18s ease; }
.setup-record-toggle[aria-expanded="true"] .setup-record-chevron { transform: rotate(180deg); }
.setup-save-content, .setup-saved-content { padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.setup-save-content[hidden], .setup-saved-content[hidden] { display: none; }
.setup-save-content textarea { min-height: 88px; }
.change-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.change-row-actions button { padding: 7px 9px; font-size: 8px; }

.context-bar { padding: 17px; display: grid; grid-template-columns: 1fr 1fr 1fr .7fr auto; gap: 12px; align-items: end; margin-bottom: 17px; }
.context-bar label { margin: 0; }
.context-bar > div { align-self: center; }
.context-bar > div small { display: block; color: var(--muted); font-size: 8px; letter-spacing: .12em; margin-bottom: 6px; }
.setup-context-picker { overflow: hidden; margin-bottom: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(150deg, #18222c, #10171f); }
.setup-context-picker > summary { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 17px; cursor: pointer; list-style: none; }
.setup-context-picker > summary::-webkit-details-marker { display: none; }
.setup-context-picker > summary:hover { background: rgba(35, 174, 239, .06); }
.setup-context-picker > summary:focus-visible { outline: 2px solid #62c8f4; outline-offset: -2px; }
.setup-context-copy { min-width: 0; }
.setup-context-copy, .setup-context-copy strong, .setup-context-copy small { display: block; }
.setup-context-copy strong { margin: 7px 0 4px; color: var(--ink); font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.setup-context-copy small { color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.setup-context-change { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; color: #62c8f4; font-size: 11px; font-weight: 850; }
.setup-context-chevron { color: #92a8b8; font-size: 18px; line-height: 1; transition: transform .18s ease; }
.setup-context-picker[open] .setup-context-chevron { transform: rotate(180deg); }
.setup-context-picker > .context-bar { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: #0d151d; }
.track-choice-card { cursor: default; grid-template-columns: 44px minmax(150px, 1fr) minmax(220px, 1.2fr) auto; }
.track-choice-card label { margin: 0; }
.visual-reference-panel { background: linear-gradient(135deg, #eff1e9, #dfe4dc); color: #161b18; }
.visual-reference-panel .panel-title small { color: #687169; }
.sheet-credit { color: #71808b; font-size: 9px; font-weight: 850; text-decoration: none; border-bottom: 1px solid #aab5bc; }
.component-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.component-card { border: 1px solid #c1c8bf; background: #fff; color: #171b18; border-radius: 14px; padding: 0; overflow: hidden; text-align: left; cursor: pointer; transition: .18s; }
.component-card:hover { transform: translateY(-2px); border-color: #287cab; box-shadow: 0 8px 24px rgba(7, 20, 31, .22); }
.component-card img { display: block; width: 100%; height: 128px; object-fit: contain; background: #fff; border-bottom: 1px solid #dce0d9; }
.component-card span { display: block; padding: 12px; }
.component-card b { display: block; font-size: 12px; }
.component-card small { display: block; color: #707970; font-size: 9px; line-height: 1.4; margin-top: 4px; }
.setup-layout { display: grid; grid-template-columns: minmax(390px, 470px) minmax(0, 1fr); gap: 17px; align-items: start; margin-bottom: 17px; }
.setup-layout > .conversation-panel { grid-column: 1; grid-row: 1; }
.setup-layout > .setup-form-grid { grid-column: 2; grid-row: 1; }
.setup-page-actions, .crew-page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.setup-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; margin-bottom: 17px; }
.setup-form-grid .span-2 { grid-column: 1 / -1; }
.setup-section { padding: 0; overflow: hidden; }
.setup-section > summary { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; cursor: pointer; list-style: none; user-select: none; }
.setup-section > summary::-webkit-details-marker { display: none; }
.setup-section > summary strong { font-size: 14px; color: #eef1eb; }
.setup-section > summary small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.setup-section > summary:after { content: "+"; width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #39433c; border-radius: 8px; color: var(--lime); font-size: 16px; }
.setup-section[open] > summary { border-bottom: 1px solid var(--line); background: #171d18; }
.setup-section[open] > summary:after { content: "−"; }
.setup-section-body { padding: 12px 14px 14px; }
.setup-field-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: stretch; }
.setup-field-list > label {
  min-width: 0;
  min-height: 78px;
  height: 100%;
  margin: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1219;
}
.setup-field-list > label:not(.setup-check) { font-size: 9px; line-height: 1.25; letter-spacing: .035em; }
.setup-field-list input, .setup-field-list select { min-height: 38px; margin-top: auto; padding: 7px 8px; border-radius: 8px; font-size: 11px; }
[data-signed-number="true"] { font-variant-numeric: tabular-nums; }
.setup-field-list label small { display: block; color: var(--muted); margin-top: 5px; font-size: 8px; }
.setup-field-list input[readonly] { color: #b7c0b8; background: #0d110f; border-style: dashed; cursor: default; }
.setup-check { justify-content: center; align-items: flex-start; color: #c9cec9; }
.setup-check input { width: 15px; height: 15px; min-height: 0; margin: 0; padding: 0; accent-color: var(--lime); }
.setup-check span { font-size: 9px; line-height: 1.2; }
.imported-fields-panel { border-color: #536540; }
.compact-empty { padding: 16px; grid-column: 1 / -1; }
.pill-calculator { margin-top: 18px; border: 1px solid #35483a; border-radius: 18px; background: linear-gradient(145deg, #0b100d, #111a14); padding: 17px; overflow: hidden; }
.pill-heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 15px; }
.pill-heading > div > small { color: var(--lime); font-size: 8px; font-weight: 950; letter-spacing: .12em; }
.pill-heading h3 { margin: 4px 0 5px; font-size: 21px; }
.pill-heading p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; max-width: 610px; }
.mirror-toggle { flex: 0 0 auto; display: grid; grid-template-columns: 19px auto; gap: 2px 8px; align-items: center; padding: 9px 11px; margin: 0; border: 1px solid var(--line); border-radius: 11px; background: #0b0e0c; }
.mirror-toggle input { grid-row: 1 / 3; width: 18px; height: 18px; accent-color: var(--lime); }
.mirror-toggle span { font-size: 10px; font-weight: 800; }
.mirror-toggle small { color: var(--muted); font-size: 7px; }
.pill-mount-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pill-mount-card { border: 1px solid #2d3e4b; border-radius: 14px; background: #111922; padding: 12px; }
.pill-mount-title { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 7px; }
.pill-mount-title strong { font-size: 11px; }
.pill-mount-title span { color: var(--muted); font-size: 8px; }
.pill-saved-summary { display: grid; gap: 7px; margin-top: 12px; padding: 11px 12px; border: 1px solid rgba(9, 148, 218, .65); border-radius: 13px; background: rgba(4, 73, 112, .22); }
.pill-saved-summary > small { color: #37b9f4; font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.pill-saved-summary > div { display: grid; grid-template-columns: 60px 1fr; gap: 9px; align-items: baseline; }
.pill-saved-summary strong { color: #f5f8fa; font-size: 11px; }
.pill-saved-summary span { color: #d7e7f0; font-size: 10px; line-height: 1.35; }
.pill-mount { position: relative; height: 116px; }
.pill-mount svg { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(0,0,0,.28)); }
.pill-mount svg path { fill: #185db2; stroke: #5fa5ff; stroke-width: 2; }
.pill-mount.d svg path { fill: #174e93; }
.mount-name { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: rgba(255,255,255,.42); font-size: 27px; font-weight: 1000; }
.mount-pill { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; padding: 3px; border: 2px solid transparent; border-radius: 11px; background: transparent; cursor: pointer; }
.mount-pill.left { left: 7%; }
.mount-pill.right { right: 7%; }
.mount-pill.active { border-color: var(--race-blue); background: rgba(7,143,209,.15); box-shadow: 0 0 0 3px rgba(7,143,209,.1); }
.mount-pill small { display: block; margin-top: 2px; color: white; font-size: 7px; text-transform: uppercase; }
.pill-face { position: relative; width: 49px; height: 49px; display: grid; place-items: center; border-radius: 8px; border: 2px solid #1b1e1c; background: #f0f0e8; color: #161916; box-shadow: inset 0 0 0 2px #aab0a7; }
.pill-face.compact { width: 36px; height: 36px; border-radius: 7px; }
.pill-face b { font-size: 13px; }
.pill-face.compact b { font-size: 10px; }
.pill-dot { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #121512; }
.pill-dot.up { top: 5px; left: 50%; transform: translateX(-50%); }
.pill-dot.down { bottom: 5px; left: 50%; transform: translateX(-50%); }
.pill-dot.left { left: 5px; top: 50%; transform: translateY(-50%); }
.pill-dot.right { right: 5px; top: 50%; transform: translateY(-50%); }
.pill-dot.up-left { left: 7px; top: 7px; }
.pill-dot.up-right { right: 7px; top: 7px; }
.pill-dot.down-left { left: 7px; bottom: 7px; }
.pill-dot.down-right { right: 7px; bottom: 7px; }
.pill-picker { margin-top: 12px; border: 1px solid #2d3931; border-radius: 13px; padding: 12px; background: #0b0f0c; }
.pill-picker-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.pill-picker-head strong { font-size: 10px; text-transform: capitalize; }
.pill-picker-head span { color: var(--muted); font-size: 8px; }
.pill-corner-note { margin: -2px 0 10px; color: #aeb7af; font-size: 8px; line-height: 1.4; }
.pill-option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 7px; }
.pill-option { display: grid; justify-items: center; gap: 5px; min-width: 0; padding: 7px 3px; border: 1px solid #303833; border-radius: 10px; background: #151a17; cursor: pointer; }
.pill-option:hover, .pill-option.active { border-color: var(--lime); background: #1b2518; }
.pill-option span { color: #b6beb7; font-size: 7px; white-space: nowrap; }
.pill-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 12px; overflow: hidden; border: 1px solid #2c3730; border-radius: 13px; background: #2c3730; }
.pill-results > div { min-height: 65px; padding: 11px; background: #101612; }
.pill-results small { display: block; color: #879088; font-size: 7px; font-weight: 900; letter-spacing: .08em; margin-bottom: 6px; }
.pill-results strong { display: block; color: #e8ece6; font-size: 11px; line-height: 1.3; }
.pill-warning { margin-top: 9px; padding: 9px 11px; border: 1px solid #6a5328; border-radius: 9px; background: #211b0f; color: #f0cb75; font-size: 9px; line-height: 1.4; }
.pill-auto-save-note { margin: 10px 2px 0; color: var(--muted); font-size: .82rem; }
.pill-empty { color: var(--muted); font-size: 10px; padding: 8px; }
.pit-panel { padding: 22px; position: sticky; top: 94px; max-height: calc(100vh - 114px); display: flex; flex-direction: column; min-height: 690px; }
.crew-context-bar { grid-template-columns: 1fr 1fr 1fr .7fr; }
.pit-panel h2 { margin: 12px 0 0; font-size: 27px; letter-spacing: -.035em; }
.conversation-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.ai-connection-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.ai-connection-controls > button { min-height: 30px; padding: 6px 10px; font-size: 8px; }
.ai-connection { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #0c100d; padding: 7px 9px; border-radius: 999px; white-space: nowrap; }
.ai-connection span { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 9px rgba(255, 181, 44, .45); }
.ai-connection strong { font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.ai-connection.online span { background: var(--race-blue); box-shadow: 0 0 9px rgba(7, 143, 209, .7); }
.ai-connection.offline span { background: #89908a; box-shadow: none; }
.ai-connect-panel { margin-top: 14px; padding: 14px; border: 1px solid #665a36; border-radius: 14px; background: #17150f; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(190px, 1fr) auto; align-items: end; gap: 10px; }
.ai-connect-panel > div strong { color: var(--amber); font-size: 12px; }
.ai-connect-panel p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.ai-connect-panel label { color: var(--muted); font-size: 8px; font-weight: 850; }
.ai-connect-panel input { margin-top: 5px; }
.ai-connect-panel button { min-height: 42px; }
.ai-connect-panel > small { grid-column: 1 / -1; min-height: 12px; color: var(--amber); font-size: 9px; }
.conversation-context { margin: 15px 0 12px; border-left: 3px solid var(--lime); border-radius: 0 10px 10px 0; background: #101611; color: #c5ccc5; padding: 10px 12px; font-size: 10px; line-height: 1.45; }
.chat-thread { flex: 1; min-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 15px; background: #090d0a; padding: 12px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.chat-message { max-width: 92%; border-radius: 14px; padding: 11px 12px; font-size: 11px; line-height: 1.55; }
.chat-message p { margin: 0; white-space: pre-wrap; }
.chat-message.user { align-self: flex-end; background: #173a73; border: 1px solid #287bb0; color: #f5f7f7; border-bottom-right-radius: 4px; }
.chat-message.assistant { align-self: flex-start; background: #171d18; border: 1px solid #2d3730; color: #c9d0ca; border-bottom-left-radius: 4px; font-size: 13px; }
.chat-message.system { align-self: center; max-width: 100%; background: transparent; color: #7f8880; text-align: center; font-size: 9px; padding: 3px 8px; }
.chat-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; color: var(--lime); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.chat-recommendation { margin-top: 11px; border: 1px solid #52643d; background: #10160e; border-radius: 13px; padding: 12px; }
.chat-recommendation > small { color: var(--lime); font-size: 8px; font-weight: 900; letter-spacing: .09em; }
.chat-recommendation h3 { font-size: 17px; line-height: 1.15; margin: 6px 0; color: #f0f4eb; }
.chat-recommendation .change { display: flex; align-items: center; gap: 8px; margin: 11px 0; font-size: 14px; }
.chat-recommendation .change b { color: #69706a; }
.chat-recommendation .trade, .chat-recommendation .test { border-top: 1px solid #2b342b; padding: 9px 0; display: grid; grid-template-columns: 63px 1fr; gap: 7px; }
.chat-recommendation .trade span, .chat-recommendation .test span { font-size: 7px; letter-spacing: .08em; font-weight: 900; color: var(--amber); }
.chat-recommendation .test span { color: var(--lime); }
.chat-recommendation .trade p, .chat-recommendation .test p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.chat-recommendation.diagnostic-card { border-color: #665a36; background: #17150f; }
.chat-recommendation.diagnostic-card > small { color: var(--amber); }
.chat-recommendation.diagnostic-card .test:first-of-type span { color: var(--amber); }
.recommendation-actions, .feedback-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.recommendation-actions button, .feedback-actions button { padding: 8px 10px; font-size: 9px; }
.recommendation-run-action { display: grid; gap: 5px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #2b342b; }
.recommendation-run-action button { width: 100%; padding: 10px; font-size: 10px; }
.recommendation-run-action small { color: var(--muted); font-size: 8px; text-align: center; }
.recommendation-status { color: var(--lime); font-size: 9px; font-weight: 850; margin-top: 9px; }
.recommendation-status.waiting-check { color: var(--amber); }
.chat-thinking { color: var(--muted); font-size: 9px; padding: 8px 2px; }
.chat-thinking span { display: inline-block; width: 6px; height: 6px; background: var(--lime); border-radius: 50%; margin-right: 3px; animation: chatPulse 1s infinite alternate; }
.chat-thinking span:nth-child(2) { animation-delay: .2s; }
.chat-thinking span:nth-child(3) { animation-delay: .4s; }
@keyframes chatPulse { to { opacity: .25; transform: translateY(-2px); } }
.chat-compose { margin-top: 10px; }
.chat-compose textarea { margin: 0; resize: vertical; min-height: 70px; }
.chat-compose-actions { display: flex; gap: 7px; justify-content: flex-end; margin-top: 7px; }
.chat-compose-actions button { padding: 9px 11px; font-size: 10px; }
.mic-button.listening { color: #62c8f4; border-color: var(--race-blue); box-shadow: 0 0 14px rgba(7,143,209,.22); }
.ai-privacy { margin: 8px 0 0; color: #687069; font-size: 8px; line-height: 1.4; }
.chat-sources { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.chat-sources > span { width: 100%; color: #778079; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.chat-sources a { max-width: 100%; padding: 5px 8px; overflow: hidden; color: var(--lime); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; border: 1px solid #303830; border-radius: 8px; background: #0a0d0b; }
.chat-sources a:hover { border-color: var(--lime); }
.calc-strip { display: grid; grid-template-columns: repeat(3, 1fr); background: #0a0d0b; border-radius: 13px; overflow: hidden; }
.calc-strip div { padding: 13px; border-right: 1px solid var(--line); }
.calc-strip div:last-child { border-right: 0; }
.calc-strip small { color: #747c75; font-size: 7px; font-weight: 900; letter-spacing: .12em; display: block; }
.calc-strip strong { display: block; margin-top: 5px; font-size: 13px; }

.history-list { display: grid; gap: 8px; }
.compact-list { margin-top: 18px; }
.history-row { display: grid; grid-template-columns: 100px 1fr 1.4fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); background: #0d110e; border-radius: 11px; padding: 12px; }
.history-row span { color: var(--muted); font-size: 10px; }
.history-row strong { font-size: 12px; }
.history-row p { margin: 0; color: var(--muted); font-size: 10px; }
.history-row em { font-style: normal; color: var(--lime); font-size: 9px; }
.empty-state { color: var(--muted); border: 1px dashed #364039; border-radius: 12px; padding: 18px; text-align: center; font-size: 11px; }

.data-summary { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 17px; overflow: hidden; margin-bottom: 17px; }
.data-summary article { padding: 19px; background: #131714; border-right: 1px solid var(--line); }
.data-summary article:last-child { border-right: 0; }
.data-summary small { color: var(--muted); display: block; font-size: 8px; letter-spacing: .13em; font-weight: 900; margin-bottom: 8px; }
.data-summary strong { font-size: 17px; }
.run-form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.run-form-actions { justify-content: space-between; margin-top: 4px; }
.run-scan-card { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 0 0 18px; padding: 16px; border: 1px solid #1684bd; border-radius: 14px; background: linear-gradient(135deg, #101f29, #0d141b); }
.run-scan-card strong, .run-scan-card small { display: block; }
.run-scan-card strong { margin: 7px 0 4px; }
.run-scan-card small, .run-scan-review small { color: var(--muted); line-height: 1.45; }
.run-scan-card-actions { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(120px, .8fr); gap: 9px; }
.run-scan-card-actions button { min-height: 48px; }
.manual-entry-action { background: #111b23; border-color: #415664; color: #f0f5f7; box-shadow: none; }
.run-scan-review { margin: 0 0 18px; padding: 12px 14px; border: 1px solid #46677d; border-radius: 12px; background: #101820; }
.run-scan-review strong, .run-scan-review small { display: block; }
.run-scan-review strong { margin: 5px 0 3px; color: #eaf7ff; }
.data-table tbody tr[data-run-detail] { cursor: pointer; transition: background .16s ease, outline-color .16s ease; }
.data-table tbody tr[data-run-detail]:hover, .data-table tbody tr[data-run-detail]:focus-visible { background: #132230; outline: 2px solid #4bb9ed; outline-offset: -2px; }
.run-detail-card { margin-top: 16px; padding: 18px; border: 1px solid #46677d; border-radius: 16px; background: linear-gradient(145deg, #101a23, #0b1218); }
.run-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.run-detail-grid div { min-height: 70px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #0b1117; }
.run-detail-grid small, .run-detail-grid strong, .run-detail-notes small { display: block; }
.run-detail-grid small, .run-detail-notes small { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.run-detail-grid strong { margin-top: 7px; color: #eef8ff; line-height: 1.35; }
.run-detail-notes { margin-top: 10px; padding: 13px; border-left: 3px solid #4bb9ed; background: #0b1117; }
.run-detail-notes p { margin: 7px 0 0; white-space: pre-wrap; }
.performance-averages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.livetime-panel { display: flex; justify-content: space-between; align-items: center; gap: 25px; border-color: #594821; }
.livetime-panel h2 { margin: 12px 0 6px; }
.livetime-panel p { color: var(--muted); margin: 0; font-size: 12px; }
.livetime-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.livetime-steps span { display: inline-flex; align-items: center; gap: 6px; color: #c6ccc6; font-size: 9px; }
.livetime-steps b { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 181, 44, .15); color: var(--amber); font-size: 8px; }
.livetime-return-card { position: fixed; right: 24px; bottom: 24px; z-index: 1100; width: min(390px, calc(100% - 32px)); padding: 20px; border: 1px solid #76602e; border-radius: 18px; background: linear-gradient(145deg, #211c11, #121510); box-shadow: 0 24px 70px rgba(0, 0, 0, .58); }
.livetime-return-card h2 { margin: 12px 0 7px; font-size: 22px; }
.livetime-return-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.livetime-return-card > div { display: flex; gap: 8px; margin-top: 15px; }
.livetime-return-card button { flex: 1; }
.small-select { width: auto; min-width: 170px; margin: 0; }
.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 1180px; }
.data-table th { text-align: left; color: #737b74; font-size: 8px; letter-spacing: .12em; padding: 10px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 12px 10px; border-bottom: 1px solid #222923; color: #c6ccc6; font-size: 11px; }

.profile-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 18px; align-items: start; }
.profile-summary {
  position: sticky;
  top: 94px;
  overflow: hidden;
  border: 1px solid #2f3b46;
  border-radius: 18px;
  background: #0d1822;
  text-align: left;
}
.profile-summary-stripe { height: 9px; background: linear-gradient(90deg, var(--race-red) 0 38%, var(--ink) 38% 48%, var(--race-blue) 48% 100%); }
.profile-summary-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 15px; padding: 22px 20px 18px; }
.profile-summary-copy { min-width: 0; }
.profile-summary-copy > small { color: var(--race-blue); font-size: 8px; letter-spacing: .14em; font-weight: 900; }
.profile-summary h2 { margin: 9px 0 7px; font-size: 27px; letter-spacing: -.04em; }
.profile-summary p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.profile-ready-status { padding: 10px 11px; border: 1px solid rgba(7, 143, 209, .52); border-radius: 9px; color: var(--race-blue); text-align: center; }
.profile-ready-status small, .profile-ready-status strong { display: block; }
.profile-ready-status small { font-size: 7px; letter-spacing: .1em; }
.profile-ready-status strong { margin-top: 3px; font-size: 9px; letter-spacing: .04em; white-space: nowrap; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: #101f2a; text-align: center; }
.profile-stats div { border-right: 1px solid var(--line); }
.profile-stats div { padding: 15px 8px; }
.profile-stats div:last-child { border-right: 0; }
.profile-stats strong, .profile-stats small { display: block; }
.profile-stats strong { font-size: 21px; }
.profile-stats small { color: var(--muted); font-size: 7px; letter-spacing: .09em; margin-top: 3px; }
.panel-intro { margin: -2px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.preference-panel .panel-title { margin-bottom: 14px; }
.preference-panel .panel-intro { margin-bottom: 14px; }
.preference-add-toggle { width: 100%; min-height: 42px; }
.preference-add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 9px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #0d110e; }
.preference-add-grid[hidden], .preference-card-edit[hidden] { display: none; }
.preference-add-grid label { margin: 0; }
.preference-add-grid select, .preference-add-grid input { min-height: 38px; margin-top: 5px; margin-bottom: 0; padding: 9px 10px; }
.preference-add-grid button { min-height: 38px; white-space: nowrap; }
.preference-list { display: grid; gap: 9px; margin-top: 12px; }
.preference-empty { padding: 22px; border: 1px dashed #344036; border-radius: 14px; color: var(--muted); font-size: 11px; text-align: center; line-height: 1.6; }
.preference-card { overflow: hidden; border: 1px solid #303a31; border-radius: 13px; background: linear-gradient(145deg, #111712, #0d100e); }
.preference-card.locked { border-color: #36617b; }
.preference-card-toggle { width: 100%; min-height: 58px; padding: 9px 11px; border: 0; color: inherit; background: transparent; text-align: left; }
.preference-card-toggle:hover { border-color: transparent; background: rgba(35, 174, 239, .06); transform: none; }
.preference-card-toggle:focus-visible { outline: 2px solid #62c8f4; outline-offset: -2px; }
.preference-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.preference-card-copy { min-width: 0; }
.preference-card-copy, .preference-card-title, .preference-card-meta { display: block; }
.preference-card-title { margin: 2px 0; overflow: hidden; font-size: 15px; font-weight: 800; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.preference-card-meta { margin: 0; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.preference-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.preference-badge { padding: 4px 7px; border-radius: 999px; background: #1c241d; color: #aeb7ae; font-size: 7px; font-weight: 900; letter-spacing: .08em; white-space: nowrap; }
.preference-badge.high { background: rgba(7, 143, 209, .15); color: #62c8f4; }
.preference-badge.medium { background: rgba(255, 181, 44, .13); color: var(--amber); }
.preference-chevron { width: 18px; color: #92a8b8; font-size: 18px; line-height: 1; text-align: center; transition: transform .18s ease; }
.preference-card-toggle[aria-expanded="true"] .preference-chevron { transform: rotate(180deg); }
.preference-card-edit { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: 8px 10px; padding: 10px 11px 11px; border-top: 1px solid #303a31; background: rgba(5, 10, 14, .28); }
.preference-card-edit label { margin: 0; }
.preference-card-edit input, .preference-card-edit select { min-height: 38px; margin-top: 5px; margin-bottom: 0; padding: 9px 10px; }
.preference-trait-field { grid-column: 1 / 7; }
.preference-scope-field { grid-column: 7 / -1; }
.preference-edit-note-field { grid-column: 1 / 9; }
.preference-actions { grid-column: 9 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; margin: 0; }
.preference-actions button { min-height: 38px; padding: 8px 10px; white-space: nowrap; }
.preference-privacy { margin: 15px 0 0; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.5; }
.preference-privacy strong { color: #cdd5cd; }
.racer-details-panel { overflow: hidden; padding: 0; }
.racer-details-toggle { width: 100%; min-height: 72px; padding: 14px 16px; border: 0; color: inherit; background: transparent; text-align: left; }
.racer-details-toggle:hover { border-color: transparent; background: rgba(35, 174, 239, .06); transform: none; }
.racer-details-toggle:focus-visible { outline: 2px solid #62c8f4; outline-offset: -2px; }
.racer-details-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.racer-details-copy { min-width: 0; }
.racer-details-copy, .racer-details-title, .racer-details-summary { display: block; }
.racer-details-title { margin: 4px 0 2px; overflow: hidden; font-size: 18px; font-weight: 800; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.racer-details-summary { overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.racer-details-chevron { width: 18px; flex: 0 0 auto; color: #92a8b8; font-size: 18px; line-height: 1; text-align: center; transition: transform .18s ease; }
.racer-details-toggle[aria-expanded="true"] .racer-details-chevron { transform: rotate(180deg); }
.racer-details-content { padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.racer-details-content[hidden] { display: none; }
.racer-details-content .two { margin-bottom: 0; }
.racer-details-content #saveProfileBtn { margin-top: 12px; }
.account-panel { overflow: hidden; padding: 0; }
.account-panel-toggle { width: 100%; min-height: 72px; padding: 14px 16px; border: 0; color: inherit; background: transparent; text-align: left; }
.account-panel-toggle:hover { border-color: transparent; background: rgba(35, 174, 239, .06); transform: none; }
.account-panel-toggle:focus-visible { outline: 2px solid #62c8f4; outline-offset: -2px; }
.account-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-panel-copy { min-width: 0; }
.account-panel-copy, .account-panel-title, .account-panel-summary { display: block; }
.account-panel-title { margin: 4px 0 2px; overflow: hidden; font-size: 18px; font-weight: 800; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.account-panel-summary { overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.account-panel-right { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.account-panel-chevron { width: 18px; color: #92a8b8; font-size: 18px; line-height: 1; text-align: center; transition: transform .18s ease; }
.account-panel-toggle[aria-expanded="true"] .account-panel-chevron { transform: rotate(180deg); }
.account-panel-details { padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.account-panel-details[hidden] { display: none; }
.account-status { display: grid; grid-template-columns: 1fr; gap: 12px; }
.account-status > div { background: #0d110e; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.account-status small { color: var(--lime); font-size: 8px; letter-spacing: .12em; font-weight: 900; }
.account-status strong { display: block; margin: 8px 0 5px; }
.account-status p { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 0; }
.membership-status { margin-top: 12px; padding: 15px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #34566d; border-radius: 14px; background: radial-gradient(circle at 95% 10%, rgba(7, 143, 209, .12), transparent 36%), #0d151d; }
.membership-status > div { min-width: 0; }
.membership-status small { color: #62c8f4; font-size: 8px; letter-spacing: .12em; font-weight: 900; }
.membership-status strong { display: block; margin: 7px 0 4px; }
.membership-status p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.membership-status .tag { flex: 0 0 auto; }
.account-reset { margin-top: 14px; border: 1px solid #5d3029; border-radius: 14px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.account-reset strong { display: block; }
.account-reset p { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 5px 0 0; }
.account-reset .danger { flex: 0 0 auto; }

.feedback-entry-panel .blue-action { min-width: 210px; }
.feedback-dialog { width: min(700px, calc(100% - 24px)); max-width: none; max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: transparent; overflow: auto; }
.feedback-dialog::backdrop { background: rgba(3, 7, 10, .84); backdrop-filter: blur(8px); }
.feedback-dialog-card { padding: 24px; border: 1px solid #3a6680; border-radius: 20px; background: linear-gradient(150deg, #18222c, #10171f); box-shadow: 0 28px 90px rgba(0, 0, 0, .58); }
.feedback-dialog-card .panel-title { margin-bottom: 18px; }
.feedback-dialog-card .panel-title h2 { margin: 5px 0 0; }
.feedback-dialog-card label { display: block; margin: 0 0 14px; color: #cdd5d8; font-size: 12px; font-weight: 800; }
.feedback-dialog-card select, .feedback-dialog-card textarea, .feedback-dialog-card input[type="file"] { width: 100%; margin-top: 7px; }
.feedback-dialog-card textarea { resize: vertical; min-height: 130px; }
.feedback-dialog-card input[type="file"] { padding: 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #0d151d; }
.feedback-optional { color: var(--muted); font-size: 10px; font-weight: 500; }
.feedback-saved-file, .feedback-message { margin: -4px 0 14px; color: #62c8f4; font-size: 11px; line-height: 1.45; }
.feedback-message.error { color: #ff8a92; }
.feedback-context { margin: 18px 0 14px; padding: 15px; border: 1px solid #34566d; border-radius: 14px; background: #0d151d; }
.feedback-context > div small, .feedback-context > div strong { display: block; }
.feedback-context > div small { color: #62c8f4; font-size: 8px; letter-spacing: .12em; font-weight: 900; }
.feedback-context > div strong { margin-top: 5px; }
.feedback-context dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 13px 0 0; }
.feedback-context dl div { min-width: 0; padding: 10px; border-radius: 10px; background: #111c25; }
.feedback-context dt { color: var(--muted); font-size: 9px; }
.feedback-context dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 11px; }
.feedback-privacy { margin: 0 0 14px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.feedback-form-actions { display: flex; justify-content: flex-end; gap: 9px; }
.feedback-form-actions button { min-width: 145px; }
@media (max-width: 620px) {
  .feedback-dialog { width: calc(100% - 12px); max-height: calc(100vh - 12px); }
  .feedback-dialog-card { padding: 18px; }
  .feedback-context dl { grid-template-columns: 1fr; }
  .feedback-form-actions { flex-direction: column-reverse; }
  .feedback-form-actions button { width: 100%; }
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--lime);
  color: #11160c;
  padding: 13px 17px;
  border-radius: 11px;
  font-weight: 850;
  font-size: 12px;
  transform: translateY(120px);
  transition: .25s;
  z-index: 50;
}
.toast.show { transform: translateY(0); }

@media (max-width: 1180px) {
  .activity-grid { grid-template-columns: 1fr 1fr; }
  .activity-card:last-child { grid-column: 1 / -1; min-height: 160px; }
  .context-bar { grid-template-columns: 1fr 1fr 1fr; }
  .context-bar .link-btn, .context-bar > button { width: 100%; }
  .component-grid { grid-template-columns: repeat(2, 1fr); }
  .setup-layout { grid-template-columns: 1fr; }
  .setup-layout > .conversation-panel, .setup-layout > .setup-form-grid { grid-column: 1; grid-row: auto; }
  .pit-panel { position: static; max-height: none; }
}

@media (max-width: 900px) {
  :root { --mobile-nav-height: 70px; }
  .performance-averages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell { display: block; }
  .topbar { position: static; }
  .rail {
    position: fixed !important;
    inset: auto 0 0 0;
    width: 100%;
    height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    min-height: var(--mobile-nav-height);
    background: #111512;
    z-index: 1000;
    border: 0;
    border-top: 1px solid var(--line);
    padding: 8px 8px max(8px, env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    transform: translateZ(0);
    backface-visibility: hidden;
    box-shadow: 0 -10px 28px rgba(0, 0, 0, .34);
  }
  .rail button { min-width: 0; text-align: center; padding: 7px 2px; font-size: clamp(8px, 1.4vw, 10px); }
  .rail button span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar { padding: 0 18px; }
  .context-pill { display: none; }
  main { padding: 34px 18px calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 36px); }
  .toast { bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 14px); }
  .hero { align-items: flex-start; flex-direction: column; }
  .home-welcome { min-height: 0; align-items: flex-start; flex-direction: column; }
  .home-engineer-status { align-self: stretch; }
  .today-card { width: 100%; }
  .activity-grid, .garage-layout, .track-directory, .form-grid, .profile-layout { grid-template-columns: 1fr; }
  .preference-add-grid { grid-template-columns: 1fr 1fr; }
  .preference-note-field { grid-column: 1 / -1; }
  .setup-field-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pill-mount-grid { grid-template-columns: 1fr; }
  .pill-option-grid { grid-template-columns: repeat(5, 1fr); }
  .activity-card:last-child, .span-2 { grid-column: auto; }
  .garage-sidebar, .maintenance-panel, .profile-summary { position: static; }
  .five { grid-template-columns: repeat(2, 1fr); }
  .home-footer, .data-summary { grid-template-columns: repeat(2, 1fr); }
  .home-footer div:nth-child(2), .data-summary article:nth-child(2) { border-right: 0; }
  .home-footer div:nth-child(-n+2), .data-summary article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 600px) {
  .pan-service-checks { grid-template-columns: 1fr; }
  .account-onboarding { padding: 12px; place-items: start center; }
  .onboarding-card { border-radius: 22px; padding: 25px 20px; }
  .onboarding-brand { margin-bottom: 25px; }
  .onboarding-card h1 { font-size: 42px; }
  .account-reset { align-items: stretch; flex-direction: column; }
  .membership-status { align-items: flex-start; flex-direction: column; }
  .profile-summary-main { gap: 10px; padding: 18px 16px 15px; }
  .profile-summary h2 { font-size: 24px; }
  .profile-ready-status { padding: 9px; }
  .performance-averages { grid-template-columns: 1fr; }
  .run-form-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .run-form-actions button { width: 100%; }
  .run-scan-card { grid-template-columns: 1fr; }
  .run-scan-actions button { width: 100%; }
  .run-scan-actions { flex-direction: column-reverse; }
  .run-scan-values { grid-template-columns: 1fr 1fr; }
  .run-detail-grid { grid-template-columns: 1fr 1fr; }
  .topbar .ghost { font-size: 0; padding: 10px; }
  .topbar .ghost:after { content: "Export"; font-size: 10px; }
  .hero h1 { font-size: clamp(34px, 10.8vw, 44px); }
  .activity-grid, .choice-grid, .two, .three, .context-bar, .component-grid, .account-status { grid-template-columns: 1fr; }
  .preference-add-grid, .preference-card-edit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preference-add-grid > *, .preference-card-edit > * { min-width: 0; }
  .preference-note-field, .preference-add-grid button { grid-column: 1 / -1; }
  .preference-add-grid button { width: 100%; }
  .preference-trait-field { grid-column: 1; }
  .preference-scope-field { grid-column: 2; }
  .preference-edit-note-field, .preference-actions { grid-column: 1 / -1; }
  .preference-card-edit input, .preference-card-edit select { min-width: 0; text-overflow: ellipsis; }
  .preference-panel .panel-title { flex-direction: row; gap: 8px; }
  .preference-card-head { flex-direction: row; }
  .preference-badges { justify-content: flex-end; }
  .preference-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-content: stretch; gap: 6px; }
  .preference-actions button { width: 100%; min-width: 0; padding: 8px 5px; font-size: 11px; }
  .preference-actions [data-preference-action="confirm"] { grid-column: 1 / -1; }
  .preference-badge { display: none; }
  .setup-page-actions, .crew-page-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .setup-page-actions button, .crew-page-actions button { width: 100%; }
  .sheet-upload-row, .sheet-step, .import-actions, .setup-working-status, .setup-version-save, .setup-version-row { grid-template-columns: 1fr; }
  .sheet-file-actions, .sheet-file-actions button { width: 100%; }
  .setup-working-status > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .setup-working-status > div:last-child { border-bottom: 0; }
  .sheet-step > span { width: 34px; height: 34px; }
  .sheet-step .link-btn, .compact-drop { width: 100%; }
  .import-review-head { flex-direction: column; }
  .import-table { min-width: 0; }
  .import-table thead { display: none; }
  .import-table tbody, .import-table tr, .import-table td { display: block; width: 100%; }
  .import-table tr { padding: 13px; border-bottom: 1px solid var(--line); }
  .import-table tr:last-child { border-bottom: 0; }
  .import-table td { padding: 7px 0; border: 0; }
  .import-table td::before { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .1em; }
  .import-table td:nth-child(1)::before { content: "ORIGINAL SHEET ENTRY"; }
  .import-table td:nth-child(2)::before { content: "PLACE IN SETUP"; }
  .import-table td:nth-child(3)::before { content: "REVIEW VALUE"; }
  .import-table td:nth-child(4)::before { content: "STATUS"; }
  .import-table select, .import-table input, .import-table textarea { min-width: 0; }
  .pill-heading, .pill-picker-head { flex-direction: column; }
  .mirror-toggle { width: 100%; }
  .pill-option-grid { grid-template-columns: repeat(3, 1fr); }
  .pill-results { grid-template-columns: 1fr 1fr; }
  .five { grid-template-columns: 1fr 1fr; }
  .home-welcome { padding: 14px 18px; border-radius: 22px; }
  .home-welcome h1 { font-size: clamp(32px, 9.2vw, 40px); }
  .home-welcome p { font-size: 13px; line-height: 1.45; }
  .home-guide-link { grid-template-columns: 40px minmax(0, 1fr); padding: 12px 14px; }
  .home-guide-icon { width: 40px; height: 40px; }
  .home-guide-link > b { grid-column: 2; }
  .home-engineer-status { display: none; }
  .activity-card { min-height: 120px; padding: 10px 16px; }
  .activity-card:last-child { min-height: 120px; }
  .activity-card .tag { padding: 4px 8px; font-size: 8px; }
  .activity-card h2 { margin: 7px 0 4px; font-size: 21px; }
  .activity-card p { font-size: 12px; line-height: 1.35; }
  .activity-card > b, .activity-card.practice > b, .activity-card.maintenance > b { padding-top: 6px; font-size: 10px; }
  .home-session-progress span { padding: 9px 4px; gap: 5px; font-size: 8px; }
  .home-session-progress span b { width: 19px; height: 19px; font-size: 8px; }
  .home-vehicle-picker {
    padding: 14px;
    grid-template-columns: 1fr;
    grid-template-areas: "vehicle" "detail" "continue";
  }
  .home-vehicle-picker button { width: 100%; }
  .track-choice-card { grid-template-columns: 44px 1fr; }
  .track-choice-card label, .track-choice-card > .primary { grid-column: 1 / -1; width: 100%; }
  .home-stage-context { align-items: flex-start; flex-direction: column; }
  .home-track-selection { grid-template-columns: 1fr; }
  .home-track-selection { padding: 14px; gap: 8px; }
  .home-track-selection h3 { font-size: 20px; }
  .home-track-selection > .primary { width: 100%; }
  .home-setup-actions { align-items: stretch; flex-direction: column; }
  .home-setup-actions button, .home-session-stage > .ghost { width: 100%; max-width: 100%; }
  .ai-connect-panel { grid-template-columns: 1fr; }
  .ai-connect-panel > small { grid-column: auto; }
  .ai-connect-panel button { width: 100%; }
  .vehicle-select { grid-template-columns: 48px 1fr; }
  .vehicle-dialog { width: calc(100% - 20px); max-height: calc(100vh - 20px); }
  .vehicle-dialog .three, .vehicle-dialog .two { grid-template-columns: 1fr; }
  .vehicle-form-actions { align-items: stretch; flex-direction: column-reverse; }
  .vehicle-monogram { width: 48px; height: 48px; }
  .fluid-summary { grid-column: 1 / -1; text-align: left; grid-template-columns: auto 1fr auto 1fr; border-top: 1px solid var(--line); padding-top: 12px; }
  .context-bar { align-items: stretch; }
  .livetime-panel { align-items: flex-start; flex-direction: column; }
  .livetime-panel .link-btn { width: 100%; }
  .livetime-return-card { inset: auto 12px calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 12px); width: auto; }
  .history-row { grid-template-columns: 1fr; }
  .data-summary { grid-template-columns: 1fr; }
  .home-footer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-footer div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .home-footer div:nth-child(2n) { border-right: 0; }
  .home-footer div:nth-last-child(-n+2) { border-bottom: 0; }
  .data-summary article { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 380px) {
  :root { --mobile-nav-height: 66px; }
  .topbar { height: 68px; padding: 0 12px; }
  .brand small { display: none; }
  main { padding: 26px 12px calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 28px); }
  .rail { padding: 6px 3px max(6px, env(safe-area-inset-bottom, 0px)); }
  .rail button { padding: 5px 1px; font-size: 0; }
  .rail button span { display: none; }
  .rail button:after { content: attr(data-short-label); display: block; overflow: hidden; font-size: 8px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
  .panel { padding: 18px; }
  .context-bar { padding: 12px; }
  .conversation-head { align-items: stretch; flex-direction: column; }
  .ai-connection-controls { justify-content: flex-start; }
  .ai-connection { align-self: flex-start; }
  .chat-compose-actions { flex-wrap: wrap; }
  .chat-compose-actions .primary { flex: 1; }
  .livetime-steps { align-items: stretch; flex-direction: column; }
  .livetime-return-card { padding: 16px; }
  .livetime-return-card > div { align-items: stretch; flex-direction: column; }
}

@media (max-width: 350px) {
  .setup-field-list { grid-template-columns: 1fr; }
  .pill-option-grid { grid-template-columns: repeat(2, 1fr); }
  .setup-section > summary { padding-inline: 11px; }
  .setup-section > summary small { display: none; }
}

@media (max-width: 900px) and (max-height: 500px) {
  :root { --mobile-nav-height: 60px; }
  .topbar { position: static; height: 62px; }
  main { padding-top: 22px; }
  .rail { padding-top: 4px; }
  .rail button { padding-block: 3px; }
  .hero { margin-bottom: 22px; }
}
.sheet-resource-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.sheet-resource-actions > .primary,
.sheet-resource-actions > .link-btn { flex: 1 1 180px; width: 180px; min-height: 44px; padding: 10px 15px; text-align: center; }
#loadVehicleKitSetupBtn { border: 1px solid #29a9e8; background: linear-gradient(135deg, #087fba, #075e91); box-shadow: 0 7px 24px rgba(7, 143, 209, .22); }
@media (max-width: 600px) { .sheet-resource-actions { width: 100%; justify-content: stretch; } .sheet-resource-actions > .primary, .sheet-resource-actions > .link-btn { flex-basis: 100%; width: 100%; } }

/* Final race-palette overrides must follow the legacy component rules. */
.home-action-panel, .vehicle-card { background: linear-gradient(150deg, #18222c, #10171f); }
.home-session-progress span b { background: #26323c; }
.home-session-progress span.active b, .surface-icon, .vehicle-monogram, .sheet-step > span { background: var(--race-blue); color: #fff; }
.session-summary, .surface-card, .service-card, .garage-card, .configuration-row, .sheet-step, .setup-version-row, .history-row, .preference-add-grid, .account-status > div { background: #0d151d; }
.track-directory-card { background: #121a22; }
.track-banner, .track-banner.dirt, .track-banner.asphalt, .track-banner.other { background: linear-gradient(145deg, #27333d, #17232c); }
.track-meta span, .configuration-tags span, .import-table th, .mirror-toggle, .pill-picker, .ai-connection, .chat-sources a, .calc-strip, .setup-check { background: #0b1219; }
.track-notes-panel, .setup-record-panel, .imported-fields-panel { border-color: #3c5364; }
.import-progress > div { background: #26333d; }
.confidence-pill { background: #233541; color: #dce7ee; }
.setup-working-status { border-color: #3d5363; background: #0d151d; }
.setup-section[open] > summary { background: #17212a; }
.setup-field-list input[readonly] { background: #0d151d; color: #bcc8cf; }
.pill-calculator { border-color: #354c5e; background: linear-gradient(145deg, #0b1219, #111d27); }
.pill-option { border-color: #34434f; background: #151e26; }
.pill-option:hover, .pill-option.active { background: #172d3c; }
.pill-results { border-color: #30414e; background: #30414e; }
.pill-results > div { background: #101923; }
.conversation-context { background: #101b24; color: #c7d1d7; }
.chat-thread { background: #090f15; }
.chat-message.assistant { background: #17212a; border-color: #2f414f; color: #d0d8dd; }
.chat-recommendation { border-color: #3e5b70; background: #101c25; }
.chat-recommendation .trade, .chat-recommendation .test, .recommendation-run-action { border-color: #2e3d48; }
.data-summary article { background: #131c24; }
.data-table td { border-color: #26313a; }
.empty-state, .preference-empty { border-color: #3b4b57; }
.preference-card { border-color: #344754; background: linear-gradient(145deg, #111a23, #0d141b); }
.preference-badge { background: #1b2833; color: #b7c3ca; }
body.firebase-auth-required { overflow: hidden; }
.firebase-auth-gate {
  position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center;
  padding: 22px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain;
  background: rgba(4, 10, 20, .96);
}

@media (max-width: 360px) {
  .run-scan-card-actions { grid-template-columns: 1fr; }
}
.firebase-auth-gate[hidden] { display: none; }
.firebase-auth-card {
  width: min(440px, 100%); padding: 30px; border: 1px solid #263953; border-radius: 18px;
  background: #0c1729; box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}
.firebase-auth-card img { width: min(260px, 80%); height: 70px; object-fit: contain; margin: 0 auto 22px; display: block; }
.firebase-auth-card h1 { margin: 7px 0 8px; }
.firebase-auth-card > p { color: #a8b7cc; line-height: 1.55; }
.firebase-auth-card label { display: grid; gap: 6px; margin-top: 14px; color: #dce6f2; font-weight: 700; }
.firebase-auth-card input { width: 100%; }
.firebase-auth-message { min-height: 22px; margin: 12px 0 4px; color: #8fe6c3 !important; }
.firebase-auth-message.error { color: #ff9d9d !important; }
.firebase-auth-card .wide { width: 100%; margin-top: 9px; }
.firebase-auth-card .text-button { width: 100%; margin-top: 12px; border: 0; background: transparent; color: #8fe6c3; }

/* Foldables can be wide while their usable height is short. Keep every account
   control reachable after folding, unfolding, rotating, or opening the keyboard. */
@media (max-height: 760px), (max-width: 600px) {
  body.onboarding-active,
  body.firebase-auth-required { overflow-y: auto; }
  .account-onboarding,
  .firebase-auth-gate {
    place-items: start center;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-bottom: max(18px, env(safe-area-inset-bottom, 0px));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
  }
  .onboarding-card,
  .firebase-auth-card { margin: 0 auto; }
  .onboarding-brand { margin-bottom: 18px; }
  .onboarding-card h1 { margin: 12px 0; font-size: clamp(36px, 7vw, 48px); }
  .onboarding-card > p { margin-bottom: 18px; line-height: 1.5; }
}
.tester-request-dialog {
  width: min(410px, calc(100% - 24px)); padding: 0; border: 1px solid #2f4969; border-radius: 16px;
  color: #edf5ff; background: #0c1729; box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
.tester-request-dialog::backdrop { background: rgba(2, 7, 15, .82); }
.tester-request-card { padding: 24px; }
.tester-request-card h2 { margin: 0 0 8px; }
.tester-request-card > p { color: #a8b7cc; line-height: 1.5; }
.tester-request-card label { display: grid; gap: 6px; margin-top: 16px; color: #dce6f2; font-weight: 700; }
.tester-request-card input { width: 100%; }
.tester-request-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.welcome-guide-dialog { width: min(600px, calc(100% - 32px)); max-width: none; padding: 0; border: 0; border-radius: 24px; color: var(--ink); background: transparent; }
.welcome-guide-dialog::backdrop { background: rgba(3, 7, 10, .84); backdrop-filter: blur(8px); }
.welcome-guide-card { padding: clamp(25px, 5vw, 42px); border: 1px solid #3a6680; border-radius: 24px; background: radial-gradient(circle at 95% 5%, rgba(7, 143, 209, .18), transparent 34%), #101820; box-shadow: 0 30px 100px rgba(0, 0, 0, .62); }
.welcome-guide-card h1 { margin: 18px 0 12px; font-size: clamp(32px, 6vw, 50px); line-height: 1; letter-spacing: -.045em; }
.welcome-guide-card > p { margin: 0; color: #b8c6ce; font-size: 14px; line-height: 1.6; }
.welcome-guide-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 27px; }
.welcome-guide-actions button { min-height: 48px; }
.welcome-guide-card > small { display: block; margin-top: 14px; color: var(--muted); text-align: center; line-height: 1.45; }
@media (max-width: 520px) { .welcome-guide-actions { grid-template-columns: 1fr; } }
.account-auth-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.account-reset[hidden], .account-auth-actions [hidden] { display: none !important; }
/* Original RC navigation artwork and the conversation-first Car Chief layout. */
.rc-icon { display: block; width: 28px; height: 28px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail button { display: flex; align-items: center; gap: 10px; min-height: 48px; padding-inline: 10px; color: #a9bac7; }
.rail button:focus-visible, #crew summary:focus-visible { outline: 2px solid #62c8f4; outline-offset: -2px; }
.rail .rc-icon { width: 26px; height: 26px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip-path: inset(50%); white-space: nowrap; border: 0 !important; }
body.crew-view { overflow: hidden; }
body.crew-view .topbar { display: none; }
body.crew-view .rail { top: 0; height: var(--crew-viewport-height, 100dvh); }
body.crew-view main { padding-top: 24px; padding-bottom: 24px; }
#crew.active { display: flex; flex-direction: column; height: calc(var(--crew-viewport-height, 100dvh) - 48px); min-height: 0; max-width: 960px; margin-inline: auto; animation: none; }
.crew-heading { position: relative; z-index: 30; display: flex; align-items: center; flex-shrink: 0; gap: 4px; margin-bottom: 0; border-bottom: 1px solid #263845; }
.crew-back { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; padding: 8px; border: 0; border-radius: 50%; color: #dce6ed; background: transparent; cursor: pointer; }
.crew-back:focus-visible { outline: 2px solid #62c8f4; }
.crew-heading h1 { min-width: 0; flex: 1; margin: 0; font-size: 24px; font-weight: 650; line-height: 1.2; letter-spacing: -.02em; }
.crew-options { grid-column: 1 / -1; min-width: 0; border-top: 1px solid #405463; }
.crew-options > summary { list-style: none; display: flex; align-items: center; min-height: 44px; cursor: pointer; color: #c4d2dc; font-size: 13px; font-weight: 650; }
.crew-options > summary::after { content: "+"; margin-left: auto; font-size: 20px; }
.crew-options[open] > summary::after { content: "−"; }
#crew summary::-webkit-details-marker { display: none; }
.crew-options-panel { display: grid; gap: 10px; padding: 6px 0 0; }
.crew-options-panel button { min-height: 44px; text-align: left; }
.crew-options-panel .ai-privacy { color: #bac7d0; font-size: 12px; line-height: 1.5; }
.car-chief-consent-dialog { width: min(560px, calc(100% - 24px)); max-width: none; max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: transparent; overflow: auto; }
.car-chief-consent-dialog::backdrop { background: rgba(3, 7, 10, .86); backdrop-filter: blur(8px); }
.car-chief-consent-card { padding: 26px; border: 1px solid #3a6680; border-radius: 20px; background: linear-gradient(150deg, #18222c, #10171f); box-shadow: 0 28px 90px rgba(0, 0, 0, .62); }
.car-chief-consent-card h2 { margin: 7px 0 12px; font-size: clamp(24px, 6vw, 32px); }
.car-chief-consent-card p { margin: 0 0 14px; color: #c5d0d7; font-size: 14px; line-height: 1.55; }
.car-chief-consent-card p:last-of-type { color: var(--ink); font-weight: 800; }
.car-chief-consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.car-chief-consent-actions button { min-height: 48px; }
@media (max-width: 440px) {
  .car-chief-consent-dialog { width: calc(100% - 16px); }
  .car-chief-consent-card { padding: 20px; }
  .car-chief-consent-actions { grid-template-columns: 1fr; }
  .car-chief-consent-actions .primary { grid-row: 1; }
}
.crew-options-panel .ai-connection { justify-self: start; }
.crew-text-size { display: grid; gap: 6px; color: #c4d2dc; font-size: 13px; font-weight: 650; }
.crew-text-size select { min-height: 44px; }
.crew-context-picker { flex: 1; min-width: 0; }
.crew-context-picker > summary { display: flex; align-items: center; justify-content: space-between; list-style: none; gap: 10px; padding: 10px 6px 12px; cursor: pointer; min-height: 72px; }
.crew-context-picker h1 small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b7c5ce; font-size: 14px; font-weight: 400; line-height: 1.4; letter-spacing: 0; margin-top: 3px; }
.crew-context-picker[open] > summary > .rc-icon { transform: rotate(180deg); }
#crew .crew-context-bar { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: calc(var(--crew-viewport-height, 100dvh) - 170px); overflow-y: auto; margin: 0; padding: 16px; background: #172631; border: 1px solid #405463; border-radius: 14px; box-shadow: 0 12px 30px #0008; }
#crewSessionDetails { grid-column: 1 / -1; margin: 0; color: #b7c5ce; font-size: 12px; }
.crew-service-notice { margin: 0 0 8px; padding: 10px 12px; flex-shrink: 0; border: 1px solid #65522d; border-radius: 10px; color: #f0cf90; background: #211c13; font-size: 13px; line-height: 1.4; }
.release-update-notice { position: fixed; z-index: 1000; left: 50%; bottom: 24px; width: min(520px, calc(100% - 32px)); transform: translateX(-50%); padding: 14px; border: 1px solid var(--blue); border-radius: 12px; background: #111a20; box-shadow: 0 12px 36px rgba(0,0,0,.45); display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.release-update-notice[hidden] { display: none; }
.release-update-notice p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.release-update-actions { display: flex; gap: 8px; flex-shrink: 0; }
.release-info-panel code { overflow-wrap: anywhere; color: var(--lime); }
@media (max-width: 640px) { .release-update-notice { bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 12px); align-items: stretch; flex-direction: column; } .release-update-actions { justify-content: flex-end; } }
#crew .crew-page-panel { position: static; flex: 1; min-height: 0; max-height: none; padding: 0; margin: 0; border: 0; border-radius: 0; background: transparent; overflow: visible; }
#crew .chat-thread { flex: 1 1 0; height: auto; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: #3c505f transparent; scroll-behavior: auto; padding: 14px 4px 16px; gap: 14px; border: 0; border-radius: 0; background: transparent; }
#crew { --crew-message-font-size: 16px; --crew-detail-font-size: 13px; --crew-source-font-size: 12px; }
#crew[data-chat-text-size="smaller"] { --crew-message-font-size: 14px; --crew-detail-font-size: 12px; --crew-source-font-size: 11px; }
#crew[data-chat-text-size="larger"] { --crew-message-font-size: 19px; --crew-detail-font-size: 16px; --crew-source-font-size: 14px; }
#crew .chat-message { position: relative; flex-shrink: 0; max-width: 88%; padding: 13px 16px; font-size: var(--crew-message-font-size); line-height: 1.5; border: 0; border-radius: 20px; overflow-wrap: anywhere; }
#crew .chat-message.user { background: #007bb9; color: #fff; border-bottom-right-radius: 5px; }
#crew .chat-message.assistant { background: #1c2b36; color: #e2eaf0; border-bottom-left-radius: 5px; }
#crew .chat-external-link { color: #62c8f4; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
#crew .chat-external-link:visited { color: #8fdcff; }
#crew .chat-message.system { font-size: var(--crew-source-font-size); color: #aebcc7; background: transparent; }
#crew .chat-meta { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.chat-date { flex-shrink: 0; padding: 2px 0; color: #9fb0bd; font-size: 12px; text-align: center; }
#crew .chat-recommendation h3 { font-size: calc(var(--crew-detail-font-size) + 4px); }
#crew .chat-recommendation .change { font-size: calc(var(--crew-detail-font-size) + 1px); }
#crew .chat-recommendation .trade p, #crew .chat-recommendation .test p { font-size: var(--crew-detail-font-size); }
#crew .recommendation-actions button, #crew .feedback-actions button, #crew .recommendation-run-action button { font-size: var(--crew-detail-font-size); min-height: 44px; }
#crew .chat-sources a { min-height: 32px; font-size: var(--crew-source-font-size); }
.crew-tools { position: relative; z-index: 20; flex-shrink: 0; margin-bottom: 3px; }
.crew-tools > summary { display: grid; place-items: center; width: 44px; height: 44px; list-style: none; border-radius: 50%; color: #dbe6ed; background: #1c2d3a; cursor: pointer; }
.crew-tools[open] > summary { color: #62c8f4; outline: 1px solid #62c8f4; }
#crew .crew-page-actions { position: absolute; bottom: calc(100% + 12px); left: 0; display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; width: 220px; max-width: calc(100% - 24px); gap: 4px; padding: 7px; border: 1px solid #435663; border-radius: 16px; background: #13212b; box-shadow: 0 10px 28px #0008; }
#crew .crew-page-actions button { display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; min-height: 48px; padding: 10px 12px; color: #d6e2ea; background: transparent; font-size: 15px; font-weight: 600; border: 0; }
#crew .crew-page-actions button:hover { background: #203543; }
#crew .crew-page-actions .rc-icon { width: 24px; height: 24px; }
#crew .chat-compose { display: flex; align-items: flex-end; gap: 8px; flex-shrink: 0; margin: 0; padding: 10px 0 8px; border-top: 1px solid #263845; }
.chat-input-wrap { flex: 1; min-width: 0; display: flex; align-items: flex-end; border: 1px solid #5b6e7c; border-radius: 27px; background: #1a2833; padding: 3px; }
.chat-input-wrap:focus-within { border-color: #62c8f4; box-shadow: 0 0 0 1px #62c8f4; }
#crew .chat-compose textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 96px; padding: 10px 8px 10px 13px; border: 0; outline: 0; box-shadow: none; background: transparent; font-size: 16px; line-height: 24px; resize: none; overflow-y: auto; }
#crew .chat-compose textarea::placeholder { color: #a9bccb; }
#crew .mic-button { flex-shrink: 0; display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 8px; border: 0; border-radius: 50%; background: transparent; color: #cad8e1; }
#crew .mic-button.listening { color: #fff; background: #a72b36; }
#crew #chatSendBtn { display: grid; place-items: center; width: 50px; height: 50px; min-height: 50px; flex-shrink: 0; padding: 10px; border: 0; border-radius: 50%; background: #0084c7; color: white; }
#crew .ai-connect-panel { flex-shrink: 0; max-height: 42%; overflow-y: auto; margin: 0 0 8px; }
#crew.compact-header .crew-session-eyebrow { display: none; }
#crew.compact-header .crew-context-picker > summary { min-height: 56px; padding: 5px 4px 6px; }
#crew.compact-header .crew-active-title h1 { font-size: 19px; line-height: 1.15; }
#crew.compact-header .crew-context-picker h1 small { margin-top: 1px; font-size: 12px; line-height: 1.25; }
#crew.compact-header .crew-heading { margin-bottom: 0; }
@media (max-width: 900px) {
  .rail { background: #0d171f; }
  .rail button { flex-direction: column; justify-content: center; gap: 3px; min-height: 44px; padding: 4px 1px; font-weight: 500; font-size: 10px; line-height: 1.2; }
  .rail button.active { color: #41b8f3; background: #0c2636; box-shadow: inset 0 2px var(--race-blue); }
  body.crew-view .app-shell { position: fixed; top: var(--crew-viewport-top, 0px); left: 0; width: 100%; height: var(--crew-viewport-height, 100dvh); display: flex; flex-direction: column; overflow: hidden; }
  body.crew-view main { order: 0; flex: 1; min-height: 0; max-width: none; padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)); }
  body.crew-view .rail { position: static !important; order: 1; flex-shrink: 0; height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px)); box-shadow: none; }
  #crew.active { height: 100%; min-height: 0; }
  .crew-heading h1 { font-size: 22px; }
  #crew.compact-header .crew-back { width: 40px; height: 40px; }
  #crew.compact-header .crew-conversation-prompt h2 { font-size: 14px; }
  #crew .crew-context-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.crew-keyboard .crew-context-picker > summary { padding-block: 6px; min-height: 60px; }
}
@media (max-width: 380px) {
  #crew .chat-message { padding: 10px 13px; }
  #crew .chat-compose { gap: 6px; }
  #crew #chatSendBtn { width: 44px; height: 44px; min-height: 44px; margin-bottom: 3px; }
  #crew .chat-compose textarea { padding-left: 9px; }
}
@media (max-width: 900px) and (max-height: 500px) {
  .crew-context-picker > summary { min-height: 60px; padding-block: 6px; }
  #crew .chat-compose { padding-block: 6px; }
}
.user-guide-dialog { width: min(960px, calc(100% - 24px)); height: 94vh; height: 94dvh; max-width: 100%; max-height: 100vh; max-height: 100dvh; padding: 0; margin: auto; border: 1px solid #3a6680; border-radius: 18px; color: var(--ink); background: #081016; overflow: hidden; }
.user-guide-dialog[open] { display: flex; flex-direction: column; }
.user-guide-dialog::backdrop { background: rgba(3, 7, 10, .84); }
.user-guide-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.user-guide-header h2 { margin: 0; font-size: 20px; }
.user-guide-header button { flex-shrink: 0; min-height: 44px; }
.user-guide-message { padding: 18px; overflow: auto; }
.user-guide-message p { margin: 0 0 16px; line-height: 1.5; }
.user-guide-dialog iframe { flex: 1; min-height: 0; width: 100%; border: 0; background: #081016; }
.user-guide-dialog [hidden] { display: none; }
@media (max-width: 600px) {
  .user-guide-dialog { width: 100%; height: 100vh; height: 100dvh; border: 0; border-radius: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .user-guide-header { padding: max(10px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px)); }
  .user-guide-header h2 { font-size: 18px; }
}

/* Keep the working pages as readable as the Home page on phones and desktops. */
.account-onboarding label,
#garage label,
#tracks label,
#setup label,
#data label,
#profile label { font-size: 12px; line-height: 1.4; }

.account-onboarding small,
#garage small,
#tracks small,
#setup small,
#data small,
#profile small { font-size: 11px; line-height: 1.45; }

#garage p,
#tracks p,
#setup p,
#data p,
#profile p { font-size: 13px; line-height: 1.55; }

#garage input, #garage select, #garage textarea,
#tracks input, #tracks select, #tracks textarea,
#setup input, #setup select, #setup textarea,
#data input, #data select, #data textarea,
#profile input, #profile select, #profile textarea { font-size: 14px; }

#garage .primary, #garage .ghost,
#tracks .primary, #tracks .ghost,
#setup .primary, #setup .ghost,
#data .primary, #data .ghost,
#profile .primary, #profile .ghost { font-size: 13px; }

#garage .eyebrow, #garage .step-label, #garage .tag,
#tracks .eyebrow, #tracks .step-label, #tracks .tag,
#setup .eyebrow, #setup .step-label, #setup .tag,
#data .eyebrow, #data .step-label, #data .tag,
#profile .eyebrow, #profile .step-label, #profile .tag { font-size: 10px; }

#garage .vehicle-copy em,
#garage .fluid-summary small,
#tracks .track-meta span,
#tracks .configuration-tags span,
#setup .setup-field-list > label:not(.setup-check),
#setup .setup-check span,
#setup .setup-version-row span,
#setup .setup-version-row p,
#data .livetime-steps span,
#profile .preference-card-head p,
#profile .preference-badge { font-size: 11px; }

#setup .setup-field-list input,
#setup .setup-field-list select { font-size: 13px; min-height: 38px; }

#data .data-table th { font-size: 10px; }
#data .data-table td { font-size: 12px; }
#data .run-scan-values small,
#data .run-detail-grid small,
#data .run-detail-notes small { font-size: 10px; }

.maintenance-reminder-settings {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid rgba(35, 174, 239, .32);
  border-radius: 12px;
  background: rgba(35, 174, 239, .06);
}
.maintenance-reminder-settings legend { padding: 0 7px; color: #29b6f6; font-weight: 800; }
.maintenance-reminder-settings p { margin: 0 0 10px; }
.maintenance-reminder-settings .setup-check { margin: 8px 0; }
.maintenance-reminder-settings > label:last-of-type { display: block; margin-top: 12px; }
.maintenance-reminder-settings small { display: block; margin-top: 8px; color: var(--muted, #91a4bf); }
.maintenance-reminder-dialog { width: min(520px, calc(100% - 24px)); }
.maintenance-reminder-actions { display: grid; gap: 9px; margin-top: 18px; }
.maintenance-snooze-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.maintenance-custom-snooze { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(35, 174, 239, .25); }
.maintenance-custom-snooze label { margin: 0; }
@media (max-width: 520px) {
  .maintenance-snooze-options { grid-template-columns: 1fr; }
  .maintenance-custom-snooze { grid-template-columns: 1fr 1fr; }
  .maintenance-custom-snooze .primary { grid-column: 1 / -1; }
}

/* iOS Safari zooms the entire page when a focused form control is rendered
   below 16px. Keep phone controls at the no-zoom threshold so the app never
   appears wider than the device after typing. */
@media (max-width: 900px) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea { font-size: 16px; }
  #garage input:not([type="checkbox"]):not([type="radio"]), #garage select, #garage textarea,
  #tracks input:not([type="checkbox"]):not([type="radio"]), #tracks select, #tracks textarea,
  #setup input:not([type="checkbox"]):not([type="radio"]), #setup select, #setup textarea,
  #data input:not([type="checkbox"]):not([type="radio"]), #data select, #data textarea,
  #profile input:not([type="checkbox"]):not([type="radio"]), #profile select, #profile textarea { font-size: 16px; }
  #setup .setup-field-list input:not([type="checkbox"]):not([type="radio"]),
  #setup .setup-field-list select { font-size: 16px; }
}

/* Keep reporting available without competing with the setup conversation. */
#crew .chat-message [data-ai-report-id] {
  display: block;
  width: max-content;
  max-width: 100%;
  min-width: 24px;
  min-height: 24px;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  box-shadow: none;
  color: #9ed4ed;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
#crew .chat-message [data-ai-report-id]:hover {
  color: #d7f0fc;
  background: transparent;
}
#crew .chat-message [data-ai-report-id]:focus-visible {
  outline: 2px solid #62c8f4;
  outline-offset: 3px;
}
