:root {
  --accent: #0058b8;
  --accent-dark: #004090;
  --accent-light: #4d94e8;
  --black: #111;
  --ink: #1d1d1f;
  --muted: #666;
  --line: #e4e4e4;
  --bg: #fff;
  --soft: #f6f6f6;
  --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.5; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }
img { max-width: 100%; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* top bar */
.topbar { background: var(--black); border-bottom: 4px solid var(--accent); padding: 10px 20px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0 20px; }
.topbar .brand { grid-column: 1; justify-self: start; }
.topbar .topnav { grid-column: 2; }
.topbar .nav-toggle, .topbar #logout { grid-column: 3; justify-self: end; }
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: .02em; text-transform: uppercase; }
.brand-logo { display: block; height: 64px; width: auto; }
.hero-logo { display: block; width: min(440px, 80vw); height: auto; margin: 0 auto 8px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.6)); }
.footer-logo { width: 120px; height: auto; margin-bottom: 12px; }
.pref { background: #e6f0fb; border-radius: 4px; padding: 1px 6px; font-weight: 600; }
.prefs { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 12px 0; }
.prefs legend { font-weight: 600; padding: 0 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; margin-right: 22px; min-height: 44px; font-weight: 600; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }

/* hero with background photo */
.hero { background: linear-gradient(rgba(0,0,0,.62), rgba(0,0,0,.62)), url('/img/bg/hero.jpg') center / cover no-repeat; color: #fff; padding: 88px 20px; text-align: center; }
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.5rem); margin-bottom: .3em; }
.hero p { font-size: clamp(1rem, 2.5vw, 1.25rem); margin: 0; opacity: .92; }

.section { max-width: 1200px; margin: 0 auto; padding: 48px 20px; }
.section-title { text-align: center; font-size: clamp(1.5rem, 4vw, 2.1rem); }
.section-title::after { content: ''; display: block; width: 64px; height: 4px; background: var(--accent); margin: 12px auto 0; border-radius: 2px; }

/* three cards across the screen (stack on phones) */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.card { text-decoration: none; display: flex; flex-direction: column; align-items: stretch; text-align: left; font: inherit; color: inherit; background: #fff; border: 1px solid var(--line); border-top: 6px solid var(--accent); border-radius: var(--radius); padding: 24px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.06); transition: transform .15s, box-shadow .15s; }
.card:hover, .card:focus-visible { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,.14); outline: none; }
.card:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; }
.card-logos { display: flex; justify-content: center; align-items: center; gap: 18px; height: 110px; margin-bottom: 16px; }
.card-logos img { max-height: 70px; max-width: 46%; width: auto; height: auto; object-fit: contain; }
.card-logos img:only-child { max-width: 90%; max-height: 90px; }
.card h3 { font-size: 1.25rem; text-align: center; }
.card-years { text-align: center; margin: 0 0 12px; font-weight: 700; color: var(--accent); }
.card-desc { margin: 0 0 12px; }
.card-models { margin: 0 0 16px; padding-left: 20px; color: var(--muted); }
.card-extra { flex: 1; margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; background: var(--soft); font-size: .95rem; }
.card-extra .card-desc { margin-bottom: 10px; }
.card-extra-label { margin: 0 0 4px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.card-extra .card-models { margin: 0; }
.card-price { font-size: 3.2rem; font-weight: 900; text-align: center; color: var(--black); line-height: 1; }
.card-cta { margin-top: 12px; text-align: center; font-weight: 700; color: var(--accent); }

.band { background-size: cover; background-position: center; color: #fff; padding: 72px 20px; text-align: center; }
.band-engine { background-image: linear-gradient(rgba(0,0,0,.7), rgba(0,0,0,.7)), url('/img/bg/engine.jpg'); }
.band-inner { max-width: 720px; margin: 0 auto; }
.band h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }

/* buttons */
.btn { font: inherit; font-weight: 700; border: 0; border-radius: 8px; padding: 12px 22px; cursor: pointer; min-height: 44px; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-black { background: var(--black); color: #fff; }
.btn-ghost { background: transparent; color: #fff; border: 1px solid #fff; }
.btn-small { padding: 8px 14px; min-height: 38px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* nav + book page */
.topnav { display: flex; flex-wrap: wrap; justify-content: center; text-align: center; gap: 4px 22px; }
.topnav a { color: #fff; text-decoration: none; font-weight: 600; padding: 8px 0; }
.topnav a:hover, .topnav a[aria-current="page"] { color: var(--accent-light); }
.topnav a[aria-current="page"] { border-bottom: 2px solid var(--accent-light); }
.nav-toggle { display: none; background: transparent; border: 1px solid #fff; border-radius: 8px; width: 48px; height: 48px; cursor: pointer; padding: 0; align-items: center; justify-content: center; }
.burger, .burger::before, .burger::after { display: block; width: 24px; height: 3px; background: #fff; border-radius: 2px; position: relative; content: ''; transition: transform .2s, background .2s; }
.burger::before { position: absolute; top: -8px; left: 0; }
.burger::after { position: absolute; top: 8px; left: 0; }
.nav-toggle[aria-expanded="true"] .burger { background: transparent; }
.nav-toggle[aria-expanded="true"] .burger::before { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .burger::after { transform: translateY(-8px) rotate(-45deg); }
.post-card { border-bottom: 1px solid var(--line); padding: 8px 0 16px; }
.post-card h2 { font-size: 1.3rem; margin-bottom: 0; }
.book-page { max-width: 820px; margin: 0 auto; padding: 24px 16px 48px; width: 100%; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 20px; }
.book-intro { display: flex; gap: 28px; align-items: flex-start; margin-bottom: 28px; }
.book-logos { display: flex; flex-direction: column; align-items: center; gap: 14px; flex: none; width: 160px; }
.book-logos img { width: 100%; max-height: 90px; height: auto; object-fit: contain; }
.book-intro h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
.book-price { font-size: 3rem; font-weight: 900; margin: 8px 0 0; line-height: 1; }
.book-form-wrap { border-top-color: var(--accent); }
.book-form-wrap h2 { margin-bottom: 0; }
.more ul { padding-left: 20px; }
.more { padding: 24px 0 0; }

/* footer (every page) */
.site-footer { background: linear-gradient(rgba(0,0,0,.86), rgba(0,0,0,.86)), url('/img/bg/garage.jpg') center / cover; color: #fff; border-top: 4px solid var(--accent); padding: 32px 20px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 12px 40px; justify-content: space-between; align-items: center; }
.footer-inner a { color: #fff; }
.footer-inner strong { color: var(--accent-light); text-transform: uppercase; letter-spacing: .04em; }

label { display: block; margin-top: 14px; font-weight: 600; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 11px 12px; font: inherit; border: 1px solid #bbb; border-radius: 8px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(0,88,184,.35); border-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 18px 0 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.notice { margin: 14px 0 0; padding: 12px; border-radius: 8px; }
.notice.ok { background: #eef8f0; border-left: 4px solid #1f8a3b; }
.notice.warn { background: #fff4e5; border-left: 4px solid #d97706; }
.errors { color: #b45309; font-weight: 600; padding-left: 18px; margin: 12px 0; }
.errors:empty { display: none; }
#submit-btn { width: 100%; margin-top: 8px; }

/* calendar */
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cal-nav button { width: 44px; height: 44px; font-size: 1.4rem; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; }
.cal-nav button:disabled { opacity: .3; cursor: default; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: .75rem; color: var(--muted); font-weight: 700; }
.cal-day { min-height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font: inherit; cursor: pointer; }
.cal-day:hover:not(:disabled) { border-color: var(--accent); }
.cal-day:disabled { background: var(--soft); color: #bbb; cursor: not-allowed; }
.cal-day.full { text-decoration: line-through; }
.cal-day.selected, .time.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.time { min-height: 44px; border: 1px solid var(--black); background: #fff; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.time:disabled { border-color: var(--line); color: #bbb; background: var(--soft); text-decoration: line-through; cursor: not-allowed; }

/* admin */
.admin-main { max-width: 900px; width: 100%; margin: 0 auto; padding: 24px 16px 48px; }
.panel { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--black); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.panel.narrow { max-width: 420px; margin: 40px auto; }
.toggle { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.toggle input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.alert { background: var(--accent); color: #fff; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 700; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab { font: inherit; font-weight: 700; padding: 10px 16px; min-height: 44px; border: 1px solid var(--black); background: #fff; border-radius: 8px; cursor: pointer; }
.tab.active { background: var(--black); color: #fff; }
.item { background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--black); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.item.unseen { border-left-color: var(--accent); background: #f1f6fd; }
.item h3 { font-size: 1.1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* burger menu below 1000px (7 links need the room); nav stays visible if JS is off */
@media (max-width: 999px) {
  .js .nav-toggle { display: flex; }
  .topbar .topnav { grid-column: 1 / -1; grid-row: 2; }
  .js .topnav { display: none; flex-direction: column; align-items: stretch; gap: 0; border-top: 1px solid #333; margin-top: 8px; }
  .js .topnav.open { display: flex; }
  .topnav a { padding: 14px 4px; border-bottom: 1px solid #222; text-align: center; }
}
@media (max-width: 860px) {
  .cards { grid-template-columns: 1fr; max-width: 480px; margin-left: auto; margin-right: auto; }
  .hero { padding: 56px 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .book-intro { flex-direction: column; align-items: stretch; }
  .book-logos { flex-direction: row; justify-content: center; width: 100%; }
  .book-logos img { width: auto; max-width: 46%; max-height: 70px; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }

/* Find-your-truck call to action */
.cta-wrap { margin-top: 2rem; }
.btn-xl { font-size: 1.4rem; padding: 1.1rem 3rem; }

/* VIN lookup */
.vin-box { border: 1px dashed var(--accent); border-radius: 8px; padding: 12px 14px; margin: 0 0 16px; background: #f6f9fe; }
.vin-box legend { font-weight: 700; padding: 0 6px; }
.vin-row { display: flex; gap: 8px; }
.vin-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.book-intro .card-years { text-align: left; }
@media (max-width: 560px) { .book-intro .card-years { text-align: center; } }

/* SEO content blocks: steps, FAQ, engine-code table */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.steps { max-width: 760px; margin: 0 auto; padding-left: 24px; }
.steps li { margin: 0 0 10px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; }
.gens { border-collapse: collapse; margin: 8px 0; min-width: 260px; }
.gens th, .gens td { border: 1px solid var(--line); padding: 6px 14px; text-align: left; }
.gens th { background: var(--soft); }
