:root {
          --wsi-blue-900:#1e3a8a;
          --wsi-blue-800:#1e40af;
          --wsi-blue-700:#1d4ed8;
          --slate-900:#0f172a;
          --wsi-slate-900:var(--slate-900);
          --slate-700:#334155;
          --wsi-slate-700:var(--slate-700);
          --slate-500:#64748b;
          --wsi-slate-500:var(--slate-500);
          --slate-200:#e2e8f0;
          --wsi-slate-200:var(--slate-200);
          --slate-50:#f8fafc;
          --wsi-slate-50:var(--slate-50);
          --white:#ffffff;
          --wsi-hero-title:var(--white);
          --wsi-hero-subtitle:#dbeafe;
          --wsi-bg-primary-light:var(--wsi-slate-50);
          --wsi-text-body:var(--wsi-slate-900);
          --wsi-hero-gradient-start:var(--wsi-blue-900);
          --wsi-hero-gradient-mid:var(--wsi-blue-800);
          --wsi-hero-gradient-end:var(--wsi-blue-700);
          --wsi-hero-gradient:linear-gradient(to right,var(--wsi-hero-gradient-start),var(--wsi-hero-gradient-mid),var(--wsi-hero-gradient-end));
          --wsi-card-bg:var(--white);
          --wsi-card-text:var(--wsi-text-body);
          --wsi-card-border:var(--wsi-slate-200);
          --wsi-card-radius:8px;
          --wsi-button-radius-pill:9999px;
          --wsi-footer-bg:var(--white);
          --wsi-footer-text:var(--wsi-slate-500);
          --wsi-footer-link:var(--wsi-blue-700);
        }
        * { box-sizing:border-box; }
        body {
          margin:0;
          min-height:100vh;
          font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
          background:var(--slate-50);
          color:var(--slate-900);
        }
        .topbar {
          background:white;
          border-bottom:1px solid var(--slate-200);
        }
        .topbar-inner {
          max-width:1100px;
          margin:auto;
          padding:14px 18px;
          display:flex;
          justify-content:space-between;
          align-items:center;
          gap:16px;
        }
        .brand {
          display:flex;
          align-items:center;
          gap:12px;
          text-decoration:none;
          color:var(--slate-900);
        }
        .logo {
          width:42px;
          height:42px;
          border-radius:999px;
          background:var(--wsi-blue-900);
          color:white;
          display:inline-flex;
          align-items:center;
          justify-content:center;
          font-weight:900;
        }
        .brand-title {
          font-size:18px;
          font-weight:900;
          line-height:1.15;
        }
        .brand-subtitle {
          font-size:13px;
          color:var(--slate-500);
          margin-top:2px;
        }
        .toplink {
          color:var(--wsi-blue-700);
          font-weight:800;
          text-decoration:none;
          font-size:14px;
        }
        .hero {
          background:linear-gradient(to right,var(--wsi-blue-900),var(--wsi-blue-800),var(--wsi-blue-700));
          color:white;
        }
        .hero-inner {
          max-width:1100px;
          margin:auto;
          padding:56px 18px;
          display:grid;
          grid-template-columns:minmax(0,1.3fr) minmax(280px,.8fr);
          gap:32px;
          align-items:center;
        }
        .badge {
          display:inline-flex;
          border-radius:999px;
          background:rgba(255,255,255,.12);
          border:1px solid rgba(219,234,254,.28);
          padding:8px 14px;
          color:#dbeafe;
          font-size:13px;
          font-weight:900;
          text-transform:uppercase;
          letter-spacing:.03em;
        }
        h1 {
          margin:20px 0 16px;
          font-size:clamp(34px,5vw,54px);
          line-height:1.08;
          letter-spacing:-.05em;
          font-weight:950;
          color:white;
        }
        .hero p {
          margin:0;
          color:#dbeafe;
          font-size:18px;
          line-height:1.7;
          max-width:720px;
        }
        .card {
          background:white;
          color:var(--slate-900);
          border-radius:22px;
          padding:28px;
          box-shadow:0 20px 45px rgba(15,23,42,.20);
          border:1px solid rgba(226,232,240,.8);
        }
        .card h2 {
          margin:0 0 12px;
          font-size:24px;
          letter-spacing:-.03em;
        }
        .card p {
          color:var(--slate-700);
          line-height:1.65;
          margin:0 0 20px;
        }
        .actions {
          display:grid;
          gap:12px;
        }
        .btn {
          display:inline-flex;
          justify-content:center;
          align-items:center;
          padding:13px 18px;
          border-radius:999px;
          font-weight:900;
          text-decoration:none;
          border:1px solid transparent;
        }
        .btn-primary {
          background:var(--wsi-blue-700);
          color:white;
        }
        .btn-primary:hover {
          background:var(--wsi-blue-800);
        }
        .btn-outline {
          color:var(--wsi-blue-800);
          border-color:#bfdbfe;
          background:#eff6ff;
        }
        .section {
          max-width:1100px;
          margin:auto;
          padding:36px 18px 48px;
          display:grid;
          grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
          gap:18px;
        }
        .info-card {
          background:white;
          border:1px solid var(--slate-200);
          border-radius:18px;
          padding:22px;
          box-shadow:0 8px 20px rgba(15,23,42,.045);
        }
        .info-card h3 {
          margin:0 0 8px;
          font-size:18px;
        }
        .info-card p {
          margin:0;
          color:var(--slate-700);
          line-height:1.6;
          font-size:14px;
        }
        footer {
          text-align:center;
          color:var(--slate-500);
          font-size:13px;
          padding:24px 18px 40px;
        }
        footer a {
          color:var(--wsi-blue-700);
          font-weight:800;
          text-decoration:none;
        }
        @media (max-width:760px) {
          .hero-inner { grid-template-columns:1fr; padding:42px 18px; }
          .topbar-inner { flex-direction:column; align-items:flex-start; }
        }
      
        .app-chip,
        .chip {
          text-decoration: none;
          display: inline-block;
        }
        .app-chip:hover,
        .chip:hover {
          background: #dbeafe;
          color: #1d4ed8;
        }
        
    .lang-switcher {
      display:flex;
      align-items:center;
      justify-content:flex-end;
      margin-left:auto;
    }

    .lang-switcher select {
      min-width:230px;
      height:38px;
      padding:0 12px;
      border:1px solid var(--wsi-slate-200);
      border-radius:999px;
      background:#fff;
      color:var(--wsi-slate-900);
      font-size:14px;
      font-weight:700;
    }

    @media (max-width:720px) {
      .topbar-inner {
        flex-wrap:wrap;
      }

      .lang-switcher {
        width:100%;
        justify-content:flex-start;
        order:3;
      }

      .lang-switcher select {
        width:100%;
      }
    }

/* KRP refined responsive header actions */
.topbar-actions {
  margin-left:auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:14px;
  flex-wrap:wrap;
}

.topbar-actions .toplink {
  white-space:nowrap;
}

.topbar-actions .lang-switcher {
  margin-left:0;
  width:auto;
}

.topbar-actions .lang-switcher select {
  min-width:260px;
  max-width:320px;
}

@media (max-width:760px) {
  .topbar-inner {
    flex-direction:column;
    align-items:flex-start;
    gap:12px;
  }

  .topbar-actions {
    width:100%;
    margin-left:0;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:nowrap;
  }

  .topbar-actions .toplink {
    font-size:13px;
    white-space:nowrap;
  }

  .topbar-actions .toplink {
    font-size:0;
  }

  .topbar-actions .toplink::after {
    content:"← Back to Portal";
    font-size:13px;
  }

  .topbar-actions .lang-switcher {
    flex:1;
    display:flex;
    justify-content:flex-end;
  }

  .topbar-actions .lang-switcher select {
    width:100%;
    max-width:210px;
    min-width:150px;
  }
}

/* Stage 3 content-page pattern (account/*, profile/*) — extends shared WSI tokens */
.page-wrap {
  max-width: 720px;
  margin: auto;
  padding: 48px 18px 64px;
}
.page-wide {
  max-width: 980px;
}
.page-wrap h1 {
  color: var(--slate-900);
  font-size: clamp(26px, 4vw, 36px);
}
.badge-row { margin-bottom: 16px; }
.copy {
  color: var(--slate-700);
  line-height: 1.65;
  font-size: 16px;
}
.notice.small {
  color: var(--slate-500);
  font-size: 13px;
  margin-top: 16px;
}
.alert {
  border-radius: 12px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 14px;
}
.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.action-box { margin-top: 24px; }
.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-secondary {
  color: var(--wsi-blue-800);
  border-color: var(--slate-200);
  background: var(--white);
}
.btn-secondary:hover { background: var(--slate-50); }
.btn-danger {
  background: #dc2626;
  color: white;
}
.btn-danger:hover { background: #b91c1c; }
.btn-danger-outline {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}
.btn-danger-outline:hover { background: #fee2e2; }
.consent-text {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 18px;
  margin: 18px 0;
  color: var(--slate-700);
  line-height: 1.6;
  font-size: 14px;
}
.field-group {
  margin: 18px 0;
  border: none;
  padding: 0;
}
.field-group legend {
  font-weight: 800;
  font-size: 14px;
  color: var(--slate-900);
  margin-bottom: 8px;
  padding: 0;
}
.field-group label[for] {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--slate-900);
  margin-bottom: 6px;
}
.field-group input[type="text"],
.field-group select,
.field-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-size: 15px;
  color: var(--slate-900);
  font-family: inherit;
}
.field-group textarea {
  resize: vertical;
}
.radio-label, .checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--slate-700);
  cursor: pointer;
}
.radio-label input, .checkbox-label input { margin-top: 3px; }
.role-match {
  color: var(--wsi-blue-700);
  font-weight: 700;
  font-size: 12px;
  margin-left: 6px;
}
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}
.info-table th, .info-table td {
  text-align: left;
  padding: 12px 0;
  border-bottom: 1px solid var(--slate-200);
  font-size: 14px;
}
.info-table th {
  color: var(--slate-500);
  font-weight: 700;
  width: 40%;
}
.info-table td {
  color: var(--slate-900);
  font-weight: 600;
}
.section-block {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--slate-200);
}
.section-block h2 {
  font-size: 18px;
  color: var(--slate-900);
  margin: 0 0 12px;
}
.danger-zone {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 20px;
  margin-top: 32px;
}
.danger-zone h2 { color: #991b1b; }
.json-block {
  overflow: auto;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: var(--slate-50);
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
}

/* Step 4 staging path badges */
.staging-badge { display:inline-block; padding:0.15em 0.5em; border-radius:3px; font-size:0.85em; font-weight:600; }
.staging-unset { background:#e2e8f0; color:#4a5568; }
.staging-proposed { background:#ebf8ff; color:#2b6cb0; }
.staging-staged { background:#c6f6d5; color:#276749; }
.staging-safeguarding_hold { background:#fff5f5; color:#c53030; }
.staging-safeguarding_cleared { background:#fefcbf; color:#744210; }
.staging-advancement_authorized { background:#d4edda; color:#155724; }
.staging-withdrawn { background:#f7fafc; color:#718096; }

/* ── Step 5 Exchange Readiness ───────────────────────────────────────────── */
.readiness-badge { display:inline-block; padding:2px 8px; border-radius:4px;
  font-size:0.8rem; font-weight:600; background:#e2e8f0; color:#2d3748; }
.readiness-badge.readiness-unset { background:#e2e8f0; color:#4a5568; }
.readiness-badge.readiness-in_progress { background:#fefcbf; color:#744210; }
.readiness-badge.readiness-recorded { background:#bee3f8; color:#2a4365; }
.readiness-badge.readiness-coordinator_reviewed { background:#c6f6d5; color:#22543d; }
.readiness-badge.readiness-advancement_authorized { background:#9ae6b4; color:#1c4532; font-weight:700; }
.readiness-badge.readiness-withdrawn { background:#fed7d7; color:#742a2a; }
.readiness-type-row { padding:0.5rem 0; border-bottom:1px solid #e2e8f0; }
.readiness-disabled { opacity:0.45; }
.readiness-unavailable { font-size:0.8rem; color:#e53e3e; margin-left:0.5rem; }
.readiness-note { font-size:0.8rem; color:#718096; margin-left:0.5rem; }

/* ── Step 6 Evidence Intake ──────────────────────────────────────────────── */
.intake-badge { display:inline-block; padding:2px 8px; border-radius:4px;
  font-size:0.8rem; font-weight:600; background:#e2e8f0; color:#2d3748; }
.intake-badge.intake-unset { background:#e2e8f0; color:#4a5568; }
.intake-badge.intake-active { background:#fefcbf; color:#744210; }
.intake-badge.intake-coordinator_review { background:#bee3f8; color:#2a4365; }
.intake-badge.intake-all_verified { background:#c6f6d5; color:#22543d; }
.intake-badge.intake-completed { background:#9ae6b4; color:#1c4532; font-weight:700; }
.intake-badge.intake-withdrawn { background:#fed7d7; color:#742a2a; }
.intake-badge.intake-verified { background:#c6f6d5; color:#22543d; }
.intake-badge.intake-pending { background:#fefcbf; color:#744210; }
.evidence-pilot-banner { background:#fff3cd; border-left:4px solid #f59e0b;
  padding:0.6rem 1rem; margin-bottom:1rem; font-size:0.85rem; border-radius:4px; }

/* ══════════════════════════════════════════════════════════════
   MAF V1 — Mobile-first wizard UI additions
   ══════════════════════════════════════════════════════════════ */

/* ── Hamburger nav ─────────────────────────────────────────── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  line-height: 1;
  color: var(--slate-700);
  font-size: 22px;
  margin-left: auto;
}
.hamburger:focus { outline: 2px solid var(--wsi-blue-700); }

.mobile-nav {
  display: none;
  background: white;
  border-bottom: 1px solid var(--slate-200);
  padding: 12px 18px 16px;
  flex-direction: column;
  gap: 10px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a, .mobile-nav form { font-size: 15px; font-weight: 700; color: var(--wsi-blue-700); }
.mobile-nav select { width: 100%; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--slate-200); font-size: 14px; font-weight: 700; }

@media (max-width: 760px) {
  .hamburger { display: inline-flex; align-items: center; }
  .topbar-actions { display: none !important; }
}

/* ── Wizard step indicator ─────────────────────────────────── */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.wizard-steps::-webkit-scrollbar { display: none; }
.wizard-step {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 13px;
  color: var(--slate-500);
}
.wizard-step .step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--slate-200);
  color: var(--slate-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}
.wizard-step.active .step-dot {
  background: var(--wsi-blue-700);
  color: white;
}
.wizard-step.done .step-dot {
  background: #16a34a;
  color: white;
}
.wizard-step.active { color: var(--slate-900); font-weight: 700; }
.wizard-step.done { color: #16a34a; }
.step-sep {
  width: 24px;
  height: 2px;
  background: var(--slate-200);
  flex-shrink: 0;
  margin: 0 2px;
}
.wizard-step.done + .step-sep { background: #16a34a; }

@media (max-width: 480px) {
  .wizard-steps { gap: 0; }
  .wizard-step .step-label { display: none; }
}

/* ── Role cards ────────────────────────────────────────────── */
.role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}
@media (max-width: 540px) {
  .role-cards { grid-template-columns: 1fr; }
}
.role-card-label {
  display: block;
  cursor: pointer;
}
.role-card-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.role-card-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  border: 2px solid var(--slate-200);
  border-radius: 14px;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 100px;
}
.role-card-inner:hover {
  border-color: var(--wsi-blue-700);
  box-shadow: 0 0 0 3px rgba(29,78,216,0.1);
}
.role-card-label input[type="radio"]:checked + .role-card-inner {
  border-color: var(--wsi-blue-700);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(29,78,216,0.15);
}
.role-card-icon {
  font-size: 26px;
  line-height: 1;
}
.role-card-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--slate-900);
  line-height: 1.2;
}
.role-card-desc {
  font-size: 13px;
  color: var(--slate-500);
  line-height: 1.4;
}

/* ── Choice chips (replaces dense checkboxes) ──────────────── */
.choice-group {
  margin: 16px 0;
}
.choice-group-label {
  font-weight: 800;
  font-size: 14px;
  color: var(--slate-900);
  margin-bottom: 10px;
  display: block;
}
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-label {
  cursor: pointer;
  display: inline-block;
}
.chip-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.chip-inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: 999px;
  background: white;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-700);
  transition: border-color 0.12s, background 0.12s;
  white-space: nowrap;
}
.chip-inner:hover {
  border-color: var(--wsi-blue-700);
  background: #eff6ff;
  color: var(--wsi-blue-700);
}
.chip-label input[type="checkbox"]:checked + .chip-inner {
  border-color: var(--wsi-blue-700);
  background: var(--wsi-blue-700);
  color: white;
}

/* ── Consent box (compact) ─────────────────────────────────── */
.consent-box {
  background: #f8fafc;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--slate-700);
  line-height: 1.6;
  margin: 16px 0;
}
.consent-box summary {
  font-weight: 700;
  color: var(--slate-900);
  cursor: pointer;
  font-size: 14px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.consent-box summary::before { content: "▶"; font-size: 10px; color: var(--slate-500); }
.consent-box[open] summary::before { content: "▼"; }
.consent-box p { margin: 10px 0 0; }

/* ── Optional note textarea (collapsed by default) ─────────── */
.optional-note-toggle {
  background: none;
  border: none;
  color: var(--wsi-blue-700);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: underline;
  display: inline-block;
}
.optional-note-area {
  display: none;
  margin-top: 8px;
}
.optional-note-area.open { display: block; }

/* ── Progress bar strip ────────────────────────────────────── */
.progress-strip {
  height: 3px;
  background: var(--slate-200);
  border-radius: 999px;
  margin: 0 0 20px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--wsi-blue-700);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ── Better mobile form inputs ─────────────────────────────── */
@media (max-width: 600px) {
  .page-wrap { padding: 28px 16px 48px; }
  .btn { padding: 14px 18px; font-size: 16px; }
  .field-group input[type="text"],
  .field-group select,
  .field-group textarea {
    font-size: 16px; /* prevents iOS zoom */
    padding: 12px 14px;
  }
  .action-row { flex-direction: column; }
  .action-row .btn { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════
   MAF V1.2 — Nav row-alignment + icon consistency + badge contrast
   Overrides conflicting legacy column-direction rules above.
   ══════════════════════════════════════════════════════════════ */

/* ── Topbar: stay single row on mobile, no stacking ───────────── */
@media (max-width: 760px) {
  .topbar-inner {
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    padding: 10px 18px !important;
  }
  /* Hide long subtitle on mobile to keep topbar compact (~64px) */
  .brand-subtitle { display: none; }
  /* Brand fills available space, hamburger stays right-pinned */
  .brand { flex: 1 1 auto; min-width: 0; overflow: hidden; }
  .brand-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
  }
}

/* ── Hamburger: CSS-bar style matching portal + maf-tier-a ────── */
/* Override V1 unicode-char hamburger */
.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: white;
  color: var(--slate-700);
  cursor: pointer;
  margin-left: 12px;
  flex-shrink: 0;
  padding: 0;
  font-size: 0;     /* suppress any residual unicode char */
  line-height: 0;
}
.hamburger:focus-visible {
  outline: 2px solid var(--wsi-blue-700);
  outline-offset: 2px;
}
.menu-icon {
  width: 21px;
  height: 2px;
  border-radius: 3px;
  background: currentColor;
  box-shadow: 0 -7px 0 currentColor, 0 7px 0 currentColor;
  display: block;
  flex-shrink: 0;
}
@media (max-width: 760px) {
  .hamburger { display: inline-flex; }
  .topbar-actions { display: none !important; }
}

/* ── Badge contrast: page-context pills → full WSI blue ─────────
   Hero badges keep pale tint (context: dark gradient background).
   Page-wrap / badge-row badges need readable WSI blue on white.  */
.badge-row .badge {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--wsi-blue-700);
}

/* ══════════════════════════════════════════════════════════════
   MAF V1.3 — Portal-compliant two-row mobile header
   Brand (row 1) / Lang LEFT + Hamburger RIGHT (row 2) / Drawer (row 3)
   ══════════════════════════════════════════════════════════════ */

/* ── Desktop-only toplink ──────────────────────────────────── */
.nav-desktop-only {
  color: var(--wsi-blue-700);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.nav-desktop-only:hover { text-decoration: underline; }
@media (max-width: 760px) { .nav-desktop-only { display: none; } }

/* ── Header controls: lang LEFT, hamburger RIGHT ──────────── */
.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.header-controls .lang-switcher {
  margin: 0;
  width: auto;
}
.header-controls .lang-switcher select {
  min-height: 40px;
  min-width: 110px;
  max-width: 190px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: white;
  color: var(--slate-700);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* Hamburger inside header-controls: hidden on desktop */
.header-controls .hamburger {
  display: none;
  margin-left: 0;
}
@media (max-width: 760px) {
  .header-controls .hamburger { display: inline-flex; }
}

/* ── Two-row layout at ≤560px (portal pattern) ────────────── */
@media (max-width: 560px) {
  .topbar-inner {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 12px 18px !important;
  }
  /* Row 1: brand full-width */
  .brand {
    width: 100% !important;
    flex: none !important;
    overflow: visible !important;
  }
  /* Row 2: controls full-width, lang left / hamburger right */
  .header-controls {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    gap: 0;
  }
  .header-controls .lang-switcher select {
    max-width: calc(100% - 58px);
    min-width: 0;
    flex: 1;
    font-size: 16px;   /* prevents iOS auto-zoom */
  }
  /* Row 3: drawer below */
  .mobile-nav { order: 3; }
}

/* At 561-760px: single compact row (brand truncated, lang+hamburger right) */
@media (min-width: 561px) and (max-width: 760px) {
  .topbar-inner {
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 12px !important;
  }
  .brand {
    flex: 1 1 auto !important;
    min-width: 0;
    overflow: hidden !important;
  }
  .brand-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ── Mobile drawer: inside topbar-inner, order:3 ─────────── */
.mobile-nav {
  display: none;
  width: 100%;
  order: 3;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--slate-200);
  padding: 8px 0 6px;
  background: white;
  border-bottom: none;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 2px;
  font-size: 15px;
  font-weight: 700;
  color: var(--wsi-blue-700);
  text-decoration: none;
  border-radius: 6px;
}
.mobile-nav a:hover { background: #eff6ff; }
/* Lang form removed from drawer — it's now in the controls row */
.mobile-nav form { display: none; }

/* ── V1.3 FIX: override legacy margin-left:auto on .lang-switcher ──────────
   Inside .header-controls, lang-switcher must sit LEFT (flex:1 pushes it to
   fill available space; hamburger stays right-pinned at its natural width).  */
.header-controls .lang-switcher {
  margin-left: 0 !important;
  flex: 1;
  justify-content: flex-start;
}
.header-controls .lang-switcher select {
  width: 100%;
  max-width: 260px;
  min-width: 0;
  font-size: 14px;
}
@media (max-width: 560px) {
  .header-controls .lang-switcher select {
    max-width: calc(100% - 4px);
    font-size: 16px;
  }
}

/* ── V1.3 ROOT CAUSE FIX: lang-switcher order reset ──────────────────────────
   Legacy @media(≤720px) sets .lang-switcher { order:3 }, which pushes the form
   after the hamburger (order:0) in header-controls. Reset to DOM order.        */
.header-controls .lang-switcher {
  order: 0 !important;
}

/* ── V1.3.1 — Compact lang select (portal-matching natural width) ─────────────
   V1.3 set flex:1 / max-width:calc(100%-Npx) which made the select fill the
   whole controls row. Portal uses natural content width, not full-row stretch.  */
@media (max-width: 760px) {
  .header-controls .lang-switcher {
    flex: 0 0 auto !important;
  }
  .header-controls .lang-switcher select {
    width: auto !important;
    min-width: 118px !important;
    max-width: 150px !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   MAF V2.0 — Hero CTA + Community Value Panel components
   (appended 2026-06-19; no rebuild in effect yet)
   ══════════════════════════════════════════════════════════════ */

/* ── Hero: solo layout (no right card — login / public pages) ─ */
.hero-solo {
  max-width: 720px;
  margin: auto;
  padding: 52px 20px 44px;
}

/* ── Hero eyebrow tag (public program label) ───────────────── */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--wsi-button-radius-pill);
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--wsi-hero-subtitle);
  margin-bottom: 20px;
  white-space: nowrap;
}
.hero-eyebrow-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(74,222,128,.3);
}

/* ── Hero CTA row and buttons ──────────────────────────────── */
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.hero-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  color: var(--wsi-blue-900);
  font-weight: 800;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: var(--wsi-button-radius-pill);
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(15,23,42,.20);
  white-space: nowrap;
  border: none;
}
.hero-cta-primary:hover { background: var(--wsi-bg-primary-light); }
.hero-cta-secondary {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,.15);
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,.38);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: var(--wsi-button-radius-pill);
  text-decoration: none;
  white-space: nowrap;
}
.hero-cta-secondary:hover { background: rgba(255,255,255,.25); }
@media (max-width: 480px) {
  .hero-cta { flex-direction: column; }
  .hero-cta-primary, .hero-cta-secondary { justify-content: center; }
}

/* ── Hero trust row ────────────────────────────────────────── */
.hero-trust-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  font-size: 12px;
  color: rgba(219,234,254,.75);
}
.hero-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.hero-trust-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: rgba(74,222,128,.25);
  color: #4ade80;
  font-size: 9px;
  font-weight: 900;
  flex-shrink: 0;
}

/* ── Community Value Panel (C8) ────────────────────────────── */
.value-section {
  background: var(--white);
  border-top: 1px solid var(--wsi-card-border);
  padding: 52px 20px 56px;
}
.value-inner {
  max-width: 1080px;
  margin: auto;
}
.value-eyebrow {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--wsi-blue-700);
  margin-bottom: 10px;
}
.value-heading {
  font-size: clamp(20px, 3.5vw, 30px);
  font-weight: 900;
  letter-spacing: -.03em;
  color: var(--wsi-slate-900);
  margin-bottom: 10px;
  line-height: 1.15;
}
.value-copy {
  font-size: 15px;
  color: var(--wsi-slate-500);
  line-height: 1.7;
  max-width: 560px;
  margin-bottom: 32px;
}
.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.value-card {
  background: var(--wsi-bg-primary-light);
  border: 1px solid var(--wsi-card-border);
  border-radius: var(--wsi-card-radius);
  padding: 22px 20px;
}
.value-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--wsi-blue-50, #eff6ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.value-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--wsi-slate-900);
  margin-bottom: 6px;
}
.value-card-body {
  font-size: 13px;
  color: var(--wsi-slate-500);
  line-height: 1.65;
}
@media (max-width: 480px) {
  .value-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   MAF D-4B — AI-Assisted Intake UI styles
   ══════════════════════════════════════════════════════════════ */

/* ── Path toggle (Option A / Option B) ────────────────────── */
.ai-path-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ai-path-btn {
  flex: 1;
  min-width: 140px;
  padding: 12px 16px;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-md, 12px);
  background: var(--white);
  color: var(--slate-700);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.ai-path-btn.active {
  border-color: var(--wsi-blue-700);
  background: #eff6ff;
  color: var(--wsi-blue-700);
}
.ai-path-btn .path-icon { font-size: 18px; display: block; margin-bottom: 4px; }
.ai-path-btn .path-label { font-size: 13px; font-weight: 800; }
.ai-path-btn .path-sub { font-size: 11px; font-weight: 500; color: var(--slate-500); margin-top: 2px; }

/* ── AI text input section ─────────────────────────────────── */
.ai-intake-section {
  background: var(--wsi-blue-50, #eff6ff);
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius-lg, 18px);
  padding: 20px;
  margin-bottom: 20px;
}
.ai-intake-section.hidden { display: none; }
.ai-intake-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 8px;
  display: block;
}
.ai-intake-textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md, 12px);
  font-size: 15px;
  font-family: inherit;
  color: var(--slate-900);
  background: var(--white);
  resize: vertical;
  margin-bottom: 10px;
}
.ai-intake-textarea:focus {
  outline: none;
  border-color: var(--wsi-blue-700);
  box-shadow: 0 0 0 3px rgba(29,78,216,.10);
}
.ai-char-count { font-size: 11px; color: var(--slate-500); margin-top: -6px; margin-bottom: 8px; }
.ai-char-count.warn { color: #b45309; font-weight: 700; }

/* ── Pre-scan refusal message ──────────────────────────────── */
.ai-refusal-box {
  background: #fef3c7;
  border: 1.5px solid #f59e0b;
  border-radius: var(--radius-md, 12px);
  padding: 14px 16px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.6;
  margin-bottom: 12px;
  display: none;
}
.ai-refusal-box.visible { display: block; }
.ai-refusal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

/* ── AI draft suggestion chips ─────────────────────────────── */
.ai-draft-section { display: none; margin-top: 20px; }
.ai-draft-section.visible { display: block; }
.ai-draft-heading {
  font-size: 14px; font-weight: 800;
  color: var(--slate-900); margin-bottom: 6px;
}
.ai-draft-note {
  font-size: 12px; color: var(--slate-500);
  margin-bottom: 14px; line-height: 1.5;
}
.ai-suggestion-chip {
  position: relative;
}
.ai-suggestion-chip .chip-inner {
  border-color: var(--wsi-blue-700);
  background: #eff6ff;
  color: var(--wsi-blue-700);
}
.ai-suggestion-chip input:checked + .chip-inner {
  background: var(--wsi-blue-700);
  color: var(--white);
}
.confidence-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-left: 4px;
  flex-shrink: 0;
}
.conf-high   { background: #16a34a; }
.conf-medium { background: #d97706; }
.conf-low    { background: #94a3b8; }

/* ── AI loading spinner ────────────────────────────────────── */
.ai-loading {
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--slate-500);
  padding: 8px 0;
}
.ai-loading.visible { display: flex; }
.ai-spinner {
  width: 18px; height: 18px;
  border: 2.5px solid #bfdbfe;
  border-top-color: var(--wsi-blue-700);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Coordinator review: AI badge ──────────────────────────── */
.ai-assisted-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-pill, 999px);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--wsi-blue-700);
}
.coordinator-narrative-box {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-left: 3px solid var(--wsi-blue-700);
  border-radius: var(--radius-md, 12px);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--slate-900);
  line-height: 1.65;
  margin: 12px 0 20px;
  font-style: italic;
}
