/* The existing night palette stays in dark-mode.css. Canvas colors are
   repainted by retrofit-scene.js when the visitor changes theme. */
.home-delta { min-height: 0; padding: clamp(48px, 8vw, 104px) 0; background: #171c22; box-shadow: 0 -28px 60px -32px #000a; border-top: 1px solid #76adff30; }
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] {
  color-scheme: light;
  --ink: #102b46;
  --blue: #1264ce;
  --surface: #edf2f7;
  --muted: #506477;
  --line: #d5dfe9;
}
html[data-theme="light"] body { background: #f3f5f7; color: var(--ink); }
html[data-theme="light"] header { background: #fff; border-color: var(--line); }
html[data-theme="light"] nav a[aria-current] { color: var(--blue); border-color: var(--blue); }
html[data-theme="light"] .brand .mark { color: var(--ink); }
html[data-theme="light"] .button { background: var(--blue); color: #fff; }
html[data-theme="light"] .button:hover { background: #0c4fa8; }
html[data-theme="light"] .button:focus-visible { outline-color: #fff; box-shadow: 0 0 0 5px #1264ce; }
html[data-theme="light"] .outline { background: transparent; color: #fff; border-color: #afc4d7; }
html[data-theme="light"] .outline:hover { background: #ffffff1c; }
html[data-theme="light"] .surface { background: var(--surface); }
html[data-theme="light"] .card,
html[data-theme="light"] .panel,
html[data-theme="light"] .form-panel { background: #fff; border-color: var(--line); }
html[data-theme="light"] .card p,
html[data-theme="light"] .lead,
html[data-theme="light"] .muted,
html[data-theme="light"] .eyebrow,
html[data-theme="light"] .gallery figcaption { color: var(--muted); }
html[data-theme="light"] .eyebrow { color: var(--blue); }
html[data-theme="light"] .link,
html[data-theme="light"] .panel a,
html[data-theme="light"] .contact-grid aside > a { color: var(--blue); border-color: #acc8e9; }
html[data-theme="light"] footer { background: #e6edf4; border-color: var(--line); }
html[data-theme="light"] .footer-grid p,
html[data-theme="light"] .legal p { color: var(--muted); }
html[data-theme="light"] .footer-brand small { border-color: #b5c5d6; }
html[data-theme="light"] .light { background: #fff; color: var(--ink); }
html[data-theme="light"] .menu { background: #fff; color: var(--ink); border-color: var(--line); }
html[data-theme="light"] .form-switch { background: #fff; border-color: var(--line); }
html[data-theme="light"] .form-switch a[aria-current="page"] { background: var(--ink); color: #fff; }
html[data-theme="light"] .form-switch a:not([aria-current]):hover { background: var(--surface); }
html[data-theme="light"] .checkout-panel { background: #fff; color: var(--ink); }
html[data-theme="light"] .checkout-panel p { color: var(--muted); }
html[data-theme="light"] .tutorial-tag { background: #fff; color: var(--ink); }
html[data-theme="light"] .engineering-grid img,
html[data-theme="light"] .card > img,
html[data-theme="light"] .gallery img,
html[data-theme="light"] .team-portrait img { background: #edf2f7; }
html[data-theme="light"] .skip { background: #fff; color: var(--ink); }
html[data-theme="light"] .field-error { color: #9f1b1b; }
html[data-theme="light"] .privacy { color: var(--muted); }
html[data-theme="light"] #interest-form .privacy { color: var(--ink); }

html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select { background-color: #fff; color: var(--ink); border-color: #b5c5d6; }
html[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23506477' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
html[data-theme="light"] select option { background: #fff; color: var(--ink); }
html[data-theme="light"] ::placeholder { color: #667a8b; }
html[data-theme="light"] input:hover:not(:disabled),
html[data-theme="light"] textarea:hover:not(:disabled),
html[data-theme="light"] select:hover:not(:disabled) { border-color: #7c92a5; }
html[data-theme="light"] input:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] select:focus { background-color: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px #1264ce33; }
html[data-theme="light"] input:-webkit-autofill,
html[data-theme="light"] textarea:-webkit-autofill { -webkit-text-fill-color: var(--ink); -webkit-box-shadow: 0 0 0 40px #fff inset; caret-color: var(--ink); }
html[data-theme="light"] input.is-invalid,
html[data-theme="light"] textarea.is-invalid,
html[data-theme="light"] select.is-invalid { border-color: #9f1b1b; box-shadow: 0 0 0 1px #9f1b1b; }
html[data-theme="light"] input.is-invalid:focus,
html[data-theme="light"] textarea.is-invalid:focus,
html[data-theme="light"] select.is-invalid:focus { box-shadow: 0 0 0 3px #9f1b1b45; }
html[data-theme="light"] #repair-form .form-unavailable { background: #fff5e9; border-color: #ba7726; color: #593a17; }
html[data-theme="light"] #repair-form.is-unavailable input,
html[data-theme="light"] #repair-form.is-unavailable textarea,
html[data-theme="light"] #repair-form.is-unavailable select,
html[data-theme="light"] input:disabled,
html[data-theme="light"] textarea:disabled,
html[data-theme="light"] select:disabled { background-color: #e4ebf2; border-color: #c5d0db; color: #6d7d8d; }
html[data-theme="light"] #repair-form.is-unavailable button[type="submit"] { background: #d5dfe9; border-color: #c5d0db; color: #506477; }

html[data-theme="light"] .home-delta,
html[data-theme="light"] .home-fleet { background: #f3f5f7; color: var(--ink); box-shadow: 0 1px var(--line); }
html[data-theme="light"] .home-delta h2,
html[data-theme="light"] .home-delta h3 { color: var(--ink); }
html[data-theme="light"] .home-delta .delta-copy p:not(.home-index),
html[data-theme="light"] .home-fleet p { color: var(--muted); }
html[data-theme="light"] .home-repair { background: var(--surface); border-color: var(--line); }
html[data-theme="light"] .home-head h2 { color: var(--ink); }
html[data-theme="light"] .home-head > p { color: var(--muted); }
html[data-theme="light"] .home-repair .home-subheading { color: var(--muted); }
html[data-theme="light"] .home-engineering { background: #0b0e12; color: #e8edf3; color-scheme: dark; }
html[data-theme="light"] .home-engineering h2,
html[data-theme="light"] .home-engineering h3 { color: #e8edf3; }
html[data-theme="light"] .home-engineering .engineering-grid p { color: #a9bfd4; }
html[data-theme="light"] .home-cta h2,
html[data-theme="light"] .home-cta .home-subheading { color: var(--ink); }
html[data-theme="light"] .home-cta p { color: var(--muted); }
html[data-theme="light"] .home-cta .outline { color: var(--ink); border-color: var(--blue); }
html[data-theme="light"] .home-cta .outline:hover { background: var(--surface); }
html[data-theme="light"] .rx-driving { background: #e9f0f6; color: var(--ink); color-scheme: light; }
html[data-theme="light"] .rx-driving h2 { color: var(--ink); }
html[data-theme="light"] .rx-drive-copy p,
html[data-theme="light"] .rx-drive-footer p,
html[data-theme="light"] .rx-driving .muted { color: var(--muted); }
html[data-theme="light"] .rx-driving .link { color: var(--blue); border-color: #acc8e9; }
html[data-theme="light"] .rx-scene { --green: #1769bf; }
html[data-theme="light"] .rx-scene-view { background: radial-gradient(120% 90% at 50% 40%, #f6fafc, #dce8f0); border-color: #acbece; color-scheme: light; }
html[data-theme="light"] .rx-scene-overlay span,
html[data-theme="light"] .rx-scene-overlay button { background: #fff; color: var(--ink); border-color: #acbece; }
html[data-theme="light"] .rx-steps button { color: var(--muted); }

/* The final engineering figure keeps its night-workshop palette in either theme. */
html[data-theme="light"] [data-delta-hardware].surface {
  color: #eef5fc;
  background-color: #101d2b;
  background-image: linear-gradient(#b9d3e70a 1px, transparent 1px), linear-gradient(90deg, #b9d3e70a 1px, transparent 1px), radial-gradient(ellipse at 85% 8%, #24618b36, transparent 55%);
  background-size: 32px 32px, 32px 32px, auto;
}
html[data-theme="light"] [data-delta-hardware] h2,
html[data-theme="light"] [data-delta-hardware] .card h3 { color: #eef5fc; }
html[data-theme="light"] [data-delta-hardware] .card { background: transparent; border-color: #7894ac55; }
html[data-theme="light"] [data-delta-hardware] .card p,
html[data-theme="light"] [data-delta-hardware] .availability { color: #bed0df; }
html[data-theme="light"] .rx-steps strong { color: var(--ink); }
html[data-theme="light"] .rx-steps button[aria-pressed="true"] strong { color: var(--blue); }

.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; min-height: 44px; margin-left: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.theme-toggle:hover { border-color: var(--blue); color: var(--blue); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 1000px) {
  .nav-row { grid-template-columns: 1fr auto auto auto; }
  .theme-toggle { order: 1; }
}
@media (max-width: 760px) {
  html.has-tabbar .nav-row { justify-content: space-between; }
  .theme-toggle { margin-left: auto; }
  .theme-toggle span { display: none; }
  html[data-theme="light"].has-tabbar .tabbar { background: #fff; border-color: var(--line); box-shadow: 0 3px 12px #102b4608; }
  html[data-theme="light"].has-tabbar .tabbar-scrim { background: #05172a52; }
  html[data-theme="light"] .tabbar-sheet { background: #fff; border-color: var(--line); box-shadow: 0 10px 28px #102b461f; }
  html[data-theme="light"] .tabbar .tabbar-sheet a:hover,
  html[data-theme="light"] .tabbar .tabbar-sheet a[aria-current] { background: var(--surface); }
}
