/* ============================================================
   Formo — design system layer
   Ported 1:1 from "Formo Design System.dc.html".
   Component styles reference tokens only — no raw hex,
   no raw spacing/type values below the token block.
   ============================================================ */

:root {
  /* --- Blue ramp (primary) --- */
  --fo-blue-900: #0A2A4E;
  --fo-blue-800: #0F3A6B;
  --fo-blue-700: #14508F;
  --fo-blue-600: #1C64B0;
  --fo-blue-400: #4A93DC;
  --fo-blue-200: #A8C6E8;
  --fo-blue-100: #DCEBFA;
  --fo-blue-50:  #F1F7FD;

  /* --- Accent ramp (CTA / highlight) --- */
  --fo-accent-700: #B85A18;
  --fo-accent-600: #D2691E;
  --fo-accent-300: #F0A868;
  --fo-accent-50:  #FDF0E4;
  --fo-accent-ink: #8A4A10;

  /* --- Neutral ramp --- */
  --fo-ink:      #0F1519;
  --fo-gray-700: #3D4A55;
  --fo-gray-500: #6B7A88;
  --fo-gray-400: #A8B4BF;
  --fo-border:   #D9E0E6;
  --fo-gray-100: #EFF3F6;
  --fo-surface:  #FFFFFF;

  /* --- Semantic --- */
  --fo-success: #1E7A55;
  --fo-success-surface: #E6F3EC;
  --fo-success-ink: #155E40;
  --fo-warning: #8A6100;
  --fo-warning-surface: #FBF0D9;
  --fo-warning-ink: #6B4B00;
  --fo-danger: #B32D22;
  --fo-danger-surface: #FDF1F0;
  --fo-danger-border: #E8B4AF;
  --fo-danger-ink: #8F231A;
  --fo-escrow: #5B4BC4;
  --fo-escrow-surface: #EDEAFB;
  --fo-escrow-ink: #3D2FA8;

  /* --- Semantic aliases: components use THESE --- */
  --color-bg: var(--fo-blue-50);
  --color-surface: var(--fo-surface);
  --color-surface-sunken: var(--fo-gray-100);
  --color-surface-tint: var(--fo-blue-50);
  --color-surface-inverse: var(--fo-blue-900);
  --color-text: var(--fo-ink);
  --color-text-secondary: var(--fo-gray-700);
  --color-text-muted: var(--fo-gray-500);
  --color-text-disabled: var(--fo-gray-400);
  --color-text-on-dark: var(--fo-surface);
  --color-text-on-dark-muted: var(--fo-blue-200);
  --color-border: var(--fo-border);
  --color-border-strong: var(--fo-gray-400);
  --color-border-accent: var(--fo-blue-200);
  --color-primary: var(--fo-blue-700);
  --color-primary-hover: var(--fo-blue-800);
  --color-primary-ink: var(--fo-blue-800);
  --color-accent: var(--fo-accent-600);
  --color-accent-hover: var(--fo-accent-700);
  --color-focus: var(--fo-blue-700);
  --color-focus-ring: rgba(20, 80, 143, 0.30);
  --color-accent-ring: rgba(210, 105, 30, 0.35);

  /* --- Spacing: 8px scale --- */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* --- Radius --- */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  /* --- Type --- */
  --font-sans: "Noto Sans Georgian", "Noto Sans", system-ui, sans-serif;
  --weight-regular: 400;
  --weight-semibold: 600;
  --text-display: clamp(30px, 4.4vw, 44px);
  --text-h1: clamp(24px, 3vw, 30px);
  --text-h2: 22px;
  --text-h3: 17px;
  --text-body-lg: 17px;
  --text-body: 16px;
  --text-small: 14px;
  --text-caption: 12px;
  --text-label: 13px;
  --text-numeric-lg: 26px;
  --text-numeric: 19px;
  --leading-tight: 1.12;
  --leading-heading: 1.28;
  --leading-snug: 1.4;
  --leading-body: 1.55;
  --tracking-display: -0.03em;
  --tracking-heading: -0.02em;
  --tracking-tight: -0.01em;

  /* --- Elevation --- */
  --elev-1: 0 1px 2px rgba(11, 42, 78, 0.06), 0 1px 3px rgba(11, 42, 78, 0.08);
  --elev-2: 0 2px 4px rgba(11, 42, 78, 0.06), 0 6px 16px rgba(11, 42, 78, 0.08);
  --elev-3: 0 12px 32px rgba(11, 42, 78, 0.14);
  --elev-sheet: 0 -8px 28px rgba(11, 42, 78, 0.16);

  /* --- Sizing primitives --- */
  --tap-min: 44px;      /* every interactive row */
  --tap-primary: 48px;  /* primary actions */
  --tap-sticky: 52px;   /* sticky mobile footer */
  --control-h: 46px;
  --border-1: 1px;
  --border-2: 2px;
  --focus-ring-w: 3px;
  --container-max: 1120px;
  --container-wide: 1400px;
  --sidebar-w: 288px;
  --gutter: var(--space-4);
  --speed: 0.15s;
}

@media (min-width: 768px) {
  :root { --gutter: var(--space-5); }
}
@media (min-width: 1024px) {
  :root { --gutter: var(--space-6); }
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--fo-blue-600); text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible {
  outline: var(--border-2) solid var(--color-focus);
  outline-offset: var(--space-1);
}
[hidden] { display: none !important; }

/* Georgian long-string safety: never truncate an action label */
.fo-wrap { overflow-wrap: anywhere; }

@keyframes fo-shimmer { 0% { background-position: -320px 0; } 100% { background-position: 320px 0; } }
@keyframes fo-spin { to { transform: rotate(360deg); } }
@keyframes fo-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes fo-rise { from { transform: translateY(var(--space-4)); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fo-unlock { 0% { transform: scale(0.985); box-shadow: 0 0 0 var(--focus-ring-w) var(--color-accent-ring); } 100% { transform: none; box-shadow: var(--elev-1); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============================================================
   Type utilities
   ============================================================ */
.t-display { font-size: var(--text-display); font-weight: var(--weight-semibold); line-height: var(--leading-tight); letter-spacing: var(--tracking-display); }
.t-h1 { font-size: var(--text-h1); font-weight: var(--weight-semibold); line-height: 1.2; letter-spacing: var(--tracking-heading); }
.t-h2 { font-size: var(--text-h2); font-weight: var(--weight-semibold); line-height: 1.3; letter-spacing: var(--tracking-tight); }
.t-h3 { font-size: var(--text-h3); font-weight: var(--weight-semibold); line-height: var(--leading-snug); }
.t-body { font-size: var(--text-body); line-height: var(--leading-body); }
.t-small { font-size: var(--text-small); line-height: 1.5; }
.t-caption { font-size: var(--text-caption); line-height: 1.45; color: var(--color-text-muted); }
.t-label { font-size: var(--text-label); font-weight: var(--weight-semibold); color: var(--color-text-muted); }
.t-muted { color: var(--color-text-muted); }
.t-secondary { color: var(--color-text-secondary); }
.num { font-variant-numeric: tabular-nums; }
.money { font-variant-numeric: tabular-nums; font-weight: var(--weight-semibold); }

/* ============================================================
   Layout
   ============================================================ */
.container { width: 100%; max-width: var(--container-max); margin-inline: auto; padding-inline: var(--gutter); }
.container--wide { max-width: var(--container-wide); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.row--wrap { flex-wrap: wrap; }
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); } .gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); } .gap-5 { gap: var(--space-5); } .gap-6 { gap: var(--space-6); }
.gap-7 { gap: var(--space-7); }
.grow { flex: 1; min-width: 0; }
.spread { justify-content: space-between; }
.center { justify-content: center; }
.sr-only {
  position: absolute; 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-4); top: calc(var(--space-4) * -4);
  background: var(--color-surface); color: var(--color-primary);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  box-shadow: var(--elev-2); z-index: 100; transition: top var(--speed);
}
.skip-link:focus { top: var(--space-4); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap-min);
  padding: var(--space-3) var(--space-5);
  border: var(--border-1) solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  cursor: pointer;
  text-align: center;
  overflow-wrap: anywhere;
  transition: background var(--speed), border-color var(--speed), color var(--speed);
}
.btn--accent { background: var(--color-accent); color: var(--color-text-on-dark); min-height: var(--tap-primary); font-size: var(--text-body); box-shadow: var(--elev-1); }
.btn--accent:hover { background: var(--color-accent-hover); }
.btn--accent:focus-visible { box-shadow: 0 0 0 var(--focus-ring-w) var(--color-accent-ring); }
.btn--primary { background: var(--color-primary); color: var(--color-text-on-dark); }
.btn--primary:hover { background: var(--color-primary-hover); }
.btn--secondary { background: var(--color-surface); color: var(--color-primary); border-color: var(--color-border-accent); }
.btn--secondary:hover { background: var(--color-surface-tint); }
.btn--ghost { background: transparent; color: var(--color-primary); padding-inline: var(--space-4); }
.btn--ghost:hover { background: var(--color-surface-sunken); }
.btn--danger { background: var(--color-surface); color: var(--fo-danger); border-color: var(--fo-danger-border); }
.btn--danger:hover { background: var(--fo-danger-surface); }
.btn--onDark { background: var(--color-surface); color: var(--fo-blue-900); }
.btn--onDark:hover { background: var(--fo-blue-100); }
.btn--sm { min-height: 36px; padding: var(--space-2) var(--space-3); font-size: var(--text-label); font-weight: var(--weight-regular); }
.btn--lg { min-height: var(--tap-sticky); font-size: var(--text-body-lg); padding-inline: var(--space-6); }
.btn--block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--color-surface-sunken); color: var(--color-text-disabled);
  border-color: transparent; cursor: not-allowed; box-shadow: none;
}
.btn__spinner {
  width: var(--space-4); height: var(--space-4); flex: none;
  border: var(--border-2) solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--color-text-on-dark);
  border-radius: var(--radius-pill);
  animation: fo-spin 0.7s linear infinite;
}
.btn.is-loading { opacity: 0.85; pointer-events: none; }

/* ============================================================
   Inputs
   ============================================================ */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field__label { font-size: var(--text-small); font-weight: var(--weight-semibold); }
.field__hint { font-size: var(--text-caption); color: var(--color-text-muted); }
.field__error { font-size: var(--text-caption); color: var(--fo-danger); font-weight: 500; }
.input, .textarea {
  width: 100%;
  min-height: var(--control-h);
  padding: var(--space-3) var(--space-4);
  border: var(--border-1) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: var(--text-body);
}
.textarea { min-height: calc(var(--control-h) * 2); resize: vertical; line-height: var(--leading-body); }
.input:focus-visible, .textarea:focus-visible {
  outline: none; border-color: var(--fo-blue-400);
  box-shadow: 0 0 0 var(--focus-ring-w) var(--color-focus-ring);
}
.input--error { border-color: var(--fo-danger); background: var(--fo-danger-surface); }
.input-group {
  display: flex; align-items: stretch;
  border: var(--border-1) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
}
.input-group:focus-within { border-color: var(--fo-blue-400); box-shadow: 0 0 0 var(--focus-ring-w) var(--color-focus-ring); }
.input-group .input { border: 0; box-shadow: none; }
.input-group .input:focus-visible { box-shadow: none; }
.input-group__prefix, .input-group__suffix {
  display: flex; align-items: center;
  padding-inline: var(--space-4);
  background: var(--color-surface-tint);
  font-size: var(--text-body);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
  flex: none;
}
.input-group__prefix { border-right: var(--border-1) solid var(--color-border); }
.input-group__suffix { border-left: var(--border-1) solid var(--color-border); font-weight: var(--weight-semibold); color: var(--color-text); }
.switch {
  width: calc(var(--space-5) + var(--space-4)); height: var(--space-5) ;
  border-radius: var(--radius-pill); background: var(--color-border-strong);
  padding: var(--space-1); display: flex; flex: none; border: 0; cursor: pointer;
  transition: background var(--speed);
}
.switch__knob { width: var(--space-4); height: var(--space-4); border-radius: var(--radius-pill); background: var(--color-surface); transition: transform var(--speed); }
.switch[aria-checked="true"] { background: var(--color-primary); }
.switch[aria-checked="true"] .switch__knob { transform: translateX(var(--space-5)); }

/* Dropzone + file rows */
.dropzone {
  border: var(--border-2) dashed var(--color-border-accent);
  background: var(--color-surface-tint);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-4);
  text-align: center;
}
.dropzone.is-dragover { border-color: var(--color-primary); background: var(--fo-blue-100); }
.file-row {
  display: flex; gap: var(--space-3); align-items: center;
  border: var(--border-1) solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-3);
}
.file-row--error { border-color: var(--fo-danger-border); background: var(--fo-danger-surface); }
.file-row__type {
  width: calc(var(--space-7) - var(--space-2)); height: calc(var(--space-7) - var(--space-2));
  border-radius: var(--radius-md); flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--fo-blue-100); color: var(--color-primary-ink);
  font-size: var(--text-caption); font-weight: var(--weight-semibold);
}
.progress { height: var(--space-1); background: var(--color-surface-sunken); border-radius: var(--radius-pill); overflow: hidden; }
.progress__bar { height: 100%; background: var(--color-primary); }

/* ============================================================
   Chips, badges, filters, segmented
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 38px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--color-primary); color: var(--color-text-on-dark);
  border: var(--border-1) solid transparent;
  font-size: var(--text-small); font-weight: 500; cursor: pointer;
}
.chip--removable { padding-right: var(--space-2); }
.chip__x {
  width: var(--space-5); height: var(--space-5); flex: none;
  border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-label);
}
.chip--outline { background: var(--color-surface); color: var(--color-text-secondary); border-color: var(--color-border); }
.chip--outline[aria-pressed="true"] { background: var(--color-primary); color: var(--color-text-on-dark); border-color: transparent; }
.chip--dashed { background: transparent; color: var(--color-text-secondary); border: var(--border-1) dashed var(--color-border-strong); }

.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-label); font-weight: 500;
  background: var(--color-surface-sunken); color: var(--color-text-secondary);
}
.badge--tech { background: var(--fo-blue-100); color: var(--color-primary-ink); }
.badge--service { background: var(--fo-accent-50); color: var(--fo-accent-ink); }
.badge--verified { background: var(--fo-success-surface); color: var(--fo-success-ink); font-weight: var(--weight-semibold); }

.checkrow {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer; width: 100%; text-align: left;
  background: transparent; border: 0;
  font-size: var(--text-body);
}
.checkrow:hover { background: var(--color-surface-sunken); }
.checkrow--child { padding-left: calc(var(--space-6) + var(--space-1)); }
.checkrow[aria-checked="true"] { background: var(--color-surface-tint); font-weight: var(--weight-semibold); }
.checkrow[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.checkrow__box {
  width: var(--space-5); height: var(--space-5); flex: none;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--color-border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-on-dark); font-size: var(--text-label);
}
.checkrow[aria-checked="true"] .checkrow__box { background: var(--color-primary); border-color: var(--color-primary); }
.checkrow__count { font-size: var(--text-label); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); padding: var(--space-1); background: var(--color-surface-sunken); border-radius: var(--radius-lg); }
.segmented__item {
  padding: var(--space-2) var(--space-3); min-height: 38px;
  border: 0; background: transparent; border-radius: var(--radius-md);
  font-size: var(--text-small); color: var(--color-text-secondary); cursor: pointer;
}
.segmented__item[aria-selected="true"] { background: var(--color-surface); color: var(--color-text); font-weight: var(--weight-semibold); box-shadow: var(--elev-1); }

.slider { width: 100%; accent-color: var(--color-primary); min-height: var(--tap-min); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--color-surface);
  border: var(--border-1) solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-1);
}
.card--pad { padding: var(--space-4); }
.card--inverse { background: var(--color-surface-inverse); color: var(--color-text-on-dark); border-color: transparent; }

/* Provider card */
.pcard { position: relative; display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); }
.pcard:hover, .pcard.is-active { border-color: var(--color-border-accent); box-shadow: var(--elev-2); }
.pcard__avatar {
  width: calc(var(--space-7) + var(--space-1)); height: calc(var(--space-7) + var(--space-1));
  flex: none; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  background: var(--fo-blue-800); color: var(--color-text-on-dark);
  font-size: var(--text-h3); font-weight: var(--weight-semibold);
}
.pcard__avatar--masked { background: var(--color-surface-sunken); color: var(--color-text-disabled); }
.pcard__meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: var(--text-small); color: var(--color-text-secondary); }
.pcard__foot {
  border-top: var(--border-1) solid var(--color-surface-sunken);
  padding-top: var(--space-3);
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  align-items: center; justify-content: space-between;
}
.pcard.is-revealed { animation: fo-unlock 0.45s ease-out both; }

/* NEW: redaction mask — stands in for withheld identity/price */
.mask { display: inline-block; height: var(--space-4); border-radius: var(--radius-xs); background: var(--color-border); vertical-align: middle; }
.mask--name { width: 104px; }
.mask--short { width: 38px; background: var(--color-surface-sunken); }
.mask--price { height: var(--space-5); width: 78px; }
.lock-tag {
  position: absolute; top: var(--space-3); right: var(--space-3);
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill);
  background: var(--color-surface-sunken); color: var(--color-text-secondary);
  font-size: var(--text-caption); font-weight: var(--weight-semibold);
}

/* ============================================================
   Escrow / status pills
   ============================================================ */
.pill {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill);
  font-size: var(--text-small); font-weight: var(--weight-semibold);
  background: var(--color-surface-sunken); color: var(--color-text-secondary);
}
.pill__dot { width: var(--space-2); height: var(--space-2); border-radius: var(--radius-pill); background: currentColor; flex: none; }
.pill--funded { background: var(--fo-escrow-surface); color: var(--fo-escrow-ink); }
.pill--progress { background: var(--fo-blue-100); color: var(--color-primary-ink); }
.pill--progress .pill__dot { animation: fo-pulse 1.8s ease-in-out infinite; }
.pill--pending { background: var(--fo-warning-surface); color: var(--fo-warning-ink); }
.pill--released { background: var(--fo-success-surface); color: var(--fo-success-ink); }
.pill--refunded { background: var(--color-surface-sunken); color: var(--color-text-secondary); }
.pill--disputed { background: var(--fo-danger-surface); color: var(--fo-danger-ink); }

/* ============================================================
   Feedback: skeleton, empty, alert, toast, modal, sheet
   ============================================================ */
.skel {
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, var(--color-surface-sunken) 25%, #F8FAFC 50%, var(--color-surface-sunken) 75%);
  background-size: 320px 100%;
  animation: fo-shimmer 1.2s linear infinite;
  display: block;
}
.skel--avatar { width: var(--space-7); height: var(--space-7); border-radius: var(--radius-lg); flex: none; }
.skel--line { height: var(--space-3); }
.skel--title { height: var(--space-4); width: 60%; }

.empty { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; padding: var(--space-6) var(--space-4); }
.empty__icon {
  width: var(--space-7); height: var(--space-7); border-radius: var(--radius-lg);
  background: var(--color-surface-tint); color: var(--fo-blue-400);
  display: flex; align-items: center; justify-content: center; font-size: var(--text-h2);
}
.alert {
  display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: var(--border-1) solid var(--color-border);
  background: var(--color-surface);
}
.alert--error { background: var(--fo-danger-surface); border-color: var(--fo-danger-border); }
.alert--info { background: var(--fo-escrow-surface); border-color: transparent; color: var(--fo-escrow-ink); }
.alert__icon {
  width: var(--space-5); height: var(--space-5); flex: none;
  border-radius: var(--radius-pill); background: var(--fo-danger);
  color: var(--color-text-on-dark); font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  display: flex; align-items: center; justify-content: center;
}

.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10, 42, 78, 0.55);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
@media (min-width: 768px) {
  .scrim { align-items: center; padding: var(--space-5); }
}
.modal {
  width: 100%; max-width: 420px;
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--elev-3);
  padding: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-4);
  max-height: 92vh; overflow-y: auto;
  animation: fo-rise 0.22s ease-out both;
}
@media (min-width: 768px) { .modal { border-radius: var(--radius-xl); } }
.modal--wide { max-width: 520px; }
.modal__close {
  width: var(--tap-min); height: var(--tap-min); flex: none;
  border: 0; background: transparent; color: var(--color-text-muted);
  font-size: var(--text-h2); cursor: pointer; border-radius: var(--radius-md);
}
.modal__close:hover { background: var(--color-surface-sunken); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--space-7) + var(--space-5)); z-index: 80;
  background: var(--fo-blue-900); color: var(--color-text-on-dark);
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-pill);
  box-shadow: var(--elev-3); font-size: var(--text-small);
  animation: fo-rise 0.2s ease-out both;
}

/* ============================================================
   NEW: app chrome — appbar, searchbar, langswitch
   ============================================================ */
.appbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--color-surface);
  border-bottom: var(--border-1) solid var(--color-border);
}
.appbar--inverse { background: var(--fo-blue-900); border-bottom-color: transparent; }
.appbar__inner { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3) var(--space-4); min-height: calc(var(--space-8) + var(--space-1)); padding-block: var(--space-2); }
@media (max-width: 767px) {
  .appbar__inner > .searchbar { order: 5; flex-basis: 100%; }
}
.wordmark { font-size: var(--text-h2); font-weight: 700; letter-spacing: var(--tracking-display); line-height: 1; color: var(--color-primary); }
.appbar--inverse .wordmark { color: var(--color-text-on-dark); }
.langswitch { display: flex; gap: var(--space-1); padding: var(--space-1); border-radius: var(--radius-pill); background: var(--color-surface-sunken); flex: none; }
.appbar--inverse .langswitch { background: rgba(255, 255, 255, 0.10); }
.langswitch__btn {
  min-height: 36px; padding: var(--space-1) var(--space-3);
  border: 0; background: transparent; border-radius: var(--radius-pill);
  font-size: var(--text-label); color: var(--color-text-secondary); cursor: pointer;
}
.appbar--inverse .langswitch__btn { color: var(--color-text-on-dark-muted); }
.langswitch__btn[aria-pressed="true"] { background: var(--color-primary); color: var(--color-text-on-dark); font-weight: var(--weight-semibold); }

.searchbar {
  display: flex; align-items: stretch; gap: var(--space-2);
  background: var(--color-surface); border-radius: var(--radius-lg);
  border: var(--border-1) solid var(--color-border);
  box-shadow: var(--elev-1); padding: var(--space-2);
  flex-wrap: wrap;
}
.searchbar .input, .searchbar .select { border: 0; box-shadow: none; background: transparent; }
.searchbar__cell { display: flex; align-items: center; flex: 1 1 180px; min-width: 0; }
.searchbar__cell + .searchbar__cell { border-left: var(--border-1) solid var(--color-border); }
@media (max-width: 767px) {
  .searchbar__cell + .searchbar__cell { border-left: 0; border-top: var(--border-1) solid var(--color-border); }
  .searchbar { flex-direction: column; }
}

/* NEW: persistent unlock bar (non-blocking) */
.unlockbar {
  position: sticky; bottom: 0; z-index: 45;
  background: var(--fo-blue-900); color: var(--color-text-on-dark);
  padding: var(--space-3) var(--gutter);
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  align-items: center; justify-content: space-between;
  box-shadow: var(--elev-sheet);
}
/* NEW: inline unlock interstitial, injected after result 3 */
.unlock-inline {
  border: var(--border-1) dashed var(--color-border-accent);
  background: var(--color-surface-tint);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-3);
  align-items: flex-start;
}

/* ============================================================
   NEW: map + mobile bottom sheet
   ============================================================ */
.maplayout { display: grid; grid-template-columns: 1fr; }
@media (min-width: 1024px) {
  .maplayout {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 0;
    height: calc(100vh - (var(--space-8) + var(--space-1)));
  }
  .maplayout__filters, .maplayout__results { overflow-y: auto; }
  .maplayout__map { position: sticky; top: 0; height: 100%; }
}
.mapcanvas { width: 100%; height: 100%; min-height: 0; background: var(--fo-blue-100); position: relative; z-index: 0; }
.leaflet-container { font-family: var(--font-sans); background: var(--fo-blue-100); z-index: 0; }

.pin {
  display: flex; align-items: center; justify-content: center;
  width: var(--space-5); height: var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--color-primary); color: var(--color-text-on-dark);
  border: var(--border-2) solid var(--color-surface);
  box-shadow: var(--elev-1);
  font-size: var(--text-caption); font-weight: var(--weight-semibold);
}
.pin.is-active { background: var(--color-accent); transform: scale(1.25); z-index: 500; }
/* fuzzy radius stands in for a withheld exact address */
.pin--fuzzy { background: rgba(20, 80, 143, 0.18); border: var(--border-1) dashed var(--fo-blue-600); }

.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--elev-sheet);
  display: flex; flex-direction: column;
  transition: height 0.24s ease;
  overflow: hidden;
}
.sheet[data-snap="peek"] { height: 132px; }
.sheet[data-snap="half"] { height: 58%; }
.sheet[data-snap="full"] { height: calc(100% - var(--space-7)); }
.sheet__grip { display: flex; justify-content: center; padding: var(--space-2); flex: none; cursor: grab; }
.sheet__grip span { width: var(--space-6); height: var(--space-1); border-radius: var(--radius-pill); background: var(--color-border-strong); }
.sheet__head { padding: 0 var(--space-4) var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; justify-content: space-between; flex: none; }
.sheet__body { overflow-y: auto; min-height: 0; padding: 0 var(--space-4) var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }
.fab {
  position: absolute; z-index: 25; right: var(--space-4);
  min-height: var(--tap-min); padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill); border: var(--border-1) solid var(--color-border);
  background: var(--color-surface); color: var(--color-text);
  font-size: var(--text-small); font-weight: var(--weight-semibold);
  box-shadow: var(--elev-2); cursor: pointer;
}

/* ============================================================
   Landing-specific: hero, doorway, steps, stats
   ============================================================ */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--fo-blue-900); color: var(--color-text-on-dark);
  padding-block: var(--space-8) var(--space-7);
}
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media image-slot { width: 100%; height: 100%; }
/* scrim keeps AA contrast over any dropped photo; click-through so the slot stays fillable */
.hero__scrim {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(100deg, rgba(10, 42, 78, 0.94) 6%, rgba(10, 42, 78, 0.82) 44%, rgba(10, 42, 78, 0.34) 100%),
    linear-gradient(0deg, rgba(10, 42, 78, 0.55) 0%, rgba(10, 42, 78, 0) 34%);
}
/* content sits above the slot but must not swallow its drop / hover controls */
.hero__grid { pointer-events: none; }
.hero__grid button, .hero__grid a, .hero__grid input { pointer-events: auto; }
.hero__grid { display: grid; gap: var(--space-6); align-items: end; }
@media (min-width: 1024px) {
  .hero { padding-block: var(--space-9) var(--space-8); }
  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-7); }
}
/* keep the slot's own placeholder + credit corner legible: no heavy scrim there */
.hero__media image-slot { width: 100%; height: 100%; }

/* NEW: stat strip — replaces the hero trust card */
.statstrip {
  display: grid; gap: var(--space-4) var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  padding-top: var(--space-5);
  border-top: var(--border-1) solid rgba(255, 255, 255, 0.18);
}

/* NEW: doorway card — the two-door entry choice */
.door {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-5); border-radius: var(--radius-lg);
  background: var(--color-surface); border: var(--border-1) solid var(--color-border);
  box-shadow: var(--elev-1); text-align: left; cursor: pointer;
  transition: box-shadow var(--speed), border-color var(--speed), transform var(--speed);
}
.door:hover { box-shadow: var(--elev-2); border-color: var(--color-border-accent); transform: translateY(-2px); }
.door--accent { border-color: var(--fo-accent-300); }
.door__kicker { font-size: var(--text-label); font-weight: var(--weight-semibold); color: var(--color-text-muted); }

/* NEW: numbered step */
.step { display: flex; flex-direction: column; gap: var(--space-2); }
.step__n {
  width: var(--space-6); height: var(--space-6); border-radius: var(--radius-pill);
  background: var(--fo-blue-100); color: var(--color-primary-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-small); font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}
/* NEW: stat block */
.stat { display: flex; flex-direction: column; gap: var(--space-1); }
.stat__value { font-size: var(--text-numeric-lg); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; letter-spacing: var(--tracking-tight); }
.stat__label { font-size: var(--text-small); color: var(--color-text-on-dark-muted); }

.autogrid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.autogrid--wide { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.section { padding-block: var(--space-7); }
@media (min-width: 1024px) { .section { padding-block: var(--space-8); } }
.divider { height: var(--border-1); background: var(--color-border); border: 0; }
