/* AJM Auto Repair site styles. Palette taken from the original draft. */
@font-face { font-family: Anton; src: url("../fonts/anton-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-2: #222;
  --border: #2c2c2c;
  --text: #eee;
  --muted: #a8a8a8;
  --accent: #ff4d30;
  --accent-dark: #d93a20;
  --ok: #3ecf8e;
  --radius: 12px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--accent); }
img { max-width: 100%; }

.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.125em; }

/* Top bar: items centered */
.topbar { position: sticky; top: 0; z-index: 10; background: #000; border-bottom: 3px solid var(--accent); }
.topbar nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 8px; padding: 14px 16px; }
.topbar a { color: #fff; text-decoration: none; font-weight: 600; padding: 6px 14px; border-radius: 6px; }
.topbar a:hover { color: var(--accent); }
.topbar a[aria-current="page"] { background: var(--accent); color: #fff; }
.topbar-row { display: none; }

main { min-height: 60vh; }
section { padding: 64px 16px; }
.wrap { max-width: 1100px; margin: 0 auto; }
.section-title { text-align: center; font-size: 2rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.section-sub { text-align: center; color: var(--muted); margin: 0 auto 36px; max-width: 640px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: 0 6px 20px rgba(0,0,0,.5); }

.btn { display: inline-block; background: var(--accent); color: #fff; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 700; border: 0; font: inherit; font-weight: 700; cursor: pointer; transition: transform .2s ease, background .2s ease; }
.btn:hover { transform: scale(1.04); background: var(--accent-dark); }
.btn-ghost { background: transparent; border: 2px solid #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.08); }

/* Home hero with centered logo */
.hero { position: relative; overflow: hidden; text-align: center; padding: 96px 16px; background:
  radial-gradient(ellipse at center, rgba(255,77,48,.18), transparent 60%),
  linear-gradient(180deg, #151515, #0b0b0b); }
.hero-content { position: relative; }

/* Animated backdrop: slides crossfade while slowly zooming. Filled in by main.js. */
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.5s ease; animation: heroZoom 18s ease-in-out infinite alternate; }
.hero-slide.active { opacity: 1; }
.hero.has-backdrop .hero-bg::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.72); }
@keyframes heroZoom { from { transform: scale(1); } to { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) {
  .hero-slide { animation: none; transition: none; }
}
.logo-placeholder { width: 200px; height: 200px; margin: 0 auto 28px; border-radius: 50%; border: 3px dashed var(--accent); display: grid; place-items: center; color: var(--muted); font-size: .85rem; background: rgba(0,0,0,.4); }
.logo-placeholder strong { display: block; color: #fff; font-size: 1.6rem; letter-spacing: 2px; }
/* Hero brand block: sets the logo's size (about the same as before: 790px on desktop, scaling down on smaller screens).
   The heading is sized from it (see .hero-brand h1). */
.hero-brand { display: block; width: min(790px, 88vw); margin: 0 auto; container-type: inline-size; }
.hero-mark { width: 100%; margin: 0 auto 20px; container-type: inline-size; }
.hero-logo { display: block; width: 100%; height: auto;
  /* Thick drop shadow that follows the logo's shape: a solid offset layer plus a soft blur. */
  filter: drop-shadow(6px 7px 0 rgba(0,0,0,.85)) drop-shadow(0 10px 22px rgba(0,0,0,.6)); }
/* "FOREIGN & DOMESTIC" under the logo, sized relative to the logo's width (cqw) so it scales with it.
   The logo image's width equals "AUTOMOTIVE REPAIR", so centering here centers under that line. */
.hero-logo-sub { font-family: Anton, Impact, "Arial Narrow", sans-serif; color: #f2ea1d; text-transform: uppercase;
  font-size: 5.6cqw; line-height: 1; letter-spacing: .3em; text-indent: .3em; text-align: center; margin-top: 2.6cqw;
  text-shadow: 3px 4px 0 rgba(0,0,0,.85), 0 6px 16px rgba(0,0,0,.6); }
.hero h1 { font-size: clamp(1.8rem, 5vw, 3rem); text-transform: uppercase; margin-bottom: 10px; }
/* Heading is slightly wider (about 6%) than "FOREIGN & DOMESTIC". 3.9cqw is a close CSS approximation;
   main.js measures both texts and sets the exact size, since the heading's system font varies by device. */
.hero-brand h1 { font-size: 3.9cqw; white-space: nowrap; }
.hero p { color: #ddd; margin-bottom: 28px; font-size: 1.25rem; font-weight: 700; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* "Official PA Inspection Station" strip, part of the sticky top bar so it's always visible.
   Bold 1.2rem white on the accent passes WCAG AA for large text. */
.inspection-banner { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 12px; background: var(--accent); color: #fff; padding: 8px 16px; text-align: center; font-size: 1.2rem; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; }
.inspection-banner .icon { font-size: 1.6em; }
/* Mouse devices: the banner drops down over the page only while the top bar is hovered or has keyboard focus.
   Touch devices can't hover, so there it stays visible. The Home page always shows it. */
@media (hover: hover) and (pointer: fine) {
  .topbar .inspection-banner { position: absolute; top: 100%; left: 0; right: 0; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .2s ease, transform .2s ease, visibility .2s; }
  .topbar:hover .inspection-banner, .topbar:focus-within .inspection-banner { opacity: 1; visibility: visible; transform: none; }
  /* Home page: always shown, as part of the pinned top bar. */
  body[data-page="home"] .topbar .inspection-banner { position: static; opacity: 1; visibility: visible; transform: none; }
}

/* Authorized installers badge */
.about-card { text-align: center; }
.badge-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 24px; }
/* Subgrid shares the icon / heading / description rows across all three boxes,
   so descriptions start at the same height even when headings wrap differently. */
.badge-row > .badge { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; }
.badge-row > .badge > .icon { justify-self: center; }
.badge-row > .badge > h2 { align-self: center; }
.badge p + p { margin-top: 8px; }
.badge { text-align: center; border: 2px solid #ff0000; background: #111; transition: box-shadow .3s ease, transform .25s ease; }
.badge:hover { box-shadow: 0 0 20px rgba(255,0,0,.35); transform: translateY(-6px); }
.badge > .icon { font-size: 48px; color: #ff3b3b; margin-bottom: 8px; transition: filter .3s ease, transform .3s ease; }
.badge h2 { color: #ff3b3b; text-transform: uppercase; font-size: 1.4rem; margin-bottom: 10px; justify-content: center; transition: text-shadow .3s ease; }
.badge:hover > .icon { filter: drop-shadow(0 0 6px rgba(255,0,0,.8)); transform: scale(1.12); }
.badge:hover h2 { text-shadow: 0 0 8px rgba(255,0,0,.6); }


/* Services grid: icon above each service */
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
/* Featured row sits above the main grid; its two cards line up over the middle two columns. */
.services-featured { margin-bottom: 22px; }
.services-featured .service-card:nth-child(1) { grid-column: 2; }
.services-featured .service-card:nth-child(2) { grid-column: 3; }
.service-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 28px 20px; text-align: center; transition: transform .25s ease, border-color .25s ease; }
.service-card:hover, .contact-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.service-card .icon { font-size: 40px; color: var(--accent); margin-bottom: 12px; transition: filter .3s ease, transform .3s ease; }
.service-card:hover .icon, .contact-card:hover .icon { filter: drop-shadow(0 0 6px #ff0000); transform: scale(1.12); }
.service-card p { color: var(--muted); font-size: .9rem; }
/* An uploaded service icon: the picture is a stencil, painted the current text colour like the line icons. Its
   picture (--m) comes from a rule the build adds per icon, or from the Manage Services page. */
.icon-img { display: inline-block; background-color: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }

/* Quote page: labor rates down the side of the form */
.quote-layout { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.sidebar, .main-col { display: flex; flex-direction: column; gap: 24px; }
#hours { scroll-margin-top: 140px; }
.shop-contact { text-align: center; }
.shop-contact h2 { justify-content: center; }
.rates h2 { font-size: 1.1rem; text-transform: uppercase; margin-bottom: 14px; }
.rate { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.rate:last-of-type { border-bottom: 0; }
.rate b { color: var(--accent); }
.rates .note { color: var(--muted); font-size: .8rem; margin-top: 12px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .92rem; }
.field .hint { color: var(--muted); font-weight: 400; }
.field input, .field textarea { background: var(--surface-2); color: var(--text); border: 1px solid #3a3a3a; border-radius: 8px; padding: 11px 12px; font: inherit; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field.invalid input, .field.invalid textarea { border-color: #ff6b6b; }
.field .error { color: #ff8a8a; font-size: .82rem; min-height: 1em; }
.form-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }
.privacy-note { color: var(--muted); font-size: .8rem; }
.form-status { margin-top: 14px; font-weight: 600; }
.form-status.ok { color: var(--ok); }
.form-status.info { color: #ffcf7a; }
.form-status.error { color: #ff8a8a; }
/* Hidden spam-trap field: off-screen for people, still present for bots. */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }

.hours-list { list-style: none; }
.hours-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.hours-list li:last-child { border-bottom: 0; }
.card h2 { font-size: 1.1rem; text-transform: uppercase; margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.big-phone { font-size: 1.6rem; font-weight: 700; text-decoration: none; }

/* Builds page */
.builds-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }
.build { position: relative; padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .25s ease, border-color .25s ease; }
.build:hover { transform: translateY(-6px); border-color: var(--accent); }
.build-photo { aspect-ratio: 16 / 10; overflow: hidden; background: repeating-linear-gradient(45deg, #151515 0 14px, #181818 14px 28px); display: grid; place-items: center; color: var(--muted); font-size: .85rem; border-bottom: 1px solid var(--border); }
.build-photo img { width: 100%; height: 100%; object-fit: cover; }
.build-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.build-body h3 { font-size: 1.2rem; }
.build-car { color: var(--accent); font-weight: 600; font-size: .9rem; }
.build-body p { color: #ccc; }
/* Build photo gallery: the cover opens a full-screen viewer (main.js). */
.build-cover { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: zoom-in; }
.build-cover:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
/* A photos-only card (no text block) lets its cover fill the card, so cards in a row stay even with no empty strip. */
.build > .build-cover:last-child { flex: 1; display: flex; flex-direction: column; }
.build > .build-cover:last-child .build-photo { flex: 1; position: relative; }
.build > .build-cover:last-child .build-photo img { position: absolute; inset: 0; }
.photo-count { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.72); color: #fff; border-radius: 999px; padding: 4px 10px; font-size: .78rem; font-weight: 600; pointer-events: none; }
.view-hint { position: absolute; inset: 0 0 1px; display: grid; place-items: center; background: rgba(0,0,0,.35); color: #fff; font-weight: 700; opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.build-cover:hover .view-hint, .build-cover:focus-visible .view-hint { opacity: 1; }
.viewer { position: fixed; inset: 0; z-index: 100; background: rgba(6,6,6,.96); display: grid; grid-template-rows: auto 1fr auto; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px calc(12px + env(safe-area-inset-bottom, 0px)); animation: viewer-in .2s ease; }
.viewer[hidden] { display: none; }
@keyframes viewer-in { from { opacity: 0; } }
.viewer-top { display: flex; align-items: center; gap: 12px; color: #ddd; min-height: 44px; }
.viewer-cap { flex: 1; min-width: 0; }
.viewer-cap b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-cap span { color: var(--accent); font-size: .85rem; font-weight: 600; }
.viewer-count { font-variant-numeric: tabular-nums; color: #bbb; font-size: .9rem; }
.v-btn { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); color: #fff; width: 44px; height: 44px; border-radius: 999px; font-size: 1.3rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.v-btn:hover { background: rgba(255,255,255,.16); }
.v-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.viewer-stage { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.viewer-stage.can-swipe { cursor: grab; }
.viewer-stage.dragging { cursor: grabbing; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; -webkit-user-drag: none; pointer-events: none; transition: transform .25s ease, opacity .25s ease; }
.viewer-stage.dragging img { transition: none; }
.viewer-stage .v-prev, .viewer-stage .v-next { position: absolute; top: 50%; transform: translateY(-50%); }
.viewer-stage .v-prev { left: 6px; }
.viewer-stage .v-next { right: 6px; }
.viewer-thumbs { display: flex; gap: 8px; justify-content: center; overflow-x: auto; padding-top: 10px; }
.viewer-thumbs button { flex: none; width: 64px; aspect-ratio: 16 / 10; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: #111; cursor: pointer; opacity: .55; }
.viewer-thumbs button[aria-current="true"] { border-color: var(--accent); opacity: 1; }
.viewer-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewer-tip { text-align: center; color: #888; font-size: .78rem; margin: 6px 0 0; display: none; }
body.viewer-open { overflow: hidden; }
@media (max-width: 640px) {
  .viewer-stage .v-prev, .viewer-stage .v-next { display: none; }   /* phones: swipe or tap a thumbnail */
  .viewer-thumbs button { width: 52px; }
  .viewer-tip { display: block; }
  .viewer-tip[hidden] { display: none; }
}
.parts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.parts li { background: var(--surface-2); border: 1px solid #3a3a3a; border-radius: 999px; padding: 3px 10px; font-size: .8rem; color: #ddd; }

/* Testimonials page */
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.testimonial { position: relative; margin: 0; display: flex; flex-direction: column; gap: 14px; transition: transform .25s ease, border-color .25s ease; }
.testimonial:hover { transform: translateY(-6px); border-color: var(--accent); }
.stars { color: #ffb400; font-size: 20px; display: flex; gap: 2px; }
.stars .icon { fill: currentColor; stroke: none; }
.testimonial blockquote { margin: 0; color: #ddd; font-style: italic; flex: 1; }
.testimonial blockquote .icon { color: var(--accent); font-size: 1.25em; vertical-align: -0.2em; }
/* The quote icon is a closing mark; turned upside down it becomes the opening mark. */
.testimonial .q-open .icon { transform: rotate(180deg); margin-right: 4px; }
.testimonial .q-close .icon { margin-left: 4px; }
.testimonial blockquote p { margin: 0 0 10px; }
.testimonial blockquote p:last-child { margin-bottom: 0; }
.testimonial figcaption { display: flex; flex-direction: column; border-top: 1px solid var(--border); padding-top: 12px; }
.testimonial figcaption span { color: var(--muted); font-size: .85rem; }
.sample-tag { position: absolute; top: 12px; right: 12px; background: #2a1a00; color: #ffcf7a; font-size: .7rem; padding: 2px 8px; border-radius: 999px; }
.testimonials-cta { text-align: center; margin-top: 32px; }
.testimonials-cta h2 { justify-content: center; }
.testimonials-cta p { color: var(--muted); max-width: 560px; margin: 0 auto 18px; }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* Submit a Testimonial: form beside a live preview card. */
.submit-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.group-label { grid-column: 1 / -1; margin: 6px 0 -6px; font-size: .78rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--border); padding-top: 14px; }
.group-label:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.group-label b { color: var(--accent); font-weight: 600; letter-spacing: 0; text-transform: none; }
.field .field-label { font-weight: 600; font-size: .92rem; }
.star-pick { display: flex; align-items: center; gap: 4px; min-height: 44px; }
.star-pick button { background: none; border: 0; padding: 2px; cursor: pointer; font-size: 28px; line-height: 1; color: #555; transition: color .15s ease, transform .15s ease; }
.star-pick button .icon { fill: currentColor; stroke: none; }
.star-pick button:hover { transform: scale(1.12); }
.star-pick button.on { color: #ffb400; }
.star-pick button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.star-pick .star-clear { font-size: .82rem; color: var(--muted); margin-left: 10px; text-decoration: underline; }
.counter { color: var(--muted); font-size: .8rem; align-self: flex-end; }
.contact-note { color: var(--muted); font-size: .82rem; margin: -8px 0 0; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; font-weight: 400; }
.consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.field.invalid .consent { color: #ff8a8a; }
.preview-col h2 { font-size: 1rem; }
.preview-col .testimonial { margin-top: 10px; }
.preview-col .note { color: var(--muted); font-size: .85rem; margin: 12px 0 0; }
@media (max-width: 860px) { .submit-layout { grid-template-columns: 1fr; } }

/* Shop Admin (/<ADMIN_PATH>/): lock screen, menu, Manage Builds, Review Testimonial. */
.lock-card { max-width: 420px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.lock-card .section-title { margin: 0; justify-content: center; }
.lock-card .field { text-align: left; }
.result-icon { font-size: 44px; line-height: 1; display: block; }
.lock-icon { font-size: 52px; line-height: 1; color: var(--accent); display: flex; justify-content: center; }
.lock-icon .icon { filter: drop-shadow(0 0 6px rgba(255,0,0,.45)); }
.btn-lock { display: inline-flex; align-items: center; gap: 8px; }
.btn-lock .icon { color: var(--accent); font-size: 1.15em; }
.lock-sub { color: var(--muted); margin: 0; }
.lock-notice { background: #1d2a3a; color: #8cc4ff; border-radius: 8px; padding: 8px 12px; font-size: .85rem; margin: 0; }
.remember { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: .92rem; font-weight: 400; cursor: pointer; }
.remember input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.remember small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.signed-in { display: block; color: var(--muted); font-size: .82rem; margin-top: 4px; }
.signed-in b { color: var(--text); font-weight: 600; }
.admin-top { display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.admin-top .where { color: var(--muted); font-size: .88rem; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #1d2a3a; color: #8cc4ff; }
.pill.live { background: #3a1d1d; color: #ff9b8a; }
.btn-sm { padding: 8px 14px; font-size: .88rem; }
.btn-deny { background: transparent; border: 2px solid #ff6b6b; color: #ff8a8a; }
.btn-deny:hover { background: rgba(255,107,107,.1); }
.admin-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.admin-tile { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; transition: transform .2s ease, border-color .2s ease; }
a.admin-tile:hover { transform: translateY(-4px); border-color: var(--accent); }
.admin-tile .tile-icon { font-size: 40px; line-height: 1; color: var(--accent); display: inline-flex; width: max-content; transform-origin: left center; transition: filter .3s ease, transform .3s ease; }
.admin-tile:hover .tile-icon, .admin-tile:focus-visible .tile-icon { filter: drop-shadow(0 0 6px #ff0000); transform: scale(1.12); }
.admin-tile h2 { margin: 0; font-size: 1.15rem; }
.admin-tile p { margin: 0; color: var(--muted); font-size: .9rem; }
.admin-tile .go { margin-top: auto; color: var(--accent); font-weight: 700; }
.admin-tile.info { border-style: dashed; }
.admin-help { margin-top: 24px; color: var(--muted); font-size: .85rem; text-align: center; }
.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; align-items: center; padding: 12px; }
.admin-row .thumb { aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: repeating-linear-gradient(45deg, #151515 0 10px, #1b1b1b 10px 20px); display: grid; place-items: center; color: var(--muted); font-size: .72rem; text-align: center; }
.admin-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-row h3 { font-size: 1.05rem; margin: 0 0 2px; }
.admin-row .meta { color: var(--accent); font-size: .85rem; font-weight: 600; }
.admin-row .sub { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.row-actions { display: flex; gap: 8px; }
.empty-note { color: var(--muted); text-align: center; padding: 30px; }
.drop { grid-column: 1 / -1; border: 2px dashed #444; border-radius: 10px; padding: 18px; text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: 4px; align-items: center; transition: border-color .2s ease, background .2s ease; }
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(255,77,48,.05); }
.drop input { display: none; }
.drop-icon { font-size: 30px; line-height: 1; }
.drop-hint { color: var(--muted); font-size: .85rem; }
.drop-error { grid-column: 1 / -1; color: #ff8a8a; font-size: .85rem; margin: -8px 0 0; }
.drop-note { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; margin: -8px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; background: var(--surface-2); border: 1px solid #3a3a3a; border-radius: 8px; padding: 8px; min-height: 46px; align-items: center; }
.chips .chip { background: #2a2a2a; border: 1px solid #3a3a3a; border-radius: 999px; padding: 3px 6px 3px 10px; font-size: .85rem; display: inline-flex; gap: 6px; align-items: center; }
.chips .chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 2px; }
.field .chips input { flex: 1; min-width: 140px; background: transparent; border: 0; padding: 4px; }
.field .chips input:focus { outline: none; }
.chips:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.edit-foot, .decide { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; align-items: center; margin-top: 22px; }
.unlocked-note { color: var(--muted); font-size: .85rem; margin-right: auto; }
.review-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: .85rem; margin: -20px auto 24px; justify-content: center; align-items: center; }
.review-meta b { color: var(--text); font-weight: 600; }
.consent-ok { grid-column: 1 / -1; color: var(--ok); font-size: .88rem; margin: 0; }
.preview-col .build { margin-top: 10px; }
.result { text-align: center; padding: 40px 24px; }
.result .section-title { justify-content: center; }
.result p { color: var(--muted); max-width: 520px; margin: 8px auto 18px; }
.result code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; overflow-wrap: anywhere; }
.admin-row.t-row { grid-template-columns: 1fr auto; padding: 14px 16px; }
.t-row h3 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stars-sm { color: #ffb400; font-size: .85rem; letter-spacing: 1px; }
.t-row .excerpt { color: var(--muted); font-size: .88rem; margin-top: 4px; font-style: italic; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-note { color: var(--muted); font-size: .85rem; margin: 16px 0 0; text-align: center; }
/* Manage Builds: photo gallery editor (drag to reorder, cover, remove). */
.admin-row .thumb { position: relative; }
.admin-row .thumb .n { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.75); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: .7rem; font-weight: 600; }
.photos-field { grid-column: 1 / -1; }
.gallery-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.gallery-head b { font-size: .92rem; }
.gallery-count { color: var(--muted); font-size: .85rem; }
.gallery-count.full { color: #ffcf7a; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.g-tile { position: relative; border: 1px solid #333; border-radius: 8px; overflow: hidden; background: #141414; display: flex; flex-direction: column; }
.g-tile.is-cover { border-color: var(--accent); }
.g-pic { position: relative; aspect-ratio: 16 / 10; background: #111; cursor: grab; }
.g-pic img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
.g-badge { position: absolute; left: 6px; top: 6px; background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 8px; font-size: .72rem; font-weight: 700; }
.g-num { position: absolute; right: 6px; top: 6px; background: rgba(0,0,0,.7); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: .72rem; }
.g-new { position: absolute; left: 6px; bottom: 6px; background: #1d2a3a; color: #8cc4ff; border-radius: 999px; padding: 1px 8px; font-size: .7rem; font-weight: 600; }
.g-state { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; font-size: .8rem; font-weight: 600; }
.g-progress { position: absolute; inset: auto 0 0 0; height: 5px; background: rgba(0,0,0,.6); }
.g-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.g-tools { display: grid; grid-template-columns: 2fr 1fr 1fr; border-top: 1px solid #2a2a2a; }
.g-tools button { background: none; border: 0; border-right: 1px solid #2a2a2a; color: #ddd; min-height: 40px; cursor: pointer; font: inherit; font-size: .95rem; }
.g-tools button:last-child { border-right: 0; color: #ff8a8a; }
.g-tools button:hover:not(:disabled) { background: rgba(255,255,255,.06); }
.g-tools button:disabled { color: #555; cursor: default; }
.g-tools button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.g-tools .grip { touch-action: none; cursor: grab; color: var(--muted); font-size: .85rem; }
.g-tile.lifted { opacity: .3; }
.g-tile.drop-before { box-shadow: -8px 0 0 -2px var(--accent); }
.g-tile.drop-after { box-shadow: 8px 0 0 -2px var(--accent); }
.g-ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; opacity: .92; box-shadow: 0 14px 34px rgba(0,0,0,.6); border-color: var(--accent); rotate: 2deg; }
body.reordering { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.g-add { border: 2px dashed #444; border-radius: 8px; min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 10px; cursor: pointer; color: var(--muted); font-size: .82rem; transition: border-color .2s ease, background .2s ease; }
.g-add b { color: var(--text); font-size: .95rem; }
.g-add .drop-icon { font-size: 26px; }
.g-add:hover, .g-add.over { border-color: var(--accent); background: rgba(255,77,48,.05); }
.g-add input { display: none; }
.g-add.full { opacity: .45; cursor: not-allowed; }
.g-add.full:hover { border-color: #444; background: none; }
.photos-field .drop-error, .photos-field .drop-note { margin: 8px 0 0; }
.g-help { color: var(--muted); font-size: .8rem; margin: 8px 0 0; }
.preview-col .build-photo { position: relative; }
/* Edit About AJM: text box + counters on the left, a preview of the home page section on the right. */
.about-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.about-edit textarea { width: 100%; min-height: 240px; resize: vertical; line-height: 1.55; }
.about-counts { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; color: var(--muted); font-size: .82rem; }
.about-counts .over { color: #ff8a8a; font-weight: 600; }
.about-counts .near { color: #ffcf7a; }
.about-help { color: var(--muted); font-size: .82rem; margin: 10px 0 0; }
.about-undo { margin-right: auto; }
.btn-link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: .88rem; padding: 0; }
.btn-link:disabled { opacity: .4; cursor: default; text-decoration: none; }
.unsaved { color: #ffcf7a; font-size: .85rem; }
.preview-col .about-pv-note { margin: 0 0 14px; }
.about-pv-frame { background: var(--bg); border-radius: 10px; padding: 22px 16px; border: 1px dashed #333; }
.about-pv-frame .section-title { margin-top: 0; }
.about-empty { color: var(--muted); font-style: italic; }
.about-edit .part + .part { margin-top: 28px; padding-top: 24px; border-top: 1px solid #2a2a2a; }
.about-edit .part-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.about-edit .part-head h2 { margin: 0; font-size: 1.05rem; }
.about-edit .part-head span { color: var(--muted); font-size: .82rem; }
.about-edit .part-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.about-edit .part-help { margin: -2px 0 12px; }
.about-edit .svc-form textarea { width: 100%; min-height: 76px; resize: vertical; line-height: 1.5; }
.box-done { display: flex; gap: 8px; justify-content: flex-end; }
/* Preview: the home page's highlight boxes, scaled down. */
.about-pv-frame .badge-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.about-pv-frame .badge-row[hidden] { display: none; }
.about-pv-frame .badge { padding: 14px 8px; }
.about-pv-frame .badge > .icon { font-size: 28px; margin-bottom: 4px; }
.about-pv-frame .badge h2 { font-size: .78rem; margin-bottom: 6px; }
.about-pv-frame .badge p { font-size: .7rem; line-height: 1.4; }
.about-pv-frame .flash { animation: svc-flash 1s ease; }
/* Manage Services: the list (left) is as tall as the preview (right) and scrolls inside; Add and Save stay in view. */
.svc-edit { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.svc-card { height: 0; min-height: max(100%, 560px); display: flex; flex-direction: column; }
.svc-scroll { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -10px; padding: 2px 10px 10px; border-bottom: 1px solid #2a2a2a; scrollbar-width: thin; scrollbar-color: #444 transparent; }
.svc-scroll:focus { outline: none; }
.svc-group + .svc-group { margin-top: 22px; }
.svc-group-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.svc-group-head b { font-size: .95rem; }
.svc-group-head span { color: var(--muted); font-size: .82rem; }
.svc-group-help { color: var(--muted); font-size: .8rem; margin: -4px 0 10px; }
.svc-list { display: flex; flex-direction: column; gap: 8px; min-height: 12px; }
.svc-empty { color: var(--muted); font-size: .85rem; font-style: italic; border: 1px dashed #333; border-radius: 8px; padding: 12px; text-align: center; margin: 0; }
.svc-row { border: 1px solid #333; border-radius: 8px; background: var(--surface-2); }
.svc-row.open { border-color: var(--accent); }
.svc-row.lifted { opacity: .3; }
.svc-row.drop-before { box-shadow: 0 -6px 0 -2px var(--accent); }
.svc-row.drop-after { box-shadow: 0 6px 0 -2px var(--accent); }
.svc-ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; opacity: .92; box-shadow: 0 14px 34px rgba(0,0,0,.6); border-color: var(--accent); rotate: 1deg; }
.svc-line { display: grid; grid-template-columns: auto 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; }
.svc-line .grip { background: none; border: 0; color: var(--muted); font-size: 1.15rem; cursor: grab; padding: 6px 4px; touch-action: none; line-height: 1; border-radius: 4px; }
.svc-line .grip:focus-visible { outline: 2px solid var(--accent); }
.svc-ico { width: 40px; height: 40px; border-radius: 8px; background: #141414; display: grid; place-items: center; color: var(--accent); font-size: 24px; }
.svc-txt { min-width: 0; }
.svc-txt b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-txt b.untitled { color: #ff8a8a; font-style: italic; font-weight: 600; }
.svc-txt small { display: block; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-actions { display: flex; gap: 6px; }
.svc-actions .btn { padding: 6px 12px; font-size: .82rem; }
.svc-form { border-top: 1px solid #333; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.svc-form .field input { width: 100%; }
.svc-form .count { color: var(--muted); font-size: .78rem; text-align: right; }
.svc-check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.svc-check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.svc-check small { display: block; color: var(--muted); font-size: .8rem; }
.svc-check.off { opacity: .55; cursor: default; }
.icon-pick-label { font-weight: 600; font-size: .92rem; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; margin-top: 8px; }
.icon-opt { aspect-ratio: 1; border: 1px solid #3a3a3a; border-radius: 8px; background: #141414; color: var(--accent); display: grid; place-items: center; font-size: 26px; cursor: pointer; padding: 0; position: relative; }
.icon-opt:hover { border-color: #666; }
.icon-opt[aria-checked="true"] { border: 2px solid var(--accent); background: #2a1612; }
.icon-opt.upload { color: var(--muted); font-size: .7rem; font-weight: 600; line-height: 1.2; text-align: center; padding: 4px; border-style: dashed; }
.icon-opt.upload span { font-size: 1.2rem; display: block; }
.icon-opt.upload:focus-within { outline: 2px solid var(--accent); }
.icon-opt.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.custom-box { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; background: #141414; border: 1px solid #333; border-radius: 8px; padding: 10px 12px; margin-top: 10px; font-size: .85rem; }
.custom-box .svc-ico { background: #0f0f0f; width: 52px; height: 52px; font-size: 32px; }
.custom-box .grow { flex: 1; min-width: 160px; color: var(--muted); }
.custom-box .grow b { color: var(--text); display: block; overflow-wrap: anywhere; }
.icon-help { color: var(--muted); font-size: .8rem; margin: 8px 0 0; }
.icon-error { color: #ff8a8a; font-size: .82rem; margin: 6px 0 0; }
.svc-add { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.svc-add .total { color: var(--muted); font-size: .85rem; }
.svc-undo { margin-right: auto; }
.svc-pv { background: var(--bg); border-radius: 10px; padding: 20px 14px; border: 1px dashed #333; }
.svc-pv .section-title { margin-top: 0; font-size: 1.6rem; }
.svc-pv .section-sub { font-size: .82rem; margin-bottom: 16px; }
.svc-pv .services-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.svc-pv .services-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 66%; margin: 0 auto 10px; }
.svc-pv .services-featured .service-card:nth-child(n) { grid-column: auto; }
.svc-pv .services-featured[hidden] { display: none; }
.svc-pv .service-card { padding: 14px 8px; }
.svc-pv .service-card .icon { font-size: 28px; margin-bottom: 6px; }
.svc-pv .service-card h3 { font-size: .85rem; line-height: 1.25; }
.svc-pv .service-card p { font-size: .72rem; }
.svc-pv .flash { animation: svc-flash 1s ease; }
@keyframes svc-flash { from { border-color: #ffcf7a; box-shadow: 0 0 0 2px #ffcf7a; } }
/* Admin menu: Devices Signed Into Panel (below the tiles). */
.devices { margin-top: 36px; padding: 0; }     /* not the 64px padding every <section> gets */
.devices-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.devices-head h2 { margin: 0; font-size: 1.15rem; display: flex; gap: 10px; align-items: center; }
.devices-head h2 .icon { color: var(--accent); font-size: 1.3em; }
.devices-sub { color: var(--muted); font-size: .85rem; margin: 0 0 14px; }
.device-list { display: flex; flex-direction: column; gap: 10px; }
.device { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; }
.device.current { border-color: #3a5a3a; }
.device-ico { width: 44px; height: 44px; border-radius: 10px; background: #141414; display: grid; place-items: center; color: var(--accent); font-size: 24px; }
.device-name { font-weight: 700; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; overflow-wrap: anywhere; }
.this-device { background: #1d3a24; color: #7fe0a0; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; }
.kept { background: #1d2a3a; color: #8cc4ff; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; }
.device-meta { color: var(--muted); font-size: .84rem; margin-top: 3px; }
.device-meta b { color: var(--text); font-weight: 600; }
.device .btn { padding: 7px 14px; font-size: .85rem; }
.devices-foot { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-top: 14px; }
.devices-foot[hidden] { display: none; }
.devices-foot p { color: var(--muted); font-size: .8rem; margin: 0; flex: 1; min-width: 220px; }
.devices-empty { color: var(--muted); font-style: italic; border: 1px dashed #333; border-radius: 10px; padding: 14px; text-align: center; margin: 0; }
@media (max-width: 640px) {
  .device { grid-template-columns: 40px minmax(0, 1fr); }
  .device .btn { grid-column: 1 / -1; width: 100%; }
  .devices-foot .btn { width: 100%; }
}
/* "Are you sure?" popup (src/partials/admin-confirm.html): a <dialog> opened with showModal(), which keeps keyboard
   focus inside it. margin: auto centres it (the reset at the top sets every margin to 0). */
.confirm-dialog { margin: auto; max-height: calc(100dvh - 32px); overflow: auto; width: min(440px, calc(100vw - 32px)); border: 1px solid #3a3a3a; border-radius: 14px; background: var(--surface); color: var(--text); padding: 0; box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.confirm-dialog::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(2px); }
.confirm-dialog[open] { animation: confirm-in .18s ease; }
@keyframes confirm-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.confirm-body { padding: 24px 24px 8px; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: start; }
.confirm-icon { grid-row: span 2; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; color: #ff6b6b; background: rgba(255,107,107,.12); }
.confirm-icon.warn { color: #ffcf7a; background: rgba(255,207,122,.12); }
.confirm-icon [hidden] { display: none; }
.confirm-dialog h2 { margin: 0; font-size: 1.15rem; line-height: 1.3; }
.confirm-dialog p { margin: 0; color: var(--muted); font-size: .92rem; }
.confirm-thumb { grid-column: 2; margin-top: 8px; width: 120px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; background: #151515; }
.confirm-thumb[hidden] { display: none; }
.confirm-actions-row { display: flex; gap: 10px; justify-content: flex-end; padding: 18px 24px 22px; }
.btn-danger { background: #c62828; border-color: #c62828; color: #fff; }
.btn-danger:hover { background: #e53935; border-color: #e53935; }
@media (max-width: 520px) {
  .confirm-body { padding: 20px 18px 6px; }
  .confirm-actions-row { flex-direction: column-reverse; padding: 16px 18px 18px; }
  .confirm-actions-row .btn { width: 100%; text-align: center; }
}
/* Popups (toasts): bottom centre, newest on top. */
.toast-wrap { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; width: min(440px, calc(100vw - 32px)); z-index: 50; }
.toast { display: flex; gap: 12px; align-items: flex-start; background: #1d1d1d; border: 1px solid #333; border-left: 4px solid var(--ok); border-radius: 10px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: toast-in .25s ease; transition: opacity .3s ease, transform .3s ease; }
.toast.error { border-left-color: #ff6b6b; }
.toast.out { opacity: 0; transform: translateY(10px); }
.toast b { display: block; }
.toast p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.toast button { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; line-height: 1; padding: 0 2px; }
.toast .toast-action { display: block; margin: 4px 0 0; padding: 0; font-size: .85rem; color: var(--accent); text-decoration: underline; line-height: 1.4; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@media (max-width: 860px) {
  .admin-row.t-row { grid-template-columns: 1fr; }
  .admin-row { grid-template-columns: 90px 1fr; }
  .row-actions { grid-column: 1 / -1; }
  .row-actions .btn { flex: 1; text-align: center; }
  .edit-foot .btn, .decide .btn { flex: 1; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-edit { grid-template-columns: 1fr; }
  .about-pv-frame .badge-row { grid-template-columns: 1fr; }
  .about-undo { flex-basis: 100%; }
  .svc-edit { grid-template-columns: 1fr; }
  .svc-card { height: auto; min-height: 0; }
  .svc-scroll { overflow: visible; border-bottom: 0; }
  .svc-line { grid-template-columns: auto 36px minmax(0, 1fr); }
  .svc-actions { grid-column: 1 / -1; }
  .svc-actions .btn { flex: 1; }
  .svc-pv .services-grid { grid-template-columns: repeat(2, 1fr); }
  .svc-pv .services-featured { width: 100%; }
  .svc-undo { flex-basis: 100%; }
  .g-tools button { min-height: 44px; }
}

/* Quote page: pay later options under Business Hours.
   White logo versions on transparent tiles, same height. The tile glows on hover; the logos don't. */
.pay-later-intro { color: #ccc; font-size: .92rem; }
.pay-later-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.pay-later-list a { display: flex; align-items: center; justify-content: center; height: 64px; padding: 12px 10px; border: 1px solid #3a3a3a; border-radius: 8px; background: transparent; transition: border-color .2s ease, transform .2s ease, box-shadow .3s ease; }
.pay-later-list a:hover, .pay-later-list a:focus-visible { border-color: #ff0000; transform: translateY(-2px); box-shadow: 0 0 16px rgba(255,0,0,.35); }
.pay-later-list img { height: 28px; width: auto; max-width: 100%; object-fit: contain; }
.pay-later .note { color: var(--muted); font-size: .8rem; }

/* Contact page */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; margin-bottom: 28px; }
.contact-card { text-align: center; }
.contact-card { transition: transform .25s ease, border-color .25s ease; }
.contact-card .icon { font-size: 36px; color: var(--accent); margin-bottom: 10px; transition: filter .3s ease, transform .3s ease; }
.contact-card h3 { text-transform: uppercase; font-size: .95rem; letter-spacing: 1px; margin-bottom: 6px; }
.contact-card a { color: #fff; word-break: break-word; }
.contact-hours { max-width: 520px; margin: 40px auto 0; }
.contact-hours h2 { justify-content: center; }
.map-frame { height: 340px; border-radius: 10px; border: 2px dashed var(--border); display: grid; place-items: center; text-align: center; color: var(--muted); background:
  repeating-linear-gradient(45deg, #151515 0 14px, #181818 14px 28px); padding: 16px; overflow: hidden; }
.map-frame.loaded { padding: 0; border: 0; }
.map-frame iframe { width: 100%; height: 100%; border: 0; }
.map-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.map-frame .note { font-size: .85rem; margin-top: 10px; }

footer { background: #000; border-top: 3px solid var(--accent); padding: 28px 16px; text-align: center; color: var(--muted); font-size: .9rem; margin-top: 40px; }
footer a { color: #fff; }

@media (max-width: 760px) {
  .quote-layout, .form-grid, .badge-row { grid-template-columns: 1fr; }
}

/* Small helpers that replace inline styles (the CSP blocks inline style attributes). */
.title-sm { font-size: 1.5rem; }
.mt-40 { margin-top: 40px; }
footer strong { color: #fff; }

/* ===== Mobile variant (phones, up to 760px wide) ===== */
@media (max-width: 760px) {
  /* Compact pinned header: one row of links, slim banner. */
  /* Phone top bar: headlight left, wide logo centered, menu button right; links slide open as a list. */
  .topbar-row { position: relative; display: flex; justify-content: center; align-items: center; min-height: 56px; padding: 8px 64px; }
  .topbar .brand { padding: 0; line-height: 0; max-width: 100%; }
  .topbar .brand:hover { color: #fff; }
  .topbar .brand img { display: block; height: 34px; width: auto; max-width: 100%; object-fit: contain; }
  .menu-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #fff; font-size: 28px; padding: 6px; line-height: 0; cursor: pointer; border-radius: 6px; }
  .menu-toggle:focus-visible { outline: 2px solid var(--accent); }
  .menu-toggle .when-open, .topbar.open .menu-toggle .when-closed { display: none; }
  .topbar.open .menu-toggle .when-open { display: inline; }
  .topbar nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; max-height: 0; overflow: hidden; opacity: 0; visibility: hidden;
    transition: max-height .35s ease, opacity .25s ease, padding .35s ease, visibility .35s; }
  .topbar.open nav { max-height: 420px; opacity: 1; visibility: visible; padding: 4px 12px 12px; }
  .topbar nav a { padding: 12px; font-size: 1.05rem; }
  /* Always shown on small screens. Darker red keeps the smaller text readable (WCAG AA). */
  .topbar .inspection-banner { position: static; opacity: 1; visibility: visible; transform: none;
    background: #b8301a; font-size: .8rem; letter-spacing: 1.2px; padding: 6px 12px; gap: 6px; }
  .inspection-banner .icon { font-size: 1.4em; }
  #hours { scroll-margin-top: 110px; }

  /* Tighter spacing overall. */
  section { padding: 40px 16px; }
  .card { padding: 20px; }
  .section-title { font-size: 1.5rem; }
  .section-sub { margin-bottom: 24px; }

  /* Home */
  .hero { padding: 56px 16px; }
  .hero p { font-size: 1.05rem; }
  .hero-mark { margin-bottom: 14px; }
  .hero-logo { filter: drop-shadow(3px 4px 0 rgba(0,0,0,.85)) drop-shadow(0 6px 14px rgba(0,0,0,.6)); }
  .hero-logo-sub { text-shadow: 2px 3px 0 rgba(0,0,0,.85), 0 4px 10px rgba(0,0,0,.6); }
  .hero .actions { flex-direction: column; align-items: stretch; max-width: 320px; margin: 0 auto; }
  .hero .actions .btn { text-align: center; }
  .about-card { text-align: left; }
  .badge > .icon { font-size: 40px; }
  .badge h2 { font-size: 1.15rem; }
  .badge-row { gap: 16px; }

  /* Services: two compact columns instead of one long list. */
  .services-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .testimonials-grid, .builds-grid { grid-template-columns: 1fr; gap: 14px; }
  .services-featured { margin-bottom: 12px; }
  .services-featured .service-card:nth-child(n) { grid-column: auto; }
  .service-card { padding: 18px 10px; }
  .service-card .icon { font-size: 32px; margin-bottom: 8px; }
  .service-card h3 { font-size: .95rem; line-height: 1.3; }
  .service-card p { font-size: .8rem; }

  /* Quote: rates as a compact strip above the form, then the form, call button, then hours. */
  .quote-layout { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
  /* Phone: Labor Rates and Business Hours headings centered (cards are full width). */
  .rates h2, .rates .note { text-align: center; justify-content: center; }
  .sidebar > .card:not(.rates):not(.pay-later) h2 { justify-content: center; }
  .sidebar { display: contents; }
  .rates { order: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .rates h2, .rates .note { grid-column: 1 / -1; margin: 0; }
  .rates .rate, .rates .rate:last-of-type { flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; }
  .main-col { order: 2; gap: 16px; }
  .sidebar > .card:not(.rates) { order: 3; }
  .form-grid { gap: 14px; }
  .form-foot { flex-direction: column-reverse; align-items: stretch; text-align: center; }
  .form-foot .btn { width: 100%; padding: 14px; }
  .shop-contact .big-phone { display: block; margin-top: 8px; padding: 12px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 1.4rem; }

  /* Contact */
  .contact-grid { gap: 12px; margin-bottom: 24px; }
  .contact-card a { display: inline-block; padding: 6px 4px; font-size: 1.05rem; }
  .map-frame { height: 260px; }
  .contact-hours { margin-top: 24px; }

  footer { font-size: .8rem; padding: 20px 16px; }
}

/* Touch screens: no hover lift/glow sticking after a tap. */
@media (hover: none) {
  .service-card:hover, .contact-card:hover, .badge:hover, .testimonial:hover, .build:hover { transform: none; box-shadow: none; }
  .service-card:hover .icon, .contact-card:hover .icon, .badge:hover > .icon { filter: none; transform: none; }
  .badge:hover h2 { text-shadow: none; }
}

/* ===== Headlight theme toggle (far left of the top bar) ===== */
.theme-toggle { position: absolute; left: 12px; top: 3px; z-index: 2; background: none; border: 0; padding: 6px; border-radius: 8px; cursor: pointer; line-height: 0; color: #777; font-size: 47px; }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); }
/* Keep centered links clear of the toggle on desktop. */
.topbar nav { padding-inline: 84px; }
.theme-toggle .icon { overflow: visible; transition: color .3s ease, filter .3s ease; }
/* Dark mode = headlights on: lamp glows yellow. */
:root:not([data-theme="light"]) .theme-toggle { color: #ffd23f; }
:root:not([data-theme="light"]) .theme-toggle .lamp { fill: rgba(255,210,63,.35); }
:root:not([data-theme="light"]) .theme-toggle .icon { filter: drop-shadow(0 0 4px rgba(255,210,63,.9)) drop-shadow(0 0 10px rgba(255,190,0,.6)); }
.theme-toggle:hover { color: #aaa; }
:root:not([data-theme="light"]) .theme-toggle:hover { color: #ffe27a; }
@media (max-width: 760px) {
  .theme-toggle { top: 0; left: 4px; font-size: 42px; }
  .topbar nav { padding-inline: 12px; }
}

/* ===== Light mode ===== */
/* Top bar, footer and hero stay dark in both modes (brand bars; photo + white logo text). */
:root[data-theme="light"] {
  --bg: #f3f3f1; --surface: #fff; --surface-2: #f4f4f4; --border: #dedede;
  --text: #1b1b1b; --muted: #5a5a5a; --accent-text: #c2361d;
  color-scheme: light;
}
[data-theme="light"] main a:not(.btn) { color: var(--accent-text); }
[data-theme="light"] .card { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
[data-theme="light"] .hero { color: #fff; }
[data-theme="light"] footer { color: #a8a8a8; }
[data-theme="light"] .about-card p, [data-theme="light"] .pay-later-intro { color: #333; }
[data-theme="light"] .badge { background: #fff; }
[data-theme="light"] .badge h2, [data-theme="light"] .badge > .icon { color: #d0201a; }
[data-theme="light"] .rate b { color: var(--accent-text); }
[data-theme="light"] .field input, [data-theme="light"] .field textarea { border-color: #cfcfcf; background: #fff; }
[data-theme="light"] .field .error { color: #c62828; }
[data-theme="light"] .form-status.info { color: #8a5a00; }
[data-theme="light"] .form-status.error { color: #c62828; }
[data-theme="light"] .map-frame { background: repeating-linear-gradient(45deg, #ececec 0 14px, #e4e4e4 14px 28px); }
[data-theme="light"] .contact-card a { color: #1b1b1b; }
[data-theme="light"] .testimonial blockquote { color: #333; }
[data-theme="light"] .build-body p { color: #333; }
[data-theme="light"] .parts li { color: #333; border-color: #d5d5d5; }
[data-theme="light"] .build-photo { background: repeating-linear-gradient(45deg, #ececec 0 14px, #e4e4e4 14px 28px); }
[data-theme="light"] .btn-ghost { color: #fff; }
/* White partner logos need a dark tile in light mode. */
[data-theme="light"] .pay-later-list a { background: #1a1a1a; border-color: #1a1a1a; }

/* ===== Transitions ===== */
.topbar a { transition: color .2s ease, background-color .2s ease; }
/* Light/dark switch: colors fade together for ~0.5s, only while switching. */
html.theme-fading, html.theme-fading *, html.theme-fading *::before, html.theme-fading *::after {
  transition: background-color .5s ease, color .5s ease, border-color .5s ease, box-shadow .5s ease, fill .5s ease, stroke .5s ease, filter .5s ease !important;
}
/* Cross-fade between pages (supported browsers only; others change pages normally). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }
/* Scroll reveal (classes added by main.js; without JS everything is simply visible).
   Animates opacity + the separate "translate" property, so it never overrides hover transforms/transitions. */
@keyframes reveal-up { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
.reveal-ready .reveal:not(.revealed) { opacity: 0; }
.reveal-ready .reveal.revealed { animation: reveal-up .6s ease both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  @view-transition { navigation: none; }
}
