/* Bayside Tutoring — warm, trustworthy, education-flavored.
   Every color and font below is a token: the rules further down use var()
   only (test/theme.test.js holds that line). A client pack rebrands through
   config.theme, which the server emits as a <style id="theme-vars"> right
   after this file (lib/theme.js) — no stylesheet fork needed. */
:root {
  color-scheme: light;
  --navy: #1c2b3a;
  --navy-soft: #2e4257;
  --amber: #f4b942;
  --amber-dark: #d99a1b;
  /* The accent as text (4.2): prices and amber status words. --amber and
     --amber-dark are fills and rules only; as text they fail 4.5:1 on light. */
  --amber-text: #875a00;
  --cream: #f4f1ea;
  --white: #ffffff;
  --ink: #22303e;
  --muted: #5b6b7a;
  --line: #e3ddd0;
  --radius: 12px;

  /* Accent tints (4.4): the service-card badge (the accent at ~15% over the
     page) and the warm band behind alternating landing sections. Mixed from
     the accent and page tokens, so a pack's palette carries them. */
  --badge: color-mix(in srgb, var(--amber) 15%, var(--cream));
  --band-soft: color-mix(in srgb, var(--amber) 7%, var(--cream));

  /* Roles navy/white play in light mode that need their own value in dark:
     the header bar (and other navy surfaces), text on it, text on amber. */
  --bar: var(--navy);
  --on-bar: var(--white);
  --on-bar-muted: var(--cream);
  --on-bar-line: rgba(255, 255, 255, 0.18);
  --on-amber: var(--navy);

  /* Semantic states: status pills, notices, destructive actions. */
  --danger: #b3261e;
  --danger-bg: #f2e1e0;
  --danger-ink: #8a2f26;
  --on-danger: var(--white);
  --success: #1c6b34;
  --success-bg: #dff3e3;
  --warning: #8a5c00;
  --warning-bg: #fdf1d6;
  --note-bg: #fffaf0; /* pale amber panel behind amber-bordered callouts */
  --info: #1c4b7a;
  --info-bg: #e2ecf7;

  --shadow: rgba(0, 0, 0, 0.2);
  --overlay: rgba(0, 0, 0, 0.04);
  --hairline: rgba(0, 0, 0, 0.08);
  --hairline-soft: rgba(0, 0, 0, 0.06);

  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  /* Type (4.1): --font-ui is the default for everything; --font-display is
     the serif for landing prose only (see "Type system" below). */
  --font-display: Georgia, 'Times New Roman', serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* Dark mode: follows the OS unless the page carries data-theme (set before
   this file loads by the inline script in every <head>, from the operator's
   Appearance choice). CSS can't share one block between a media query and an
   attribute selector, so the two blocks below must stay identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --navy: #d3dfeb;
    --navy-soft: #a9bdd1;
    --amber: #f4b942;
    --amber-dark: #e5a93a;
    --amber-text: var(--amber);
    --cream: #1a1816;
    --white: #24211e;
    --ink: #e8e3da;
    --muted: #a89f93;
    --line: #3a3530;
    --badge: color-mix(in srgb, var(--amber) 20%, var(--white));
    --band-soft: color-mix(in srgb, var(--amber) 5%, var(--cream));
    --bar: #3a5166;
    --on-bar: #f3efe8;
    --on-bar-muted: #e3ddd2;
    --on-bar-line: rgba(255, 255, 255, 0.18);
    --on-amber: #1a1816;
    --danger: #f2b8b5;
    --danger-bg: #4a1f1c;
    --danger-ink: #f2b8b5;
    --on-danger: #5c1612;
    --success: #9ad7a8;
    --success-bg: #1d3a26;
    --warning: #f0c46a;
    --warning-bg: #3d3016;
    --note-bg: #2b2519;
    --info: #a8c8ec;
    --info-bg: #1d2f45;
    --shadow: rgba(0, 0, 0, 0.6);
    --overlay: rgba(255, 255, 255, 0.05);
    --hairline: rgba(255, 255, 255, 0.1);
    --hairline-soft: rgba(255, 255, 255, 0.07);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #d3dfeb;
  --navy-soft: #a9bdd1;
  --amber: #f4b942;
  --amber-dark: #e5a93a;
  --amber-text: var(--amber);
  --cream: #1a1816;
  --white: #24211e;
  --ink: #e8e3da;
  --muted: #a89f93;
  --line: #3a3530;
  --badge: color-mix(in srgb, var(--amber) 20%, var(--white));
  --band-soft: color-mix(in srgb, var(--amber) 5%, var(--cream));
  --bar: #3a5166;
  --on-bar: #f3efe8;
  --on-bar-muted: #e3ddd2;
  --on-bar-line: rgba(255, 255, 255, 0.18);
  --on-amber: #1a1816;
  --danger: #f2b8b5;
  --danger-bg: #4a1f1c;
  --danger-ink: #f2b8b5;
  --on-danger: #5c1612;
  --success: #9ad7a8;
  --success-bg: #1d3a26;
  --warning: #f0c46a;
  --warning-bg: #3d3016;
  --note-bg: #2b2519;
  --info: #a8c8ec;
  --info-bg: #1d2f45;
  --shadow: rgba(0, 0, 0, 0.6);
  --overlay: rgba(255, 255, 255, 0.05);
  --hairline: rgba(255, 255, 255, 0.1);
  --hairline-soft: rgba(255, 255, 255, 0.07);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}

h1, h2, h3, .brand, .btn, button, input, select, textarea, label {
  font-family: var(--font-ui);
}

/* Type system (UX plan 4.1). The sans is the body default: everything
   interactive, numeric, in a card, in the public shell or the dashboard is
   --font-ui. The serif is applied by name, to the landing page's prose only:
   the hero headline and sentence, the section headings, the steps, the
   operator's bio and the testimonial quotes. */
.hero h1, .hero > p,
.services > h2, .steps > h2, .operator h2, .closing > h2,
.step-list, .operator-blurb, .quote-band blockquote p { font-family: var(--font-display); }
/* Prices read as facts, not promotions: sans, tabular numerals. */
.rate, .chip-meta, .summary-meta, .summary-due, .checkout-sum-row dd,
.checkout-summary, .plan-row-text { font-family: var(--font-ui); font-variant-numeric: tabular-nums; }

/* Links (4.3): navy, visited or not — never the browser's default blue.
   Zero specificity, so any class that sets its own colour still wins. */
:where(a:link, a:visited) { color: var(--navy); text-underline-offset: 0.15em; }

/* Alternating landing bands (4.4): the steps and the quotes sit on the warm
   tint of the page, full-bleed (the shadow paints past the centred section;
   it never adds scroll width). */
.steps, .quote-band { background: var(--band-soft); box-shadow: 0 0 0 100vmax var(--band-soft); clip-path: inset(0 -100vmax); }

h2 { font-size: 1.75rem; margin: 0 0 1.25rem; }

section { padding: 3.5rem 1.5rem; max-width: 960px; margin: 0 auto; }

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--bar);
}
.brand { font-size: 1.3rem; font-weight: 700; color: var(--on-bar); }
.brand-accent { color: var(--amber); }

/* Landing header nav (3.11): a landmark around the outlined CTA, no box of its own. */
.site-nav { flex: none; display: flex; align-items: center; }

/* Buttons (4.4): amber fill is the one primary action per screen — .btn
   (and the dashboard's .btn.op-btn). Secondary actions are .btn-outline
   (ring, no fill), .btn-ghost, or text (.op-text-btn, .manage-text-btn,
   .card-book). Status never borrows the accent: it uses the semantic tokens.
   test/public-scripts.test.js holds the dashboard cards to one filled button
   per action row. */
.btn {
  display: inline-block;
  background: var(--amber);
  color: var(--on-amber);
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 999px;
  text-decoration: none;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: var(--amber-dark); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-small { padding: 0.5rem 1.1rem; font-size: 0.9rem; }
/* The secondary action: same size as .btn (the ring is a shadow, not a
   border), no fill. Reads on the cream page and, below, on the brand band. */
.btn-outline,
.btn-outline:hover {
  background: transparent;
  color: var(--navy);
  box-shadow: inset 0 0 0 2px var(--navy);
}
.btn-outline:hover { background: var(--overlay); }
.btn:focus-visible, .slot:focus-visible, .card-book:focus-visible {
  outline: 3px solid var(--amber-dark);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Landing page: the brand band carries the nav and the hero; the light page
   starts at services. Scoped to .band so the admin/privacy headers keep their
   own full-width bar. */
.band { background: var(--bar); color: var(--on-bar); }
.band > .site-header { max-width: 960px; margin: 0 auto; background: transparent; }
.band > .site-header { gap: 1rem; }
.band > .site-header .btn { flex: none; white-space: nowrap; }
.band .btn-outline { color: var(--on-bar); box-shadow: inset 0 0 0 2px var(--on-bar-muted); }
.band .btn-outline:hover { background: var(--on-bar-line); }
/* With the "Finish paying" banner on top, that is the screen's primary. */
body:has(.pending-banner) .hero-ctas .btn:not(.btn-outline) { background: transparent; color: var(--on-bar); box-shadow: inset 0 0 0 2px var(--on-bar-muted); }

/* Landing header brand: a link home, a 44px target that reaches into the
   header's own padding (the negative block margin), so the band keeps the
   height the 33px text gave it on a phone. */
.band .brand {
  display: inline-flex; align-items: center; min-height: 44px; min-width: 0; margin-block: -0.35rem;
  text-decoration: none; overflow-wrap: anywhere; line-height: 1.2;
}
.band .brand:hover { text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 4px; }
.band .brand:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

/* Hero (4.6): person-first. Without a portrait it is one column of copy. */
.hero { padding-top: 3.5rem; padding-bottom: 4.5rem; }
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.25rem);
  margin: 0 0 1rem;
  color: var(--on-bar);
  line-height: 1.15;
  max-width: 18em;
}
.hero .hero-intro { max-width: 620px; margin: 0 0 2rem; color: var(--on-bar-muted); font-size: 1.1rem; }
/* Hero: the filled primary and the outlined secondary, left-aligned. */
.hero .hero-ctas { justify-content: flex-start; }
.band .btn, .closing .btn, .btn-retry { min-height: 44px; }
.band .btn-small { display: inline-flex; align-items: center; }
@media (max-width: 640px) {
  .band > .site-header .nav-cta { display: none; }
  .band > .site-header { min-height: 44px; }
  .hero { padding-top: 2rem; }
  .hero .hero-ctas .btn { flex: 1 1 auto; text-align: center; }
}
/* The name and the credential subline (lib/landing.js heroPerson). */
.hero-person { min-width: 0; margin: 0 0 1.25rem; }
.hero-name { margin: 0; font-family: var(--font-ui); font-weight: 700; font-size: 1rem; line-height: 1.3; color: var(--on-bar); }
.hero-person .hero-creds { margin: 0.2rem 0 0; }
/* The portrait: one image, a circle on phones, the photo card from 960px. */
.hero-portrait { margin: 0; min-width: 0; }
.hero-portrait picture, .hero-portrait img { display: block; }
.hero-portrait img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.hero-portrait-link { display: block; border-radius: inherit; }
.hero-portrait-link:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
@media (max-width: 959px) {
  .hero-has-portrait { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 0.9rem; align-items: center; }
  .hero-has-portrait > * { grid-column: 1 / -1; min-width: 0; }
  .hero-has-portrait > .hero-portrait { grid-column: 1; grid-row: 1; align-self: start; }
  .hero-has-portrait > .hero-person { grid-column: 2; grid-row: 1; margin: 0; }
  .hero-has-portrait > h1 { margin-top: 1.25rem; }
  /* Centred on the face: the brief's composition puts it at about 50% / 38%
     of a 4:5 frame, so a square crop zoomed a third about that point. */
  .hero-portrait, .hero-portrait-link, .hero-portrait picture { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; }
  .hero-portrait img { width: 56px; height: 56px; aspect-ratio: auto; object-position: 50% 0; transform: scale(1.33); transform-origin: 50% 46%; }
  .hero-portrait-link { box-shadow: 0 0 0 2px var(--on-bar-line); }
  .hero-portrait-link:hover { box-shadow: 0 0 0 2px var(--amber); }
}
@media (min-width: 960px) {
  .hero-has-portrait {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    grid-template-rows: auto auto auto auto 1fr; column-gap: 3.5rem;
  }
  .hero-has-portrait > * { grid-column: 1; min-width: 0; }
  .hero-has-portrait > .hero-portrait { grid-column: 2; grid-row: 1 / -1; align-self: center; }
  .hero-has-portrait > .hero-person { grid-row: 1; }
  .hero-portrait, .hero-portrait-link, .hero-portrait img { border-radius: var(--radius); }
  .hero-portrait-link { box-shadow: 0 0 0 0 transparent; }
  .hero-portrait-link:hover { box-shadow: 0 0 0 3px var(--amber); }
}

/* Scene tiles (4.6): one or two photo-plus-caption tiles between the services
   and "How booking works". Never wider than 480px: the demo scenes are 1024
   wide with generated writing that must stay texture. */
.scenes { display: grid; gap: 1.5rem; padding-top: 1rem; padding-bottom: 1rem; }
.scene-tile { margin: 0; max-width: 480px; min-width: 0; }
.scene-tile picture, .scene-tile img { display: block; }
.scene-tile img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.scene-tile figcaption { margin-top: 0.6rem; font-family: var(--font-ui); font-size: 0.9rem; line-height: 1.45; color: var(--muted); }
@media (min-width: 720px) {
  .scenes-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* One tile: the photo left, its caption beside it, so it reads as a pair. */
  .scenes:not(.scenes-pair) .scene-tile {
    max-width: none; display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
    gap: 1.75rem; align-items: center;
  }
  .scenes:not(.scenes-pair) .scene-tile figcaption { margin: 0; font-size: 1.05rem; max-width: 22em; }
}

/* Services */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}
.service-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}
/* Landing-page cards (app.js): badges on top, the "Book this" control
   pinned to the bottom so a row of cards lines its buttons up. */
.service-card-pick { display: flex; flex-direction: column; }
.service-card-pick .blurb { margin-bottom: 0.75rem; }
.service-card h3 { margin: 0 0 0.25rem; font-size: 1.05rem; color: var(--navy); }
.service-card .rate { margin: 0 0 0.5rem; font-weight: 600; color: var(--amber-text); }
.service-card .blurb { margin: 0; font-size: 0.92rem; color: var(--muted); }
/* Selected only after a visitor's choice (app.js: state.serviceChosen). */
.service-card-selected { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.card-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.6rem; }
.badge {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px;
  background: var(--badge);
  font-family: var(--font-ui); font-size: 0.75rem; font-weight: 600; color: var(--ink); white-space: nowrap;
}
/* "Online" / "In studio" — only on services that declare a format. */
.format-tag {
  display: inline-block; vertical-align: middle;
  padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--cream);
  font-size: 0.75rem; font-weight: 600; color: var(--navy-soft); white-space: nowrap;
}
.card-book {
  margin-top: auto; align-self: flex-start; min-height: 44px; padding: 0 0.1rem;
  background: none; border: none; cursor: pointer;
  color: var(--navy); font-weight: 700; font-size: 0.95rem;
  text-decoration: underline; text-decoration-color: var(--amber-dark);
  text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.card-book::after { content: ' \2192'; }
/* Phones: a compact 2-up grid — length, name, price, a short blurb — so the
   calendar is within about a screen and a half of the top (1.4). */
@media (max-width: 640px) {
  .services { padding-top: 2rem; padding-bottom: 1.5rem; }
  .services h2 { font-size: 1.4rem; margin-bottom: 0.9rem; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .service-card { padding: 0.8rem; min-width: 0; }
  .service-card h3 { font-size: 0.95rem; line-height: 1.25; }
  .service-card .rate { margin-bottom: 0.25rem; font-size: 0.9rem; }
  .card-badges { margin-bottom: 0.4rem; }
  .service-card-pick .blurb {
    font-size: 0.82rem; line-height: 1.35; margin-bottom: 0.1rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .card-book { font-size: 0.88rem; }
}
.card-book:hover { color: var(--amber-text); }

/* About the operator: optional portrait + short fact table (lib/landing.js). */
.operator { display: grid; gap: 1.5rem 2.5rem; align-items: start; }
.operator h2 { color: var(--navy); margin-bottom: 0.25rem; }
.operator-name { margin: 0 0 0.75rem; font-family: var(--font-ui); font-weight: 600; color: var(--muted); }
.operator-blurb { margin: 0 0 1.5rem; max-width: 620px; }
.operator-photo { margin: 0; }
.operator-photo picture { display: block; }
.operator-photo img { display: block; width: 100%; max-width: 320px; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
@media (max-width: 719px) {
  .operator-photo img { max-width: 220px; }
}
/* Credentials: label + detail pairs as a wrapping strip under the name. */
.credential-strip {
  list-style: none; margin: 0 0 1.25rem; padding: 0; max-width: 620px;
  display: flex; flex-wrap: wrap; gap: 0.5rem; font-family: var(--font-ui);
}
.credential-strip li {
  display: flex; flex-direction: column; min-width: 0; padding: 0.45rem 0.75rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--white); line-height: 1.3;
}
.cred-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.cred-detail { font-size: 0.9rem; color: var(--ink); }
/* The hero subline: the first credentials on the band, dot-separated. */
.hero-creds {
  list-style: none; margin: -1.25rem 0 1.75rem; padding: 0; max-width: 620px;
  font-family: var(--font-ui); font-size: 0.9rem; line-height: 1.5; color: var(--on-bar-muted);
}
/* Inline, so a long credential wraps as running text with its dot. */
.hero-creds li { display: inline; }
.hero-creds li + li::before { content: '\00B7'; margin: 0 0.6rem; color: var(--amber); font-weight: 700; }
.hero-creds .cred-label { font-size: inherit; letter-spacing: 0; text-transform: none; color: var(--on-bar); }
.hero-creds .cred-detail { font-size: inherit; color: var(--on-bar-muted); }
.fact-table { margin: 0; max-width: 620px; border-top: 1px solid var(--line); font-family: var(--font-ui); }
.fact-table div {
  display: grid; grid-template-columns: minmax(7rem, 1fr) 2fr; gap: 0.25rem 1rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--line);
}
.fact-table dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-top: 0.15rem; }
.fact-table dd { margin: 0; color: var(--ink); }
@media (min-width: 720px) {
  .operator-has-photo { grid-template-columns: minmax(200px, 1fr) 2fr; }
}

/* The quotes, quietly: one centered, or a set stacked on a phone and side by
   side from 720px. */
.quote-band { text-align: center; padding-top: 2.5rem; padding-bottom: 2.5rem; }
.quote-band figure { margin: 0 auto; max-width: 640px; }
.quote-set { display: grid; gap: 2.25rem; }
.quote-band.quote-band-set blockquote p { font-size: clamp(1.05rem, 2.2vw, 1.15rem); }
@media (min-width: 720px) {
  .quote-band-set .quote-set { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2rem; }
  .quote-band.quote-band-set figure { max-width: none; }
}
.quote-band figure::before {
  content: ''; display: block; width: 3rem; height: 3px; margin: 0 auto 1.25rem;
  background: var(--amber); border-radius: 2px;
}
.quote-band blockquote { margin: 0; }
.quote-band blockquote p { margin: 0; font-size: clamp(1.15rem, 2.6vw, 1.4rem); line-height: 1.5; color: var(--navy); font-style: italic; }
.quote-band figcaption { margin-top: 1rem; font-family: var(--font-ui); font-size: 0.9rem; color: var(--muted); }
/* The set on a phone (app.js quoteCarousel): one quote at a time with dots,
   only once the script has run; without it the quotes stay stacked. */
.quote-dots { display: none; }
@media (max-width: 719px) {
  .quote-carousel .quote-set { display: flex; gap: 0; overflow: hidden; }
  .quote-carousel .quote-set figure {
    flex: 0 0 100%; max-width: none; min-width: 0;
    transform: translateX(calc(var(--slide, 0) * -100%));
  }
  .quote-carousel .quote-dots { display: flex; justify-content: center; gap: 0.25rem; margin-top: 0.75rem; }
}
.quote-dot {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: none; cursor: pointer;
}
.quote-dot::before {
  content: ''; width: 10px; height: 10px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--muted);
}
.quote-dot[aria-current="true"]::before { background: var(--amber-dark); box-shadow: inset 0 0 0 2px var(--amber-dark); }
.quote-dot:focus-visible { outline: 3px solid var(--amber-dark); outline-offset: -4px; }

/* Closing block: the same filled + outlined pair as the top of the page. */
.closing { text-align: center; }
.closing h2 { color: var(--navy); }
.cta-pair { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }

/* Steps */
.step-list { margin: 0; padding-left: 1.25rem; max-width: 640px; }
.step-list li { margin-bottom: 0.75rem; }

/* Desktop page (4.5): one 1180px measure for the band and the light page
   (the dark band + light page split unchanged), services three across (four
   when there are exactly four), the steps as three numbered cards. Section
   containers only — the hero, operator and quote rules stay their own. */
@media (min-width: 960px) {
  #main > section, .band > .site-header, .band > .hero { max-width: 1180px; }
  .service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
  .service-grid:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .step-list {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem;
    max-width: none; padding: 0; list-style: none; counter-reset: step;
  }
  .step-list li {
    margin: 0; padding: 1.25rem; counter-increment: step;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  }
  .step-list li::before {
    content: counter(step); display: flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; margin-bottom: 0.75rem; border-radius: 999px;
    background: var(--note-bg); background: color-mix(in srgb, var(--amber) 18%, transparent);
    color: var(--navy); font-family: var(--font-ui); font-weight: 700;
  }
  .step-list li strong { display: block; margin-bottom: 0.35rem; color: var(--navy); font-family: var(--font-ui); }
  #main > .confirmation { max-width: 820px; }
}

/* Booking */
.booking { background: var(--white); border-radius: var(--radius); border: 1px solid var(--line); }

.week-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-weight: 700;
}
.btn-nav {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  font-size: 1rem;
  color: var(--navy);
  cursor: pointer;
}
.btn-nav:focus-visible { outline: 3px solid var(--amber-dark); outline-offset: 2px; }
.btn-nav:disabled { opacity: 0.4; cursor: default; }

/* Slot picker: a timetable — one row per day with open times, the date in a
   left column and the times as wrapping pills (app.js). Never wider than the
   screen, so no day is clipped on a phone. */
.slot-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.day-row {
  display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.75rem 1rem; align-items: start;
  padding: 0.85rem 0; border-bottom: 1px solid var(--line);
}
.day-head { padding-top: 0.55rem; font-family: var(--font-ui); line-height: 1.25; }
.day-name { display: block; font-weight: 700; font-size: 0.95rem; color: var(--navy); }
.day-date { display: block; font-size: 0.82rem; color: var(--muted); }
.day-slots { display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* A day with no open time says why: Closed / Booked up / … (app.js DAY_NOTES). */
.day-note { margin: 0; padding-top: 0.55rem; font-family: var(--font-ui); font-size: 0.9rem; color: var(--muted); }
.day-closed .day-name, .day-past .day-name, .day-later .day-name { color: var(--muted); }
.day-booked .day-note { font-style: italic; }
.week-label { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 0; text-align: center; line-height: 1.25; font-family: var(--font-ui); }
.week-title { font-weight: 700; color: var(--navy); }
.week-range { font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.week-window { margin: -0.5rem 0 1rem; text-align: center; font-family: var(--font-ui); font-size: 0.85rem; color: var(--muted); }
.no-slots { margin: 0; padding: 1rem 0; color: var(--muted); font-family: var(--font-ui); }
/* Network-failure state (app.js renderLoadError): the form-error message and
   a "Try again" button, in place of the cards or the week. */
.load-error {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem;
  padding: 1rem 0; font-family: var(--font-ui); grid-column: 1 / -1;
}
/* Loading placeholder while a week's availability is fetched. The pulse is
   opt-in: only when the visitor hasn't asked for reduced motion. */
.slots-loading { font-style: italic; }
@media (prefers-reduced-motion: no-preference) {
  .slots-loading { animation: slots-pulse 1.2s ease-in-out infinite alternate; }
}
@keyframes slots-pulse { from { opacity: 1; } to { opacity: 0.45; } }

.slot {
  min-height: 44px;
  min-width: 5.5rem;
  border: 1px solid var(--navy-soft);
  background: var(--white);
  color: var(--navy);
  border-radius: 999px;
  padding: 0 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.slot:hover { background: var(--cream); }
.slot-selected, .slot-selected:hover { background: var(--amber); color: var(--on-amber); border-color: var(--amber); }
.slot-usual { border-color: var(--amber-dark); box-shadow: inset 0 0 0 1px var(--amber-dark); }
.slot-usual::after { content: ' ★'; }

@media (max-width: 420px) {
  .day-row { grid-template-columns: 1fr; gap: 0.4rem; }
  .day-head { padding-top: 0; }
  .day-head .day-name, .day-head .day-date { display: inline; }
  .day-head .day-date::before { content: ' · '; }
  .day-note { padding-top: 0; }
  /* A day with no times is one compact line: "Sun · Oct 25 — Closed". */
  .day-row:not(.day-open) { grid-template-columns: auto 1fr; align-items: baseline; padding: 0.6rem 0; }
  .day-row:not(.day-open) .day-note { text-align: right; }
}

/* Referral Twin Pages */
.ref-banner {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--note-bg);
  border: 1px solid var(--amber);
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--navy);
}
.refer-facts { margin: 0 0 1.5rem; padding-left: 1.25rem; color: var(--muted); text-align: left; }
.refer-facts li { margin-bottom: 0.3rem; }
/* Twin page (UX plan 2.5): the landing .service-card with the referrer's
   facts as its last block; the CTA sits clear below the card. */
.twin-card { margin: 0 0 1.5rem; min-width: 0; }
.twin-facts { margin: 0.75rem 0 0; padding-top: 0.75rem; border-top: 1px solid var(--line); font-size: 0.92rem; }
.twin-facts li:last-child { margin-bottom: 0; }
.twin-card > .refer-facts:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.twin-cta { display: flex; align-items: center; justify-content: center; min-height: 44px; text-align: center; }
.refer-share-box { display: flex; gap: 0.5rem; margin-top: 0.5rem; min-width: 0; }
.refer-share-box input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--cream);
  color: var(--muted);
}

/* Read by screen readers, not shown (the booking announcements, 1.11). */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Service chips: the booking flow's picker, directly above the week nav. */
.service-picker { margin-bottom: 1.25rem; scroll-margin-top: 1rem; }
.picker-label { margin: 0 0 0.6rem; font-family: var(--font-ui); font-weight: 700; color: var(--navy); }
.service-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.service-chip {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  min-height: 44px; max-width: 100%; padding: 0.45rem 0.95rem; text-align: left;
  border: 1px solid var(--navy-soft); border-radius: 14px; background: var(--white); color: var(--navy);
  cursor: pointer; line-height: 1.25; transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.service-chip:hover { background: var(--cream); }
.chip-name { font-weight: 700; font-size: 0.92rem; }
@media (max-width: 640px) {
  .service-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-chip { padding: 0.45rem 0.7rem; }
}
.chip-meta { font-size: 0.78rem; color: var(--muted); }
.service-chip-selected, .service-chip-selected:hover { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.service-chip-selected .chip-meta { color: var(--cream); opacity: 0.85; }
.service-chip:focus-visible, .summary-change:focus-visible, .btn-retry:focus-visible { outline: 3px solid var(--amber-dark); outline-offset: 2px; }
.pick-prompt {
  margin: 0; padding: 1.5rem 1rem; text-align: center; font-family: var(--font-ui); color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius);
}
.slot-list:has(.pick-prompt) { border-top: 0; }
.slot-notice {
  margin: 0 0 1rem; padding: 0.7rem 1rem; border-radius: 8px; background: var(--warning-bg); color: var(--warning);
  font-family: var(--font-ui); font-weight: 600; font-size: 0.92rem;
}

/* Booking form */
.booking-form {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 460px;
}
.booking-form h3 { margin: 0; color: var(--navy); }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label { font-weight: 600; font-size: 0.9rem; }
.optional { font-weight: 400; color: var(--muted); }
.booking-form input, .booking-form textarea {
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--cream);
}
.booking-form input:focus-visible, .booking-form textarea:focus-visible { outline: 3px solid var(--amber-dark); outline-offset: 1px; }
/* Placeholders are examples, so they read lighter than an answer. */
.booking-form ::placeholder { color: var(--muted); font-weight: 400; opacity: 0.75; }
.booking-form [aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.field-error { margin: 0; color: var(--danger); font-family: var(--font-ui); font-size: 0.85rem; font-weight: 600; }
.error-summary {
  padding: 0.75rem 1rem; border: 2px solid var(--danger); border-radius: 8px; background: var(--danger-bg);
  color: var(--danger-ink); font-family: var(--font-ui); font-size: 0.92rem;
}
.error-summary p { margin: 0 0 0.3rem; font-weight: 700; }
.error-summary ul { margin: 0; padding-left: 1.1rem; }
.error-summary a { color: var(--danger-ink); font-weight: 600; }
.error-summary:focus { outline: 3px solid var(--amber-dark); outline-offset: 2px; }
.form-error { color: var(--danger); font-weight: 600; margin: 0; }

/* Booking summary (1.3): the booking restated once, with Change and the
   Continue button — a bar fixed to the bottom on a phone, a sticky rail
   beside the calendar from 960px. */
.booking-summary {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; flex-direction: column; gap: 0.6rem;
  padding: 0.75rem 16px calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px var(--shadow);
  font-family: var(--font-ui);
}
.summary-text { min-width: 0; }
.summary-text p { margin: 0; line-height: 1.35; }
.summary-service strong { color: var(--navy); }
.summary-meta { color: var(--muted); font-size: 0.88rem; }
.summary-time { font-size: 0.95rem; color: var(--ink); }
.summary-due { font-size: 0.85rem; color: var(--muted); }
.summary-change {
  min-height: 44px; min-width: 44px; padding: 0 0.35rem; margin: -0.6rem 0; vertical-align: middle;
  background: none; border: 0; cursor: pointer; font: inherit; font-weight: 700; color: var(--navy);
  text-decoration: underline; text-decoration-color: var(--amber-dark); text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.summary-continue { width: 100%; min-height: 48px; }
body.has-summary { padding-bottom: 10rem; }
/* From 960px (4.5): the calendar left, the rail right — the summary on top
   and the form under it, sticky together. The columns are there before a
   pick too, so choosing a time never reflows the pills under the pointer. */
@media (min-width: 960px) {
  .booking { max-width: 1180px; }
  .booking-flow { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 3rem; align-items: start; }
  .booking-rail { position: sticky; top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
  .booking-summary {
    order: -1; position: static; left: auto; right: auto; bottom: auto; z-index: auto;
    padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--cream); box-shadow: none; gap: 1rem;
  }
  .booking-rail .booking-form {
    margin-top: 0; padding: 1.25rem; max-width: 560px; gap: 0.85rem;
    border: 1px solid var(--line); border-radius: var(--radius);
  }
  .booking-rail .booking-form h3 { font-size: 1.05rem; }
  .booking-rail .booking-form textarea { resize: vertical; }
  .summary-text p + p { margin-top: 0.4rem; }
  .summary-meta, #sum-time { display: block; }
  body.has-summary { padding-bottom: 0; }
}

/* Confirmation */
/* Confirmation (1.10): its own section in place of the booking section. */
.confirmation {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--amber);
  border-radius: var(--radius);
  margin-top: 2rem;
  margin-bottom: 2rem;
}
.confirmation:focus { outline: none; }
.confirmation h2 { color: var(--navy); margin: 0 0 1.25rem; font-size: clamp(1.6rem, 5vw, 2.1rem); line-height: 1.2; }
.confirmation h3 { margin: 2rem 0 0.5rem; color: var(--navy); font-size: 1.1rem; }
.confirmation-kicker {
  margin: 0 0 0.35rem; font-family: var(--font-ui); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--success);
}
.confirmation-details { margin: 0 0 1.5rem; max-width: 560px; border-top: 1px solid var(--line); font-family: var(--font-ui); }
.confirmation-details div {
  display: grid; grid-template-columns: minmax(5.5rem, 1fr) 3fr; gap: 0.25rem 1rem;
  padding: 0.65rem 0; border-bottom: 1px solid var(--line);
}
.confirmation-details dt { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding-top: 0.15rem; }
.confirmation-details dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.confirmation-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.confirmation-actions .btn { min-height: 44px; display: inline-flex; align-items: center; }
.confirmation-next { margin: 0; padding-left: 1.25rem; max-width: 620px; }
.confirmation-next li { margin-bottom: 0.4rem; }
.confirmation a:not(.btn) { color: var(--navy); font-weight: 700; }
.confirmation-contact { margin: 1.5rem 0 0; font-family: var(--font-ui); color: var(--muted); overflow-wrap: anywhere; }
.confirmation-demo { margin: 0.75rem 0 0; font-family: var(--font-ui); font-size: 0.85rem; color: var(--muted); }
@media (max-width: 640px) {
  .confirmation { margin: 1rem 16px; padding: 1.5rem 1rem; }
  .confirmation-actions .btn { flex: 1 1 100%; justify-content: center; }
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.demo-note { font-size: 0.8rem; opacity: 0.8; }

/* The one public shell (UX plan 2.3) — server.js publicShell() for checkout,
   offer, nudge, manage, login, refer, twin and proposal pages: the brand
   band with the business name home, the card top-aligned under it, the
   footer with the contact route and privacy pinned to the bottom. Colors are
   tokens only, so dark mode and a pack's theme follow with no extra rules. */
.public-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.public-header { padding: 0.5rem 16px; }
.public-header .brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-decoration: none;
  font-size: 1.15rem;
}
.public-header .brand:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.public-shell {
  width: calc(100% - 32px);
  max-width: 480px;
  margin: 1.5rem auto 0;
}
.public-footer { margin-top: auto; padding: 2rem 16px 1.5rem; overflow-wrap: anywhere; }
.public-footer p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 1.25rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
}
/* The way out of a dead-end page: text links, never a second filled button. */
.public-next { margin: 0 0 0.5rem; font-family: var(--font-ui); font-size: 0.95rem; color: var(--muted); overflow-wrap: anywhere; }
.public-next p { margin: 0; }
.public-footer a,
.public-next a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--navy);
  font-weight: 600;
  text-decoration-color: var(--amber-dark);
  text-underline-offset: 3px;
}

/* The shell's card (checkout and every client page inside the shell). */
.checkout-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  min-width: 0;
}
@media (max-width: 640px) {
  .public-shell { margin-top: 1rem; }
  .checkout-card { padding: 1.5rem 1.25rem; }
}
.checkout-badge {
  display: inline-block;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 1rem;
  font-family: var(--font-ui);
}
.checkout-card h1 { font-size: 1.35rem; margin: 0 0 0.75rem; color: var(--navy); }
.checkout-detail { color: var(--muted); margin: 0 0 1.5rem; }
.checkout-card form { display: flex; flex-direction: column; gap: 0.9rem; }
.checkout-card label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.85rem; }
.checkout-card input {
  /* Plan §6: phone controls are at least 44px tall. */
  min-height: 44px;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--cream);
  color: var(--muted);
}
/* UX plan 1.1 [A1]: the flex children must be allowed to shrink below the
   inputs' intrinsic width, or the CVC field overflows the card at 320–390px.
   test/checkout.test.js asserts this block keeps min-width: 0. */
.checkout-row { display: flex; gap: 0.9rem; min-width: 0; }
.checkout-row label { flex: 1 1 0; min-width: 0; }
.checkout-row input { min-width: 0; width: 100%; box-sizing: border-box; }
.checkout-card button {
  background: var(--amber);
  color: var(--on-amber);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.8rem;
  min-height: 44px; /* plan §6 */
  border: none;
  border-radius: 999px;
  cursor: pointer;
}
.checkout-card button:hover { background: var(--amber-dark); }
.checkout-fine { font-size: 0.78rem; color: var(--muted); margin: 0; text-align: center; }

@media (max-width: 640px) {
  section { padding: 2.5rem 1rem; }
  .band > .site-header { padding: 0.85rem 1rem; }
  .hero { padding-top: 1.25rem; padding-bottom: 2rem; }
  .hero h1 { font-size: 1.75rem; margin-bottom: 0.75rem; }
  .hero p { font-size: 1rem; margin-bottom: 1.25rem; }
  .hero-creds { margin: -0.5rem 0 1.25rem; font-size: 0.85rem; }
  /* The steps are short reading on the way to the calendar (1.4). */
  .steps { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  .steps h2 { font-size: 1.4rem; margin-bottom: 0.75rem; }
  .step-list { font-size: 0.95rem; }
  .step-list li { margin-bottom: 0.4rem; }
  .booking { padding-top: 1.75rem; }
  .booking h2 { font-size: 1.5rem; margin-bottom: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .slot, .btn { transition: none; }
}

/* Motion (4.6, A22): 150–200ms transitions on state changes only — a card or
   pill being picked, a button's hover, the hero portrait's hover/focus ring,
   the quote slide — and only when the visitor hasn't asked for less motion.
   Nothing animates on entrance. */
@media (prefers-reduced-motion: no-preference) {
  .service-card { transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease; }
  .slot, .service-chip { transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
  .btn { transition: background-color 160ms ease, box-shadow 160ms ease, color 160ms ease; }
  .hero-portrait-link { transition: box-shadow 180ms ease; }
  .quote-carousel .quote-set figure { transition: transform 200ms ease; }
}
@media (prefers-reduced-motion: reduce) {
  .service-card, .slot, .service-chip, .btn, .hero-portrait-link, .quote-carousel .quote-set figure { transition: none; }
}

/* Admin dashboard */
.admin-body { background: var(--cream); }
.admin-tag {
  color: var(--on-bar-muted);
  opacity: 0.8;
  font-size: 0.8rem;
  font-family: var(--font-ui);
}
.admin-main { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem 4rem; display: flex; flex-direction: column; gap: 2.5rem; }
.admin-section h2 { margin: 0 0 0.75rem; color: var(--navy); }
.admin-hint { color: var(--muted); font-size: 0.9rem; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.admin-table th, .admin-table td { text-align: left; padding: 0.6rem 0.9rem; font-size: 0.9rem; border-bottom: 1px solid var(--line); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table th {
  background: var(--cream);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-family: var(--font-ui);
}
.admin-cancel {
  background: var(--white);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.admin-cancel:hover { background: var(--danger); color: var(--on-danger); }

/* Detailed view on phones (3.10): a wide table scrolls inside its own region,
   and the edge shadows (background-attachment: local covers them at the ends)
   say there's more — the page itself never scrolls sideways. */
h1.admin-tag { margin: 0; font-weight: 400; line-height: 1.3; }
.admin-back { font-family: var(--font-ui); font-size: 0.95rem; }
.admin-back a { color: var(--navy); font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
.admin-back + .admin-hint { margin-top: -2rem; }
.admin-label { display: block; margin: 0 0 0.35rem; font-family: var(--font-ui); font-size: 0.9rem; font-weight: 600; color: var(--navy); }
/* `section` centres itself with auto margins, which would size a section to
   its widest table: fill the column instead, so .scroll-x does the scrolling. */
.admin-main > section { min-width: 0; width: 100%; box-sizing: border-box; }
.scroll-x {
  max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius);
  background:
    linear-gradient(to right, var(--white) 30%, transparent) left / 2.5rem 100% no-repeat local,
    linear-gradient(to left, var(--white) 30%, transparent) right / 2.5rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--shadow), transparent) left / 0.9rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--shadow), transparent) right / 0.9rem 100% no-repeat scroll,
    var(--white);
}
.scroll-x:focus-visible { outline: 3px solid var(--amber-dark); outline-offset: 2px; }
.scroll-x > .admin-table { background: transparent; }
/* One filled primary per screen here too: in a list of check-ins or
   suggested changes, the first card's Approve; the ones under it are the
   outlined twin. */
.salvage-candidate ~ .salvage-candidate .radar-nudge-actions .btn { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
@media (max-width: 719px) {
  .admin-body:not(.op-body) .site-header { flex-wrap: wrap; gap: 0.5rem 1rem; padding: 0.75rem 16px; }
  .admin-main { padding: 1.25rem 16px 3rem; gap: 2rem; }
  .admin-main > section { padding: 1.5rem 0; }
  .scroll-x > .admin-table { min-width: 36rem; }
  .scroll-x > .admin-table th, .scroll-x > .admin-table td { white-space: nowrap; }
  .admin-body:not(.op-body) .btn, .admin-body:not(.op-body) button, .admin-body:not(.op-body) select,
  .admin-body:not(.op-body) input:not([type="checkbox"]):not([type="radio"]) { min-height: 44px; box-sizing: border-box; }
  .admin-body:not(.op-body) .btn-small, .admin-body:not(.op-body) .admin-cancel { display: inline-flex; align-items: center; justify-content: center; }
  .admin-main pre, .admin-main code { white-space: pre-wrap; overflow-wrap: anywhere; }
}

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-ui);
}
.status-confirmed, .status-recovered, .status-converted { background: var(--success-bg); color: var(--success); }
.status-pending, .status-active, .status-sent, .status-claimed { background: var(--warning-bg); color: var(--warning); }
.status-cancelled, .status-exhausted, .status-expired, .status-dismissed, .status-conflict { background: var(--danger-bg); color: var(--danger-ink); }
.status-open, .status-draft { background: var(--info-bg); color: var(--info); }
.pill-salvage { background: var(--info-bg); color: var(--info); }

/* Cadence Radar */
.radar-draft-preview { margin: 0.5rem 0; font-size: 0.85rem; color: var(--ink); }
.radar-draft-preview strong { display: block; margin-bottom: 0.15rem; }
.radar-nudge-actions { display: flex; gap: 0.6rem; margin-top: 0.6rem; }
.radar-skipped { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--line); font-size: 0.88rem; color: var(--muted); }
.radar-skipped ul { margin: 0.4rem 0 0; }

.admin-notice {
  background: var(--info-bg);
  color: var(--info);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-ui);
  margin: 0 0 0.9rem;
}

.salvage-case { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.salvage-case-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.salvage-case-head h3 { margin: 0; font-size: 1.05rem; color: var(--navy); }
.salvage-candidates { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.salvage-candidate { border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.8rem; font-size: 0.85rem; }
.salvage-candidate-active { border-color: var(--amber); background: var(--note-bg); }
.salvage-candidate-head { display: flex; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.3rem; }
.salvage-score { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.salvage-reasons { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.salvage-offers { display: flex; flex-direction: column; gap: 0.4rem; }
.salvage-offer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  background: var(--cream);
}
.salvage-offer-status { font-weight: 700; text-transform: capitalize; }
.salvage-offer-active .salvage-offer-status { color: var(--amber-text); }
.salvage-offer-lapsed .salvage-offer-status { color: var(--muted); }
.salvage-offer-accepted .salvage-offer-status { color: var(--success); }
.salvage-offer-mode {
  color: var(--muted);
  font-size: 0.72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}
.salvage-countdown { font-variant-numeric: tabular-nums; color: var(--navy); font-weight: 700; }
.salvage-offer a { margin-left: auto; color: var(--navy); font-weight: 600; }

/* Inquiry-to-Proposal Agent */
.proposal-textarea {
  display: block;
  width: 100%;
  max-width: 640px;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
  resize: vertical;
}
.proposal-inquiry { margin: 0.75rem 0; font-size: 0.85rem; color: var(--muted); }
.proposal-inquiry summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.proposal-inquiry pre { white-space: pre-wrap; margin: 0.5rem 0 0; font-family: inherit; }
.proposal-form { display: flex; flex-direction: column; gap: 0.6rem; margin: 0.75rem 0; }
.proposal-form label { display: flex; flex-direction: column; gap: 0.25rem; font-weight: 600; font-size: 0.82rem; color: var(--navy); }
.proposal-form input, .proposal-form select, .proposal-form textarea {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: var(--font-ui);
  background: var(--cream);
}
.proposal-hints { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.proposal-weekday { flex-direction: row !important; align-items: center; gap: 0.3rem !important; font-weight: 400 !important; }
.proposal-schedule { margin-top: 0.5rem; }
.proposal-sent-info { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }

/* Business Analyst Agent */
.analyst-diff {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  margin: 0.5rem 0;
  color: var(--navy);
}
.analyst-rationale { margin: 0.5rem 0; font-size: 0.88rem; color: var(--ink); }
.analyst-rationale p { margin: 0 0 0.3rem; }
.analyst-line { margin: 0.35rem 0; font-size: 0.85rem; color: var(--muted); }
.analyst-line strong { color: var(--navy); }
/* Uncertainty is a first-class element on the card, not fine print — the
   grader flag on camera: the agent states its own honesty limits plainly. */
.analyst-uncertainty {
  margin: 0.6rem 0;
  padding: 0.5rem 0.75rem;
  background: var(--note-bg);
  border: 1px solid var(--amber);
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--navy);
}
.analyst-audit { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }
.analyst-audit-insufficient { font-style: italic; }

/* Client self-service page (/manage/:token) */
.checkout-card h2 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
/* The shared picker (public/picker.js) inside the card. `.checkout-card button`
   fills every button amber, so the picker's controls restate their own look
   here; the chosen pill is a ring, not a fill — the move card's Confirm is
   the page's one filled primary. */
.manage-picker { margin: 0 0 1rem; }
.manage-picker .week-nav { gap: 0.5rem; }
.manage-picker .btn-nav,
.manage-picker .btn-nav:hover {
  background: var(--cream); color: var(--navy); border: 1px solid var(--line); border-radius: 8px;
  width: 2.75rem; height: 2.75rem; min-height: 44px; padding: 0; font-size: 1rem; font-weight: 400;
}
.manage-picker .slot {
  min-height: 44px; min-width: 5.5rem; padding: 0 1rem; border: 1px solid var(--navy-soft); border-radius: 999px;
  background: var(--white); color: var(--navy); font-size: 0.9rem; font-weight: 600; font-family: var(--font-ui);
}
.manage-picker .slot:hover { background: var(--cream); }
.manage-picker .slot-selected,
.manage-picker .slot-selected:hover { background: var(--cream); color: var(--navy); border-color: var(--amber-dark); box-shadow: inset 0 0 0 2px var(--amber-dark); }
/* The booking's own time: shown for orientation, not tappable. */
.slot-current,
.manage-picker .slot-current,
.manage-picker .slot-current:hover {
  background: transparent; font-weight: 600;
  display: inline-flex; align-items: center; box-sizing: border-box; min-height: 44px; padding: 0 1rem;
  border: 1px dashed var(--line); border-radius: 999px; color: var(--muted); font-size: 0.85rem;
  font-family: var(--font-ui); font-variant-numeric: tabular-nums; cursor: default;
}
.manage-picker .day-row { grid-template-columns: 4.5rem minmax(0, 1fr); }
@media (max-width: 420px) {
  .manage-picker .day-row { grid-template-columns: 1fr; }
  .manage-picker .day-row:not(.day-open) { grid-template-columns: auto 1fr; }
}
/* The inline confirm cards: move ("Move from … → …?") and cancel. */
.manage-confirm {
  margin: 0.75rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 12px;
  background: var(--cream); font-family: var(--font-ui);
}
.manage-confirm-text { margin: 0 0 0.75rem; font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.manage-confirm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.manage-confirm-actions .btn { padding: 0.75rem 1.5rem; }
/* Quiet text actions inside the card ("Cancel", "Keep my session", the
   "Cancel this session" link): no fill, still a 44px target. */
.checkout-card .manage-text-btn,
.checkout-card .manage-text-btn:hover {
  background: transparent; color: var(--navy); min-height: 44px; padding: 0 0.25rem; border-radius: 4px;
  font-weight: 600; font-size: 0.95rem; text-decoration: underline; text-decoration-color: var(--amber-dark);
  text-underline-offset: 3px; font-family: var(--font-ui);
}
.checkout-card .manage-text-btn:focus-visible { outline: 3px solid var(--amber-dark); outline-offset: 2px; }
/* Cancel: a quiet link at the foot of the card, then a confirm card whose
   destructive button is the danger token — never amber. */
.manage-cancel { margin-top: 1.5rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }
.manage-confirm-danger { border-color: var(--danger); background: var(--danger-bg); }
.manage-confirm-danger .manage-confirm-text { color: var(--danger-ink); }
.manage-confirm-danger .checkout-detail { margin-bottom: 1rem; color: var(--ink); }
.manage-confirm-text:focus { outline: none; }
.manage-confirm-text:focus-visible { outline: 3px solid var(--amber-dark); outline-offset: 2px; }
.checkout-card .manage-danger-btn,
.checkout-card .manage-danger-btn:hover {
  background: var(--danger); color: var(--on-danger); min-height: 44px; padding: 0.75rem 1.5rem;
  border-radius: 999px; font-weight: 700; font-family: var(--font-ui);
}
.checkout-card .manage-danger-btn:hover { background: var(--danger-ink); }
.checkout-card .manage-danger-btn:disabled { opacity: 0.6; cursor: default; }
.checkout-card .manage-danger-btn:focus-visible { outline: 3px solid var(--danger); outline-offset: 2px; }

/* Owner dashboard: refunds due */
.refunds-list { list-style: none; padding: 0; margin: 0; }
.refunds-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--hairline); }

/* Owner dashboard: time off — one column at any width; rows wrap on a phone */
.timeoff-form { max-width: 420px; }
.timeoff-form .btn { align-self: flex-start; }
.timeoff-list li { flex-wrap: wrap; }
.timeoff-list li .btn, .timeoff-list li .admin-cancel { min-height: 40px; }
/* Remove is a row's secondary action, never a second filled button on screen. */
.timeoff-list li .btn { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }

/* Owner dashboard: settings — one column at any width, 40px tap targets */
.settings-form { max-width: 480px; }
.settings-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.settings-group legend { font-weight: 700; color: var(--navy); padding: 0 0.3rem; }
.settings-day, .settings-service { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.4rem 0; border-bottom: 1px solid var(--hairline-soft); }
.settings-day:last-child, .settings-service:last-child { border-bottom: 0; }
.settings-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; }
.settings-row label { flex: 1 1 120px; }
.settings-closed { flex-direction: row !important; align-items: center; gap: 0.4rem !important; font-weight: 400 !important; min-height: 40px; }
.settings-form input, .settings-form select, .settings-actions .btn { min-height: 40px; }
.settings-closed input { min-height: 0; width: 20px; height: 20px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--white); }

/* Long-form pages (privacy) */
.prose { max-width: 680px; margin: 0 auto; padding: 32px 16px 64px; line-height: 1.65; }
.prose h2 { margin-top: 2rem; font-size: 1.15rem; }

/* Operator dashboard (/admin.html) — phone-first, one column, 680px max.
   Everything here is .op- prefixed so the detailed view's styles are untouched. */
.op-body { font-size: 1.0625rem; }
.op-body h2, .op-body h3 { color: var(--navy); }
.op-bar { position: sticky; top: 0; z-index: 10; background: var(--bar); }
.op-bar-top {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  max-width: 680px; margin: 0 auto; padding: 0.6rem 16px 0.3rem;
}
.op-brand { margin: 0; min-width: 0; color: var(--on-bar); font-weight: 700; font-size: 1.05rem; line-height: 1.3; font-family: var(--font-ui); overflow-wrap: anywhere; }
.op-bar-links { display: flex; align-items: center; gap: 0.75rem; white-space: nowrap; }
.op-quiet { color: var(--on-bar-muted); opacity: 0.8; font-size: 0.85rem; font-family: var(--font-ui); }
.op-bar .op-text-btn { color: var(--on-bar-muted); }
/* Section nav (3.1): a bottom tab bar on phones — five equal tabs, icon over a
   short label, never scrolling sideways — and a left rail from 720px. The
   active tab is marked with an amber bar and its own weight, not a fill:
   the screen's one filled button stays the content's primary action. */
.op-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0 0 env(safe-area-inset-bottom, 0); background: var(--bar);
  border-top: 1px solid var(--on-bar-line); box-shadow: 0 -4px 16px var(--shadow);
}
.op-tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
  min-width: 0; min-height: 56px; padding: 0.35rem 1px 0.4rem;
  color: var(--on-bar-muted); text-decoration: none; font-family: var(--font-ui); font-size: 0.72rem; font-weight: 600;
  line-height: 1.15; text-align: center;
}
.op-tab-icon-wrap { position: relative; display: inline-flex; }
.op-tab-icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.op-tab-label { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.op-tab::before {
  content: ''; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: transparent;
}
.op-tab-active { color: var(--on-bar); font-weight: 700; }
.op-tab-active::before { background: var(--amber); }
.op-tab-active .op-tab-icon { stroke: var(--amber); }
.op-tab:focus-visible { outline: 3px solid var(--amber); outline-offset: -3px; border-radius: 6px; }
.op-count {
  min-width: 1.15rem; padding: 0 0.3rem; border-radius: 999px; background: var(--danger); color: var(--on-danger);
  font-size: 0.7rem; font-weight: 700; text-align: center; line-height: 1.15rem;
}
.op-tab .op-count { position: absolute; top: -0.35rem; left: 62%; box-shadow: 0 0 0 2px var(--bar); }
/* Content and footer clear the bar (plus the phone's home-indicator inset). */
.op-body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
.op-main { padding-bottom: 1.5rem; }

@media (min-width: 720px) {
  .op-body {
    display: grid; grid-template-columns: 13.5rem minmax(0, 1fr);
    grid-template-areas: "bar bar" "nav main" "nav foot"; grid-template-rows: auto 1fr auto;
    padding-bottom: 0; min-height: 100vh;
  }
  .op-bar { grid-area: bar; }
  .op-bar-top, .op-freshness { max-width: none; padding-left: 24px; padding-right: 24px; }
  .op-main { grid-area: main; width: 100%; box-sizing: border-box; padding-left: 24px; padding-right: 24px; }
  .op-footer { grid-area: foot; width: 100%; box-sizing: border-box; }
  .op-nav {
    grid-area: nav; position: sticky; top: 3.25rem; bottom: auto; align-self: start;
    display: flex; flex-direction: column; gap: 0.25rem; max-height: calc(100vh - 3.25rem); overflow-y: auto;
    padding: 1.25rem 0.75rem; background: transparent; border-top: 0; box-shadow: none;
  }
  .op-tab {
    flex-direction: row; justify-content: flex-start; gap: 0.75rem; min-height: 48px; padding: 0 0.9rem;
    border-radius: var(--radius); color: var(--muted); font-size: 0.98rem; text-align: left;
  }
  .op-tab:hover { background: var(--overlay); color: var(--navy); }
  .op-tab::before { top: 22%; bottom: 22%; left: 0; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .op-tab-active { background: var(--white); color: var(--navy); box-shadow: inset 0 0 0 1px var(--line); }
  .op-tab-active .op-tab-icon { stroke: var(--amber-text); }
  .op-tab .op-count { position: static; margin-left: auto; box-shadow: none; order: 2; }
  .op-tab-icon-wrap { display: contents; }
}
/* Under the nav, only after a failed poll: "Last updated 2 min ago · couldn't refresh" */
.op-freshness {
  max-width: 680px; margin: 0 auto; padding: 0 16px 0.5rem;
  color: var(--on-bar-muted); font-size: 0.85rem; font-family: var(--font-ui);
}
.op-freshness::before { content: '\25CF'; color: var(--amber); margin-right: 0.4rem; }

.op-toast {
  position: fixed; top: 4.5rem; left: 50%; transform: translateX(-50%); z-index: 20;
  width: calc(100% - 32px); max-width: 648px; padding: 0.75rem 1rem; border-radius: var(--radius);
  background: var(--bar); color: var(--on-bar); font-weight: 600; font-size: 0.95rem;
  font-family: var(--font-ui); box-shadow: 0 6px 24px var(--shadow);
}

.op-main { max-width: 680px; margin: 0 auto; padding: 0.5rem 16px 2rem; }
.op-section { max-width: none; margin: 0; padding: 1.75rem 0 0.75rem; scroll-margin-top: 4.5rem; }
.op-section h2 { font-size: 1.45rem; margin: 0 0 0.75rem; }
.op-subhead { font-size: 1.05rem; margin: 1.5rem 0 0.25rem; }
.op-lead, .op-date { color: var(--muted); margin: 0 0 0.75rem; }
.op-date { margin: 0; font-family: var(--font-ui); font-size: 0.9rem; }
.op-status { font-size: 1.2rem; margin: 0.2rem 0 1rem; line-height: 1.4; }
.op-status a { color: var(--navy); font-weight: 700; }

.op-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.op-stack { display: flex; flex-direction: column; gap: 0.75rem; }
.op-signin { margin-top: 1rem; }
.op-item-title { margin: 0 0 0.25rem; font-size: 1.05rem; line-height: 1.35; }
.op-item-why { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.95rem; }
.op-actions, .op-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.op-actions { margin-top: 0.75rem; }
.op-row-actions { margin-left: auto; }
.op-btn { min-height: 44px; padding: 0.55rem 1.3rem; font-size: 0.98rem; }
.op-text-btn, .op-danger {
  min-height: 44px; padding: 0 0.75rem; background: none; border: none; cursor: pointer;
  color: var(--navy-soft); font-weight: 600; font-size: 0.95rem; text-decoration: underline; text-underline-offset: 3px;
}
.op-text-btn:disabled, .op-danger:disabled { opacity: 0.5; cursor: default; }
.op-text-danger { color: var(--danger); }
.op-danger { background: var(--danger); color: var(--on-danger); text-decoration: none; border-radius: 999px; padding: 0 1rem; }
.op-confirm-q { font-weight: 600; font-family: var(--font-ui); font-size: 0.95rem; }
.op-more { margin-top: 0.5rem; font-size: 0.93rem; }
.op-more summary { cursor: pointer; color: var(--navy); font-weight: 600; min-height: 44px; display: flex; align-items: center; font-family: var(--font-ui); }
.op-more p { margin: 0 0 0.5rem; }
/* The label is the only affordance on these fold-outs, so give it one: an
   inline chevron that turns when open (the default marker vanishes under
   display: flex). */
.op-more summary::-webkit-details-marker { display: none; }
.op-more summary::before { content: '\25B8'; margin-right: 0.45rem; color: var(--amber-text); font-size: 1.05em; transition: transform 0.15s; }
.op-more[open] > summary::before { transform: rotate(90deg); }
.op-msg-subject { font-weight: 700; }
.op-muted { color: var(--muted); }
.op-pre { white-space: pre-wrap; margin: 0; font-family: inherit; color: var(--muted); }
.op-review { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
/* Proposal form autosave line: Saving… / Saved / Couldn't save (both dashboards) */
.proposal-save-status { min-height: 1.3em; margin: 0; font-size: 0.85rem; color: var(--muted); }
.proposal-save-status[data-status="failed"] { color: var(--warning); }
/* Settings: the field the server refused, with its message beneath it */
.settings-form [aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.settings-field-error { margin: 0.2rem 0 0; color: var(--danger); font-size: 0.85rem; font-weight: 600; }
/* Copy refused: the proposal link shown in its row, selected, to copy by hand */
.op-copy-box { flex-basis: 100%; min-width: 0; font: inherit; font-size: 0.9rem; padding: 0.4rem 0.5rem; }
.op-empty { color: var(--muted); list-style: none; margin: 0.25rem 0; }
.op-empty-big { text-align: center; padding: 2rem 16px; font-size: 1.15rem; color: var(--navy); }

/* Lists: today, schedule, recent proposals — rows wrap, never scroll sideways */
.op-list { list-style: none; margin: 0; padding: 0; }
.op-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; min-height: 44px;
  padding: 0.5rem 0; border-bottom: 1px solid var(--line);
}
.op-row-past { opacity: 0.55; }
.op-row-cancelled .op-time, .op-row-cancelled .op-what { text-decoration: line-through; color: var(--muted); }
.op-time { font-weight: 700; min-width: 4.8rem; font-variant-numeric: tabular-nums; font-family: var(--font-ui); }
.op-who { font-weight: 600; }
.op-what { color: var(--muted); font-size: 0.95rem; }
.op-state-sent { color: var(--warning); }
.op-state-converted { color: var(--success); }
.op-status-line { flex-basis: 100%; font-size: 0.88rem; color: var(--warning); }
.op-good { color: var(--success); }
.op-day { font-size: 0.95rem; margin: 1.25rem 0 0.1rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.op-divider {
  padding: 0.45rem 0.75rem; margin: 0.4rem 0; border-radius: 8px; background: var(--overlay);
  color: var(--muted); font-size: 0.9rem; font-style: italic;
}

.op-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-top: 1.25rem; }
.op-tile {
  display: flex; flex-direction: column; gap: 0.2rem; padding: 0.9rem 0.75rem; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none;
}
.op-tile-num { font-size: 1.7rem; font-weight: 700; color: var(--navy); line-height: 1; font-family: var(--font-ui); }
.op-tile-label { font-size: 0.8rem; color: var(--muted); line-height: 1.3; }

.op-textarea { max-width: none; font-size: 1rem; }
.op-fold { margin-bottom: 0.75rem; padding: 0 16px; }
.op-fold > summary {
  display: flex; flex-direction: column; justify-content: center; min-height: 56px; padding: 0.6rem 0; cursor: pointer; list-style: none;
}
.op-fold > summary::-webkit-details-marker { display: none; }
.op-fold > summary::after { content: '▾'; position: absolute; top: 1.1rem; right: 16px; color: var(--muted); }
.op-fold { position: relative; }
.op-fold[open] > summary::after { content: '▴'; }
.op-fold[open] { padding-bottom: 16px; }
.op-fold-title { font-weight: 700; color: var(--navy); font-family: var(--font-ui); padding-right: 1.5rem; }
.op-fold-summary { color: var(--muted); font-size: 0.9rem; padding-right: 1.5rem; }
.op-fold .settings-form, .op-fold .timeoff-form { max-width: none; }
/* Appearance: Auto / Light / Dark — a segmented control, 44px tall like every op tap target */
.op-appearance { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.op-appearance .op-fold-summary { flex-basis: 100%; padding-right: 0; }
.op-segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--cream); }
.op-segmented label {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.9rem; border-radius: 999px; cursor: pointer;
  color: var(--muted); font-family: var(--font-ui); font-size: 0.92rem; font-weight: 600;
}
.op-segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.op-segmented label:has(input:checked) { background: var(--white); color: var(--navy); box-shadow: inset 0 0 0 1px var(--line); }
.op-segmented label:has(input:focus-visible) { outline: 2px solid var(--navy); outline-offset: 1px; }
.op-links { margin-top: 1.25rem; }
.op-links a, .op-footer a { color: var(--navy); font-weight: 600; }
.op-footer { max-width: 680px; margin: 0 auto; padding: 1.5rem 16px 3rem; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--line); }

/* Today (3.2): sans numerals and labels; a calm card when nothing is booked;
   only the tiles that carry something, laid out for however many there are. */
.op-status { font-family: var(--font-ui); font-size: 1.15rem; }
.op-clear { margin: 0.75rem 0 0; font-size: 1.1rem; line-height: 1.5; color: var(--ink); }
.op-status-needs { color: var(--navy); font-weight: 700; }
.op-tiles { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.op-tiles[hidden] { display: none; }
.op-tile-label, .op-tile-trend { font-family: var(--font-ui); }
.op-tile-num { font-variant-numeric: tabular-nums; }
.op-tile-trend { font-size: 0.78rem; color: var(--navy); font-weight: 600; }
.op-list[hidden] { display: none; }

/* Schedule stepper (3.7): ‹ range › on one row, Today / This week / Next week
   as a quiet segmented row under it. All 44px; none of them filled. */
.op-stepper { display: flex; flex-direction: column; gap: 0.5rem; margin: 0 0 0.5rem; font-family: var(--font-ui); }
.op-step-row { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.op-step-range { flex: 1 1 auto; min-width: 0; margin: 0; text-align: center; font-weight: 700; color: var(--navy); font-size: 0.98rem; }
.op-step-arrow {
  flex: none; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--white);
  color: var(--navy); font: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.op-step-views { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--cream); }
.op-step-view {
  flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 0.5rem; border: 0; border-radius: 999px; background: none;
  color: var(--muted); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.op-step-view[aria-pressed="true"] { background: var(--white); color: var(--navy); box-shadow: inset 0 0 0 1px var(--line); }
.op-step-arrow:focus-visible, .op-step-view:focus-visible { outline: 3px solid var(--amber-dark); outline-offset: 1px; }
/* Cancellations and time off read differently from a booking at a glance. */
.op-row-cancelled { border-left: 3px solid var(--danger); padding-left: 0.6rem; }
.op-row-cancelled .op-who { color: var(--muted); }
.op-cancel-line { color: var(--danger-ink, var(--danger)); }
.op-divider {
  font-style: normal; font-family: var(--font-ui); font-weight: 600; color: var(--ink);
  background: repeating-linear-gradient(135deg, var(--overlay) 0 8px, transparent 8px 16px), var(--white);
  border: 1px dashed var(--line); border-left: 3px solid var(--muted);
}
.op-day-off::after { content: ' · time off'; text-transform: none; letter-spacing: 0; }
.op-earlier { margin: 0.25rem 0 0.5rem; }
.op-earlier > summary { color: var(--muted); }

/* Inquiries: the box's visible label (3.11) keeps the old lead's look. */
.op-label { display: block; font-size: 1rem; }

/* Studio (3.8/3.9): moved out of the scoped <style> that lived in admin.html. */
#studio .op-automation { margin-bottom: 0.75rem; }
#studio .op-automation-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.6rem 0; border-top: 1px solid var(--line); }
#studio .op-automation-row:first-of-type { margin-top: 0.5rem; }
#studio .op-automation-line { flex: 1 1 16rem; margin: 0; font-size: 0.95rem; line-height: 1.45; }
#studio .settings-form input, #studio .settings-form select, #studio .settings-form .btn,
#studio .settings-form button { min-height: 44px; }
#studio .timeoff-form input, #studio .timeoff-form .btn { min-height: 44px; }
#studio .btn-ghost { color: var(--navy); }
/* The "Closed" label around each day's checkbox is the tap target: 44px,
   the 20px box centred in it. */
.settings-closed { display: flex; min-height: 44px; align-items: center; box-sizing: border-box; }
#studio .timeoff-list li .btn { min-height: 44px; display: inline-flex; align-items: center; }
/* Studio's folds can all be open at once: Save page & contact and Save
   settings stay filled (a screen apart), adding time off is the outlined one. */
#studio .timeoff-form .btn { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
/* Needs you: one filled primary per screen — the top card's; every later
   card's primary is the outlined twin, still 44px and still first in its row. */
#needs-list > .op-item ~ .op-item .op-actions > .btn:not(.btn-outline) { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
#studio .settings-form input[type="checkbox"] { min-height: 0; }
#studio .settings-form textarea { min-height: 88px; font: inherit; }
#studio .settings-form input, #studio .settings-form select, #studio .settings-form textarea { width: 100%; box-sizing: border-box; min-width: 0; }
#studio .profile-form { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 0.5rem; }
#studio .profile-row { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
#studio .profile-row:last-of-type { border-bottom: 0; }
#studio .profile-row-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
#studio .profile-row-head strong { font-family: var(--font-ui); font-size: 0.9rem; }
#studio .profile-portrait { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
#studio .profile-portrait img { width: 128px; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); background: var(--cream); }
#studio .profile-portrait-actions { display: flex; flex-direction: column; gap: 0.5rem; flex: 1 1 12rem; min-width: 0; }
#studio .profile-file { font-size: 0.9rem; }
#studio .profile-count { margin: 0; }
#studio .studio-preview { margin-top: 0.75rem; overflow: hidden; }
#studio .studio-preview > * { max-width: 100%; }
#studio .studio-preview .operator, #studio .studio-preview .quote-band { padding: 1rem 0; margin: 0; }
#studio .studio-preview-band { padding: 0.9rem 16px; border-radius: var(--radius); }
#studio .studio-preview-band .hero-creds { margin: 0; }
#studio .studio-preview-label { margin: 0.75rem 0 0.25rem; font-family: var(--font-ui); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

/* --- checkout + pending banner (1.1, 1.8, 1.9) --- */
/* 1.8: the money, stated before the card fields. */
.checkout-summary {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}
.checkout-sum-row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; padding: 0.3rem 0; min-width: 0; }
.checkout-sum-row + .checkout-sum-row { border-top: 1px solid var(--hairline); }
.checkout-sum-row dt { color: var(--muted); margin: 0; }
.checkout-sum-row dd { margin: 0; text-align: right; font-weight: 600; color: var(--ink); min-width: 0; }
.checkout-sum-today dt, .checkout-sum-today dd { color: var(--navy); font-weight: 700; }
.checkout-sum-note { display: block; font-weight: 400; font-size: 0.78rem; color: var(--muted); }

/* 1.9: the hold line under the summary, counting down like the nudge page. */
.checkout-hold {
  margin: 0 0 1.25rem;
  padding: 0.6rem 0.85rem;
  background: var(--note-bg);
  border-left: 3px solid var(--amber);
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--ink);
}
.checkout-hold-left { color: var(--muted); font-variant-numeric: tabular-nums; }
.checkout-hold-ended { border-left-color: var(--warning); background: var(--warning-bg); }
.checkout-card .form-error { text-align: center; font-size: 0.88rem; }

/* 1.9: "Finish paying for Mon 4:00 PM" on the booking page after a visitor
   left checkout. A slim bar above the header; wraps to two rows on phones. */
.pending-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding: 0.75rem 16px;
  background: var(--note-bg);
  border-bottom: 2px solid var(--amber);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}
.pending-banner-text { margin: 0; min-width: 0; flex: 1 1 14rem; }
.pending-banner-text strong { color: var(--navy); }
.pending-banner-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
/* Plan §6: both banner actions are at least 44px tall on phones. */
.pending-banner-actions .btn {
  min-height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
}
.pending-banner-release {
  min-height: 44px;
  background: none;
  border: none;
  padding: 0.4rem 0;
  color: var(--navy);
  text-decoration: underline;
  font: inherit;
  cursor: pointer;
}
.pending-banner-release:disabled { opacity: 0.6; cursor: default; }
.pending-banner-error { flex-basis: 100%; margin: 0; color: var(--danger); font-weight: 600; }

/* --- booking detail + client card (3.6) --- */
/* The schedule row is one button: whole-row tap target, keyboard-operable,
   wraps like the other rows and never scrolls sideways. */
.op-row-booking { padding: 0; }
.op-row-main {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem;
  flex: 1 1 100%; min-width: 0; min-height: 44px; padding: 0.5rem 0;
  background: none; border: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.op-row-main:hover .op-who { text-decoration: underline; text-underline-offset: 3px; }
.op-row-main:focus-visible { outline: 3px solid var(--amber-dark); outline-offset: 2px; border-radius: 6px; }
.op-row-main[aria-expanded="true"] .op-who { color: var(--navy); }
.op-detail { flex-basis: 100%; min-width: 0; padding: 0 0 0.75rem; }
.op-detail-card { display: flex; flex-direction: column; gap: 0.35rem; font-family: var(--font-ui); }
.op-detail-line { display: flex; flex-wrap: wrap; gap: 0 0.75rem; font-size: 0.95rem; line-height: 1.45; min-width: 0; }
.op-detail-label { flex: 0 0 7.5rem; color: var(--muted); font-size: 0.88rem; }
.op-detail-value { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.op-detail-card .op-actions { margin-top: 0.5rem; }
.op-detail-card .op-actions .op-confirm-q { flex-basis: 100%; }
.op-detail-copy { display: contents; }
.op-detail-card .op-copy-box { min-height: 44px; }
.op-link { color: var(--navy); text-underline-offset: 3px; overflow-wrap: anywhere; }
.op-client-card { display: flex; flex-direction: column; gap: 0.35rem; padding-top: 0.25rem; }
.op-client-card > .op-who { margin: 0; }
.op-client-card > .op-detail-label { flex: none; margin: 0.35rem 0 0; }
.op-client-history { list-style: none; margin: 0; padding: 0; }
.op-client-booking {
  display: flex; flex-wrap: wrap; gap: 0 0.75rem; padding: 0.35rem 0; border-top: 1px solid var(--line);
  font-size: 0.92rem; min-width: 0;
}
.op-client-when { font-variant-numeric: tabular-nums; font-weight: 600; }
.op-client-cancelled .op-client-when { text-decoration: line-through; color: var(--muted); }

/* --- proposal review (3.5) --- */
/* Status chips on both dashboards: Draft / Link ready / Emailed / Email failed / Booked */
.proposal-chip {
  display: inline-flex; align-items: center; min-height: 1.6rem; padding: 0.1rem 0.65rem;
  border-radius: 999px; font-family: var(--font-ui); font-size: 0.78rem; font-weight: 700; white-space: nowrap;
}
.proposal-chip-neutral { background: var(--overlay); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.proposal-chip-info { background: var(--info-bg); color: var(--info); }
.proposal-chip-danger { background: var(--danger-bg); color: var(--danger-ink); }
.proposal-chip-success { background: var(--success-bg); color: var(--success); }
.op-proposal-detail { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; font-size: 0.88rem; }
.op-btn-small { min-height: 44px; padding: 0.35rem 1rem; font-size: 0.92rem; }
.op-link-only { padding: 0 0.5rem; }
/* The review form's schedule preview: only once a service is set */
.proposal-schedule-head { margin: 0 0 0.25rem; font-family: var(--font-ui); font-size: 0.85rem; font-weight: 700; color: var(--navy); }
.proposal-schedule-hint { margin: 0.25rem 0 0; }
.proposal-schedule[hidden], .proposal-schedule-hint[hidden] { display: none; }
/* /p/<token> after session 1: the rest of the plan, one row per session */
.plan-rest { list-style: none; margin: 0 0 1rem; padding: 0; }
.plan-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--line);
}
.plan-row-text { margin: 0; min-width: 0; flex: 1 1 12rem; overflow-wrap: anywhere; }
.plan-row-state { color: var(--muted); font-size: 0.92rem; }
.plan-row-booked .plan-row-state { color: var(--success); font-weight: 600; }
.plan-row-held .plan-row-state { color: var(--warning); font-weight: 600; }
.plan-book-btn { min-height: 44px; padding: 0.55rem 1.2rem; }
.plan-picker { margin: 0.5rem 0 1rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.plan-picker-title { margin: 0 0 0.5rem; font-weight: 700; color: var(--navy); }
.plan-picker-title:focus { outline: none; }
.plan-picker .manage-text-btn { min-height: 44px; }
.manage-picker .slot-suggested { border-style: dashed; border-color: var(--amber-dark); }
.manage-picker .slot-suggested::after { content: ' · suggested'; font-weight: 500; color: var(--muted); }
/* The operator review card's fields meet the 44px tap floor on phones. */
.op-review .proposal-form input:not([type="checkbox"]), .op-review .proposal-form select { min-height: 44px; box-sizing: border-box; }

/* Dashboard from 960px (4.5): a wider main column; Today and Needs you side
   by side as the home (admin-op.js showSection shows both); Schedule's week
   as seven day columns with the open booking card full width under them;
   Inquiries and Studio keep a reading column and every form stays ≤ 560px. */
@media (min-width: 960px) {
  .op-main { max-width: 1240px; margin: 0; padding-left: 32px; padding-right: 32px; }
  .op-home { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0 2.5rem; align-items: start; }
  .op-home > .op-section[hidden] { display: none; }
  #inquiries, #studio { max-width: 720px; }
  .op-main .proposal-form, .op-main .settings-form, .op-main .timeoff-form,
  .op-fold .settings-form, .op-fold .timeoff-form, #inquiry-text { max-width: 560px; }
  #schedule .op-stepper { flex-direction: row; align-items: center; gap: 1rem; max-width: 760px; }
  #schedule .op-step-row { flex: 1 1 auto; }
  #schedule .op-step-views { flex: 0 0 22rem; }
  .op-week {
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.5rem;
    margin-top: 0.75rem; align-items: stretch;
  }
  .op-week-day {
    display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; min-height: 12rem;
    padding: 0.5rem; border-radius: var(--radius); background: var(--overlay);
  }
  .op-week-off {
    background: repeating-linear-gradient(135deg, var(--overlay) 0 8px, transparent 8px 16px), var(--white);
    box-shadow: inset 0 0 0 1px var(--line);
  }
  .op-week-head {
    display: flex; flex-direction: column; margin: 0 0 0.15rem; padding: 0.15rem 0.25rem 0.4rem;
    border-bottom: 1px solid var(--line); font-family: var(--font-ui); line-height: 1.25;
  }
  .op-week-name { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--navy); }
  .op-week-date { font-size: 0.85rem; font-weight: 400; color: var(--muted); }
  .op-week-today .op-week-head { border-bottom: 3px solid var(--amber); }
  .op-week-past .op-week-name { color: var(--muted); }
  .op-week-list { display: flex; flex-direction: column; gap: 0.4rem; }
  .op-week-list > .op-row, .op-week-list > .op-divider {
    margin: 0; padding: 0.4rem 0.5rem; min-height: 0;
    background: var(--white); border: 1px solid var(--line); border-radius: 8px;
    font-size: 0.85rem; line-height: 1.3; overflow-wrap: anywhere;
  }
  .op-week-list > .op-row { display: flex; flex-direction: column; align-items: stretch; gap: 0.1rem; }
  .op-week-list > .op-row-cancelled { border-left: 3px solid var(--danger); }
  .op-week-list > .op-row-booking { padding: 0; }
  .op-week-list .op-row-main {
    flex-direction: column; align-items: flex-start; gap: 0.1rem; min-height: 44px; padding: 0.4rem 0.5rem;
  }
  .op-week-list .op-row-main[aria-expanded="true"] { box-shadow: inset 0 0 0 2px var(--navy); border-radius: 8px; }
  .op-week-list .op-time { min-width: 0; font-size: 0.85rem; }
  .op-week-list .op-who { font-size: 0.88rem; }
  .op-week-list .op-what { font-size: 0.8rem; }
  .op-week-list .op-status-line { font-size: 0.78rem; }
  .op-week-list .op-row-booking > .op-status-line { padding: 0 0.5rem 0.4rem; }
  .op-week-empty { margin: 0.25rem; color: var(--muted); font-family: var(--font-ui); font-size: 0.82rem; }
  .op-week-detail > .op-detail:not([hidden]) { margin-top: 1rem; padding: 0; max-width: 760px; scroll-margin: 5rem 0 1rem; }
}
