:root {
    --tenant-primary: #2B145A;
    --tenant-primary-dark: #240f4d;
    --tenant-accent: #0FA36B;
    --tenant-accent-dark: #0c8a5c;
    --tenant-bg: #f5f7fa;
    --tenant-surface: #ffffff;
    --tenant-border: #d8dee8;
    --tenant-text: #1f2937;
    --tenant-muted: #6b7280;
    --tenant-success: #047857;
    --tenant-warning: #b45309;
    --tenant-danger: #be123c;
}

* { box-sizing: border-box; font-family: 'Poppins', sans-serif; }
body { margin: 0; background: var(--tenant-bg); color: var(--tenant-text); }
.auth-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(15,163,107,0.16), transparent 26%),
        radial-gradient(circle at bottom right, rgba(43,20,90,0.14), transparent 30%),
        linear-gradient(135deg, #fbfbfc 0%, #eef2f5 100%);
}
.page-shell { display: flex; min-height: 100vh; }
.sidebar-link {
    display: flex; align-items: center; gap: .75rem; border-radius: 1rem; padding: .85rem 1rem;
    color: rgba(255,255,255,.82); font-size: .95rem; transition: .2s ease;
    text-decoration: none;
}
.sidebar-link:hover, .sidebar-link.active { background: rgba(255,255,255,.08); color: #fff; }
.topbar {
    position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--tenant-border);
    background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
}
.stat-card, .panel, .metric-card {
    background: var(--tenant-surface); border: 1px solid var(--tenant-border);
    box-shadow: 0 12px 32px rgba(22, 31, 45, 0.06);
}
.stat-card, .metric-card { border-radius: 1.5rem; padding: 1.25rem; }
.panel { border-radius: 1.5rem; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table thead th {
    padding-bottom: .9rem; text-align: left; font-size: .85rem; font-weight: 600;
    color: var(--tenant-muted); border-bottom: 1px solid var(--tenant-border);
}
.data-table tbody td {
    padding: 1rem 0; font-size: .92rem; color: var(--tenant-text);
    border-bottom: 1px solid #edf2f7; vertical-align: top;
}
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: .35rem .75rem; font-size: .75rem; font-weight: 600; }
.badge-success { background: #ecfdf5; color: #047857; }
.badge-warning { background: #fff4df; color: #b45309; }
.badge-info { background: #f3ecff; color: var(--tenant-primary); }
.badge-danger { background: #fff1f2; color: #be123c; }
.badge-slate { background: #f1f5f9; color: #334155; }
.btn-primary, .btn-secondary, .btn-soft {
    display: inline-flex; align-items: center; justify-content: center; border-radius: 1rem;
    padding: .85rem 1.1rem; font-size: .92rem; font-weight: 600; transition: .2s ease;
    text-decoration: none; border: 0; cursor: pointer;
}
.btn-primary { background: var(--tenant-accent); color: white; }
.btn-primary:hover { background: var(--tenant-accent-dark); }
.btn-secondary { background: var(--tenant-surface); color: var(--tenant-text); border: 1px solid var(--tenant-border); }
.btn-secondary:hover { background: #f8fafc; }
.btn-soft { background: rgba(43,20,90,0.08); color: var(--tenant-primary); }
.btn-soft:hover { background: rgba(43,20,90,0.14); }
.form-input, .form-select, .form-textarea {
    width: 100%; border-radius: 1rem; border: 1px solid var(--tenant-border); background: #fff;
    padding: .9rem 1rem; outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--tenant-accent); box-shadow: 0 0 0 4px rgba(15,163,107,0.12);
}
.kpi-bar span { display: block; border-radius: 999px; height: .65rem; background: linear-gradient(90deg, var(--tenant-accent) 0%, var(--tenant-primary) 100%); }
.brand-logo { width: auto; object-fit: contain; }
.tenant-hero {
    background: linear-gradient(135deg, rgba(43,20,90,0.98) 0%, rgba(36,15,77,0.96) 58%, rgba(15,163,107,0.94) 100%);
    color: white; border-radius: 2rem; overflow: hidden;
}
.tenant-hero::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.12), transparent 28%), radial-gradient(circle at bottom left, rgba(255,255,255,0.08), transparent 30%);
    pointer-events: none;
}
.chart-bars { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: .6rem; align-items: end; height: 180px; }
.chart-bars span { display: block; border-radius: .9rem .9rem .3rem .3rem; background: linear-gradient(180deg, rgba(15,163,107,0.95), rgba(43,20,90,0.95)); }
.workflow-step { border: 1px solid var(--tenant-border); border-radius: 1.25rem; padding: 1rem; background: #fff; }
.risk-dot { width: .6rem; height: .6rem; border-radius: 999px; display: inline-block; }
.progress-track { height: .55rem; border-radius: 999px; overflow: hidden; background: #ecf0f4; }
.progress-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--tenant-accent), var(--tenant-primary)); }
.info-list { display: grid; gap: 1rem; }
.info-row { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; padding-bottom:1rem; border-bottom:1px solid #edf2f7; }
.info-row:last-child { border-bottom:0; padding-bottom:0; }
.section-title { color: var(--tenant-primary); font-weight: 700; font-size: 1.05rem; }
.page-grid { display:grid; gap:1.5rem; }
@media (min-width:1280px){ .page-grid-2{grid-template-columns:1.2fr .8fr;} .page-grid-3{grid-template-columns:1.1fr 1.1fr .8fr;} }

.sidebar-icon { width: 1.1rem; height: 1.1rem; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 1.1rem; }
.sidebar-icon svg { width: 100%; height: 100%; }


.step-chip { display:flex; align-items:center; gap:.75rem; border-radius:999px; padding:.7rem 1rem; border:1px solid var(--tenant-border); background:#fff; }
.step-chip span { display:inline-flex; width:2rem; height:2rem; align-items:center; justify-content:center; border-radius:999px; font-size:.8rem; font-weight:700; background:#eef2f7; color:var(--tenant-primary); }
.step-chip strong { font-size:.9rem; }
.step-chip.current { border-color: rgba(15,163,107,0.35); background: rgba(15,163,107,0.08); }
.step-chip.current span { background: var(--tenant-accent); color:#fff; }
.step-chip.complete { border-color: rgba(15,163,107,0.3); background:#ecfdf5; }
.step-chip.complete span { background: var(--tenant-success); color:#fff; }
.upload-card, .review-item { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; padding:1rem 1.1rem; border:1px solid var(--tenant-border); border-radius:1.25rem; background:#fff; }
.journey-card { display:flex; gap:1rem; padding:1rem 1.1rem; border-radius:1.25rem; background: rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.12); }
.journey-card span { width:2rem; height:2rem; border-radius:999px; display:inline-flex; align-items:center; justify-content:center; font-size:.8rem; font-weight:700; background: rgba(255,255,255,0.14); }
.journey-card strong { display:block; }
.journey-card p { margin:.2rem 0 0; font-size:.92rem; color: rgba(255,255,255,0.72); }
.journey-card.current { background: rgba(255,255,255,0.14); }

:root {
    --borrower-primary: #2B145A;
    --borrower-primary-dark: #240f4d;
    --borrower-accent: #0FA36B;
    --borrower-accent-dark: #0c8a5c;
    --borrower-bg: #f5f7fa;
    --borrower-surface: #ffffff;
    --borrower-border: #d8dee8;
    --borrower-text: #1f2937;
    --borrower-muted: #6b7280;
    --borrower-success: #047857;
    --borrower-warning: #b45309;
    --borrower-danger: #be123c;
    --borrower-info: #4338ca;
}
* { box-sizing: border-box; font-family: 'Poppins', sans-serif; }
body { margin: 0; background: var(--borrower-bg); color: var(--borrower-text); }
a { color: inherit; }
.auth-shell {
    min-height: 100vh;
    background:
      radial-gradient(circle at top left, rgba(15,163,107,0.16), transparent 26%),
      radial-gradient(circle at bottom right, rgba(43,20,90,0.14), transparent 30%),
      linear-gradient(135deg, #fbfbfc 0%, #eef2f5 100%);
}
.page-shell { display:flex; min-height:100vh; }
.borrower-sidebar {
    width: 288px; min-height:100vh; background: var(--borrower-primary); color:white;
}
.sidebar-link { display:flex; align-items:center; gap:.75rem; border-radius:1rem; padding:.85rem 1rem; color:rgba(255,255,255,.82); text-decoration:none; transition:.2s ease; }
.sidebar-link:hover, .sidebar-link.active { background: rgba(255,255,255,.08); color:#fff; }
.sidebar-icon { width:1.1rem; height:1.1rem; display:inline-flex; }
.sidebar-icon svg { width:100%; height:100%; }
.topbar { position:sticky; top:0; z-index:20; border-bottom:1px solid var(--borrower-border); background:rgba(255,255,255,.92); backdrop-filter:blur(10px); }
.panel, .metric-card, .info-card { background:var(--borrower-surface); border:1px solid var(--borrower-border); box-shadow:0 12px 32px rgba(22,31,45,.06); border-radius:1.5rem; }
.panel { padding:1.5rem; }
.metric-card, .info-card { padding:1.25rem; }
.hero-card {
    background: linear-gradient(135deg, rgba(43,20,90,0.98) 0%, rgba(36,15,77,0.96) 56%, rgba(15,163,107,0.94) 100%);
    color:#fff; border-radius:2rem; overflow:hidden; position:relative;
}
.hero-card::after { content:''; position:absolute; inset:0; background:radial-gradient(circle at top right, rgba(255,255,255,0.12), transparent 28%); pointer-events:none; }
.btn-primary, .btn-secondary, .btn-soft, .btn-danger {
  display:inline-flex; align-items:center; justify-content:center; gap:.55rem; border-radius:1rem; padding:.85rem 1.1rem; font-size:.92rem; font-weight:600; text-decoration:none; border:0; cursor:pointer; transition:.2s ease;
}
.btn-primary { background:var(--borrower-accent); color:#fff; }
.btn-primary:hover { background:var(--borrower-accent-dark); }
.btn-secondary { background:#fff; color:var(--borrower-text); border:1px solid var(--borrower-border); }
.btn-soft { background:rgba(43,20,90,0.08); color:var(--borrower-primary); }
.btn-danger { background:#fff1f2; color:var(--borrower-danger); border:1px solid #fecdd3; }
.badge { display:inline-flex; align-items:center; border-radius:999px; padding:.35rem .75rem; font-size:.75rem; font-weight:600; }
.badge-success { background:#ecfdf5; color:#047857; }
.badge-warning { background:#fff4df; color:#b45309; }
.badge-info { background:#f3ecff; color:var(--borrower-primary); }
.badge-danger { background:#fff1f2; color:#be123c; }
.form-input,.form-select,.form-textarea,.form-file { width:100%; border-radius:1rem; border:1px solid var(--borrower-border); background:#fff; padding:.9rem 1rem; outline:none; }
.form-file { padding:.8rem 1rem; }
.form-input:focus,.form-select:focus,.form-textarea:focus,.form-file:focus { border-color:var(--borrower-accent); box-shadow:0 0 0 4px rgba(15,163,107,0.12); }
.form-label { display:block; font-size:.85rem; font-weight:600; color:var(--borrower-text); margin-bottom:.45rem; }
.data-table { width:100%; border-collapse:collapse; min-width:760px; }
.data-table thead th { padding-bottom:.9rem; text-align:left; font-size:.85rem; font-weight:600; color:var(--borrower-muted); border-bottom:1px solid var(--borrower-border); }
.data-table tbody td { padding:1rem 0; font-size:.92rem; color:var(--borrower-text); border-bottom:1px solid #edf2f7; vertical-align:top; }
.progress-track { height:.55rem; border-radius:999px; overflow:hidden; background:#ecf0f4; }
.progress-track > span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--borrower-accent),var(--borrower-primary)); }
.section-title { color: var(--borrower-primary); font-weight:700; font-size:1.05rem; }
.auth-card { width:min(520px,100%); background:#fff; border:1px solid var(--borrower-border); box-shadow:0 18px 48px rgba(22,31,45,.08); border-radius:2rem; padding:2rem; }
.kpi-grid { display:grid; gap:1rem; }
.stat-grid { display:grid; gap:1rem; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); }
.investor-stat-row { display:grid !important; grid-template-columns:repeat(4,minmax(0,1fr)) !important; gap:1rem !important; }
@media (max-width: 1280px) { .investor-stat-row { grid-template-columns:repeat(2,minmax(0,1fr)) !important; } }
@media (max-width: 700px) { .investor-stat-row { grid-template-columns:1fr !important; } }
.kpi-number { margin-top:.35rem; color:var(--borrower-text); font-size:1.65rem; line-height:1.15; font-weight:700; letter-spacing:-.03em; }
.table-shell { width:100%; overflow-x:auto; }
.table-shell table { width:100%; min-width:720px; border-collapse:collapse; }
.table-shell thead th { padding:.25rem 1rem .95rem; text-align:left !important; font-size:.88rem; font-weight:700; color:var(--borrower-text); border-bottom:1px solid var(--borrower-border); white-space:nowrap; }
.table-shell tbody td { padding:1rem; text-align:left !important; color:var(--borrower-text); border-bottom:1px solid #edf2f7; vertical-align:middle; }
.table-shell tbody tr:last-child td { border-bottom:0; }
.opportunity-table { table-layout:fixed; }
.investor-stat-row-3 { display:grid !important; grid-template-columns:repeat(3,minmax(0,1fr)) !important; gap:1rem !important; }
.investor-watchlist-table { width:100% !important; table-layout:fixed !important; border-collapse:collapse !important; }
.investor-table { width:100% !important; table-layout:fixed !important; border-collapse:collapse !important; }
.investor-table th,
.investor-table td,
.investor-watchlist-table th,
.investor-watchlist-table td { padding-left:1rem !important; padding-right:1rem !important; text-align:left !important; }
@media (max-width: 1024px) { .investor-stat-row-3 { grid-template-columns:1fr !important; } }
.opportunity-table th:nth-child(1), .opportunity-table td:nth-child(1) { width:32%; }
.opportunity-table th:nth-child(2), .opportunity-table td:nth-child(2) { width:26%; }
.opportunity-table th:nth-child(3), .opportunity-table td:nth-child(3) { width:22%; }
.opportunity-table th:nth-child(4), .opportunity-table td:nth-child(4) { width:20%; }
.opportunity-table.with-actions th:nth-child(1), .opportunity-table.with-actions td:nth-child(1) { width:24%; }
.opportunity-table.with-actions th:nth-child(2), .opportunity-table.with-actions td:nth-child(2) { width:20%; }
.opportunity-table.with-actions th:nth-child(3), .opportunity-table.with-actions td:nth-child(3) { width:17%; }
.opportunity-table.with-actions th:nth-child(4), .opportunity-table.with-actions td:nth-child(4) { width:14%; }
.opportunity-table.with-actions th:nth-child(5), .opportunity-table.with-actions td:nth-child(5) { width:25%; }
.onboarding-step { display:flex; align-items:flex-start; gap:1rem; }
.step-dot { width:2.25rem; height:2.25rem; display:flex; align-items:center; justify-content:center; border-radius:999px; font-weight:700; }
.step-dot.active { background:var(--borrower-accent); color:#fff; }
.step-dot.done { background:rgba(15,163,107,.16); color:var(--borrower-success); }
.step-dot.todo { background:#e5e7eb; color:#6b7280; }
.status-card { border-left:4px solid var(--borrower-accent); }
.small-muted { font-size:.82rem; color:var(--borrower-muted); }
.password-strength-meter{display:grid;gap:.55rem;margin-top:.6rem}
.password-strength-track{height:.55rem;border-radius:999px;overflow:hidden;background:#e5e7eb;border:1px solid rgba(148,163,184,.35)}
.password-strength-fill{display:block;height:100%;width:0%;border-radius:999px;background:#ef4444;transition:width .2s ease,background .2s ease}
.password-strength-meter[data-strength-level="1"] .password-strength-fill{width:25%;background:#ef4444}
.password-strength-meter[data-strength-level="2"] .password-strength-fill{width:50%;background:#f59e0b}
.password-strength-meter[data-strength-level="3"] .password-strength-fill{width:75%;background:#84cc16}
.password-strength-meter[data-strength-level="4"] .password-strength-fill{width:100%;background:#10b981}
.password-strength-summary{display:flex;align-items:center;justify-content:space-between;gap:1rem;font-size:.78rem;color:var(--borrower-muted);font-weight:700}
.password-strength-checks{display:flex;flex-wrap:wrap;gap:.4rem}
.password-strength-rule{border:1px solid #e2e8f0;border-radius:999px;padding:.25rem .55rem;font-size:.72rem;font-weight:700;color:#64748b;background:#f8fafc}
.password-strength-rule.is-met{border-color:#bbf7d0;background:#ecfdf5;color:#047857}
@media (max-width: 1024px) {
  .borrower-sidebar { display:none; }
}
.alert{padding:14px 16px;border-radius:14px;margin-bottom:16px;border:1px solid transparent;font-weight:600;box-shadow:0 12px 30px rgba(15,23,42,.08)}
.fs-alert-persistent{position:relative;display:flex;align-items:flex-start;gap:.75rem;padding-right:3.25rem}
.alert-close{position:absolute;top:50%;right:.75rem;transform:translateY(-50%);width:1.9rem;height:1.9rem;border:0;border-radius:999px;background:rgba(15,23,42,.08);color:inherit;font-size:1.15rem;line-height:1;cursor:pointer}
.alert-close:hover{background:rgba(15,23,42,.14)}
.alert-success{background:#ecfdf3;color:#027a48;border-color:#abefc6}
.alert-danger{background:#fef3f2;color:#b42318;border-color:#fecdca}
.alert-warning{background:#fffaeb;color:#b54708;border-color:#fedf89}
.alert-info{background:#eff8ff;color:#175cd3;border-color:#b2ddff}

.mobile-portal-nav {
  display: none;
}

.saver-mobile-bottom-nav,
.saver-mobile-drawer {
  display: none;
}

@media (max-width: 1023px) {
  .page-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .page-shell > main {
    padding-bottom: calc(5.3rem + env(safe-area-inset-bottom, 0px));
  }

  .saver-mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 55;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .18rem;
    min-height: 4.7rem;
    border-top: 1px solid rgba(203, 213, 225, .9);
    background: rgba(255, 255, 255, .97);
    padding: .45rem .45rem calc(.45rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -12px 34px rgba(15, 23, 42, .12);
    backdrop-filter: blur(16px);
  }

  .saver-mobile-bottom-link {
    display: flex;
    min-width: 0;
    min-height: 3.65rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .22rem;
    border: 0;
    border-radius: .85rem;
    background: transparent;
    color: #64748b;
    padding: .35rem .15rem;
    font: inherit;
    font-size: .63rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
  }

  .saver-mobile-bottom-link.active {
    background: #ecfdf5;
    color: #047857;
  }

  .saver-mobile-bottom-link:focus-visible,
  .saver-mobile-drawer-link:focus-visible,
  .saver-mobile-drawer-close:focus-visible {
    outline: 3px solid rgba(16, 185, 129, .35);
    outline-offset: 2px;
  }

  .saver-mobile-bottom-icon {
    display: grid;
    width: 1.55rem;
    height: 1.55rem;
    place-items: center;
    color: currentColor;
    font-size: 1.05rem;
    line-height: 1;
  }

  .saver-mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    pointer-events: none;
    visibility: hidden;
  }

  .saver-mobile-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
  }

  .saver-mobile-drawer-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, .55);
    opacity: 0;
    transition: opacity .2s ease;
  }

  .saver-mobile-drawer.is-open .saver-mobile-drawer-backdrop {
    opacity: 1;
  }

  .saver-mobile-drawer-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: min(78vh, 42rem);
    overflow-y: auto;
    border-radius: 1.4rem 1.4rem 0 0;
    background: #fff;
    padding: .65rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -24px 60px rgba(15, 23, 42, .24);
    transform: translateY(105%);
    transition: transform .22s ease;
  }

  .saver-mobile-drawer.is-open .saver-mobile-drawer-panel {
    transform: translateY(0);
  }

  .saver-mobile-drawer-handle {
    width: 2.8rem;
    height: .3rem;
    margin: .1rem auto .75rem;
    border-radius: 999px;
    background: #cbd5e1;
  }

  .saver-mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .25rem .25rem .8rem;
  }

  .saver-mobile-drawer-eyebrow {
    color: #94a3b8;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
  }

  .saver-mobile-drawer-head h2 {
    margin-top: .2rem;
    color: #172033;
    font-size: 1.2rem;
    font-weight: 700;
  }

  .saver-mobile-drawer-close {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 1.6rem;
    line-height: 1;
  }

  .saver-mobile-drawer-links {
    display: grid;
    gap: .55rem;
  }

  .saver-mobile-drawer-link {
    display: flex;
    width: 100%;
    min-height: 3.5rem;
    align-items: center;
    gap: .8rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #fff;
    color: #334155;
    padding: .75rem .9rem;
    font: inherit;
    font-size: .9rem;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
  }

  .saver-mobile-drawer-link.active {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #047857;
  }

  .saver-mobile-drawer-link-icon {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    place-items: center;
    border-radius: .7rem;
    background: #f1f5f9;
    color: inherit;
  }

  .mobile-portal-nav {
    display: block;
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid rgba(216, 222, 232, .9);
    background: rgba(255, 255, 255, .96);
    padding: .75rem .875rem .65rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
    backdrop-filter: blur(14px);
  }

  .mobile-portal-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .65rem;
  }

  .mobile-portal-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
  }

  .mobile-portal-brand img {
    width: 2.35rem;
    height: 2.35rem;
    object-fit: contain;
    border-radius: .75rem;
    background: #26194f;
  }

  .mobile-portal-brand strong,
  .mobile-portal-brand span {
    display: block;
    line-height: 1.15;
  }

  .mobile-portal-brand strong {
    color: var(--borrower-primary, var(--tenant-primary));
    font-size: .95rem;
  }

  .mobile-portal-brand span {
    color: #64748b;
    font-size: .73rem;
  }

  .mobile-portal-current {
    flex: 0 0 auto;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 999px;
    background: rgba(15, 163, 107, .1);
    color: #047857;
    padding: .45rem .7rem;
    font-size: .75rem;
    font-weight: 700;
  }

  .mobile-portal-scroll {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .15rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-portal-scroll::-webkit-scrollbar {
    display: none;
  }

  .mobile-portal-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    max-width: 76vw;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    padding: .58rem .8rem;
    text-decoration: none;
    white-space: nowrap;
    font-size: .82rem;
    font-weight: 700;
  }

  .mobile-portal-link.active {
    border-color: transparent;
    background: var(--borrower-primary, var(--tenant-primary));
    color: #fff;
  }

  .mobile-portal-link .sidebar-icon {
    width: 1rem;
    min-width: 1rem;
    color: inherit !important;
  }

  .topbar {
    position: static;
    flex-wrap: wrap;
    align-items: flex-start !important;
    padding: 1rem !important;
  }

  .topbar > .flex.items-center.justify-between {
    flex-wrap: wrap;
    align-items: flex-start !important;
  }

  .topbar > div {
    min-width: 0;
  }

  .topbar h1 {
    font-size: 1.25rem !important;
    line-height: 1.2 !important;
    overflow-wrap: anywhere;
  }

  .topbar .btn-primary,
  .topbar .btn-secondary,
  .topbar .btn-soft {
    padding: .65rem .8rem;
  }

  .page-shell main > div[class*="p-6"],
  .page-shell main > div[class*="p-8"] {
    padding: 1rem !important;
  }

  .hero-card,
  .tenant-hero {
    border-radius: 1.5rem;
    padding: 1.5rem !important;
  }

  .hero-card h2,
  .tenant-hero h2 {
    font-size: 1.85rem !important;
    line-height: 1.15 !important;
  }

  .panel,
  .stat-card,
  .metric-card,
  .info-card {
    border-radius: 1.15rem;
  }

  .panel {
    padding: 1rem;
  }

  .upload-card,
  .review-item,
  .info-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .topbar,
  .topbar > .flex.items-center.justify-between {
    flex-direction: column;
    align-items: stretch !important;
  }

  .panel > .flex.items-center.justify-between,
  .panel > div.flex.items-center.justify-between,
  .panel > .flex.items-center.justify-between.gap-4,
  .panel > div.flex.items-center.justify-between.gap-4 {
    flex-direction: column;
    align-items: stretch !important;
  }

  .panel > .flex.items-center.justify-between .btn-primary,
  .panel > .flex.items-center.justify-between .btn-secondary,
  .panel > .flex.items-center.justify-between .btn-soft,
  .panel > div.flex.items-center.justify-between .btn-primary,
  .panel > div.flex.items-center.justify-between .btn-secondary,
  .panel > div.flex.items-center.justify-between .btn-soft {
    width: 100%;
  }

  .table-wrap,
  .table-shell,
  .overflow-x-auto {
    overflow-x: visible !important;
  }

  table.responsive-cards,
  .table-shell table.responsive-cards,
  .data-table.responsive-cards,
  .investor-table.responsive-cards {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  table.responsive-cards thead {
    display: none;
  }

  table.responsive-cards tbody,
  table.responsive-cards tr,
  table.responsive-cards td {
    display: block;
    width: 100% !important;
  }

  table.responsive-cards tr {
    margin-bottom: .85rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #fff;
    padding: .85rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
  }

  table.responsive-cards td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #edf2f7 !important;
    padding: .6rem 0 !important;
    text-align: right !important;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  table.responsive-cards td:last-child {
    border-bottom: 0 !important;
  }

  table.responsive-cards td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    color: #64748b;
    font-size: .78rem;
    font-weight: 800;
    text-align: left;
  }

  table.responsive-cards td[colspan] {
    display: block;
    text-align: left !important;
  }

  table.responsive-cards td[colspan]::before {
    content: none;
  }

  table.responsive-cards td form {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  table.responsive-cards td input,
  table.responsive-cards td select,
  table.responsive-cards td button {
    max-width: 100% !important;
  }
}

/* First-time SME and Investor page guides */
.portal-tour-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  border: 1px solid #d8dee8;
  border-radius: 1rem;
  background: #fff;
  color: #2b145a;
  padding: .6rem .8rem;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.portal-tour-launch:hover,
.portal-tour-launch:focus-visible {
  border-color: rgba(15, 163, 107, .55);
  box-shadow: 0 0 0 4px rgba(15, 163, 107, .1);
  outline: none;
}

.portal-tour-launch:active { transform: translateY(1px); }

.portal-tour-launch-icon {
  display: inline-grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border-radius: 999px;
  background: #0fa36b;
  color: #fff;
  font-size: .82rem;
  line-height: 1;
}

.portal-tour[hidden] { display: none !important; }

.portal-tour {
  position: fixed;
  inset: 0;
  z-index: 9999;
  font-family: Poppins, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  pointer-events: none;
}

.portal-tour-shade {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: transparent;
  pointer-events: auto;
}

.portal-tour.is-centered .portal-tour-shade { background: rgba(15, 23, 42, .72); }

.portal-tour-spotlight {
  position: fixed;
  z-index: 1;
  border: 3px solid rgba(255, 255, 255, .96);
  border-radius: 1.15rem;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, .68), 0 18px 48px rgba(15, 23, 42, .28);
  pointer-events: none;
  transition: left .2s ease, top .2s ease, width .2s ease, height .2s ease;
}

.portal-tour-spotlight[hidden] { display: none; }

.portal-tour-card {
  position: fixed;
  z-index: 2;
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 1.1rem;
  background: #fff;
  color: #1f2937;
  padding: 1.25rem;
  pointer-events: auto;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .32);
  transform: none;
}

.portal-tour-card::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .7);
  transform: rotate(45deg);
  box-shadow: -5px -5px 12px rgba(15, 23, 42, .04);
}

.portal-tour-card[data-placement="right"]::before {
  left: -9px;
  top: calc(50% - 8px);
  border-top: 0;
  border-right: 0;
}

.portal-tour-card[data-placement="left"]::before {
  right: -9px;
  top: calc(50% - 8px);
  border-bottom: 0;
  border-left: 0;
}

.portal-tour-card[data-placement="bottom"]::before {
  top: -9px;
  left: calc(50% - 8px);
  border-right: 0;
  border-bottom: 0;
}

.portal-tour-card[data-placement="top"]::before {
  bottom: -9px;
  left: calc(50% - 8px);
  border-left: 0;
  border-top: 0;
}

.portal-tour-card.is-centered {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.portal-tour-card.is-centered::before { display: none; }

.portal-tour-card-head,
.portal-tour-actions,
.portal-tour-step-actions {
  display: flex;
  align-items: center;
}

.portal-tour-card-head,
.portal-tour-actions { justify-content: space-between; gap: 1rem; }
.portal-tour-step-actions { gap: .6rem; }

.portal-tour-kicker {
  color: #0c8a5c;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.portal-tour-close {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 1.25rem;
  cursor: pointer;
}

.portal-tour-progress {
  height: .35rem;
  margin-top: .9rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.portal-tour-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0fa36b, #2b145a);
  transition: width .2s ease;
}

.portal-tour-count {
  margin: .7rem 0 0;
  color: #64748b;
  font-size: .72rem;
  font-weight: 700;
}

.portal-tour-title {
  margin: .35rem 0 0;
  color: #2b145a;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
}

.portal-tour-description {
  margin: .7rem 0 0;
  color: #475569;
  font-size: .88rem;
  line-height: 1.65;
}

.portal-tour-actions { margin-top: 1.15rem; }

.portal-tour-skip,
.portal-tour-back,
.portal-tour-next {
  min-height: 2.5rem;
  border-radius: .85rem;
  padding: .62rem .85rem;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}

.portal-tour-skip {
  border: 0;
  background: transparent;
  color: #64748b;
  padding-left: 0;
}

.portal-tour-back {
  border: 1px solid #d8dee8;
  background: #fff;
  color: #334155;
}

.portal-tour-back:disabled { opacity: .45; cursor: not-allowed; }

.portal-tour-next {
  min-width: 4.8rem;
  border: 0;
  background: #0fa36b;
  color: #fff;
}

.portal-tour-close:focus-visible,
.portal-tour-skip:focus-visible,
.portal-tour-back:focus-visible,
.portal-tour-next:focus-visible {
  outline: 3px solid rgba(15, 163, 107, .25);
  outline-offset: 2px;
}

.portal-tour-active-target {
  position: relative;
  z-index: 2;
  scroll-margin: 7rem;
}

@media (max-width: 640px) {
  .portal-tour-card {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    border-radius: 1rem;
    padding: 1rem;
  }

  .portal-tour-card:not(.is-centered) { left: 12px !important; }
  .portal-tour-actions { align-items: flex-end; }
  .portal-tour-step-actions { flex-wrap: wrap; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-tour-spotlight,
  .portal-tour-progress span,
  .portal-tour-launch { transition: none; }
}
