/* ==========================================================================
   24-7 Garage Door & Gate Services — stylesheet (v4)
   Mobile-first. No framework, no web fonts (system stacks) to avoid third-party requests.
   Contrast notes (WCAG relative luminance, computed by hand — verify in QA):
     --ink #1F1D1A on --ivory #F6F1E7  ≈ 15.6:1
     --muted #5C564D on --ivory        ≈ 6.4:1
     --accent #A84716 on --ivory       ≈ 5.2:1   white on --accent ≈ 5.9:1
     --ok #2F6B3F on --ivory           ≈ 5.6:1   --error #A3261B on --ivory ≈ 6.5:1
     --line-strong #8C8378 (control borders) on --paper ≈ 3.5:1 (non-text ≥ 3:1)
   ========================================================================== */

:root {
  --ivory: #F6F1E7;
  --paper: #FBF8F2;
  --sand: #EFE8DB;
  --line: #DCD2C2;
  --line-strong: #8C8378;
  --ink: #1F1D1A;
  --ink-2: #2B2824;
  --muted: #5C564D;
  --accent: #A84716;
  --accent-hover: #8A3910;
  --accent-soft: #F3E3D5;
  --accent-on-dark: #F0A574;
  --ok: #2F6B3F;
  --ok-soft: #EAF2EB;
  --error: #A3261B;
  --error-soft: #FBECE9;
  --dark: #1F1D1A;
  --darker: #161411;
  --on-dark: #F6F1E7;
  --on-dark-muted: #BDB4A6;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Draft logo wordmark: must match the SVG files. Final artwork should outline a licensed typeface. */
  --font-logo: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 6px;
  --radius-sm: 4px;
  --callbar-h: 4.375rem; /* ≥ bar content (48px button + 20px padding) + 1px border */
  --header-h: 4.5rem;
  --section-y: clamp(3.5rem, 2rem + 5vw, 6.5rem);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; }
p { margin: 0; }
p + p { margin-top: 0.75em; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
code { font-family: var(--font-mono); font-size: 0.875em; overflow-wrap: anywhere; }
ul, ol { margin: 0; padding: 0; }

/* Visible keyboard focus everywhere: charcoal ring with ivory halo works on light and accent backgrounds. */
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--ivory);
  border-radius: 2px;
}
.section--dark :focus-visible,
.site-footer :focus-visible,
.proto-banner :focus-visible {
  outline-color: var(--on-dark);
  box-shadow: 0 0 0 2px var(--dark);
}
:focus:not(:focus-visible) { outline: none; }
main:focus, [tabindex="-1"]:focus { outline: none; box-shadow: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 0.75rem; top: -10rem; z-index: 100;
  background: var(--ink); color: var(--on-dark); padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 0.75rem; color: var(--on-dark); }

.wrap {
  width: 100%;
  max-width: 78rem;
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.wrap--narrow { max-width: 48rem; }

.icon { width: 1.125em; height: 1.125em; flex: none; }

/* ---------- Eyebrows, titles ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.625rem;
  font-size: 0.8125rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.875rem;
}
.eyebrow::before { content: ""; width: 1.75rem; height: 3px; background: var(--accent); flex: none; }
.eyebrow--light { color: var(--on-dark-muted); }
.eyebrow--light::before { background: var(--accent-on-dark); }

.section { padding-block: var(--section-y); }
.section--sand { background: var(--sand); }
.section--dark { background: var(--dark); color: var(--on-dark); }
.section--dark a { color: var(--on-dark); }
.section--dark a:hover { color: var(--accent-on-dark); }
.section__head { max-width: 44rem; margin-bottom: clamp(2rem, 1rem + 3vw, 3rem); }
.section__title { font-size: clamp(1.75rem, 1.25rem + 2vw, 2.625rem); font-weight: 700; letter-spacing: -0.022em; }
.section__title--sm { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); margin-bottom: 1.25rem; }
.section__intro { margin-top: 1rem; color: var(--muted); font-size: 1.125rem; max-width: 38rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.625rem 1.25rem;
  border: 2px solid transparent; border-radius: var(--radius-sm);
  font: inherit; font-size: 1rem; font-weight: 650; line-height: 1.2; letter-spacing: 0.005em;
  text-decoration: none; text-align: center; cursor: pointer; overflow-wrap: anywhere;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn--sm { min-height: 44px; padding: 0.5rem 1rem; font-size: 0.9375rem; }
.btn--lg { min-height: 56px; padding: 0.75rem 1.5rem; font-size: 1.0625rem; }
.btn--block { width: 100%; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
.btn--secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--secondary:hover { background: var(--ink); color: var(--on-dark); text-decoration: none; }
.btn[aria-disabled="true"] { cursor: progress; opacity: 0.85; }

/* ---------- Prototype banner ---------- */
.proto-banner { background: var(--darker); color: var(--on-dark); font-size: 0.8125rem; line-height: 1.45; }
.proto-banner__inner { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; padding-block: 0.5rem; }
.proto-banner strong { color: var(--accent-on-dark); font-weight: 650; }
/* AR-08: review-only markup can never show in production mode, even if a build step missed it. */
[data-mode="production"] [data-review-only] { display: none !important; }
/* Keeps the brand token "24-7" together inside the email address (AR-06). */
.nobr { white-space: nowrap; }

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 20; background: var(--ivory); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; min-height: var(--header-h); padding-block: 0.625rem; }
.brand { display: inline-flex; align-items: center; gap: 0.625rem; margin-right: auto; color: var(--ink); text-decoration: none; min-height: 44px; }
.brand:hover { color: var(--ink); }
.brand__mark { width: 2.25rem; height: 2.25rem; flex: none; }
.brand__accent { fill: var(--accent); }
/* Same stack, weights and colours as src/assets/brand/*.svg (single approved draft lockup). */
.brand__text { display: flex; flex-direction: column; font-family: var(--font-logo); font-size: 1rem; line-height: 1.12; letter-spacing: -0.01em; }
.brand__l1 { font-weight: 700; }
.brand__l2 { font-weight: 400; color: var(--muted); }

.nav-toggle {
  order: 3; display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 44px; min-width: 44px; padding: 0.5rem 0.75rem;
  background: transparent; color: var(--ink); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; position: relative;
}
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

.site-header__call { order: 2; display: none; }

/* Below 1080px the nav is a disclosure controlled by .nav-toggle.
   Without JS, assets/css/no-js.css (loaded via <noscript>) shows it as a wrapped row instead. */
.site-nav { order: 4; flex-basis: 100%; display: none; }
.site-nav__list { list-style: none; display: flex; flex-wrap: wrap; gap: 0 1rem; }
.site-nav a {
  display: flex; align-items: center; min-height: 44px; padding-inline: 0.25rem;
  color: var(--ink); text-decoration: none; font-weight: 550; font-size: 0.9375rem;
}
.site-nav a:hover { color: var(--accent); text-decoration: underline; }

.site-header[data-nav-open] .site-nav {
  display: block;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--ivory); border-bottom: 1px solid var(--line);
  box-shadow: 0 16px 24px -16px rgba(31, 29, 26, .25);
  padding: 0.25rem max(var(--gutter), env(safe-area-inset-right)) 1rem max(var(--gutter), env(safe-area-inset-left));
}
.site-header[data-nav-open] .site-nav__list { flex-direction: column; gap: 0; }
.site-header[data-nav-open] .site-nav a { min-height: 52px; border-top: 1px solid var(--line); font-size: 1.0625rem; }

@media (min-width: 600px) {
  .site-header__call { display: inline-flex; }
}
@media (min-width: 1080px) {
  .nav-toggle { display: none; }
  .site-nav, .site-header[data-nav-open] .site-nav {
    display: block; order: 2; flex-basis: auto; position: static; margin-right: 0.5rem;
    padding: 0; background: none; border: 0; box-shadow: none;
  }
  .site-nav__list, .site-header[data-nav-open] .site-nav__list { flex-direction: row; gap: 0 1.375rem; flex-wrap: nowrap; }
  .site-header[data-nav-open] .site-nav a { min-height: 44px; border-top: 0; font-size: 0.9375rem; }
  .site-header__call { order: 3; }
}
/* Sticky header only where there is room for it (desktop / landscape tablet).
   AR-43: em units, so enlarged text or zoom drops the sticky behaviour instead of eating the viewport. */
@media (min-width: 60em) and (min-height: 37.5em) {
  .site-header { position: sticky; top: 0; }
  html { scroll-padding-top: calc(var(--header-h) + 1rem); }
}
/* AR-36: if app.js never initializes, boot.js adds .nav-fallback — show the links as a plain row
   (same treatment as no-js.css) instead of a menu button that does nothing. */
.nav-fallback .nav-toggle { display: none; }
.nav-fallback .site-nav { display: block; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2rem, 1rem + 4vw, 4.5rem) clamp(2.5rem, 1.5rem + 4vw, 5rem); }
.hero__grid { display: grid; gap: clamp(2rem, 1rem + 3vw, 3.5rem); align-items: center; }
.hero__title {
  font-size: clamp(2.25rem, 1.35rem + 3.8vw, 4.125rem);
  font-weight: 750; line-height: 1.03; letter-spacing: -0.03em;
  max-width: 14ch;
}
.hero__lead { margin-top: 1.25rem; font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); color: var(--ink-2); max-width: 36rem; }
.hero__actions { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.75rem; }
.hero__actions .btn { width: 100%; }
@media (min-width: 600px) {
  .hero__actions { flex-direction: row; flex-wrap: wrap; }
  .hero__actions .btn { width: auto; }
}

.hours-card {
  margin-top: 1.75rem; padding: 1rem 1.125rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  max-width: 36rem;
}
.hours-card__status { display: flex; align-items: center; gap: 0.5rem; font-weight: 650; }
.hours-card__week { display: flex; flex-wrap: wrap; gap: 0.125rem 1rem; margin-top: 0.375rem; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.hours-card__note { margin-top: 0.5rem; font-size: 0.875rem; color: var(--muted); }
.hero__trust { margin-top: 0.875rem; font-size: 0.875rem; line-height: 1.4; color: var(--muted); }
.hours-card__closed { margin-top: 0.5rem; font-size: 0.9375rem; color: var(--ink-2); }

.status-dot { width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--line-strong); flex: none; box-shadow: 0 0 0 3px rgba(140,131,120,.18); }
[data-open="true"] .status-dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(47,107,63,.18); }

.hero__media { position: relative; margin: 0; }
.hero__media::before { /* "lintel" accent echoing the lifted panel in the logo mark */
  content: ""; position: absolute; top: -10px; left: 0; width: 4.5rem; height: 4px; background: var(--accent);
}
.hero__media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius-sm); background: var(--sand); }

/* Concept-image label: always visible, never hidden behind hover. */
.concept, .owner-photo { position: relative; }
.concept__tag, .owner-photo__tag {
  position: absolute; left: 0.625rem; bottom: 0.625rem; max-width: calc(100% - 1.25rem);
  padding: 0.25rem 0.5rem; border-radius: 3px;
  background: rgba(22, 20, 17, .84); color: var(--on-dark);
  font-size: 0.75rem; font-weight: 550; line-height: 1.35; letter-spacing: 0.01em;
}

@media (min-width: 960px) {
  .hero__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .hero__media img { aspect-ratio: 4 / 3.4; }
}

/* ---------- Facts strip ---------- */
.facts { border-block: 1px solid var(--line); background: var(--paper); }
.facts__list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.facts__list li { padding: 1rem 0.75rem 1rem 0; display: flex; flex-direction: column; gap: 0.125rem; }
.facts__list li:nth-child(n+3) { border-top: 1px solid var(--line); }
.facts__k { font-size: 0.75rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.facts__v { font-weight: 600; font-size: 0.9375rem; }
.facts__v a { color: var(--ink); display: inline-block; padding-block: 0.75rem; margin-block: -0.75rem; }
@media (min-width: 960px) {
  .facts__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .facts__list li { padding: 1.25rem 1.5rem; border-top: 0 !important; border-left: 1px solid var(--line); }
  .facts__list li:first-child { border-left: 0; padding-left: 0; }
}

/* ---------- Services ---------- */
.svc-grid { display: grid; gap: 1.5rem; }
.svc-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.svc-card__media { margin: 0; }
.svc-card__media img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; background: var(--sand); }
.svc-card__body { padding: 1.25rem 1.25rem 0.5rem; }
.svc-card__title { font-size: 1.375rem; font-weight: 700; margin-bottom: 0.5rem; }

.fault-list { list-style: none; }
.fault {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem;
  padding: 0.875rem 0; min-height: 48px;
  border-top: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.fault__name { font-weight: 650; }
.fault__desc { grid-column: 1; color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }
.fault__go { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--accent); font-size: 1.25rem; transition: transform .15s ease; }
a.fault:hover { color: var(--ink); }
a.fault:hover .fault__name { color: var(--accent); text-decoration: underline; }
a.fault:hover .fault__go { transform: translateX(3px); }
/* Calls-only build: the build turns fault links into static items (there is no form to pre-fill). */
.fault--static { grid-template-columns: minmax(0, 1fr); }

.svc-strip {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: center; margin-top: 1.5rem;
  padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
}
.svc-strip__title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.25rem; }
.svc-strip p { color: var(--muted); }
.svc-strip__links { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.svc-strip__links .btn { flex: 1 1 min(12rem, 100%); }

@media (min-width: 640px) and (max-width: 899.98px) {
  .svc-card { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  /* The figure stretches to the card height; the picture and img must fill it, otherwise the
     img keeps its intrinsic ratio and leaves an empty column under it (v1 defect). */
  .svc-card__media { position: relative; min-height: 16rem; }
  .svc-card__media picture { position: absolute; inset: 0; }
  .svc-card__media img { width: 100%; height: 100%; aspect-ratio: auto; }
}
@media (min-width: 900px) {
  .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .svc-card__body { padding: 1.5rem 1.75rem 0.75rem; }
  .svc-strip { grid-template-columns: minmax(0, 1fr) auto; padding: 1.5rem 1.75rem; }
  .svc-strip__links .btn { flex: none; }
}

/* ---------- Next steps & safety ---------- */
.next-grid { display: grid; gap: 2.5rem; }
.steps { list-style: none; counter-reset: step; }
.step {
  counter-increment: step; position: relative;
  display: grid; grid-template-columns: 3rem minmax(0, 1fr); column-gap: 1rem;
  padding-block: 1.25rem; border-top: 1px solid var(--line-strong);
}
.step::before {
  content: counter(step, decimal-leading-zero);
  grid-row: 1 / span 3; font-size: 1.5rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.2;
}
.step > * { grid-column: 2; }
.step__title { font-size: 1.1875rem; font-weight: 700; margin-bottom: 0.375rem; }
.step p { color: var(--ink-2); }

.owner-flag { display: block; margin-top: 0.75rem; font-size: 0.875rem; color: var(--muted); }
.owner-flag__tag {
  display: inline-block; margin-right: 0.375rem; padding: 0.0625rem 0.4375rem; border: 1.5px dashed var(--accent); border-radius: 3px;
  color: var(--accent); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.6;
}
.owner-flag--dark { color: var(--on-dark-muted); }
.owner-flag--dark .owner-flag__tag { border-color: var(--accent-on-dark); color: var(--accent-on-dark); }

.safety { align-self: start; background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--ink); border-radius: var(--radius-sm); padding: 1.5rem; }
.safety__title { font-size: 1.1875rem; font-weight: 700; margin-bottom: 0.75rem; }
.safety__list { list-style: none; display: grid; gap: 0.625rem; }
.safety__list li { position: relative; padding-left: 1.25rem; }
.safety__list li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 0.5rem; height: 0.5rem; background: var(--accent); }

@media (min-width: 960px) {
  .next-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 4rem; align-items: end; }
}

/* ---------- Request form ---------- */
.request-grid { display: grid; gap: 2rem; }
.request-intro > p { color: var(--ink-2); max-width: 32rem; }
.request-intro .section__title { margin-bottom: 1rem; }
.request-intro__call { margin-top: 1.25rem; }
.request-intro__status { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.875rem; font-weight: 600; font-size: 0.9375rem; }
.request-intro__notice { margin-top: 1rem; padding-left: 0.875rem; border-left: 3px solid var(--accent); }
.request-intro__hours { margin-top: 0.25rem; font-size: 0.9375rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.request-intro__hours span { color: var(--muted); }
.req-form__commit { margin-bottom: 0.625rem; font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }


.request-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  padding: clamp(1.125rem, 0.5rem + 3vw, 2.25rem);
  box-shadow: 0 1px 0 var(--line), 0 24px 48px -32px rgba(31, 29, 26, .35);
  min-width: 0;
}
.req-form__note { font-size: 0.875rem; color: var(--muted); margin-bottom: 1.25rem; }

.field { margin: 0 0 1.25rem; padding: 0; border: 0; min-width: 0; }
.field__label { display: block; padding: 0; margin-bottom: 0.375rem; font-weight: 650; font-size: 1rem; }
.field__opt { font-weight: 400; color: var(--muted); }
.field__hint { margin-top: 0.375rem; font-size: 0.875rem; color: var(--muted); }
.field__count { margin-top: 0.25rem; font-size: 0.8125rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.field__error { display: flex; gap: 0.375rem; margin-top: 0.375rem; color: var(--error); font-weight: 600; font-size: 0.9375rem; }
.field__error::before { content: "!"; content: "!" / ""; flex: none; display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; margin-top: 0.1em; border-radius: 50%; background: var(--error); color: #fff; font-size: 0.75rem; font-weight: 800; }
.field__error[hidden] { display: none; }
.field-row { display: grid; gap: 0 1rem; }
@media (min-width: 600px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

input[type="text"], input[type="tel"], input[type="email"], select, textarea {
  display: block; width: 100%; min-height: 48px;
  padding: 0.6875rem 0.875rem;
  font: inherit; font-size: 1rem; /* ≥16px prevents iOS zoom-on-focus */
  color: var(--ink); background: #fff;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
}
textarea { resize: vertical; min-height: 7rem; line-height: 1.5; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231F1D1A' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.875rem center; background-size: 0.75rem;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ink); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); border-width: 2px; background-color: #fffdfc; }

.choice-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice {
  flex: 1 1 auto; display: flex; align-items: center; gap: 0.625rem;
  min-height: 48px; padding: 0.5rem 0.875rem;
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 550;
}
.choice input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--accent); flex: none; }
.choice:hover { border-color: var(--ink-2); }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.choice:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.choice input:focus-visible { outline: none; box-shadow: none; }
fieldset[aria-invalid="true"] .choice { border-color: var(--error); }

.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.challenge { margin-bottom: 1.25rem; min-height: 1.5rem; font-size: 0.8125rem; color: var(--muted); }
.challenge__hint { margin: -0.75rem 0 1.25rem; color: var(--ink); font-weight: 600; }
.challenge__hint[hidden] { display: none; }
.challenge[data-challenge-kind="local-test"] { padding: 0.5rem 0.75rem; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); }
.req-form__privacy { font-size: 0.875rem; color: var(--muted); margin-bottom: 1rem; }

.error-summary, .form-alert {
  margin-bottom: 1.5rem; padding: 1rem 1.125rem;
  background: var(--error-soft); border: 2px solid var(--error); border-left-width: 6px; border-radius: var(--radius-sm);
}
.error-summary__title, .form-alert__title { color: var(--error); font-size: 1.0625rem; font-weight: 700; margin-bottom: 0.5rem; }
.error-summary__list { padding-left: 1.25rem; display: grid; gap: 0.25rem; }
.error-summary__list { font-size: 0.9375rem; line-height: 1.45; }
.error-summary__list a { color: var(--error); font-weight: 550; }
.form-alert__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.875rem; }
.form-alert__actions .btn { flex: 1 1 11rem; }
/* In the failed state the alert's "Try again" is the single primary action. */
.req-form[data-state="failed"] .req-form__submit,
.req-form[data-state="conflict"] .req-form__submit { display: none; }
.form-alert__actions [hidden] { display: none; }

.spinner { display: none; width: 1.125rem; height: 1.125rem; border: 2.5px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; }
.req-form[data-state="submitting"] .spinner,
.req-form[data-state="retrying"] .spinner { display: inline-block; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-done { padding: 1.25rem 1.25rem 1.5rem; background: var(--ok-soft); border: 2px solid var(--ok); border-left-width: 6px; border-radius: var(--radius-sm); }
.form-done__title { color: var(--ok); font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; }
.form-done p { margin-bottom: 0.75rem; }
.form-done__ref code { color: var(--ink); }
.form-done__summary { margin: 0 0 0.75rem; display: grid; gap: 0.25rem; font-size: 0.9375rem; }
.form-done__summary > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.5rem; }
.form-done__summary dt { color: var(--muted); }
.form-done__summary dd { margin: 0; font-weight: 600; }
.form-done__note { padding-left: 0.75rem; border-left: 3px solid var(--accent); font-size: 0.9375rem; }

/* Fail-closed shell: disabled in HTML until app.js has attached every handler. */
.req-form__shell { margin: 0; padding: 0; border: 0; min-width: 0; }
[data-form="unavailable"] .req-form { display: none; } /* fallback notice replaces it */
.req-form__fields[inert] { opacity: 0.72; }
[data-form="checking"] .req-form__shell { opacity: 0.72; }
.field--conditional[hidden] { display: none; }

/* Truthful fallback. Hidden while JS is expected to start, shown if it never does (boot.js) or the
   build has no backend (app.js). Without JS at all, no-js.css hides the form and this stays visible. */
.form-unavailable {
  margin-bottom: 1.5rem; padding: 1rem 1.125rem;
  background: var(--ivory); border: 2px solid var(--ink); border-left-width: 6px; border-radius: var(--radius-sm);
}
.form-unavailable__title { font-size: 1.0625rem; font-weight: 700; margin-bottom: 0.375rem; }
.js .form-unavailable { display: none; }
.js[data-form="unavailable"] .form-unavailable, [data-form="unavailable"] .form-unavailable { display: block; }
[data-form="ready"] .form-unavailable { display: none; }

@media (min-width: 960px) {
  .request-grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 4rem; align-items: start; }
}
@media (min-width: 60em) and (min-height: 53.75em) { /* AR-43: em, so enlarged text drops the sticky intro */
  .request-intro { position: sticky; top: calc(var(--header-h) + 1.5rem); }
}

/* ---------- Service area (v4) ---------- */
.region-grid { display: grid; gap: 1rem; }
.region { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--ink); border-radius: var(--radius-sm); padding: 1.25rem 1.25rem 1rem; min-width: 0; }
.region__title { font-size: 1.1875rem; font-weight: 700; margin-bottom: 0.625rem; }
.region__list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(8rem, 100%), 1fr)); gap: 0 1rem; }
.region__list li { padding: 0.4375rem 0; border-top: 1px solid var(--line); font-weight: 550; }
.region__base { display: inline-block; margin-left: 0.375rem; padding: 0 0.375rem; border-radius: 3px; background: var(--accent-soft); color: var(--accent-hover); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; vertical-align: 0.1em; }
.areas-note { margin-top: 1.25rem; color: var(--muted); font-size: 0.9375rem; max-width: 44rem; }
@media (min-width: 900px) {
  .region-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
  .region__list { grid-template-columns: minmax(0, 1fr); }
}
.areas a { text-decoration: underline; }

/* ---------- FAQ ---------- */
.section--rule { border-top: 1px solid var(--line); }
.faq-grid { display: grid; gap: 0.5rem; }
.faq__head { margin-bottom: 1rem; }
.faq { border-bottom: 1px solid var(--line-strong); }
.faq__item { border-top: 1px solid var(--line-strong); }
.faq__q {
  list-style: none; position: relative; display: flex; align-items: center;
  min-height: 56px; padding: 0.875rem 2.75rem 0.875rem 0;
  font-size: 1.0625rem; font-weight: 650; line-height: 1.35; cursor: pointer;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after { /* plus / minus marker drawn with borders (no icon font) */
  content: ""; position: absolute; right: 0.5rem; top: 50%; width: 0.875rem; height: 0.875rem; margin-top: -0.4375rem;
  background:
    linear-gradient(var(--accent), var(--accent)) center / 100% 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) center / 2px 100% no-repeat;
}
.faq__item[open] > .faq__q::after { background: linear-gradient(var(--accent), var(--accent)) center / 100% 2px no-repeat; }
.faq__q:hover { color: var(--accent); }
.faq__a { padding: 0 0 1.25rem; max-width: 44rem; color: var(--ink-2); }
.faq__a p + p { margin-top: 0.75em; }
.faq__a .owner-flag { margin-top: 0.75rem; }
.faq__areas { list-style: none; margin: 0.625rem 0 0.75rem; display: grid; gap: 0.375rem; }
.faq__areas li { padding-left: 1rem; position: relative; }
.faq__areas li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 0.375rem; height: 0.375rem; background: var(--accent); }
@media (min-width: 960px) {
  .faq-grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 4rem; align-items: start; }
}

/* ---------- Contact (dark) ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
.section--dark .section__title { color: var(--on-dark); }
.contact__status { display: flex; align-items: center; gap: 0.5rem; margin-top: 1rem; font-weight: 600; }
.section--dark .status-dot { background: var(--on-dark-muted); box-shadow: 0 0 0 3px rgba(189,180,166,.2); }
.section--dark [data-open="true"] .status-dot { background: #6FCB86; box-shadow: 0 0 0 3px rgba(111,203,134,.22); }

.contact-list { margin: 1.75rem 0 0; }
.contact-list > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.75rem; padding-block: 0.875rem; border-top: 1px solid rgba(246, 241, 231, .18); }
.contact-list dt { font-size: 0.75rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-dark-muted); padding-top: 0.25rem; }
.contact-list dd { margin: 0; font-size: 1.125rem; overflow-wrap: anywhere; }
.contact-list a { display: inline-block; min-height: 44px; padding-block: 0.375rem; }
/* AR-06: phones stack label above value so the email keeps one line ("24-7" never splits). */
@media (max-width: 599.98px) {
  .contact-list > div { grid-template-columns: minmax(0, 1fr); gap: 0.125rem; }
  .contact-list dd { font-size: 1rem; }
}

.areas { margin-top: 1.75rem; }
.areas__title { font-size: 1.0625rem; font-weight: 700; margin-bottom: 0.375rem; }
.areas p { color: var(--on-dark-muted); }
.areas strong { color: var(--on-dark); }

.hours-table-wrap { align-self: start; background: rgba(246, 241, 231, .04); border: 1px solid rgba(246, 241, 231, .16); border-radius: var(--radius); padding: 1.25rem 1.25rem 1rem; }
/* AR-62: no overflow-wrap:anywhere here (v2 split "Wednesd/ay"); times carry no-break spaces before AM/PM. */
.hours-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hours-table caption { text-align: left; font-size: 1.125rem; font-weight: 700; padding-bottom: 0.75rem; }
.hours-table caption span { font-weight: 400; color: var(--on-dark-muted); font-size: 0.9375rem; }
.hours-table th, .hours-table td { padding: 0.75rem 0.5rem; border-top: 1px solid rgba(246, 241, 231, .14); text-align: left; font-weight: 450; }
.hours-table td { text-align: right; }
.hours-table tr.is-today th, .hours-table tr.is-today td { font-weight: 700; background: rgba(240, 165, 116, .12); }
.hours-table .today-tag { display: inline-block; margin-left: 0.5rem; padding: 0 0.375rem; border-radius: 3px; background: var(--accent-on-dark); color: var(--dark); font-size: 0.75rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; vertical-align: 0.15em; }
/* Phones: stack the tag under the day name so the time range keeps one line at default text size. */
@media (max-width: 599.98px) { .hours-table .today-tag { display: table; margin: 0.25rem 0 0; } }
/* AR-62: narrowest phones and enlarged text — stack day above hours instead of splitting words. */
@media (max-width: 22.4375em) {
  .hours-table th, .hours-table td { display: block; text-align: left; }
  .hours-table td { border-top: 0; padding-top: 0; }
  .hours-table tr { display: block; }
}
/* Also stack when the card itself is narrow relative to the text size (e.g. enlarged root text). */
.hours-table-wrap { container-type: inline-size; }
@container (max-width: 17.5rem) {
  .hours-table th, .hours-table td { display: block; text-align: left; }
  .hours-table td { border-top: 0; padding-top: 0; }
  .hours-table tr { display: block; }
}
.hours-table__note { margin-top: 0.75rem; font-size: 0.875rem; color: var(--on-dark-muted); }

@media (min-width: 900px) {
  .contact-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 4rem; }
}

/* ---------- Privacy ---------- */
.prose p { color: var(--ink-2); max-width: 44rem; }
.prose p + p { margin-top: 1em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--darker); color: var(--on-dark-muted); padding-top: 3rem; font-size: 0.9375rem; }
.site-footer a { color: var(--on-dark); }
.site-footer a:hover { color: var(--accent-on-dark); }
.site-footer__grid { display: grid; gap: 1.5rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(246, 241, 231, .14); }
.site-footer__logo { width: 13.5rem; height: auto; }
.site-footer__draft { margin-top: 0.625rem; font-size: 0.8125rem; }
.site-footer__contact p { margin: 0 0 0.25rem; overflow-wrap: anywhere; }
.site-footer__contact a { display: inline-block; min-height: 44px; padding-block: 0.5rem; }
.site-footer__legal { padding-block: 1.25rem; font-size: 0.8125rem; }
.site-footer__legal p + p { margin-top: 0.25rem; }
.site-footer__legal a { display: inline-block; padding-block: 0.75rem; }
@media (min-width: 768px) {
  .site-footer__grid { grid-template-columns: 1fr auto; align-items: start; }
  .site-footer__contact { text-align: right; }
}

/* ---------- Measurement consent (inert until measurement is approved; assets/js/consent.js) ---------- */
.consent[hidden], .site-footer__choices[hidden] { display: none; }
.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 1rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: var(--paper); color: var(--ink); border-top: 2px solid var(--ink);
  box-shadow: 0 -8px 24px -16px rgba(31, 29, 26, .45);
}
.consent__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.consent__text { flex: 1 1 22rem; margin: 0; font-size: 0.9375rem; }
.consent__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.site-footer__choices { padding: 0.75rem 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- Sticky mobile call bar ---------- */
.callbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 0.75rem;
  min-height: var(--callbar-h);
  padding: 0.625rem max(1rem, env(safe-area-inset-right)) max(0.625rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: #FBF8F2; border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -16px rgba(31, 29, 26, .35);
}
/* AR-01 (v2 regression): the button gets its natural width first and never breaks inside a word
   (no overflow-wrap:anywhere), so "310-968-2745" stays on one line at default text. The status text
   uses the remaining space; when enlarged text leaves too little room it wraps onto its own row
   instead of squeezing the button. The number is kept unbroken (nowrap) unless the bar is narrower
   than ~8.75rem of text inside its padding (container query, reacts to enlarged text and zoom); only then may it wrap
   at its hyphens, so it never overflows the button. */
.callbar { flex-wrap: wrap; row-gap: 0.375rem; container-type: inline-size; }
.callbar__status { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8125rem; font-weight: 600; line-height: 1.3; min-width: 0; flex: 1 1 5.5rem; }
.callbar__btn { flex: 0 1 auto; min-width: 0; min-height: 48px; overflow-wrap: normal; }
.callbar__btn [data-biz="phone.display"] { white-space: nowrap; }
@container (max-width: 8.75rem) { .callbar__btn [data-biz="phone.display"] { white-space: normal; } }
.callbar[data-hidden] { display: none; }
@media (max-width: 959.98px) {
  /* Reserve the bar's full height (incl. safe area) so it can never cover the last content or controls. */
  body { padding-bottom: max(calc(var(--callbar-h) + env(safe-area-inset-bottom)), var(--callbar-measured, 0px)); }
  html { scroll-padding-bottom: calc(max(calc(var(--callbar-h) + env(safe-area-inset-bottom)), var(--callbar-measured, 0px)) + 1rem); }
}
/* Narrow phones AND enlarged text (em): the status steps aside and the Call button takes the full bar. */
@media (max-width: 22.49em) {
  .callbar__status { display: none; }
  .callbar__btn { flex: 1 1 auto; }
}
@media (max-width: 959.98px) and (max-height: 480px) { /* phone landscape: compact bar */
  :root { --callbar-h: 3.625rem; }
  .callbar { padding-top: 0.375rem; padding-bottom: max(0.375rem, env(safe-area-inset-bottom)); }
  .callbar__btn { min-height: 44px; }
}
@media (min-width: 960px) { .callbar { display: none !important; } }

/* ---------- Preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .req-form[data-state="submitting"] .spinner, .req-form[data-state="retrying"] .spinner { animation: none; border-top-color: rgba(255,255,255,.45); }
}
@media (forced-colors: active) {
  .btn, .choice, .nav-toggle { border: 1px solid ButtonText; }
  .status-dot { forced-color-adjust: none; }
  .concept__tag, .owner-photo__tag { border: 1px solid CanvasText; }
}

/* Owner-supplied photos: preserve the full door/gate composition on small screens. */
.hero__media--photo img { aspect-ratio: 1287 / 610; height: auto; object-fit: contain; }
.svc-card__media--photo img { aspect-ratio: 1289 / 610; height: auto; object-fit: contain; }
@media (min-width: 960px) {
  .hero__media--photo img { aspect-ratio: 3 / 2; object-fit: cover; object-position: 70% 55%; }
}
@media (min-width: 640px) and (max-width: 899.98px) {
  .svc-card--photo { display: flex; }
  .svc-card--photo .svc-card__media { min-height: 0; }
  .svc-card--photo .svc-card__media picture { position: static; }
}
