/*
 * time-slot public booking page — component styles (full UX overhaul, doc 56).
 *
 * Design system (one density; WCAG 2.2 AA is a PRIMARY constraint — many customers are elderly):
 *   - 18px base, ≥44px primary targets, universal visible focus ring (never removed).
 *   - Real labels (never placeholder-only). Availability never conveyed by colour alone.
 *   - Motion is action-feedback / attention / transition only; killed under prefers-reduced-motion.
 *   - Skeleton shimmer for content waits, never spinners.
 *   - prefers-contrast + forced-colors blocks kept.
 *
 * Brand: real per-market colours (systems/shared/email-templates/src/brand.ts). --accent = the
 * market PRIMARY (deep navy / blue) used for primary buttons + selected states (AA on white).
 * --brand = the bright brand accent, DECORATIVE only (check, day dot, focus halo). Hover/soft
 * hexes are pre-derived (no runtime colour math). Overridden per [data-market] on <html>.
 *
 * Two hard radii, two shadows, one spacing scale. No ad-hoc values.
 */

:root {
  --font-sans:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --font-size-base: 1.125rem; /* 18px — legibility for an elderly audience */
  --line-height: 1.55;

  /* Neutral palette (shared across markets). */
  --bg: #eef1f6;
  --bg-grad-a: #eef1f6;
  --bg-grad-b: #e6ebf3;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --surface-3: #eaeef4;
  --text: #10141c; /* ~17:1 on surface */
  --muted: #4a5563; /* ~7:1 on surface — AA for body */
  --border: #d9dee7; /* ≥3:1 vs surface for non-text UI (1.4.11) */
  --border-strong: #aab2c0;

  /* Accent = market PRIMARY. Default = DK (data-market defaults to dk). */
  --accent: #000045;
  --accent-hover: #1a1a5e;
  --accent-contrast: #ffffff;
  --accent-soft: #eaeaf1;
  --brand: #29c4a9; /* decorative only */
  --brand-soft: #e7f8f4;

  --success: #117a3d;
  --success-soft: #e3f3e9;
  --danger: #b3261e; /* red on white ~6.4:1 */
  --danger-soft: #fbe7e6;
  --warning: #8a5a00;
  --warning-soft: #fbf0d9;

  --radius-sm: 10px; /* controls */
  --radius-lg: 18px; /* cards / panels */
  --shadow-1:
    0 1px 2px rgba(16, 22, 40, 0.06), 0 1px 3px rgba(16, 22, 40, 0.05);
  --shadow-2: 0 12px 40px rgba(16, 22, 40, 0.14);

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;

  --target: 2.75rem; /* 44px */

  --dur: 160ms;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ── Per-market brand overrides (real colours; pre-derived hover/soft). ─────────────────── */
[data-market="dk"] {
  --accent: #000045;
  --accent-hover: #1a1a5e;
  --accent-soft: #eaeaf1;
  --brand: #29c4a9;
  --brand-soft: #e7f8f4;
}
[data-market="se"] {
  --accent: #000045;
  --accent-hover: #1a1a5e;
  --accent-soft: #eaeaf1;
  --brand: #76b82a;
  --brand-soft: #eff7e3;
}
[data-market="ie"] {
  --accent: #0c71c3;
  --accent-hover: #0a5ea3;
  --accent-soft: #e7f1fb;
  --brand: #bb9d6c;
  --brand-soft: #f5efe1;
}
[data-market="uk"] {
  --accent: #0c71c3;
  --accent-hover: #0a5ea3;
  --accent-soft: #e7f1fb;
  --brand: #bb9d6c;
  --brand-soft: #f5efe1;
}

/* ── Reset / base ───────────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  font-size: 100%;
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--text);
  background: var(--bg);
  background-image: linear-gradient(180deg, var(--bg-grad-a), var(--bg-grad-b));
  background-attachment: fixed;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
h1,
h2,
h3,
p {
  margin: 0;
}
img,
svg {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.detail-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Universal visible focus ring (:focus-visible where supported; :focus fallback). */
:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Utilities ──────────────────────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: var(--space-2);
  top: var(--space-2);
  z-index: 100;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  /* Hidden by its own full height (a fixed offset once leaked a sliver). */
  transform: translateY(calc(-100% - var(--space-2) - 6px));
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus {
  transform: translateY(0);
}

/* ── App chrome: header / footer / progress ─────────────────────────────────────────────── */
.app-header {
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.app-header__inner {
  max-width: 57rem;
  margin-inline: auto;
}
.app-logo {
  display: block;
  height: 42px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}
/* SE/IE/UK lockups are taller than DK's wide wordmark (2.5–3.2:1 vs 5.5:1) — give them more
   height so the wordmark stays legible at header scale. */
[data-market="se"] .app-logo,
[data-market="ie"] .app-logo,
[data-market="uk"] .app-logo {
  height: 52px;
}
.progress {
  width: 100%;
  max-width: 60rem;
  margin: var(--space-4) auto 0;
  padding: 0 var(--space-4);
}
.progress__track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  width: 33%;
  border-radius: 999px;
  background: var(--accent);
  transition: width var(--dur) var(--ease);
}
[data-progress-step="1"] .progress__fill {
  width: 33%;
}
[data-progress-step="2"] .progress__fill {
  width: 66%;
}
[data-progress-step="3"] .progress__fill {
  width: 100%;
}
.progress__label {
  margin-top: var(--space-1);
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

/* ── Shell ──────────────────────────────────────────────────────────────────────────────── */
.shell {
  flex: 1 0 auto;
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding: var(--space-4);
}

/* ── Booker (event-info rail + main) ────────────────────────────────────────────────────── */
.booker {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
@media (min-width: 56rem) {
  .booker {
    grid-template-columns: minmax(240px, 19rem) 1fr;
    gap: 0;
    /* A shared floor steadies the three steps; long questions still grow naturally. */
    min-height: 46rem;
  }
  /* Rail switched off (doc 61 block.eventInfoRail): [hidden] removes the <aside> from the grid,
     but the 19rem track it lived in would remain — squeezing the booking form into the sidebar
     column. app.js stamps data-present-rail="off" on <html>; give the form the whole row. */
  html[data-present-rail="off"] .booker {
    grid-template-columns: 1fr;
  }
}

.event-info {
  padding: var(--space-5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
@media (min-width: 56rem) {
  .event-info {
    border-bottom: none;
    border-right: 1px solid var(--border);
  }
  /* The desktop disclosure stays open (app.js); its summary is hidden below the base rule. */
  .event-info__extra {
    flex: 1 1 auto;
  }
}
/* Below the desktop breakpoint the event-info rail collapses to a compact summary bar so the
   interactive booker isn't pushed below decorative content (doc 56 §2.1). Logo mark (embed only) +
   event name + duration chip sit on one row; reassurance/contact live behind the disclosure. */
@media (max-width: 55.99rem) {
  .event-info {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    padding: var(--space-3) var(--space-4);
  }
  .event-info__eyebrow {
    display: none; /* brand already shown by the header logo directly above */
  }
  .event-info__title {
    font-size: 1.15rem;
    flex: 1 1 auto;
    min-width: 0;
  }
  .event-info__chips {
    margin-left: auto;
  }
  .event-info__manage,
  .event-info__extra,
  .event-info__description {
    flex-basis: 100%; /* reschedule context + blurb + disclosure each take their own full-width row */
  }
  .event-info__contact-head {
    display: none; /* the disclosure summary already reads "Need help?" */
  }
}
.event-info__logo {
  display: none; /* shown only in embed mode (app chrome hidden) */
  height: 34px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  margin-bottom: var(--space-1);
}
.event-info__eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.event-info__title {
  font-size: 1.125rem;
  line-height: 1.4;
  font-weight: 650;
}
.event-info__chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.event-info__description {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--muted);
  white-space: pre-line; /* admin-entered plain text: keep intentional line breaks */
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.chip__icon {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.event-info__reassure {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 1rem;
  color: var(--muted);
  padding-top: var(--space-2);
}
.event-info__lock {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  margin-top: 0.15rem;
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.event-info__manage {
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}
.event-info__manage-with {
  font-weight: 700;
}
.event-info__manage-current {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.event-info__contact {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.event-info__contact-head {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.event-info__contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--target);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  word-break: break-word;
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.event-info__contact-link:hover {
  text-decoration: underline;
}
.event-info__contact-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.event-info__contact-num {
  font-weight: 600;
}

/* Reassurance + contact disclosure. On phones it's a real <details> (collapsed → one-line
   summary); from 56rem up the summary is hidden and it's forced open (app.js), so it renders as
   a compact help block without a duplicated desktop heading. */
.event-info__extra {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.event-info__extra-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--target);
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  list-style: none; /* drop the default disclosure triangle; a chevron is drawn below */
}
@media (min-width: 56rem) {
  .event-info__extra-summary {
    display: none;
  }
}
.event-info__extra-summary::-webkit-details-marker {
  display: none;
}
.event-info__extra-summary::after {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg); /* chevron down = collapsed */
  transition: transform var(--dur) var(--ease);
}
.event-info__extra[open] > .event-info__extra-summary::after {
  transform: rotate(-135deg); /* chevron up = expanded */
}

.booker__main {
  min-width: 0;
  padding: var(--space-5);
}

/* ── Panels ─────────────────────────────────────────────────────────────────────────────── */
.panel--book {
  min-width: 0;
}
.panel--centered {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: var(--space-5);
  max-width: 34rem;
  margin: 0 auto;
  text-align: center;
}
.panel__title {
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.015em;
}
.panel__intro {
  color: var(--muted);
  margin-top: var(--space-2);
}
.subhead {
  font-size: 1.125rem;
  font-weight: 650;
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
  line-height: 1.4;
}
.panel--book .panel__intro {
  margin-bottom: var(--space-4);
}
.panel__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.panel__nav .btn {
  flex: 1 1 11rem;
}
.panel__nav--center {
  justify-content: center;
  margin-top: var(--space-4);
}
.legal-line {
  margin-top: var(--space-4);
  font-size: 1rem;
  color: var(--muted);
}
.whatnext {
  margin-top: var(--space-4);
  font-size: 1rem;
  color: var(--muted);
}

/* ── Forms ──────────────────────────────────────────────────────────────────────────────── */
.field {
  margin-bottom: var(--space-3);
}
.field__label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-1);
  font-size: 1rem;
}
/* Question prompts may contain admin-entered newlines. */
.field__label > span:first-child,
.question__legend > span:first-child {
  white-space: pre-line;
}
.field__req {
  font-weight: 400;
  color: var(--muted);
  font-size: 1rem;
  margin-left: 0.25rem;
}
.input {
  display: block;
  width: 100%;
  min-height: var(--target);
  padding: 0.65rem var(--space-3);
  font-size: var(--font-size-base);
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.input::placeholder {
  color: var(--muted);
}
.input:hover {
  border-color: var(--muted);
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.textarea {
  resize: vertical;
  min-height: 5rem;
  line-height: 1.5;
}
.field__hint {
  margin-top: var(--space-1);
  font-size: 1rem;
  color: var(--muted);
}
.field.has-error .input {
  border-color: var(--danger);
}
.field.has-error .input:focus {
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.field__error {
  margin-top: var(--space-1);
  color: var(--danger);
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

/* ── Buttons ────────────────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--target);
  min-width: var(--target);
  padding: 0.6rem var(--space-4);
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn__icon {
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn__icon--end {
  margin-left: -0.1rem;
}
.btn--block {
  width: 100%;
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
  box-shadow: var(--shadow-1);
}
.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn--ghost {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--border-strong);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.btn--link {
  background: transparent;
  color: var(--accent);
  border-color: transparent;
  min-height: var(--target); /* 44px house-minimum tap target (was 36px) */
  padding: 0.35rem 0.6rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn--link:hover {
  background: var(--accent-soft);
}
.btn--danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn--danger:hover:not(:disabled) {
  background: #8f1e17;
  border-color: #8f1e17;
}
.btn--danger-ghost {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger);
}
.btn--danger-ghost:hover:not(:disabled) {
  background: var(--danger-soft);
}
.btn.is-busy {
  position: relative;
  color: transparent;
}
.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  color: var(--accent-contrast);
  animation: spin 0.7s linear infinite;
}
.btn--ghost.is-busy::after,
.btn--link.is-busy::after {
  color: var(--accent);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--target);
  height: var(--target);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.icon-btn svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--muted);
}
.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── "Call us" card (landing) ───────────────────────────────────────────────────────────── */
.call-card {
  margin-top: var(--space-4);
  padding: var(--space-3) 0 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  text-align: left;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-2);
}
.call-card__label {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
}
.call-card__link {
  width: auto;
  border-color: transparent;
  padding-inline: 0.25rem;
}
.call-card__num {
  font-weight: 600;
}

/* ── Timezone control ───────────────────────────────────────────────────────────────────── */
.slots-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.tz {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  color: var(--muted);
}
.tz__field {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.35rem 0.15rem 0.6rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.tz__globe {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tz__select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  padding: 0.3rem 1.4rem 0.3rem 0.15rem;
  min-height: var(--target); /* 44px house-minimum tap target (was 32px) */
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%234a5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.2rem center;
  background-size: 1.1rem;
}

/* ── Picker: calendar + times ───────────────────────────────────────────────────────────── */
.picker {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 35rem) {
  .picker {
    grid-template-columns: minmax(0, 19rem) 1fr;
    gap: var(--space-5);
  }
}
.cal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.cal__month {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  flex: 1 1 auto;
}
.cal__grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.cal__grid th {
  padding: var(--space-1) 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.cal__grid th abbr {
  text-decoration: none;
  cursor: default;
}
.cal__grid td {
  padding: 2px;
  text-align: center;
}
/* Day cell: roving tabindex in JS. Width flexes with the fixed table (no overflow on phones). */
.day-btn {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  min-height: var(--target);
  padding: 0.35rem 0;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
/* The fixed 7-col grid renders each visual cell as narrow as ~35px on a 320px phone. Keep the
   POINTER/tap target ≥44px (WCAG 2.5.8 / house rule) without widening the visual box: a centred
   pseudo-element extends the hit area symmetrically past the visual bounds (doc 56 §2.1 "40px
   visual, ≥44px hit area"). Only real day buttons ([data-date]) get it — not empty/skeleton cells. */
.day-btn[data-date]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  min-width: var(--target);
  min-height: var(--target);
}
.day-btn:hover:not([aria-disabled="true"]) {
  background: var(--accent-soft);
}
/* Availability marker = a dot (not colour alone — 1.4.1). */
.day-btn.has-times {
  border-color: var(--border-strong);
}
.day-btn__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
}
.day-btn.has-times .day-btn__dot {
  background: var(--brand);
}
/* Today = outlined ring distinct from selected (filled). */
.day-btn.is-today {
  border-color: var(--accent);
}
.day-btn[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.day-btn[aria-selected="true"] .day-btn__dot {
  background: var(--accent-contrast);
}
/* Unavailable days use aria-disabled (NOT native `disabled`) so they stay focusable for APG
   roving-tabindex traversal; activation is blocked in JS. Style them like the old :disabled. */
.day-btn[aria-disabled="true"] {
  color: var(--muted);
  opacity: 0.4;
  cursor: not-allowed;
}
.day-btn.is-empty {
  background: transparent;
  border: none;
  cursor: default;
  min-height: var(--target);
}
.day-btn.is-skeleton {
  color: transparent;
  pointer-events: none;
  border-color: transparent;
}
.day-btn.is-skeleton .day-btn__num {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 5px;
}

/* Times list. */
.times__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
}
.times__prompt,
.times__empty {
  color: var(--muted);
  margin: var(--space-2) 0;
}
.times__month-empty {
  margin: var(--space-3) 0;
  padding: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
}
.times__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 26rem;
  overflow-y: auto;
  padding-right: 2px;
}
.time-group__label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: var(--space-2) 0 0.15rem;
}
.time-group__label:first-child {
  margin-top: 0;
}
.time-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: var(--target);
  padding: 0.7rem var(--space-3);
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  color: var(--accent);
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.time-btn:hover:not([aria-pressed="true"]) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.time-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}
.time-btn[aria-pressed="true"]:focus-visible {
  outline-color: var(--accent-contrast);
  outline-offset: -5px;
}
.time-btn__check {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Sticky two-tap confirm bar. */
.slot-bar {
  position: sticky;
  bottom: var(--space-3);
  z-index: 5;
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  animation: slideUp var(--dur) var(--ease);
}
.slot-bar__info {
  flex: 1 1 auto;
  min-width: 0;
}
.slot-bar__when {
  font-weight: 600;
  font-size: 1rem;
}
.slot-bar .btn {
  flex: 0 0 auto;
}

/* ── Read card (confirm step) ───────────────────────────────────────────────────────────── */
.read-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}
.read-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.read-card__head .subhead {
  margin: 0;
}
.read-card__edit {
  margin-top: var(--space-3);
}

/* ── Questions ──────────────────────────────────────────────────────────────────────────── */
.question {
  margin-bottom: var(--space-4);
  border: 0;
  padding: 0;
  min-width: 0;
}
.question__legend {
  font-weight: 600;
  margin-bottom: var(--space-1);
  padding: 0;
  font-size: 1rem;
}
.choice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--target);
  padding: 0.5rem 0.75rem;
  margin-bottom: var(--space-1);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.choice:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.choice input {
  width: 1.3rem;
  height: 1.3rem;
  accent-color: var(--accent);
  flex: 0 0 auto;
}
.choice--other-text {
  margin-top: var(--space-1);
}

/* ── Detail / summary lists ─────────────────────────────────────────────────────────────── */
.detail-list {
  margin: 0;
  padding: 0;
}
.summary-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}
.summary-card__head {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
}
.detail-list--card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-4);
  margin: var(--space-4) 0;
  text-align: left;
}
.detail-row {
  display: grid;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
  grid-template-columns: minmax(7rem, 0.85fr) minmax(0, 1.65fr);
  align-items: baseline;
}
.detail-row:first-child dd {
  font-weight: 600;
}
@media (max-width: 35rem) {
  .detail-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
  }
}
.detail-row:last-child {
  border-bottom: none;
}
.detail-row dt {
  color: var(--muted);
  font-weight: 400;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.detail-row dd {
  margin: 0;
  text-align: left;
  font-weight: 500;
  font-size: 1rem;
  overflow-wrap: anywhere;
  min-width: 0;
}

/* ── Hero icons + success ───────────────────────────────────────────────────────────────── */
.hero-check {
  display: inline-grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 0 auto var(--space-3);
  border-radius: 50%;
  /* Success semantics use the dedicated --success tokens (green), not the decorative brand accent. */
  background: var(--success-soft);
}
.hero-check__circle {
  stroke: var(--success);
  stroke-width: 2;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: draw 0.5s var(--ease) forwards;
}
.hero-check__mark {
  stroke: var(--success);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw 0.35s var(--ease) 0.35s forwards;
}
.hero-icon {
  display: inline-grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin: 0 auto var(--space-3);
  border-radius: 50%;
}
.hero-icon svg {
  width: 2.1rem;
  height: 2.1rem;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero-icon--warn {
  background: var(--warning-soft);
}
.hero-icon--warn svg {
  stroke: var(--warning);
}
.hero-icon--danger {
  background: var(--danger-soft);
}
.hero-icon--danger svg {
  stroke: var(--danger);
}
.hero-icon--muted {
  background: var(--surface-3);
}
.hero-icon--muted svg {
  stroke: var(--muted);
}

.confirm-sent {
  margin: var(--space-4) 0;
  font-weight: 400;
  font-size: 1rem;
}
.join-link {
  margin: var(--space-3) 0;
}
.addcal {
  margin: var(--space-4) 0 var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.addcal__head {
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: var(--space-2);
}
.addcal__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
}
.addcal__row .btn {
  flex: 1 1 8rem;
  font-size: 1rem;
}
.gate-existing {
  text-align: left;
}
.gate-existing .subhead {
  text-align: left;
}

/* ── Turnstile placeholders ─────────────────────────────────────────────────────────────── */
.nojs-turnstile {
  margin: var(--space-3) 0 var(--space-4);
  padding: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.turnstile-invisible {
  margin: 0;
}

/* ── Skeletons ──────────────────────────────────────────────────────────────────────────── */
.skeleton,
.day-btn.is-skeleton .day-btn__num {
  background: linear-gradient(
    90deg,
    var(--surface-3) 25%,
    var(--surface-2) 37%,
    var(--surface-3) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.skeleton-row {
  height: var(--target);
  border-radius: var(--radius-sm);
}

/* ── Keyframes ──────────────────────────────────────────────────────────────────────────── */
@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes slideUp {
  from {
    transform: translateY(0.6rem);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.panel[data-panel] {
  animation: fadeIn var(--dur) var(--ease);
}

/* ── Preview highlight (doc 63) — pulse the element the admin operator just edited. ────────
   Applied ONLY inside the admin's ?preview=1 iframe (app.js highlightPreviewKey), removed on
   animationend. Killed under prefers-reduced-motion by the global block below. */
@keyframes previewFlash {
  0% {
    outline-color: transparent;
    box-shadow: 0 0 0 0 rgba(41, 196, 169, 0);
  }
  15% {
    outline-color: var(--brand);
    box-shadow: 0 0 0 6px rgba(41, 196, 169, 0.28);
  }
  100% {
    outline-color: transparent;
    box-shadow: 0 0 0 0 rgba(41, 196, 169, 0);
  }
}
.preview-flash {
  outline: 2px solid transparent;
  outline-offset: 3px;
  border-radius: var(--radius-sm);
  animation: previewFlash 2s var(--ease);
}

/* ── Embed mode: hide app chrome (display:none, never offset tricks). ────────────────────── */
[data-embed="1"] [data-chrome],
[data-embed="1"] .progress {
  display: none !important;
}
/* Solid background inside an embed (doc 56 §2.7): drop the page-level gradient so the widget
   blends into the host page instead of showing DFJ's own backdrop behind the card. The body's
   solid --bg base remains once the gradient image is removed. */
[data-embed="1"] body {
  background-image: none;
  background-attachment: initial;
}
[data-embed="1"] .shell {
  padding: var(--space-3);
}
[data-embed="1"] .event-info__logo {
  display: block;
}
[data-embed="1"] .booker,
[data-embed="1"] .panel--centered {
  box-shadow: var(--shadow-1);
}

/* ── Motion & contrast preferences ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .hero-check__circle,
  .hero-check__mark {
    stroke-dashoffset: 0;
  }
}
@media (prefers-contrast: more) {
  :root {
    --border: #5b6373;
    --border-strong: #2a2f3a;
    --muted: #2f3848;
  }
  .input,
  .day-btn.has-times,
  .chip {
    border-color: var(--text);
  }
}
@media (forced-colors: active) {
  /* aria-disabled (kept focusable for the APG grid) has no native :disabled styling —
     restore the GrayText distinction Windows High Contrast users would otherwise lose. */
  .day-btn[aria-disabled="true"] {
    color: GrayText;
    border-color: GrayText;
  }

  .btn,
  .input,
  .day-btn,
  .time-btn,
  .chip,
  .icon-btn {
    border: 2px solid ButtonText;
  }
  .day-btn[aria-selected="true"],
  .time-btn[aria-pressed="true"] {
    background: Highlight;
    color: HighlightText;
  }
  :focus-visible {
    outline: 3px solid Highlight;
  }
}

/* ── Small-screen tuning (≤375px): trim padding so the 7-col grid never overflows. ──────── */
@media (max-width: 24rem) {
  .shell {
    padding: var(--space-2);
  }
  .booker__main,
  .event-info,
  .panel--centered {
    padding: var(--space-3);
  }
  .panel__title {
    font-size: 1.4rem;
  }
}

/* ── International phone input (doc 58 §4) ─────────────────────────── */
.phone-input {
  position: relative;
  display: flex;
  align-items: stretch;
}
.phone-input .input {
  flex: 1;
  min-width: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left-width: 1px;
}
.phone-cc {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.7rem;
  min-height: var(--target);
  border: 2px solid var(--border-strong);
  border-right-width: 1px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.phone-cc:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.phone-cc__label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.phone-cc__flag {
  display: inline-flex;
  line-height: 0;
}
.phone-cc__iso {
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}
.phone-cc__dial {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 1rem;
}
.field.has-error .phone-cc {
  border-color: var(--danger);
}
.phone-pop {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: min(20rem, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  padding: 0.5rem;
}
.phone-pop__search {
  width: 100%;
  margin-bottom: 0.4rem;
}
.phone-pop__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 16rem;
  overflow-y: auto;
}
.phone-pop__list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}
.phone-pop__list li:hover,
.phone-pop__list li.chosen {
  background: var(--surface-2);
}
/* Pinned markets first — a subtle divider after the 4th row. */
.phone-pop__list li:nth-child(4) {
  border-bottom: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  margin-bottom: 0.3rem;
}
.phone-pop__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phone-pop__dial {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── Advisor selection (doc 62) — direct-event host picker + none-mode personal-link list ──
   advisor-select renders <button> cards (pick → re-POST /api/route); advisor-none renders
   <a> cards linking to each advisor's personal /:hostSlug/:eventSlug page. */
.advisor-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  max-width: 26rem;
  margin: 1.4rem auto 0;
  text-align: left;
}
.advisor-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.advisor-card:hover,
.advisor-card:focus-visible {
  border-color: var(--accent);
  background: var(--surface-2);
}
/* While a pick POST is in flight, dim the list and swallow further clicks (JS also guards). */
.advisor-list[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}
.advisor-card__name {
  font-weight: 600;
}
.advisor-card__cta {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
