/* Raasta shared stylesheet. Hand-written, no build step.
   Targets Chrome 61 and Safari 12: no :has, container queries, nesting,
   color-mix, dvh, or flex gap (spacing uses margins). Light mode only.
   Tokens and rules: docs/DESIGN.md */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light;

  --ink: #1D2B22;
  --ink-700: #3B4A40;
  --ink-600: #4E5D53;
  --ink-500: #66756B;

  --saffron-700: #E56420;
  --saffron-600: #F57A2F;
  --saffron-500: #FF8C42;
  --saffron-100: #FFE6CC;
  --saffron-50: #FFF5EB;

  --leaf-700: #2D7341;
  --leaf-600: #3D8854;
  --leaf-200: #A2E0B4;

  --sage-50: #F4F8F2;
  --sage-100: #E6EFE2;
  --sage-200: #D3E3CB;
  --sage-400: #8FB57F;

  --chakra-700: #1F3A8A;
  --alert-700: #B91C1C;

  --paper: #FFFFFF;
  --ground: #FBF9F4;
  --line: #E6EFE2;

  --r-field: 14px;
  --r-small: 16px;
  --r-card: 24px;
  --r-card-lg: 34px;
  --r-panel: 44px;
  --r-pill: 999px;

  --shadow-soft: 0 18px 48px -24px rgba(29, 43, 34, 0.22);
  --shadow-small: 0 6px 18px -10px rgba(29, 43, 34, 0.18);
  --glow-lift: 0 22px 52px -22px rgba(45, 115, 65, 0.28);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 240ms;
  --dur-base: 380ms;
  --dur-slow: 520ms;

  --font-display: "Baloo 2", "Baloo Da 2", "Nunito", "Segoe UI", Arial, sans-serif;
  --font-body: "Nunito", "Segoe UI", Roboto, Arial, sans-serif;
  --font-hand: "Caveat", "Nunito", cursive;
  --font-urdu: "Noto Nastaliq Urdu", "Nunito", serif;

  --wrap: 1120px;
  --gutter: 16px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-700);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 768px) { body { font-size: 18px; } }
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.45em;
  text-wrap: balance;
}
h1 { font-size: 2.3rem; font-weight: 800; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.3rem; font-weight: 700; }
@media (min-width: 768px) {
  h1 { font-size: 3.2rem; }
  h2 { font-size: 2.25rem; }
}
.btn, .chip, label, summary, .lp-cat, .site-header nav a { font-family: var(--font-display); }
p { margin: 0 0 1em; }
a { color: var(--leaf-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
[hidden] { display: none !important; }
:root[dir="rtl"] body, [dir="rtl"] { font-family: var(--font-urdu); }
[lang="ur"] h1, [lang="ur"] h2, [lang="ur"] h3, [lang="ur"] p { font-family: var(--font-urdu); }

/* ---------- 3. Accessibility ---------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }
:focus-visible {
  outline: 3px solid var(--leaf-700);
  outline-offset: 2px;
  border-radius: 6px;
}
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- 4. Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.stack > * { margin-top: 0; margin-bottom: 0; }
.stack > * + * { margin-top: 1.1rem; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; list-style: none; padding: 0; margin: 0; }
.cluster > * { margin: 0 10px 10px 0; }
.cluster > *:last-child { margin-right: 0; }
/* Real grids that wrap (CSS grid works on Chrome 61 and Safari 12; grid-gap is the old spelling). */
.grid-2, .grid-3, .grid-auto {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-gap: 20px;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.grid-2 > *, .grid-3 > *, .grid-auto > * { margin: 0; min-width: 0; }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
@media (min-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-gap: 24px; gap: 24px; }
}
.section { padding: 56px 0; position: relative; }
@media (min-width: 768px) { .section { padding: 96px 0; } }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 24px;
  border: 2px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  min-height: 50px;
  background: var(--saffron-700);
  color: #FFFFFF;
  font-size: 1.1875rem; /* 19px bold = WCAG large text, white on #E56420 is 3.2:1 */
  font-weight: 800;
  box-shadow: 0 14px 30px -14px rgba(229, 100, 32, 0.6);
}
.btn-primary:hover { color: #FFFFFF; transform: translateY(-2px); box-shadow: 0 18px 36px -14px rgba(229, 100, 32, 0.7); }
.btn-secondary {
  background: var(--paper);
  color: var(--leaf-700);
  border-color: var(--leaf-700);
}
.btn-secondary:hover { background: var(--sage-50); color: var(--ink); }
.btn-ghost {
  background: transparent;
  color: var(--leaf-700);
  padding-left: 12px;
  padding-right: 12px;
}
.btn-ghost:hover { color: var(--ink); text-decoration: underline; }
.btn-primary:focus-visible, .btn-secondary:focus-visible, .btn-ghost:focus-visible { border-radius: var(--r-pill); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- 6. Surfaces ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 24px;
  box-shadow: var(--shadow-small);
}
@media (min-width: 768px) { .card { padding: 32px; border-radius: var(--r-card-lg); } }
.card-warm {
  background: var(--saffron-50);
  border: 1px solid var(--saffron-100);
  border-radius: var(--r-card);
  padding: 24px;
}
.lift {
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.lift:hover, .lift:focus-within { transform: translateY(-2px); box-shadow: var(--glow-lift); }

.blob {
  position: absolute;
  z-index: -1;
  width: 320px;
  height: 320px;
  border-radius: 46% 54% 58% 42% / 52% 40% 60% 48%;
  background: var(--saffron-50);
  opacity: 0.9;
  pointer-events: none;
}
.blob-sage { background: var(--sage-100); }

/* Wave edges: the section above or below carries the wave in its own colour. */
.wave-top, .wave-bottom {
  display: block;
  width: 100%;
  height: 48px;
  pointer-events: none;
}
.wave-top {
  margin-bottom: -1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 48' preserveAspectRatio='none'%3E%3Cpath d='M0 48V24Q180 0 360 24T720 24T1080 24T1440 24V48Z' fill='%23FBF9F4'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.wave-bottom {
  margin-top: -1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 48' preserveAspectRatio='none'%3E%3Cpath d='M0 0V24Q180 48 360 24T720 24T1080 24T1440 24V0Z' fill='%23F4F8F2'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.wave-top.on-sage, .wave-bottom.on-sage { background-color: transparent; }

/* ---------- 7. Chips and small text ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 16px;
  border: 1px solid var(--sage-200);
  border-radius: var(--r-pill);
  background: var(--paper);
  color: var(--ink-700);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.chip:hover { transform: translateY(-1px); background: var(--sage-50); color: var(--ink); }
.chip[aria-pressed="true"], .chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.text-free { color: var(--leaf-700); font-weight: 800; }
.text-meta { color: var(--ink-500); font-size: 0.95rem; }

/* ---------- 8. Forms ---------- */
.field { margin: 0 0 1.1rem; }
.field > label, .field .field-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--ink);
}
.field .field-hint { display: block; margin-top: 4px; font-size: 0.95rem; color: var(--ink-500); }
.field input:not([type="radio"]):not([type="checkbox"]), .field textarea, .field select {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border: 1.5px solid var(--sage-200);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-600) 50%), linear-gradient(135deg, var(--ink-600) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-500); opacity: 1; }
.field input:not([type="radio"]):not([type="checkbox"]):focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--leaf-600);
  box-shadow: 0 0 0 4px rgba(61, 136, 84, 0.22);
}
.field[data-error] input, .field[data-error] textarea, .field[data-error] select,
.field.is-error input, .field.is-error textarea, .field.is-error select {
  border-color: var(--alert-700);
  box-shadow: 0 0 0 1px var(--alert-700);
}
.field-error {
  display: block;
  margin-top: 6px;
  color: var(--alert-700);
  font-weight: 700;
  font-size: 0.95rem;
}
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; accent-color: var(--leaf-700); }

/* ---------- 9. Stepper (vertical, numbered) ---------- */
.stepper { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.stepper > li {
  position: relative;
  padding: 0 0 22px 60px;
  margin: 0;
}
.stepper > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--sage-400);
  background: var(--paper);
  color: var(--ink-700);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 38px;
  text-align: center;
}
.stepper > li::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 46px;
  bottom: 0;
  width: 2px;
  background: repeating-linear-gradient(to bottom, var(--sage-400) 0 6px, transparent 6px 12px);
}
.stepper > li:last-child::after { display: none; }
.stepper > li.is-done::before {
  background: var(--leaf-200);
  border-color: var(--leaf-600);
  color: var(--ink);
  content: "\2713";
}
.stepper > li.is-done::after { background: var(--leaf-200); }
.stepper > li.is-current::before { border-color: var(--saffron-700); color: var(--ink); box-shadow: 0 0 0 4px var(--saffron-100); }
.stepper .step-title { display: block; font-weight: 800; color: var(--ink); }
.stepper .step-body { display: block; margin-top: 4px; }

/* ---------- 10. Checklist (big tick boxes) ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist > li { margin: 0 0 12px; }
.checklist label {
  display: flex;
  align-items: flex-start;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--paper);
  cursor: pointer;
}
.checklist input[type="checkbox"] {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin: 0 14px 0 0;
  border: 2px solid var(--sage-400);
  border-radius: 9px;
  background: var(--paper);
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  cursor: pointer;
}
.checklist input[type="checkbox"]::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 2px;
  width: 8px;
  height: 15px;
  border-right: 3px solid #FFFFFF;
  border-bottom: 3px solid #FFFFFF;
  transform: rotate(45deg) scale(0);
  transition: transform var(--dur-base) var(--ease-out);
}
.checklist input[type="checkbox"]:checked { background: var(--leaf-600); border-color: var(--leaf-600); }
.checklist input[type="checkbox"]:checked::after { transform: rotate(45deg) scale(1); }
.checklist .item-text { font-size: 1.05rem; color: var(--ink); }
.checklist .item-note { display: block; font-size: 0.95rem; color: var(--ink-500); }

/* ---------- 11. Notices ---------- */
.notice {
  padding: 16px 20px;
  border-radius: var(--r-card);
  border: 1px solid #C9D6EE;
  background: #EEF3FC;
  color: var(--ink-700);
}
.notice strong { color: var(--chakra-700); }
.alert {
  padding: 18px 22px;
  border-radius: var(--r-card);
  border: 1px solid #F3C4C4;
  background: #FDECEC;
  color: var(--ink);
}
.alert strong, .alert .alert-title { color: var(--alert-700); font-weight: 800; }
.alert a { color: var(--alert-700); font-weight: 700; }

/* ---------- 12. Office card, action list, timer ---------- */
.office-card { padding: 22px; }
.office-card h3 { margin-bottom: 4px; }
.office-card .office-meta { color: var(--ink-500); font-size: 0.97rem; margin: 0 0 10px; }
.office-card .cluster { margin-top: 12px; }
.offices-filter {
  gap: 0.75rem 1rem;
  align-items: flex-end;
}
.offices-filter > .btn-secondary {
  min-height: 48px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.offices-filter > * { margin: 0; }
.offices-filter > .field { display: grid; gap: 0.5rem; }
.action-list { list-style: none; margin: 0; padding: 0; }
.action-list > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 56px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.action-list > li:last-child { border-bottom: 0; }
.action-list .action-label { font-weight: 700; color: var(--ink); margin-right: 12px; }
.timer {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--r-small);
  background: var(--sage-50);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

/* ---------- 13. Street of doors ---------- */
.door-street { position: relative; width: 100%; }
.door-street svg { width: 100%; height: auto; }
.door-street .door { transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-slow) var(--ease-out); transform-box: fill-box; transform-origin: left center; }
.door-street .is-dim { opacity: 0.35; }
.door-street .is-chosen .door { transform: perspective(400px) rotateY(-28deg); }
.door-street .is-chosen { opacity: 1; }
.door-street #path { transition: stroke-dashoffset 900ms var(--ease-out); }

/* ---------- 14. Site chrome ---------- */
/* Header rules live in section 21. */
.site-footer {
  margin-top: 64px;
  padding: 40px 0 48px;
  background: var(--sage-50);
  border-top: 1px solid var(--sage-200);
  font-size: 0.95rem;
  color: var(--ink-600);
}
.site-footer a { color: var(--leaf-700); }
.site-footer .footer-disclaimer { max-width: 680px; }

/* Rail: sticky side progress on desktop, plain on mobile. */
.rail { margin: 0 0 24px; }
@media (min-width: 900px) {
  .rail { position: sticky; top: 16px; }
}

/* ---------- 15. Hero helpers ---------- */
.hero { position: relative; overflow: hidden; padding: 40px 0 0; }
.hero-lede { font-size: 1.15rem; max-width: 40em; }

/* ---------- 16. Reduced motion ---------- */
@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;
  }
  .btn-primary:hover, .lift:hover, .chip:hover, .btn:active { transform: none; }
  .door-street .is-chosen .door { transform: none; }
}

/* ---------- 17. Mobile ---------- */
@media (max-width: 767px) {
  .container { padding: 0 16px; }
  .btn { width: 100%; }
  .cluster .btn { width: auto; }
  .blob { width: 220px; height: 220px; }
  .section { padding: 40px 0; }
  .card { border-radius: var(--r-card); }

}

/* ---------- 18. Right to left ---------- */
[dir="rtl"] .stepper > li { padding: 0 60px 22px 0; }
[dir="rtl"] .stepper > li::before { left: auto; right: 0; }
[dir="rtl"] .stepper > li::after { left: auto; right: 20px; }
[dir="rtl"] .checklist input[type="checkbox"] { margin: 0 0 0 14px; }
[dir="rtl"] .checklist input[type="checkbox"]::after { left: auto; right: 8px; }
[dir="rtl"] .cluster > * { margin: 0 0 8px 8px; }
[dir="rtl"] .cluster > *:last-child { margin-left: 0; }
[dir="rtl"] .action-list .action-label { margin-right: 0; margin-left: 12px; }
[dir="rtl"] .field select { background-position: 20px 55%, 14px 55%; padding-right: 14px; padding-left: 36px; }
[dir="rtl"] .skip-link { left: auto; right: 12px; }

/* ---------- 19. Print (A4 friendly) ---------- */
@media print {
  @page { size: A4; margin: 16mm; }
  html, body { background: #FFFFFF; color: #000000; font-size: 11pt; }
  .site-header nav, .site-footer, .skip-link, .btn, .chip, .blob,
  .wave-top, .wave-bottom, .door-street, .no-print { display: none !important; }
  .card, .notice, .alert, .card-warm { box-shadow: none; border: 1px solid #999999; background: #FFFFFF; }
  .checklist label { border: 1px solid #999999; }
  .checklist input[type="checkbox"] { border: 1.5px solid #000000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .checklist input[type="checkbox"]:checked { background: #FFFFFF; }
  .checklist input[type="checkbox"]:checked::after { border-color: #000000; }
  h1, h2, h3 { color: #000000; page-break-after: avoid; }
  a { color: #000000; text-decoration: underline; }
  .card, .office-card, .alert, .notice { page-break-inside: avoid; }
}

/* ---------- 20. Action centre (Worker result page) ---------- */
.mode-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.mode { padding: 14px 0; border-top: 1px solid var(--sage-100); }
.mode:first-child { border-top: 0; }
.mode-label { margin: 0 0 6px; }
.act-h { font-size: 1.1rem; }
.is-blocked { opacity: 0.6; background: var(--sage-50); }
.copy-tray textarea, .field textarea[readonly] { width: 100%; background: var(--sage-50); }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--leaf-700); }
@media print {
  .action-centre, .mode-list { display: none !important; }
}

/* ---------- 20. Design layer v2 (orchestrator, shared by the static site and Worker pages) ---------- */
/* Buttons keep their own colours inside tinted panels (alerts and notices used to leak link colours into buttons) */
a.btn-primary, .alert a.btn-primary, .notice a.btn-primary, .card-warm a.btn-primary { color: #FFFFFF; }
a.btn-secondary, .alert a.btn-secondary, .notice a.btn-secondary { color: var(--leaf-700); }
.alert a.btn-secondary { border-color: var(--alert-700); color: var(--alert-700); background: #FFFFFF; }
.alert a.btn-secondary:hover { background: #FFF5F5; color: var(--alert-700); }
.alert .btn-primary { background: var(--alert-700); box-shadow: 0 14px 30px -14px rgba(185, 28, 28, 0.6); }
.alert .btn-primary:hover { background: #991B1B; }
.alert h1, .alert h2, .alert h3 { color: var(--alert-700); }
.alert p { color: var(--ink-700); }

/* Radios and checkboxes: friendly option pills instead of stretched text boxes */
fieldset { border: 0; padding: 0; margin: 0 0 1.2rem; min-width: 0; }
legend { padding: 0; margin-bottom: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--ink); }
input[type="radio"], input[type="checkbox"] {
  width: 22px; height: 22px; margin: 0 10px 0 0; flex: 0 0 auto;
  accent-color: var(--saffron-700);
}
label > input[type="radio"], label > input[type="checkbox"] { vertical-align: middle; }
fieldset label, .choice {
  display: inline-flex; align-items: center;
  min-height: 48px; padding: 8px 18px 8px 14px; margin: 0 10px 10px 0;
  border: 1.5px solid var(--sage-200); border-radius: 999px; background: var(--paper);
  font-weight: 600; color: var(--ink-700); cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
fieldset label:hover, .choice:hover { border-color: var(--saffron-500); transform: translateY(-1px); }
fieldset label:focus-within, .choice:focus-within { border-color: var(--saffron-700); box-shadow: 0 0 0 4px rgba(255, 140, 66, 0.25); }

/* Language menu: space between the script name and the English name */
.sh-pop-panel li a .sh-muted { margin-left: 0.6em; }
[dir="rtl"] .sh-pop-panel li a .sh-muted { margin-left: 0; margin-right: 0.6em; }

/* Office cards: long emails and phones wrap instead of overflowing */
.office-card, .office-card a { overflow-wrap: anywhere; word-break: break-word; }
.office-card { transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.office-card:hover { transform: translateY(-3px); box-shadow: var(--glow-lift); }

/* Softer, rounder cards and a little more breathing room everywhere */
.card { border-color: transparent; box-shadow: var(--shadow-soft); }
.page { padding-top: 40px; padding-bottom: 72px; }
.stack > * + * { margin-top: 1.4rem; }
.page-lead { font-size: 1.15rem; max-width: 60ch; color: var(--ink-600); }
.chip { font-weight: 600; }

/* Scroll reveal (html.motion is added by JS only on capable devices) */
.motion .reveal { opacity: 0; transform: translateY(22px); transition: opacity 620ms var(--ease-out) var(--d, 0ms), transform 620ms var(--ease-out) var(--d, 0ms); }
.motion .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .motion .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- 21. Site header and footer (shared by static pages and Worker pages) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  box-shadow: 0 1px 0 rgba(29, 43, 34, 0.06), 0 10px 30px -24px rgba(29, 43, 34, 0.35);
}
.sh-bar { display: flex; align-items: center; min-height: 68px; padding-top: 8px; padding-bottom: 8px; }
.sh-logo { display: inline-flex; align-items: center; margin-right: 18px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; letter-spacing: -0.01em; }
.sh-logo:hover { color: var(--ink); }
.sh-logo-mark { margin-right: 10px; transition: transform var(--dur-base) var(--ease-out); }
.sh-logo:hover .sh-logo-mark { transform: rotate(-8deg) scale(1.06); }
.sh-nav { display: none; }
.sh-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; margin-right: 2px;
  border-radius: 999px; text-decoration: none; color: var(--ink-700);
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast);
}
.sh-nav a:hover, .sh-nav a[aria-current="page"] { background: var(--sage-50); color: var(--ink); }
.sh-tools { display: flex; align-items: center; margin-left: auto; }
.sh-tools > * { margin-left: 8px; }
.sh-pop { position: relative; }
.sh-pop > summary { list-style: none; cursor: pointer; }
.sh-pop > summary::-webkit-details-marker { display: none; }
.sh-chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px;
  border-radius: 999px; background: var(--paper); border: 1.5px solid var(--sage-200);
  color: var(--ink-700); font-family: var(--font-display); font-weight: 600; font-size: 0.98rem;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast);
}
.sh-chip svg { margin-right: 6px; flex: 0 0 auto; }
.sh-chip:hover, .sh-pop[open] > .sh-chip { border-color: var(--leaf-600); background: var(--sage-50); }
.sh-chip.is-set { border-color: var(--leaf-600); color: var(--leaf-700); }
.sh-chip-label { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-emergency {
  display: inline-flex; align-items: center; min-height: 44px; padding: 6px 16px; border-radius: 999px;
  background: #FDECEC; color: var(--alert-700); text-decoration: none;
  font-family: var(--font-display); font-weight: 700;
}
.sh-emergency svg { margin-right: 6px; }
.sh-emergency:hover { background: var(--alert-700); color: #FFFFFF; }
.sh-pop-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60;
  width: 300px; max-width: calc(100vw - 24px); margin: 0; padding: 12px; list-style: none;
  background: var(--paper); border-radius: 26px; box-shadow: 0 24px 60px -20px rgba(29, 43, 34, 0.35);
}
.sh-pop-panel li a {
  display: flex; align-items: baseline; justify-content: space-between; min-height: 44px; padding: 8px 14px;
  border-radius: 16px; text-decoration: none; color: var(--ink); font-size: 1.05rem;
}
.sh-pop-panel li a .sh-muted { margin-left: 0.8em; font-size: 0.9rem; color: var(--ink-500); }
.sh-pop-panel li a:hover { background: var(--sage-50); }
.sh-pop-panel li a[aria-current="true"] { background: var(--saffron-50); font-weight: 700; }
.sh-lang .sh-pop-panel { width: 280px; max-height: 70vh; overflow: auto; }
.sh-loc-form { padding: 10px 8px 4px; }
.sh-loc-form .field { margin-bottom: 12px; }
.sh-loc-form .btn { width: 100%; }
.sh-loc-form .sh-hint { margin: 0 0 12px; font-size: 0.95rem; color: var(--ink-600); }
.sh-locate {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; margin: 0 0 14px;
  border: 0; border-radius: 999px; background: var(--sage-50); color: var(--leaf-700); cursor: pointer;
  font: inherit; font-family: var(--font-display); font-weight: 700;
}
.sh-locate svg { margin-right: 8px; }
.sh-locate:hover { background: var(--sage-100); }
.sh-locate[disabled] { opacity: 0.6; cursor: progress; }
.sh-or { display: block; text-align: center; margin: 0 0 10px; font-size: 0.9rem; color: var(--ink-500); }
[data-locate-status]:not(:empty) { display: block; margin: -6px 0 12px; font-size: 0.92rem; color: var(--ink-600); }
.sh-menu { display: block; }
@media (max-width: 559px) {
  .sh-chip-label { display: none; }
  .sh-chip svg, .sh-emergency svg { margin-right: 0; }
  .sh-emergency span { display: none; }
  .sh-logo { font-size: 1.25rem; }
}
@media (min-width: 900px) { .sh-nav { display: flex; } .sh-menu { display: none; } }

.site-footer { margin-top: 0; padding: 40px 0 48px; background: var(--sage-50); color: var(--ink-600); font-size: 0.95rem; }
.site-footer a { color: var(--ink-700); }
.sh-footer-nav a { display: inline-flex; min-height: 40px; align-items: center; margin-right: 18px; }
.sh-attrib { font-size: 0.88rem; }

/* ---------- 22. Answer cards and unit inputs (shared) ---------- */
.opts { display: grid; grid-template-columns: minmax(0, 1fr); grid-gap: 10px; gap: 10px; }
@media (min-width: 560px) { .opts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .opts-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.opt { display: block; position: relative; cursor: pointer; margin: 0; padding: 0; border: 0; background: none; min-height: 0; }
fieldset .opt { display: block; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 0; background: none; }
fieldset .opt:hover { transform: none; }
.opt-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.opt-face {
  display: flex; align-items: center;
  min-height: 60px; padding: 12px 16px;
  border-radius: 22px; border: 2px solid var(--sage-100); background: var(--paper);
  font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.opt:hover .opt-face { border-color: var(--saffron-500); transform: translateY(-2px); }
.opt-dot {
  flex: 0 0 auto; position: relative; width: 22px; height: 22px; margin-right: 12px;
  border-radius: 50%; border: 2px solid var(--sage-400); background: var(--paper);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.opt-dot::after { content: ""; position: absolute; left: 4px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--saffron-700); transform: scale(0); transition: transform 260ms var(--ease-out); }
.opt-input:checked + .opt-face { border-color: var(--saffron-700); background: var(--saffron-50); }
.opt-input:checked + .opt-face .opt-dot { border-color: var(--saffron-700); }
.opt-input:checked + .opt-face .opt-dot::after { transform: scale(1); }
.opt-input:focus-visible + .opt-face { box-shadow: 0 0 0 4px rgba(61, 136, 84, 0.3); }
.opt-input:focus + .opt-face { box-shadow: 0 0 0 4px rgba(61, 136, 84, 0.22); }
.opt-hint { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.9rem; color: var(--ink-500); margin-left: 8px; }

/* Checkbox cards (legal aid screener etc.) */
.opt-check .opt-dot { border-radius: 8px; }
.opt-check .opt-dot::after { left: 5px; top: 1px; width: 7px; height: 12px; border-radius: 0; background: none; border: solid #FFFFFF; border-width: 0 3px 3px 0; transform: rotate(45deg) scale(0); }
.opt-check .opt-input:checked + .opt-face .opt-dot { background: var(--saffron-700); }
.opt-check .opt-input:checked + .opt-face .opt-dot::after { transform: rotate(45deg) scale(1); }

/* ---------- Inputs with units ---------- */
.q-input { position: relative; display: flex; align-items: center; }
.q-input input { flex: 1 1 auto; font-size: 1.25rem !important; min-height: 58px !important; border-radius: 20px !important; }
.q-input.has-pre input { padding-left: 44px !important; }
.q-input.has-post input { padding-right: 84px !important; }
.q-pre, .q-post { position: absolute; top: 50%; transform: translateY(-50%); color: var(--ink-500); font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; pointer-events: none; }
.q-pre { left: 18px; }
.q-post { right: 18px; }
.q-textarea {
  display: block; width: 100%; min-height: 150px; padding: 16px 18px; border: 2px solid var(--sage-100); border-radius: 24px;
  font: inherit; font-size: 1.12rem; color: var(--ink); background: var(--paper); resize: vertical; outline: none;
}
.q-textarea:focus { border-color: var(--saffron-600); box-shadow: 0 0 0 4px rgba(255, 140, 66, 0.22); }

