/* ============================================================
   Sinora — Rehberli Web-App (Guided Web-App)
   UI v2 visual rebuild — LOCAL PREVIEW ONLY. Not a production
   stylesheet. Frozen contract:
   G:/SINORA/FIGMA_HANDOFF/SINORA_WEBAPP_UI_V2_20260710/
   (01_UI_VISUAL_CONTRACT.md §-references below). Tokens reused
   verbatim from the Session 01/02 :root; v2 tokens additive only.
   ============================================================ */

/* Canonical Persian @font-face — paths from fa/fa-rtl.css, no duplication */
@font-face {
  font-family: "w_Ray Extra Black";
  src: url("../fa/fonts/w_Ray Extra Black.ttf") format("truetype");
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IranSans";
  src: url("../fa/fonts/iran-sans.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IranSans";
  src: url("../fa/fonts/IRAN-Sans-Bold.ttf") format("truetype");
  font-weight: 600 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Parastoo";
  src: url("../fa/fonts/Parastoo-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Parastoo";
  src: url("../fa/fonts/Parastoo-Medium.ttf") format("truetype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Parastoo";
  src: url("../fa/fonts/Parastoo-SemiBold.ttf") format("truetype");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Parastoo";
  src: url("../fa/fonts/Parastoo-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --bg-primary: #020712;
  --bg-secondary: #050d1a;
  --bg-card: #081225;
  --accent-gold: #d2ab67;
  --accent-gold-hover: #f3d18c;
  --accent-gold-dark: #b18843;
  --border-color: rgba(210, 171, 103, 0.15);
  --border-color-glow: rgba(210, 171, 103, 0.4);
  --text-primary: #ffffff;
  --text-secondary: #a2b2c8;
  --text-muted: #5f728c;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 999px;

  --shadow-premium: 0 20px 40px rgba(0, 0, 0, 0.5);
  --shadow-gold-glow: 0 0 25px rgba(210, 171, 103, 0.15);
  --shadow-card: 0 28px 90px rgba(0, 0, 0, 0.42);
  --shadow-btn: 0 12px 30px rgba(215, 168, 78, 0.22);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-micro: 180ms;
  --t-reveal: 320ms;

  --app-max: 460px;
  --app-pad: 20px;
  --nav-h: 74px;

  --chat-bot-bubble: linear-gradient(180deg, rgba(23, 33, 52, 0.82), rgba(14, 22, 38, 0.84));
  --chat-user-bubble: linear-gradient(135deg, #ecd093 0%, #d9b264 55%, #c39a4c 100%);
  --chat-user-text: #2a1d05;

  /* ---- UI v2 tokens (Contract §3.2, additive; 40px space step
     excluded by the 2026-07-10 founder decision — 7 steps only) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --rail-h: 64px;
  --row-h: 48px;
  --offer-row-h: 64px;
  --composer-h: 64px; /* frozen minimum token; not the complete stack */
  --composer-row-h: 48px; /* accessible input/send target row */
  --composer-stack-h: 93px; /* safe full stack: note + gap + row + padding */
  --hero-media-ratio: 4 / 5;

  /* Typography scale (Contract §7 — computed values are binding).
     Only two scales exist: mobile (here) and desktop (≥1024). */
  --fs-display: 26px;
  --fs-h2: 18px;
  --fs-h3: 15px;
  --fs-body: 14px;
  --fs-small: 12.5px;
  --fs-caption: 11px;
  --fs-overline: 10px;

  /* Surface fills (frozen foundations token set) */
  --surface-row: rgba(5, 13, 26, 0.65);
  --surface-row-locked: rgba(5, 13, 26, 0.4);
  --surface-bar-blur: rgba(4, 10, 22, 0.72);
  --surface-nav-blur: rgba(4, 10, 22, 0.9);
  --border-locked: rgba(210, 171, 103, 0.08);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: radial-gradient(120% 90% at 50% -10%, #071228 0%, var(--bg-primary) 55%) fixed;
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }

/* ---------- Persian typography (canonical mapping) ---------- */
#app-fa {
  font-family: "Parastoo", "IranSans", Tahoma, sans-serif;
}

#app-fa .hero-title,
#app-fa .chat-title,
#app-fa .chat-flow-title,
#app-fa .state-title {
  font-family: "w_Ray Extra Black", "Ray", "IranSans", sans-serif;
  font-weight: 900;
  letter-spacing: 0;
  word-spacing: 0.05em;
}

#app-fa .eyebrow,
#app-fa .btn,
#app-fa .chat-badge,
#app-fa .chat-status,
#app-fa .chat-quick-label,
#app-fa .chat-reply,
#app-fa .nav-item,
#app-fa .value-card strong,
#app-fa .chat-composer__send,
#app-fa .chat-back,
#app-fa .chat-restart,
#app-fa .offer-card__cta,
#app-fa .offer-card__badge,
#app-fa .offer-card__name,
#app-fa .journey-row__title,
#app-fa .progress-rail__caption,
#app-fa .faq-q,
#app-fa .sector-card,
#app-fa .live-retry,
#app-fa .chat-capture__title,
#app-fa .chat-capture__field label,
#app-fa .chat-capture__field input {
  font-family: "IranSans", Tahoma, sans-serif;
}

#app-fa .hero-sub,
#app-fa .chat-bubble,
#app-fa .chat-bubble__body,
#app-fa .chat-bubble__lead,
#app-fa .value-card p,
#app-fa .footer-tagline,
#app-fa .footer-note,
#app-fa .chat-composer__note,
#app-fa .chat-composer__input,
#app-fa .process-list li,
#app-fa .offer-card__desc,
#app-fa .faq-a__inner p,
#app-fa .chat-capture__consent span,
#app-fa .chat-capture__error,
#app-fa .chat-handoff__note {
  font-family: "Parastoo", "IranSans", serif;
}

/* FA never letter-spaces or uppercases Persian glyphs (Contract §7) */
#app-fa .eyebrow,
#app-fa .chat-quick-label,
#app-fa .nav-item,
#app-fa .chat-badge,
#app-fa .offer-card__badge {
  letter-spacing: 0;
  text-transform: none;
}

/* FA UI-label scale (frozen foundations type-fa.ui-label: 12.5px) —
   Persian UI faces need the larger label step to stay legible. */
#app-fa .chat-badge,
#app-fa .offer-card__badge,
#app-fa .nav-item span { font-size: var(--fs-small); }

/* ---------- App column (Contract §2) ---------- */
.lang-panel {
  position: relative;
  width: 100%;
  max-width: var(--app-max);
  margin-inline: auto;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(8, 18, 37, 0.55), rgba(2, 7, 18, 0.0) 320px),
    var(--bg-primary);
  border-inline: 1px solid rgba(210, 171, 103, 0.06);
  overflow-x: clip;
}
.lang-panel[hidden] { display: none; }

/* ---------- App bar (Contract §1.1 — 56px, logo + docked toggle) ---------- */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  min-height: calc(56px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 0 0;
  padding-inline-start: var(--app-pad);
  padding-inline-end: 92px; /* reserved for the docked language toggle */
  background: var(--surface-bar-blur);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
}
.app-bar__logo { height: 30px; width: auto; }

/* ---------- Scroll region ----------
   Bottom clearance = bottom nav + fixed composer + breathing room,
   so the last thread message is never hidden (Contract §13). */
.app-scroll {
  --composer-clearance: 112px;
  padding: var(--space-4) var(--app-pad)
           calc(var(--nav-h) + var(--composer-clearance) + env(safe-area-inset-bottom, 0px));
}

.state { margin-bottom: var(--space-4); }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
}

/* ---------- Founder hero — compact split card (Contract §8) ----------
   Responsive exception: the eyebrow + canonical 3-line title span the
   card because neither TR nor FA fits 3 lines at the binding 26px inside
   the 58% column at 390px. The frozen 42% media column remains beside the
   clamped sub + CTA block, preserving the ≤340px height budget. */
.hero-grid {
  display: grid;
  grid-template-columns: 42% minmax(0, 1fr);
  gap: var(--space-4);
  align-items: stretch;
  margin-top: var(--space-3);
}
.hero-media {
  aspect-ratio: var(--hero-media-ratio);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  align-self: start;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
}
.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
}
.eyebrow {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-overline);
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-gold);
}
.hero-title {
  margin: 0;
  font-size: var(--fs-display);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  outline: none;
}
.hero-cta {
  position: relative;
  width: 100%;
  height: 48px;
  min-height: 48px;
  flex: 0 0 48px;
  line-height: 1.3;
  padding-block: 6px;
  padding-inline: var(--space-2) var(--space-6);
  white-space: normal;
  text-align: center;
}
.hero-cta .btn-arrow {
  position: absolute;
  inset-inline-end: var(--space-2);
}
.hero-sub {
  margin: 0;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text-secondary);
}
/* 390/430: keep the hero inside the ≤340px budget — Contract §8 permits
   a 2-line sub clamp, and the media box caps at 430 (03 §2). */
@media (max-width: 639.98px) {
  .hero-sub {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hero-media { max-height: 166px; }
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  font: inherit;
  font-size: var(--fs-body);
  line-height: 1.3;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 13px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: transform var(--t-micro) var(--ease),
              box-shadow var(--t-micro) var(--ease),
              background-color var(--t-micro) var(--ease),
              border-color var(--t-micro) var(--ease),
              color var(--t-micro) var(--ease);
}
.btn-arrow { font-weight: 700; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-gold-hover), var(--accent-gold) 55%, var(--accent-gold-dark));
  color: #1a1204;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover { box-shadow: 0 16px 38px rgba(215, 168, 78, 0.3); }
.btn-primary:active { transform: translateY(1px) scale(0.985); }
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color-glow);
}
.btn-secondary:hover { background: rgba(210, 171, 103, 0.08); }

/* ---------- Open Chat Interface — transparent v2 wrapper.
   The card treatment moved to the active journey panel (Contract §6);
   hero + active panel are the only two shadowed surfaces. ---------- */
.chat-interface {
  outline: none;
  scroll-margin-top: 72px;
  margin-bottom: var(--space-4);
}

/* ---------- Progress rail (Contract §9) ---------- */
.progress-rail {
  min-height: var(--rail-h);
  padding: var(--space-3) 0;
  margin-bottom: var(--space-4);
}
.progress-rail__track {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.chat-progress {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}
.chat-progress__dot {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(210, 171, 103, 0.10);
  border: 1px solid var(--border-color);
}
.chat-progress__dot::before {
  content: attr(data-progress-step);
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  color: var(--text-muted);
}
#app-fa .chat-progress__dot[data-progress-step="1"]::before { content: "۱"; }
#app-fa .chat-progress__dot[data-progress-step="2"]::before { content: "۲"; }
#app-fa .chat-progress__dot[data-progress-step="3"]::before { content: "۳"; }
#app-fa .chat-progress__dot[data-progress-step="4"]::before { content: "۴"; }
#app-fa .chat-progress__dot[data-progress-step="5"]::before { content: "۵"; }
.chat-progress__line {
  flex: 1;
  height: 2px;
  min-width: var(--space-2);
  background: var(--border-color);
}
/* Engine signal (markProgress → is-active on reached nodes):
   reached nodes render with the completed tint. The presentation
   layer refines the deepest one to the gold active fill. */
.chat-progress__dot.is-active {
  background: rgba(210, 171, 103, 0.22);
  border-color: var(--border-color-glow);
}
.chat-progress__dot.is-active::before { color: var(--accent-gold); }
.progress-rail__caption {
  margin: var(--space-2) 0 0;
  font-size: var(--fs-caption);
  line-height: 1.4;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}
.progress-rail__caption:empty { display: none; }
.chat-restart {
  appearance: none;
  font: inherit;
  font-size: var(--fs-caption);
  font-weight: 600;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  min-height: 32px;
  padding: 5px 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  transition: color var(--t-micro) var(--ease),
              border-color var(--t-micro) var(--ease),
              background-color var(--t-micro) var(--ease);
}
/* 32px visual pill, ≥44px effective hit target (Contract §9 + §16) */
.chat-restart::before {
  content: "";
  position: absolute;
  inset: -6px;
}
.chat-restart:hover { color: var(--text-primary); border-color: var(--accent-gold); }
.chat-restart[hidden] { display: none; }

/* ---------- Chat identity header (canonical C1–C3 strings) ---------- */
.chat-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 0 0 var(--space-3);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-4);
}
.chat-identity {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}
.chat-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent-gold);
  background: var(--bg-card);
  border: 1px solid var(--border-color-glow);
}
.chat-avatar svg { width: 22px; height: 22px; }
.chat-badge {
  display: inline-block;
  font-size: var(--fs-overline);
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: var(--space-1);
}
.chat-title {
  margin: 0 0 var(--space-1);
  font-size: var(--fs-h2);
  line-height: 1.3;
  font-weight: 700;
  outline: none;
}
.chat-status {
  margin: 0;
  font-size: var(--fs-caption);
  line-height: 1.4;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ---------- Thread ---------- */
.chat-body {
  display: flex;
  flex-direction: column;
}
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-x: clip;
}

.chat-message {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 100%;
}
.chat-message--assistant { align-self: flex-start; }
.chat-message--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message__avatar {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-gold);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.chat-bubble {
  max-width: min(100%, 320px);
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  line-height: 1.6;
  font-size: var(--fs-body);
  overflow-wrap: break-word;
}
.chat-bubble--assistant {
  background: var(--chat-bot-bubble);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-end-start-radius: var(--radius-sm);
}
.chat-bubble--user {
  background: var(--chat-user-bubble);
  color: var(--chat-user-text);
  border: 1px solid rgba(210, 171, 103, 0.35);
  border-end-end-radius: var(--radius-sm);
}

.chat-bubble__lead {
  margin: 0 0 var(--space-2);
  font-weight: 600;
  color: var(--text-primary);
}
.chat-bubble__body {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--fs-body);
  max-width: 75ch;
}
.chat-bubble--user .chat-bubble__body { color: var(--chat-user-text); }

.chat-quick-replies {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--space-1) 0 var(--space-2);
}
.chat-quick-replies[hidden] { display: none; }

.chat-quick-label {
  margin: 0 0 2px;
  font-size: var(--fs-overline);
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.chat-reply {
  appearance: none;
  font: inherit;
  font-size: var(--fs-body);
  text-align: start;
  cursor: pointer;
  min-height: 44px;
  padding: 12px 16px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color-glow);
  border-radius: var(--radius-md);
  line-height: 1.45;
  transition: background-color var(--t-micro) var(--ease),
              border-color var(--t-micro) var(--ease),
              transform var(--t-micro) var(--ease);
}
.chat-reply:hover {
  background: rgba(210, 171, 103, 0.1);
  border-color: var(--accent-gold);
}
.chat-reply:active { transform: scale(0.99); }

.chat-dynamic {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.chat-dynamic:empty { display: none; }

/* ---------- Journey presentation (Contract §10) ----------
   Each state renders as: locked row (closed) → expanded panel (open,
   deepest / viewed) → summary row (open, not viewed — presentation
   layer). The row button reuses the existing data-back-to pathway;
   while locked it stays aria-disabled and the existing guard keeps
   it inert. -->  */
.journey-step { min-width: 0; }

.journey-row {
  appearance: none;
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--row-h);
  padding: var(--space-3) var(--space-4);
  text-align: start;
  background: var(--surface-row-locked);
  border: 1px solid var(--border-locked);
  border-radius: var(--radius-md);
  opacity: 0.55;
  color: var(--text-muted);
}
.journey-row[aria-disabled="true"] { cursor: not-allowed; }
.journey-row__disc {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-locked);
  color: var(--text-muted);
}
.journey-row__glyph { width: 14px; height: 14px; }
.journey-row__glyph--check { display: none; }
.journey-row__title {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-h3);
  line-height: 1.35;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.journey-row__chevron {
  flex-shrink: 0;
  display: none;
  color: var(--text-muted);
}
.journey-row__chevron svg { width: 16px; height: 16px; display: block; }

/* Open state (engine signal: hidden attribute removed) → the row
   disappears and the flow renders as the expanded active panel. */
.journey-step:has(> .chat-flow:not([hidden])):not(.is-summary) > .journey-row { display: none; }

/* ---------- Active journey panel (Contract §10.2, §6) ---------- */
.chat-flow .chat-message { display: block; }
.chat-flow .chat-message__avatar { display: none; }
.chat-flow .chat-bubble--flow {
  max-width: 100%;
  width: 100%;
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color-glow);
  background:
    radial-gradient(130% 90% at 100% 0%, rgba(210, 171, 103, 0.12), transparent 58%),
    linear-gradient(180deg, rgba(10, 18, 36, 0.96), rgba(5, 10, 22, 0.98));
  box-shadow: var(--shadow-card);
}

.chat-flow-title {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-h2);
  line-height: 1.3;
  font-weight: 700;
  outline: none;
}

/* Reveal container — animates height + opacity */
.reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows var(--t-reveal) var(--ease),
              opacity var(--t-reveal) var(--ease);
}
.reveal[hidden] { display: none; }
.reveal-inner { overflow: hidden; min-height: 0; }
.reveal.is-open { grid-template-rows: 1fr; opacity: 1; }
.state-title--unlocked { padding-top: 2px; }

/* ---------- State 1 — value cards ---------- */
.value-grid { display: grid; gap: 10px; margin-top: var(--space-3); }
.value-card {
  background: var(--surface-row);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.value-card strong {
  display: block;
  font-size: var(--fs-h3);
  line-height: 1.35;
  font-weight: 700;
  margin-bottom: var(--space-1);
}
.value-card p {
  margin: 0;
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ---------- Gate / back actions inside a state panel ---------- */
.flow-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.chat-gate { min-height: 48px; padding: 11px 18px; }
.chat-back {
  appearance: none;
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  padding: 9px 16px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  transition: color var(--t-micro) var(--ease),
              border-color var(--t-micro) var(--ease);
}
.chat-back:hover { color: var(--text-primary); border-color: var(--border-color-glow); }

/* Honest disabled state for primary/secondary buttons */
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-secondary[aria-disabled="true"]:hover { background: transparent; }

/* ---------- State 2 — process steps ---------- */
.process-list {
  list-style: none;
  counter-reset: step;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}
.process-list li {
  counter-increment: step;
  position: relative;
  padding: 11px 12px;
  padding-inline-start: 46px;
  background: var(--surface-row);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--fs-body);
  line-height: 1.45;
}
.process-list li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--accent-gold);
}
#app-fa .process-list li::before { content: counter(step, persian); }

/* ---------- State 3 — offer ladder (Contract §11) ----------
   Growth System = the one expanded recommended card, pinned first;
   the other five tiers are compact rows. The existing CTA button is
   the tap target: on compact rows it stretches over the whole row and
   its label becomes the row's accessible name. */
.offer-grid { display: grid; gap: var(--space-3); margin-top: var(--space-3); }
.offer-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-1);
  min-height: var(--offer-row-h);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-row);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.offer-card__name {
  margin: 0;
  grid-column: 1;
  font-size: var(--fs-h3);
  line-height: 1.35;
  font-weight: 700;
  color: var(--text-primary);
}
.offer-card__desc {
  margin: 0;
  grid-column: 1;
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 75ch;
}
.offer-card__chevron {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--text-muted);
}
.offer-card__chevron svg { width: 16px; height: 16px; display: block; }
/* Compact rows: the canonical CTA label stays the accessible name;
   the button stretches over the row as the whole-row tap target. */
.offer-card:not(.offer-card--recommended) .offer-card__cta {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: transparent;
  font-size: var(--fs-caption);
  cursor: pointer;
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
}
.offer-card:has(.offer-card__cta:focus-visible) {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
}
.offer-card:not(.offer-card--recommended):hover {
  border-color: var(--border-color-glow);
}

/* Expanded recommended card — Growth System only (Contract §11.1) */
.offer-card--recommended {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  min-height: 148px;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border-color: var(--accent-gold);
  background: linear-gradient(180deg, rgba(210, 171, 103, 0.1), rgba(5, 13, 26, 0.72));
  box-shadow: var(--shadow-gold-glow);
}
.offer-card--recommended .offer-card__name { font-size: var(--fs-h2); line-height: 1.3; }
.offer-card__badge {
  font-size: var(--fs-overline);
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1a1204;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--accent-gold-hover), var(--accent-gold));
}
.offer-card--recommended .offer-card__cta {
  appearance: none;
  font: inherit;
  font-size: var(--fs-body);
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  padding: 10px 20px;
  margin-top: var(--space-2);
  align-self: stretch;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--accent-gold-hover), var(--accent-gold) 55%, var(--accent-gold-dark));
  color: #1a1204;
  box-shadow: var(--shadow-btn);
  transition: box-shadow var(--t-micro) var(--ease),
              transform var(--t-micro) var(--ease);
}
.offer-card--recommended .offer-card__cta:hover { box-shadow: 0 16px 38px rgba(215, 168, 78, 0.3); }
.offer-card--recommended .offer-card__cta:active { transform: translateY(1px) scale(0.985); }

/* Latin brand terms embedded in RTL copy */
.latin { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- State 4 — sectors (Contract §12) ---------- */
.sector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: var(--space-3);
}
.sector-card {
  min-height: 56px;
  display: grid;
  place-items: center;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-row);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--fs-body);
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
}

/* ---------- State 5 — FAQ accordion (Contract §12) ---------- */
.faq-list { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.faq-item {
  background: var(--surface-row);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.faq-q {
  appearance: none;
  font: inherit;
  width: 100%;
  text-align: start;
  cursor: pointer;
  position: relative;
  min-height: 46px;
  padding: 12px 16px;
  padding-inline-end: 40px;
  color: var(--text-primary);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.4;
  background: none;
  border: 0;
}
.faq-q::after {
  content: "+";
  position: absolute;
  inset-inline-end: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  color: var(--accent-gold);
  transition: transform 220ms var(--ease);
}
.faq-item.is-open .faq-q::after { transform: translateY(-50%) rotate(45deg); }
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 220ms var(--ease);
}
.faq-a__inner {
  overflow: hidden;
  min-height: 0;
  visibility: hidden;
  transition: visibility 0s linear 220ms;
}
.faq-item.is-open .faq-a { grid-template-rows: 1fr; }
.faq-item.is-open .faq-a__inner { visibility: visible; transition-delay: 0s; }
.faq-a__inner p {
  margin: 0;
  padding: 0 16px 12px;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 75ch;
}

/* ---------- Sticky composer (Contract §13 — product focus) ----------
   Same DOM node inside the chat section; fixed above the bottom nav,
   column-aligned like the nav. Honest disabled baseline unchanged. */
.chat-composer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  z-index: 35;
  width: 100%;
  max-width: var(--app-max);
  min-height: var(--composer-h);
  margin: 0;
  padding: var(--space-2) var(--app-pad) var(--space-3);
  background: var(--surface-nav-blur);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
}
/* Scroll targets clear the fixed chrome (app bar / composer / nav) */
.chat-flow,
.chat-message,
.chat-quick-replies,
.chat-capture,
.chat-handoff {
  scroll-margin-top: 72px;
  scroll-margin-bottom: calc(var(--nav-h) + var(--composer-stack-h) + 16px);
}
.chat-composer__note {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-caption);
  line-height: 1.4;
  font-weight: 500;
  color: var(--text-secondary);
}
.chat-composer__row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.chat-composer__input {
  flex: 1;
  min-width: 0;
  min-height: var(--composer-row-h);
  padding: 10px 16px;
  font: inherit;
  font-size: var(--fs-body);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  opacity: 0.72;
}
.chat-composer__input:disabled { cursor: not-allowed; }
.chat-composer__send {
  appearance: none;
  flex-shrink: 0;
  width: 48px;
  min-height: var(--composer-row-h);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: rgba(210, 171, 103, 0.08);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: not-allowed;
  opacity: 0.55;
}
.chat-composer__send svg { width: 20px; height: 20px; }

/* ---------- Footer ---------- */
.app-footer {
  text-align: center;
  padding: var(--space-2) var(--space-1) var(--space-1);
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-2);
}
.footer-tagline { margin: 14px 0 6px; font-size: 13px; line-height: 1.55; color: var(--accent-gold); }
.footer-note { margin: 0; font-size: var(--fs-caption); line-height: 1.4; color: var(--text-secondary); }

/* ---------- Bottom navigation (Contract §14 — subtle) ---------- */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: 40;
  width: 100%;
  max-width: var(--app-max);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: var(--surface-nav-blur);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
}
.nav-item {
  appearance: none;
  font: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 52px;
  padding: 6px 2px;
  border-radius: var(--radius-md);
  font-size: var(--fs-caption);
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--t-micro) var(--ease);
}
.nav-item span { color: var(--text-secondary); }
.nav-ico { width: 22px; height: 22px; }
.nav-item[aria-current="page"],
.nav-item[aria-current="page"] span { color: var(--accent-gold); }
.nav-item:not([aria-disabled="true"]):hover,
.nav-item:not([aria-disabled="true"]):hover span { color: var(--text-primary); }
.nav-item[aria-disabled="true"] { color: var(--text-muted); opacity: 0.4; cursor: not-allowed; }

/* Nav items and action buttons may be real anchors when a verified
   destination exists — same look, native link semantics. */
a.nav-item { text-decoration: none; }
a.btn { text-decoration: none; }

.nav-item--elevated { color: var(--text-primary); }
.nav-elevated-disc {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-top: -22px;
  border-radius: 50%;
  color: #1a1204;
  background: linear-gradient(180deg, var(--accent-gold-hover), var(--accent-gold) 60%, var(--accent-gold-dark));
  box-shadow: var(--shadow-btn), 0 0 0 5px rgba(4, 10, 22, 0.9);
}
.nav-item--elevated .nav-ico { width: 24px; height: 24px; }

/* ---------- Language toggle — docked into the app-bar row ---------- */
.lang-toggle {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 6px);
  inset-inline-end: calc(max(0px, (100vw - var(--app-max)) / 2) + 12px);
  z-index: 60;
  appearance: none;
  font: inherit;
  font-weight: 600;
  font-size: var(--fs-small);
  letter-spacing: 0.06em;
  cursor: pointer;
  min-height: 44px;
  padding: 8px 14px;
  color: var(--text-primary);
  background: rgba(4, 10, 22, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color-glow);
  border-radius: var(--radius-pill);
  transition: background-color var(--t-micro) var(--ease);
}
.lang-toggle:hover { background: rgba(210, 171, 103, 0.14); }

/* ---------- Focus visibility ---------- */
:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Responsive (existing ramp — Contract 03) ---------- */
@media (min-width: 640px) {
  :root { --app-max: 480px; }
  .app-scroll { padding-inline: 26px; }
}

/* Tablet: centered column widens, mobile shell behavior unchanged */
@media (min-width: 860px) {
  :root { --app-max: 600px; }
}

/* Desktop: top navigation replaces the bottom bar; centered 680px
   Web-App shell; two-column compact-offer grid. Same markup, same
   tokens — no duplicated content system, no landing layout. */
@media (min-width: 1024px) {
  :root {
    --app-max: 680px;
    /* Desktop type step (Contract §7 / 03 §4 — the only other scale) */
    --fs-display: 30px;
    --fs-h2: 20px;
    --fs-h3: 16px;
    --fs-body: 15px;
    --fs-small: 13px;
    --fs-caption: 11.5px;
    --fs-overline: 10.5px;
  }

  .bottom-nav {
    top: 0;
    bottom: auto;
    height: 64px;
    max-width: 720px;
    padding: 8px 16px;
    border-top: 0;
    border-bottom: 1px solid var(--border-color);
  }
  .nav-elevated-disc {
    width: 42px;
    height: 42px;
    margin-top: 0;
    box-shadow: var(--shadow-btn);
  }
  .nav-item--elevated .nav-ico { width: 20px; height: 20px; }

  .lang-panel { padding-top: 64px; }
  .app-bar { top: 64px; }
  .app-scroll { padding-inline: 24px; padding-bottom: 48px; }
  .lang-toggle { top: calc(env(safe-area-inset-top, 0px) + 70px); }

  .hero-grid { grid-template-columns: min(42%, 260px) minmax(0, 1fr); }
  .footer-tagline { font-size: 14px; }

  .value-grid { grid-template-columns: repeat(3, 1fr); }
  .offer-grid { grid-template-columns: repeat(2, 1fr); }
  .offer-card--recommended { grid-column: 1 / -1; }
  .sector-grid { grid-template-columns: repeat(4, 1fr); }

  /* No bottom nav to clear at ≥1024: composer docks to the viewport
     bottom, aligned to the 680px shell (Contract 03 §4). */
  .chat-composer { bottom: env(safe-area-inset-bottom, 0px); }
  .app-scroll {
    padding-bottom: calc(var(--composer-clearance) + env(safe-area-inset-bottom, 0px));
  }
}

/* ============================================================
   Live Concierge connection states (EU-3) — unchanged behavior
   ============================================================ */
.chat-bubble--typing {
  color: var(--text-muted);
}
.chat-bubble--typing::after {
  content: "…";
  display: inline-block;
  animation: live-pulse 1.2s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}
.chat-bubble--status {
  border-color: var(--border-color-glow);
}
.live-retry {
  appearance: none;
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  margin-top: var(--space-2);
  min-height: 36px;
  padding: 7px 14px;
  color: var(--accent-gold);
  background: transparent;
  border: 1px solid var(--border-color-glow);
  border-radius: var(--radius-pill);
  transition: background-color var(--t-micro) var(--ease),
              border-color var(--t-micro) var(--ease);
}
.live-retry:hover { background: rgba(210, 171, 103, 0.1); border-color: var(--accent-gold); }

/* Enabled (live) composer — replaces the honest disabled look */
.chat-composer__input:not(:disabled) {
  color: var(--text-primary);
  opacity: 1;
  cursor: text;
}
.chat-composer__input:not(:disabled)::placeholder { color: var(--text-muted); }
.chat-composer__send--live {
  cursor: pointer;
  opacity: 1;
  color: #1a1204;
  background: linear-gradient(180deg, var(--accent-gold-hover), var(--accent-gold) 60%, var(--accent-gold-dark));
  border-color: transparent;
  box-shadow: var(--shadow-btn);
}
.chat-composer__send--live:hover { box-shadow: 0 14px 32px rgba(215, 168, 78, 0.3); }

/* ============================================================
   Consent-led lead capture + human handoff (EU-4) — unchanged
   behavior; v2 inner-panel geometry (radius 16, Contract §14/§3.4)
   ============================================================ */
.chat-capture {
  margin: var(--space-3) 0 0;
  padding: var(--space-4);
  background: rgba(5, 13, 26, 0.7);
  border: 1px solid var(--border-color-glow);
  border-radius: var(--radius-lg);
}
.chat-capture[hidden] { display: none; }
.chat-capture__title {
  margin: 0 0 10px;
  font-size: var(--fs-h3);
  line-height: 1.35;
  font-weight: 700;
}
.chat-capture__consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--text-secondary);
  cursor: pointer;
}
.chat-capture__consent a { color: var(--accent-gold); }
.chat-capture__checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent-gold);
}
.chat-capture__fields { margin-top: var(--space-3); display: grid; gap: 10px; }
.chat-capture__fields[hidden] { display: none; }
.chat-capture__field { display: grid; gap: var(--space-1); }
.chat-capture__field label {
  font-size: var(--fs-caption);
  line-height: 1.4;
  font-weight: 500;
  color: var(--text-secondary);
}
.chat-capture__field input {
  min-height: 44px;
  padding: 10px 14px;
  font: inherit;
  font-size: var(--fs-body);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.chat-capture__field input:focus-visible { border-color: var(--accent-gold); }
.chat-capture__error { margin: 0; font-size: var(--fs-small); color: #e08c8c; }
.chat-capture__error[hidden] { display: none; }
.chat-capture__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chat-capture__submit { min-height: 44px; padding: 11px 18px; }
/* Refusal sits between the consent label and the (initially hidden)
   fields block — visible before consent, in both directions. */
.chat-capture__dismiss { margin-top: var(--space-3); }

.chat-handoff {
  margin: var(--space-3) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.chat-handoff[hidden] { display: none; }
.chat-handoff__link[hidden] { display: none; }
.chat-handoff__note { margin: 0; font-size: var(--fs-small); color: var(--text-secondary); }
.chat-handoff__note[hidden] { display: none; }

/* ============================================================
   UI v2 presentation states — driven by the presentation layer in
   web-app.js (syncJourney): is-summary on journey steps, is-current /
   is-done on rail nodes. Engine signals stay untouched.
   ============================================================ */

/* Completed-state summary row (Contract §10.1): open but not viewed */
.journey-step.is-summary > .chat-flow { display: none; }
.journey-step.is-summary > .journey-row {
  opacity: 1;
  background: var(--surface-row);
  border-color: var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
}
.journey-step.is-summary > .journey-row:hover { border-color: var(--border-color-glow); }
.journey-step.is-summary > .journey-row .journey-row__disc {
  background: rgba(210, 171, 103, 0.22);
  border-color: var(--border-color-glow);
  color: var(--accent-gold);
}
.journey-step.is-summary > .journey-row .journey-row__glyph--lock { display: none; }
.journey-step.is-summary > .journey-row .journey-row__glyph--check { display: block; }
.journey-step.is-summary > .journey-row .journey-row__chevron { display: block; }

/* Rail refinement (Contract §9): the deepest open state's node is the
   gold active node; earlier nodes show the completed check; connectors
   up to completed nodes take gold at 40% alpha. */
.chat-progress__dot.is-done::before {
  content: "✓";
  color: var(--accent-gold);
}
#app-fa .chat-progress__dot.is-done::before { content: "✓"; }
.chat-progress__dot.is-current {
  background: var(--accent-gold);
  border-color: var(--accent-gold-hover);
  box-shadow: 0 0 10px rgba(210, 171, 103, 0.45);
}
.chat-progress__dot.is-current::before {
  color: #1a1204;
  font-weight: 700;
}
.chat-progress__line:has(+ .chat-progress__dot.is-done) {
  background: var(--border-color-glow);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .reveal { transition: none !important; }
  .faq-a { transition: none !important; }
  .faq-a__inner { transition: none !important; }
  .faq-q::after { transition: none !important; }
  .chat-bubble--typing::after { animation: none !important; }
}
