/* Steady Finance — Member portal (teal brand) */

:root {
    --portal-teal: #007981;
    --portal-teal-dark: #005a61;
    --portal-teal-darker: #004a50;
    --portal-teal-light: #1aabb3;
    --portal-teal-muted: #e6f5f6;
    --portal-teal-soft: #d4eef0;
    --portal-navy: #082b5c;
    --portal-bg: #f5f7fa;
    --portal-card: #ffffff;
    --portal-text: #1a2332;
    --portal-text-muted: #5c667a;
    --portal-border: #e2e8f0;
    --portal-success: #16a34a;
    --portal-success-bg: #ecfdf3;
    --portal-success-border: #bbf7d0;
    --portal-purple: #6f42c1;
    --portal-purple-bg: #f3ebff;
    --portal-purple-light: #ede5ff;
    --portal-radius: 12px;
    --portal-radius-lg: 16px;
    --portal-shadow: 0 4px 24px rgba(8, 43, 92, 0.06);
    --portal-sidebar-width: 280px;
    --portal-header-height: var(--steady-header-height, 64px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.portal-body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--portal-text);
    background: var(--portal-bg);
    -webkit-font-smoothing: antialiased;
}

.portal-shell {
    display: flex;
    align-items: stretch;
    min-height: calc(100vh - var(--portal-header-height));
    background: linear-gradient(
        90deg,
        var(--portal-teal-darker) 0,
        var(--portal-teal-darker) var(--portal-sidebar-width),
        transparent var(--portal-sidebar-width)
    );
}

.portal-body--with-header .portal-sidebar {
    top: var(--portal-header-height);
    height: auto;
    min-height: calc(100vh - var(--portal-header-height));
}

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

/* ── Sidebar ── */

.portal-sidebar {
    width: var(--portal-sidebar-width);
    flex-shrink: 0;
    align-self: stretch;
    background: linear-gradient(180deg, var(--portal-teal-dark) 0%, var(--portal-teal-darker) 100%);
    color: #fff;
    min-height: calc(100vh - var(--portal-header-height));
}

.portal-sidebar-inner {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--portal-header-height));
    padding: 1.5rem 1.25rem;
    gap: 1.5rem;
}

.portal-welcome h2 {
    margin: 0 0 0.35rem;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.35;
}

.portal-welcome p {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75);
}

.portal-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.portal-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.875rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.portal-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.portal-nav-link.is-active {
    background: var(--portal-teal);
    color: #fff;
}

.portal-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.portal-nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 0.875rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.portal-nav-group-toggle:hover,
.portal-nav-group-toggle.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.portal-nav-chevron {
    width: 1rem;
    height: 1rem;
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.portal-nav-group.is-open .portal-nav-chevron {
    transform: rotate(180deg);
}

.portal-nav-submenu {
    display: none;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.15rem 0 0.35rem 2.35rem;
}

.portal-nav-group.is-open .portal-nav-submenu {
    display: flex;
}

.portal-nav-sublink {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.portal-nav-sublink:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.portal-nav-sublink.is-active {
    background: var(--portal-teal);
    color: #fff;
}

.portal-nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.portal-promo {
    background: rgba(0, 121, 129, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--portal-radius);
    padding: 1rem;
}

.portal-promo p {
    margin: 0 0 0.875rem;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
}

.portal-benefits-box {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--portal-radius);
    padding: 1rem;
}

.portal-benefits-box h3 {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}

.portal-benefits-list {
    list-style: none;
    margin: 0 0 0.875rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.portal-benefits-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.88);
}

.portal-benefits-list svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--portal-success);
}

.portal-sidebar-footer {
    margin-top: auto;
    padding-top: 0.5rem;
}

.portal-sidebar-footer > p {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
}

.portal-support-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.portal-support-link svg {
    width: 1.125rem;
    height: 1.125rem;
}

.portal-support-link:hover {
    text-decoration: underline;
}

.portal-logout-form {
    margin-top: 1rem;
}

.portal-logout-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8125rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
}

.portal-logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ── Main content ── */

.portal-main {
    flex: 1;
    min-width: 0;
    padding: 2rem 2.5rem 3rem;
    max-width: 1200px;
    overflow-x: hidden;
}

.portal-main--wide {
    max-width: none;
    width: 100%;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.portal-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.portal-page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.portal-page-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--portal-navy);
}

.portal-page-header p {
    margin: 0;
    color: var(--portal-text-muted);
    font-size: 0.9375rem;
}

.portal-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: var(--portal-card);
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    font-size: 0.8125rem;
    color: var(--portal-text-muted);
    white-space: nowrap;
}

.portal-badge svg {
    width: 1rem;
    height: 1rem;
    color: var(--portal-teal);
}

.portal-page-header-actions--path {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.portal-path-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.portal-stat-icon--status {
    background: #ecfdf5;
}

.portal-stat-icon--status.is-warning {
    background: #fef2f2;
}

.portal-status-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
    animation: portal-status-pulse 1.8s ease-in-out infinite;
}

.portal-stat-icon--status.is-warning .portal-status-dot {
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
}

@keyframes portal-status-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.85; }
}

.portal-banner--schedule {
    background: #f8f1e7;
    border: 1px solid #ead9c4;
    color: #6b4f2e;
}

.portal-banner p {
    margin: 0 0 0.55rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.portal-banner p:last-child {
    margin-bottom: 0;
}

.portal-setup-copy {
    margin: 0.65rem 0 0.5rem;
}

.portal-setup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    margin-top: 0.15rem;
}

/* ── Overview status cards ── */

.portal-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.portal-overview-card {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    background: var(--portal-card);
    border-radius: var(--portal-radius);
    padding: 1.125rem 1.25rem;
    box-shadow: var(--portal-shadow);
    border: 1px solid var(--portal-border);
}

.portal-overview-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-overview-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.portal-overview-icon--teal {
    background: var(--portal-teal-muted);
    color: var(--portal-teal);
}

.portal-overview-icon--purple {
    background: var(--portal-purple-bg);
    color: var(--portal-purple);
}

.portal-overview-icon--gray {
    background: #f1f5f9;
    color: #64748b;
}

.portal-overview-label {
    display: block;
    font-size: 0.75rem;
    color: var(--portal-text-muted);
    margin-bottom: 0.15rem;
}

.portal-overview-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--portal-navy);
    margin-bottom: 0.25rem;
}

.portal-overview-value--success {
    color: var(--portal-success);
}

.portal-overview-value--purple {
    color: var(--portal-purple);
}

.portal-overview-value--muted {
    color: #64748b;
}

.portal-overview-card p {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--portal-text-muted);
}

/* ── Stats row ── */

.portal-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.portal-stat-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    background: var(--portal-card);
    border-radius: var(--portal-radius);
    padding: 1.125rem 1.25rem;
    box-shadow: var(--portal-shadow);
    border: 1px solid var(--portal-border);
}

.portal-stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--portal-teal-muted);
    color: var(--portal-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.portal-stat-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.portal-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--portal-text-muted);
    margin-bottom: 0.15rem;
}

.portal-stat-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--portal-navy);
}

.portal-stat-hint {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.6875rem;
    line-height: 1.35;
    color: var(--portal-text-muted);
}

.portal-stats-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.portal-stats-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.portal-progress-meta {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: var(--portal-text-muted);
}

/* ── Grid & cards ── */

.portal-grid {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    min-width: 0;
}

.portal-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.portal-grid--2 > * {
    min-width: 0;
}

.portal-grid--hero {
    grid-template-columns: 2fr 1fr;
}

.portal-card--hero {
    padding: 1.75rem;
}

.portal-card--why {
    display: flex;
    flex-direction: column;
}

.portal-hero-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.portal-hero-art {
    flex-shrink: 0;
    width: 140px;
}

.portal-hero-art svg {
    width: 100%;
    height: auto;
}

.portal-hero-copy {
    flex: 1;
    min-width: 0;
}

.portal-hero-copy > p {
    margin: 0 0 1.25rem;
    font-size: 0.875rem;
    color: var(--portal-text-muted);
    line-height: 1.55;
}

.portal-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
    margin-bottom: 1.25rem;
}

.portal-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-size: 0.8125rem;
}

.portal-feature-icon {
    font-size: 1.125rem;
    line-height: 1;
    flex-shrink: 0;
}

.portal-feature-item strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--portal-navy);
    margin-bottom: 0.1rem;
}

.portal-feature-item span {
    display: block;
    font-size: 0.75rem;
    color: var(--portal-text-muted);
}

.portal-why-list {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.portal-why-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.portal-why-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.portal-why-icon--teal {
    background: var(--portal-teal-muted);
    color: var(--portal-teal);
}

.portal-why-icon--green {
    background: var(--portal-success-bg);
    color: var(--portal-success);
}

.portal-why-icon--purple {
    background: var(--portal-purple-bg);
    color: var(--portal-purple);
}

.portal-why-icon--blue {
    background: #eff6ff;
    color: #2563eb;
}

.portal-why-list strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--portal-navy);
    margin-bottom: 0.15rem;
}

.portal-why-list span {
    display: block;
    font-size: 0.75rem;
    color: var(--portal-text-muted);
}

.portal-benefits-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.portal-benefit-tile {
    text-align: center;
}

.portal-benefit-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    margin: 0 auto 0.625rem;
    font-size: 1.25rem;
}

.portal-benefit-circle--teal {
    background: var(--portal-teal-muted);
}

.portal-benefit-circle--purple {
    background: var(--portal-purple-bg);
}

.portal-benefit-circle--blue {
    background: #eff6ff;
}

.portal-benefit-circle--green {
    background: var(--portal-success-bg);
}

.portal-benefit-tile strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--portal-navy);
    margin-bottom: 0.2rem;
}

.portal-benefit-tile span {
    display: block;
    font-size: 0.75rem;
    color: var(--portal-text-muted);
    line-height: 1.4;
}

.portal-journey {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.25rem;
    padding-top: 0.5rem;
}

.portal-journey-step {
    flex: 1;
    text-align: center;
    position: relative;
    min-width: 0;
}

.portal-journey-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-size: 1.125rem;
    border: 2px solid transparent;
}

.portal-journey-icon--teal {
    background: var(--portal-teal-muted);
    border-color: var(--portal-teal);
}

.portal-journey-icon--purple {
    background: var(--portal-purple-bg);
    border-color: var(--portal-purple);
}

.portal-journey-icon--gray {
    background: #f1f5f9;
    color: #94a3b8;
}

.portal-journey-step strong {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--portal-navy);
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.portal-journey-step > span:not(.portal-journey-badge) {
    display: block;
    font-size: 0.625rem;
    color: var(--portal-text-muted);
    line-height: 1.35;
}

.portal-journey-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    font-size: 0.625rem;
    margin-top: 0.25rem;
}

.portal-journey-badge--success {
    background: var(--portal-success);
    color: #fff;
}

.portal-journey-line {
    flex: 0 0 1.5rem;
    height: 2px;
    margin-top: 1.375rem;
    background: repeating-linear-gradient(
        90deg,
        #cbd5e1 0,
        #cbd5e1 4px,
        transparent 4px,
        transparent 8px
    );
}

.portal-journey-step.is-current strong {
    color: var(--portal-purple);
}

.portal-journey-step.is-locked {
    opacity: 0.65;
}

.portal-card {
    background: var(--portal-card);
    border-radius: var(--portal-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--portal-shadow);
    border: 1px solid var(--portal-border);
    min-width: 0;
    max-width: 100%;
}

.portal-card-title {
    margin: 0 0 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--portal-navy);
}

/* ── Progress ring ── */

.portal-progress-wrap {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    min-width: 0;
}

.portal-progress-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.portal-progress-copy p,
.portal-progress-meta {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.portal-progress-ring {
    --size: 120px;
    --track: #e2e8f0;
    --fill: var(--portal-teal);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(
        var(--fill) calc(var(--progress) * 1%),
        var(--track) calc(var(--progress) * 1%)
    );
    position: relative;
}

.portal-progress-ring--svg {
    background: transparent;
    position: relative;
}

.portal-progress-ring--svg svg {
    width: 100%;
    height: 100%;
    display: block;
}

.portal-progress-ring-track {
    stroke: #e8eef3;
}

.portal-progress-ring-fill {
    stroke: var(--portal-teal);
    transition: stroke-dashoffset 0.4s ease;
}

.portal-progress-ring--svg.is-warning .portal-progress-ring-fill {
    stroke: #f472b6;
}

.portal-progress-ring::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: var(--portal-card);
}

.portal-progress-ring--svg::before {
    display: none;
}

.portal-progress-ring span {
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--portal-navy);
    line-height: 1.2;
}

.portal-progress-ring--svg span {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.portal-progress-ring span small {
    display: block;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--portal-text-muted);
}

.portal-progress-copy p {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: var(--portal-text-muted);
}

.portal-progress-copy strong {
    color: var(--portal-text);
}

.portal-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--portal-text-muted);
}

.portal-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.portal-dot--success {
    background: var(--portal-success);
}

.portal-dot--danger {
    background: #f87171;
}

.portal-dot--pink {
    background: #f9a8d4;
}

.portal-dot--sky {
    background: #93c5fd;
}

.portal-dot--muted {
    background: #cbd5e1;
}

/* ── Banners ── */

.portal-banner {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

.portal-banner--success {
    background: var(--portal-success-bg);
    border: 1px solid var(--portal-success-border);
    color: #166534;
}

.portal-arrears-box {
    background: #fee2e2;
    border-radius: 12px;
    padding: 1.35rem 1.4rem;
    margin-bottom: 1.25rem;
}

.portal-arrears-box span {
    display: block;
    font-size: 0.9rem;
    color: #9f1239;
    margin-bottom: 0.4rem;
}

.portal-arrears-box strong {
    display: block;
    font-size: 1.85rem;
    font-weight: 700;
    color: #881337;
    line-height: 1.15;
}

.portal-arrears-days {
    margin: 0.55rem 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #9f1239;
}

.portal-arrears-days span {
    display: inline;
    font-weight: 500;
    color: #be123c;
}

.portal-arrears-summary {
    margin: 0.65rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #9f1239;
}

.portal-card--path-status .portal-cta-stack {
    margin-bottom: 1rem;
}

.portal-card--path-status .portal-sub-link {
    margin-top: 0.25rem;
}

/* ── Next payment ── */

.portal-next-payment {
    background: var(--portal-teal-muted);
    border: 1px solid var(--portal-teal-soft);
    border-radius: var(--portal-radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    min-width: 0;
    overflow: hidden;
}

.portal-next-payment span {
    display: block;
    font-size: 0.8125rem;
    color: var(--portal-text-muted);
    margin-bottom: 0.35rem;
    overflow-wrap: anywhere;
}

.portal-next-payment strong {
    display: block;
    font-size: clamp(1.15rem, 6vw, 1.75rem);
    font-weight: 700;
    color: var(--portal-navy);
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.portal-sub-link {
    margin: 0.875rem 0 0;
    font-size: 0.8125rem;
    color: var(--portal-text-muted);
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.portal-sub-link a {
    color: var(--portal-teal);
    font-weight: 500;
    text-decoration: none;
}

.portal-sub-link a:hover {
    text-decoration: underline;
}

/* ── Summary list ── */

.portal-summary-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.portal-summary-list > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    font-size: 0.875rem;
}

.portal-summary-list dt {
    margin: 0;
    color: var(--portal-text-muted);
    font-weight: 400;
}

.portal-summary-list dd {
    margin: 0;
    font-weight: 600;
    color: var(--portal-text);
    text-align: right;
}

.portal-summary-list .is-highlight dd {
    color: var(--portal-success);
}

.portal-summary-list .is-soft dd {
    color: #94a3b8;
    font-weight: 600;
}

.portal-summary-list .is-late dd {
    color: #e11d48;
    font-weight: 700;
}

.portal-note {
    margin: 1rem 0 0;
    font-size: 0.75rem;
    color: var(--portal-text-muted);
    overflow-wrap: anywhere;
}

/* ── Table ── */

.portal-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin-bottom: 0.75rem;
}

.portal-table {
    width: 100%;
    min-width: 42rem;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.portal-table th {
    text-align: left;
    padding: 0.65rem 0.75rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--portal-text-muted);
    border-bottom: 1px solid var(--portal-border);
}

.portal-table--sentence th {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 700;
    font-size: 0.8125rem;
    color: var(--portal-text);
}

.portal-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--portal-border);
    color: var(--portal-text);
}

.portal-table tbody tr:last-child td {
    border-bottom: none;
}

.portal-table-note {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: var(--portal-text-muted);
    text-transform: capitalize;
}

.portal-code {
    font-size: 0.75rem;
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: var(--portal-navy);
}

.portal-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
}

.portal-status svg {
    width: 1rem;
    height: 1rem;
    color: var(--portal-success);
}

.portal-status--paid {
    color: var(--portal-success);
}

.portal-status--upcoming {
    background: var(--portal-teal-muted);
    color: var(--portal-teal-dark);
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-weight: 500;
}

.portal-status--scheduled {
    color: var(--portal-text-muted);
}

.portal-status--success {
    background: var(--portal-success-bg);
    color: #166534;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-weight: 500;
}

.portal-status--pending {
    background: #fff6e5;
    color: #9a6700;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-weight: 500;
}

.portal-status--failed {
    background: #fef2f2;
    color: #b42318;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-weight: 500;
}

.portal-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.portal-card-head .portal-card-title {
    margin: 0;
}

.portal-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--portal-teal);
    text-decoration: none;
}

.portal-link:hover {
    text-decoration: underline;
}

.portal-meta {
    font-size: 0.8125rem;
    color: var(--portal-text-muted);
}

/* ── Profile page ── */

.portal-profile-hero {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--portal-card);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-lg);
    box-shadow: var(--portal-shadow);
}

.portal-profile-avatar {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--portal-teal), #005a61);
    color: #fff;
    font-size: 1.125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.portal-profile-name {
    margin: 0 0 0.35rem;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--portal-navy);
}

.portal-profile-meta {
    margin: 0;
    font-size: 0.875rem;
    color: var(--portal-text-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.portal-profile-meta-sep {
    opacity: 0.5;
}

.portal-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.portal-profile-section .portal-card-title {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--portal-border);
}

.portal-detail-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.portal-detail-list > div {
    display: grid;
    grid-template-columns: 9.5rem 1fr;
    gap: 0.75rem;
    align-items: start;
}

.portal-detail-list dt {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--portal-text-muted);
}

.portal-detail-list dd {
    margin: 0;
    font-size: 0.875rem;
    color: var(--portal-text);
    word-break: break-word;
}

.portal-detail-sub {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: var(--portal-text-muted);
}

.portal-profile-empty {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: var(--portal-text-muted);
}

.portal-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.portal-empty {
    text-align: center;
    color: var(--portal-text-muted);
    padding: 2rem 1rem;
}

.portal-pagination {
    margin-top: 1.25rem;
}

.portal-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.portal-pager-group {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.portal-pager-btn,
.portal-pager-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    background: #fff;
    color: var(--portal-navy);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
}

.portal-pager-page {
    min-width: 2.25rem;
    padding: 0.4rem 0.55rem;
}

.portal-pager-btn:hover:not(.is-disabled),
.portal-pager-page:hover:not(.is-active) {
    border-color: var(--portal-teal);
    color: var(--portal-teal);
}

.portal-pager-btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.portal-pager-page.is-active {
    background: var(--portal-teal);
    border-color: var(--portal-teal);
    color: #fff;
}

.portal-pager-ellipsis {
    padding: 0 0.25rem;
    color: var(--portal-text-muted);
}

.portal-pager-info {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--portal-text-muted);
}

.portal-pagination nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.portal-pagination svg {
    width: 1rem;
    height: 1rem;
}

.portal-link-more {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--portal-teal);
    text-decoration: none;
}

.portal-link-more:hover {
    text-decoration: underline;
}

/* ── CTA banner ── */

.portal-cta-banner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--portal-teal-muted);
    border: 1px solid var(--portal-teal-soft);
    border-radius: var(--portal-radius-lg);
    padding: 1.5rem 1.75rem;
    margin-top: 0.5rem;
}

.portal-cta-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--portal-teal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.portal-cta-banner h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--portal-navy);
}

.portal-cta-banner p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--portal-text-muted);
}

.portal-cta-banner .portal-btn {
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Buttons ── */

.portal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    text-align: center;
}

.portal-btn-primary {
    background: var(--portal-teal);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 121, 129, 0.28);
}

.portal-btn-primary:hover {
    background: #006168;
}

.portal-btn-block {
    width: 100%;
    max-width: 100%;
}

.portal-btn-light {
    background: #fff;
    color: var(--portal-teal-dark);
    width: 100%;
    font-weight: 600;
}

.portal-btn-light:hover {
    background: #f0fafb;
}

.portal-btn-purple {
    background: var(--portal-purple);
    color: #fff;
    box-shadow: 0 2px 8px rgba(111, 66, 193, 0.28);
}

.portal-btn-purple:hover {
    background: #5a32a3;
}

.portal-btn:disabled,
.portal-btn.is-disabled,
.portal-btn.is-loading,
.portal-btn-purple:disabled,
.portal-btn-purple.is-disabled,
.portal-btn-purple.is-loading {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

.portal-btn-purple:disabled:hover,
.portal-btn-purple.is-loading:hover {
    background: var(--portal-purple);
}

.portal-btn-outline {
    background: transparent;
    color: var(--portal-teal-dark);
    border: 1.5px solid var(--portal-teal);
}

.portal-btn-outline:hover {
    background: var(--portal-teal-muted);
}

.portal-apply-error {
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.875rem;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b42318;
    font-size: 0.8125rem;
}

.portal-cta-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.portal-success-card {
    max-width: 720px;
    text-align: center;
    padding: 2.5rem 2rem;
}

.portal-success-icon {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: var(--portal-success-bg);
    color: var(--portal-success);
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-success-icon svg {
    width: 2.25rem;
    height: 2.25rem;
}

.portal-success-card h2 {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--portal-navy);
}

.portal-success-card > p {
    margin: 0 auto 1.75rem;
    max-width: 28rem;
    color: var(--portal-text-muted);
    font-size: 0.975rem;
    line-height: 1.55;
}

.portal-success-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.portal-banner--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b42318;
}

.portal-bank-card {
    max-width: 820px;
}

.portal-bank-lead {
    margin: -0.5rem 0 1.25rem;
    color: var(--portal-text-muted);
    font-size: 0.9rem;
}

.portal-bank-form .portal-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.portal-bank-form label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--portal-navy);
}

.portal-bank-form input,
.portal-bank-form select,
.portal-select {
    width: 100%;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    font: inherit;
    color: var(--portal-text);
    background: #fff;
}

.portal-bank-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.portal-bank-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

@media (max-width: 700px) {
    .portal-bank-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Steady Path apply / confirm details ── */

.portal-main--narrow {
    max-width: 760px;
}

.portal-apply-header {
    margin-bottom: 1.5rem;
}

.portal-apply-back {
    display: inline-block;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--portal-teal);
    text-decoration: none;
    font-weight: 500;
}

.portal-apply-back:hover {
    text-decoration: underline;
}

.portal-apply-header h1 {
    margin: 0 0 0.35rem;
    font-size: 1.75rem;
    color: var(--portal-navy);
}

.portal-apply-header p {
    margin: 0;
    color: var(--portal-text-muted);
}

.portal-apply-card {
    width: 100%;
    background: var(--portal-card);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-lg);
    box-shadow: var(--portal-shadow);
    overflow: hidden;
}

.portal-confirm-section {
    border: 0;
}

.portal-confirm-summary {
    list-style: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--portal-border);
}

.portal-confirm-summary::-webkit-details-marker {
    display: none;
}

.portal-confirm-step {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--portal-teal);
}

.portal-confirm-summary h2 {
    margin: 0 0 0.25rem;
    font-size: 1.125rem;
    color: var(--portal-navy);
}

.portal-confirm-summary p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--portal-text-muted);
}

.portal-confirm-status {
    flex-shrink: 0;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.portal-confirm-status.is-pending {
    background: #fef3c7;
    color: #92400e;
}

.portal-confirm-status.is-confirmed {
    background: #dcfce7;
    color: #166534;
}

.portal-confirm-body {
    padding: 1.5rem;
}

.portal-confirm-notice {
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
}

.portal-confirm-notice--success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.portal-confirm-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.portal-confirm-form .portal-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.portal-confirm-form .portal-field--full {
    grid-column: 1 / -1;
}

.portal-confirm-form label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--portal-navy);
}

.portal-confirm-form input,
.portal-confirm-form select {
    width: 100%;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    font: inherit;
    color: var(--portal-text);
    background: #fff;
}

.portal-field--readonly input {
    background: #f8fafc;
    color: var(--portal-text-muted);
}

.portal-field-hint {
    font-size: 0.75rem;
    color: var(--portal-text-muted);
}

.portal-field-hint--success {
    color: #166534;
}

.portal-optional {
    font-weight: 400;
    color: var(--portal-text-muted);
}

.portal-confirm-checkbox {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
}

.portal-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.875rem;
    color: var(--portal-text);
    cursor: pointer;
    line-height: 1.45;
}

.portal-checkbox input {
    width: 1rem;
    height: 1rem;
    margin-top: 0.18rem;
    padding: 0;
    flex: 0 0 1rem;
    flex-shrink: 0;
    accent-color: var(--portal-teal);
    cursor: pointer;
}

.portal-checkbox span {
    flex: 1;
    min-width: 0;
}

.portal-confirm-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
}

@media (max-width: 700px) {
    .portal-confirm-grid {
        grid-template-columns: 1fr;
    }

    .portal-confirm-summary {
        flex-direction: column;
    }
}

@media (max-width: 1100px) {
    .portal-confirm-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ── Steady Path Agreement & E-Sign ── */

.portal-agree-card {
    background: var(--portal-card);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-lg);
    box-shadow: var(--portal-shadow);
    padding: 1.5rem 1.75rem 1.75rem;
}

.portal-agree-check {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--portal-text);
    cursor: pointer;
    margin-bottom: 0.75rem;
}

.portal-agree-check input {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.15rem;
    flex: 0 0 1.1rem;
    accent-color: var(--portal-teal);
    cursor: pointer;
}

.portal-agree-check.is-invalid input {
    outline: 2px solid #dc2626;
    outline-offset: 1px;
}

.portal-agree-wait-note {
    margin: 0;
    padding: 1rem 1.1rem;
    border-left: 3px solid var(--portal-teal);
    background: rgba(0, 121, 129, 0.06);
    color: var(--portal-muted, #5b6b73);
    font-size: 0.95rem;
    line-height: 1.5;
}

.portal-toast {
    position: fixed;
    right: 1rem;
    top: 5.25rem;
    z-index: 9999;
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 320px;
    max-width: 560px;
    display: none;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 0.9rem;
}

.portal-toast.is-visible,
.portal-toast:not([hidden]) {
    display: flex !important;
}

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

.portal-toast-content {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}

.portal-toast-icon {
    display: inline-flex;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: #10b981;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.portal-toast-message {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
}

.portal-toast-close {
    border: 0;
    background: transparent;
    color: #065f46;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.portal-agree-accordion {
    display: flex;
    flex-direction: column;
}

.portal-agree-item {
    border-bottom: 1px solid var(--portal-border);
}

.portal-agree-item:last-of-type {
    border-bottom: 0;
}

.portal-agree-item-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 0;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: var(--portal-navy);
}

.portal-agree-item-title {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1rem;
    font-weight: 600;
}

.portal-agree-chevron {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--portal-text-muted);
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.portal-agree-item.is-open .portal-agree-chevron {
    transform: rotate(180deg);
}

.portal-agree-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--portal-text-muted);
    white-space: nowrap;
}

.portal-agree-status svg {
    width: 1.15rem;
    height: 1.15rem;
}

.portal-agree-status.is-accepted {
    color: #16a34a;
}

.portal-agree-item-body {
    padding: 0 0 1.35rem;
}

.portal-agree-doc {
    max-height: min(52vh, 520px);
    overflow-y: auto;
    padding: 1.15rem 1.25rem;
    margin-bottom: 1.15rem;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    background: #f8fafc;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--portal-text);
}

.portal-agree-doc-content h1,
.portal-agree-doc-content h2,
.portal-agree-doc-content h3 {
    color: var(--portal-navy);
    margin: 1rem 0 0.65rem;
    line-height: 1.3;
}

.portal-agree-doc-content h1 {
    font-size: 1.15rem;
}

.portal-agree-doc-content h2 {
    font-size: 1.05rem;
}

.portal-agree-doc-content h3 {
    font-size: 1rem;
    text-align: center;
}

.portal-agree-doc-lead {
    margin: 0 0 0.85rem;
}

.portal-agree-doc-title {
    margin: 0 0 0.5rem;
    text-align: center;
    font-size: 0.95rem;
}

.portal-agree-doc p {
    margin: 0 0 0.75rem;
}

.portal-agree-doc p:last-child {
    margin-bottom: 0;
}

.portal-agree-brand {
    text-align: center;
    margin: 0.15rem 0 1.5rem;
    padding-bottom: 0.35rem;
}

.portal-agree-brand-logo {
    display: block;
    height: 52px;
    width: auto;
    margin: 0 auto 1.05rem;
}

.portal-agree-doc-content .portal-agree-brand h1 {
    margin: 0 0 0.8rem;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-align: center;
    color: #0f172a;
}

.portal-agree-doc .portal-agree-brand p {
    margin: 0 auto 0.75rem;
    max-width: 42rem;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #1e293b;
}

.portal-agree-doc .portal-agree-brand p:last-child {
    margin-bottom: 0;
}

.portal-agree-doc ul {
    margin: 0 0 0.85rem;
    padding-left: 1.25rem;
}

.portal-agree-doc li {
    margin-bottom: 0.35rem;
}

.portal-agree-doc table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0 1rem;
    background: #fff;
}

.portal-agree-doc td {
    border: 1px solid #cbd5e1;
    padding: 0.45rem 0.6rem;
    vertical-align: top;
}

.portal-agree-doc td:first-child {
    width: 34%;
    background: #f1f5f9;
}

.portal-agree-doc hr {
    border: 0;
    border-top: 1px solid #cbd5e1;
    margin: 1rem 0;
}

.portal-agree-equifax {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.portal-agree-equifax-title {
    margin: 0;
    font-size: 1.05rem;
    color: var(--portal-navy);
}

.portal-agree-equifax-help {
    margin: 0;
    font-size: 0.9rem;
    color: var(--portal-text);
}

.portal-agree-choice {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--portal-text);
    cursor: pointer;
}

.portal-agree-choice input {
    -webkit-appearance: none;
    appearance: none;
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.15rem;
    flex: 0 0 1.2rem;
    border: 2px solid #94a3b8;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.portal-agree-choice input:checked {
    border-color: var(--portal-teal);
    background: radial-gradient(circle, var(--portal-teal) 45%, #fff 48%);
}

.portal-agree-equifax.is-invalid .portal-agree-choice input {
    border-color: #dc2626;
}

.portal-agree-choice strong {
    color: var(--portal-navy);
}

.portal-agree-item-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

.portal-agree-accept-btn {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: var(--portal-navy);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.portal-agree-accept-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: var(--portal-teal);
    color: var(--portal-teal-dark);
}

.portal-agree-accept-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.portal-agree-accepted-note {
    margin: 0;
    font-size: 0.8125rem;
    color: #166534;
}

.portal-agree-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--portal-border);
}

@media (max-width: 700px) {
    .portal-agree-card {
        padding: 1.15rem;
    }

    .portal-agree-item-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 1199px) {
    :root {
        --portal-header-height: var(--steady-header-height, 56px);
    }

    .portal-body .steady-mobile-menu {
        display: none !important;
    }

    .portal-shell {
        background: none;
    }

    .portal-body.portal-body--with-header .portal-sidebar,
    .portal-sidebar {
        position: fixed;
        top: var(--portal-header-height);
        left: 0;
        bottom: 0;
        width: min(86vw, 300px);
        height: calc(100vh - var(--portal-header-height));
        height: calc(100dvh - var(--portal-header-height));
        max-height: calc(100vh - var(--portal-header-height));
        max-height: calc(100dvh - var(--portal-header-height));
        min-height: 0;
        z-index: 95;
        transform: translateX(-105%);
        transition: transform 0.28s ease;
        box-shadow: none;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .portal-body.portal-nav-open .portal-sidebar {
        transform: translateX(0);
        box-shadow: 10px 0 32px rgba(8, 43, 92, 0.28);
    }

    .portal-sidebar-inner {
        min-height: 0;
        height: auto;
        padding: 1.25rem 1.15rem 2rem;
    }

    .portal-nav-backdrop {
        display: block;
        position: fixed;
        inset: var(--portal-header-height) 0 0 0;
        z-index: 90;
        background: rgba(8, 43, 92, 0.45);
        border: 0;
        padding: 0;
        cursor: pointer;
        overscroll-behavior: none;
        touch-action: none;
    }

    .portal-nav-backdrop[hidden] {
        display: none;
    }

    html.portal-nav-locked,
    .portal-body.portal-nav-locked {
        overflow: hidden;
        overscroll-behavior: none;
    }

    .portal-body.portal-nav-locked {
        position: fixed;
        width: 100%;
        left: 0;
        right: 0;
    }
}

/* ── Responsive ── */

@media (max-width: 1100px) {
    .portal-stats-grid,
    .portal-stats-grid--3,
    .portal-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portal-grid--2,
    .portal-grid--hero {
        grid-template-columns: 1fr;
    }

    .portal-benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portal-feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .portal-shell {
        flex-direction: column;
        min-height: auto;
        background: none;
    }

    .portal-nav {
        flex: none;
    }

    .portal-promo,
    .portal-sidebar-footer,
    .portal-benefits-box {
        display: none;
    }

    .portal-main {
        padding: 1.25rem;
    }

    .portal-cta-banner {
        flex-direction: column;
        text-align: center;
    }

    .portal-cta-banner .portal-btn {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .portal-progress-wrap {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .portal-setup-btn {
        width: 100%;
    }

    .portal-next-payment {
        padding: 1rem;
    }

    .portal-card {
        padding: 1.15rem 1rem;
    }

    .portal-profile-grid {
        grid-template-columns: 1fr;
    }

    .portal-detail-list > div {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .portal-table-wrap {
        overflow-x: auto;
    }

    .portal-table.portal-table--stack {
        min-width: 0;
        width: 100%;
    }

    .portal-table--stack thead {
        display: none;
    }

    .portal-table--stack tbody,
    .portal-table--stack tr,
    .portal-table--stack td {
        display: block;
        width: 100%;
    }

    .portal-table--stack tr {
        background: #f8fafc;
        border: 1px solid var(--portal-border);
        border-radius: 10px;
        margin-bottom: 0.75rem;
        padding: 0.65rem 0.85rem;
    }

    .portal-table--stack td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.4rem 0;
        border-bottom: 1px solid #eef2f6;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .portal-table--stack td:last-child {
        border-bottom: none;
    }

    .portal-table--stack td::before {
        content: attr(data-label);
        flex: 0 1 42%;
        font-weight: 700;
        color: var(--portal-navy);
        font-size: 0.78rem;
        overflow-wrap: anywhere;
    }

    .portal-table--stack td.portal-empty {
        display: block;
        text-align: center;
    }

    .portal-table--stack td.portal-empty::before {
        content: none;
        display: none;
    }

    .portal-pager {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-pager-group {
        justify-content: center;
    }

    .portal-pager-info {
        text-align: center;
    }
}

@media (max-width: 540px) {
    .portal-stats-grid,
    .portal-overview-grid {
        grid-template-columns: 1fr;
    }

    .portal-benefits-grid {
        grid-template-columns: 1fr 1fr;
    }

    .portal-hero-layout {
        flex-direction: column;
    }

    .portal-hero-art {
        width: 100%;
        max-width: 180px;
        margin: 0 auto;
    }

    .portal-journey {
        flex-wrap: wrap;
        justify-content: center;
    }

    .portal-journey-line {
        display: none;
    }

    .portal-journey-step {
        flex: 0 0 45%;
        margin-bottom: 1rem;
    }

    .portal-progress-wrap {
        flex-direction: column;
        text-align: center;
    }

    .portal-legend {
        align-items: center;
    }
}

.portal-chat-card {
    padding: 1rem 1.1rem 1.15rem;
}

.portal-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

.portal-chat-title {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.portal-chat-title h2 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--portal-navy);
}

.portal-chat-title-icon {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-teal-muted);
    color: var(--portal-teal);
}

.portal-chat-title-icon svg {
    width: 1rem;
    height: 1rem;
}

.portal-chat-thread {
    display: flex;
    flex-direction: column;
    max-height: 520px;
    overflow-y: auto;
    padding: 0.15rem 0.35rem 0.65rem;
    background: #fff;
}

.portal-chat-row {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.7rem 0.35rem;
    border-bottom: 1px solid #eef2f6;
}

.portal-chat-row:last-child {
    border-bottom: none;
}

.portal-chat-row.is-support {
    justify-content: flex-start;
}

.portal-chat-row.is-mine {
    justify-content: flex-end;
}

.portal-chat-col {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: min(640px, 78%);
}

.portal-chat-col--end {
    align-items: flex-end;
}

.portal-chat-channel-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.1rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1;
}

.portal-chat-channel-icon svg {
    width: 1.05rem;
    height: 1.05rem;
}

.portal-chat-channel-icon--sms {
    background: #86c99a;
    color: #fff;
}

.portal-chat-channel-icon--email {
    background: #7ea8e8;
    color: #fff;
}

.portal-chat-bubble {
    position: relative;
    width: fit-content;
    max-width: 100%;
    border-radius: 10px;
    padding: 0.55rem 0.8rem;
}

.portal-chat-row.is-support .portal-chat-bubble::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 14px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 7px solid #f3f4f6;
}

.portal-chat-row.is-support .portal-chat-bubble--email::before {
    border-right-color: #eef4fc;
}

.portal-chat-row.is-mine .portal-chat-bubble::before {
    content: '';
    position: absolute;
    right: -6px;
    top: 14px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 7px solid #eef8f1;
}

.portal-chat-bubble--sms {
    background: #eef8f1;
    color: #1f2937;
}

.portal-chat-bubble--email {
    background: #eef4fc;
    color: #1f2937;
}

.portal-chat-row.is-mine .portal-chat-bubble {
    background: #eef8f1;
}

.portal-chat-row.is-support .portal-chat-bubble {
    background: #f3f4f6;
}

.portal-chat-row.is-support .portal-chat-bubble--email {
    background: #eef4fc;
}

.portal-chat-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #64748b;
}

.portal-chat-bubble p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #1f2937;
    white-space: pre-wrap;
}

.portal-chat-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-top: 0.35rem;
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 500;
}

.portal-chat-footer svg {
    width: 0.95rem;
    height: 0.95rem;
    color: #3b82f6;
}

.portal-chat-compose {
    border-top: 1px solid var(--portal-border);
    margin-top: 0.85rem;
    padding-top: 0.9rem;
}

.portal-chat-compose-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.55rem;
}

.portal-chat-input {
    min-height: 42px;
    height: 42px;
    width: 100%;
    padding: 0.65rem 0.875rem;
    border: 1.5px solid var(--portal-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.35;
    resize: none;
    color: var(--portal-text);
    background: #fff;
}

.portal-chat-input:focus {
    outline: none;
    border-color: var(--portal-teal);
    box-shadow: 0 0 0 3px rgba(0, 121, 129, 0.15);
}

.portal-chat-input.is-invalid {
    border-color: #e11d48;
}

.portal-chat-send {
    min-height: 42px;
    min-width: 7.5rem;
    white-space: nowrap;
    position: relative;
}

.portal-chat-send-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.portal-chat-send-label svg {
    width: 1rem;
    height: 1rem;
}

.portal-chat-send-spinner {
    display: none;
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: portal-chat-spin 0.7s linear infinite;
}

.portal-chat-send.is-loading {
    cursor: wait;
    opacity: 0.85;
    pointer-events: none;
}

.portal-chat-send.is-loading .portal-chat-send-label {
    visibility: hidden;
}

.portal-chat-send.is-loading .portal-chat-send-spinner {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -0.55rem;
    margin-left: -0.55rem;
}

.portal-chat-send:disabled {
    cursor: wait;
}

.portal-chat-error {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: #e11d48;
}

@keyframes portal-chat-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 640px) {
    .portal-chat-col {
        max-width: 88%;
    }

    .portal-chat-compose-row {
        grid-template-columns: 1fr;
    }

    .portal-chat-send {
        width: 100%;
    }
}

/* Graduation / loan opportunities */

.portal-loans-header {
    margin-bottom: 1.15rem;
}

.portal-loans-header h1 {
    margin: 0 0 0.4rem;
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #082b5c;
}

.portal-loans-header p {
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.45;
    color: #6b8494;
}

.portal-loans-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.15rem;
    background: #fff;
    border: 1px solid #e6ecef;
    border-radius: 22px;
    padding: 1.15rem 1.15rem;
    margin-bottom: 1.15rem;
}

.portal-loans-hero-copy {
    display: flex;
    align-items: flex-start;
    gap: 1.05rem;
    padding: 0.55rem 0.45rem 0.45rem 0.35rem;
}

.portal-loans-cap {
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    background: #e9f7f7;
    color: #0c8b8d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-loans-cap svg {
    width: 1.65rem;
    height: 1.65rem;
}

.portal-loans-hero-text {
    min-width: 0;
    padding-top: 0.1rem;
}

.portal-loans-hero-copy h2 {
    margin: 0 0 0.7rem;
    font-size: clamp(1.35rem, 1.9vw, 1.625rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: #102555;
}

.portal-loans-hero-copy h2 span {
    color: #0c8b8d;
}

.portal-loans-hero-copy p {
    margin: 0 0 0.7rem;
    max-width: 31rem;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.58;
    color: #7a818c;
}

.portal-loans-hero-copy p:last-child {
    margin-bottom: 0;
}

.portal-loans-hero-copy strong {
    color: #102555;
    font-weight: 700;
}

.portal-loans-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1.15rem;
    row-gap: 1.15rem;
    align-content: center;
    align-items: start;
    background: #f0f8fa;
    border-radius: 18px;
    padding: 1.35rem 1.4rem 1.3rem;
}

.portal-loans-facts > div {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.portal-loans-fact-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    background: #dcf4f3;
    color: #0a7d84;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-loans-fact-icon svg {
    width: 1.05rem;
    height: 1.05rem;
}

.portal-loans-facts strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: #102555;
}

.portal-loans-fact-label {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.4;
    color: #8b939c;
}

.portal-loans-facts > div:last-child strong,
.portal-loans-facts > div:last-child .portal-loans-fact-label {
    max-width: 10.75rem;
}

.portal-loans-notice {
    background: #edf6fd;
    border: 1px solid #d9eaf4;
    border-radius: 20px;
    padding: 1.15rem 1.25rem 1.1rem;
    margin-bottom: 1.75rem;
}

.portal-loans-notice-head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.portal-loans-info {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    background: transparent;
    color: #0c8b8d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.portal-loans-info svg {
    width: 1.85rem;
    height: 1.85rem;
}

.portal-loans-notice-head h3 {
    margin: 0 0 0.28rem;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #102555;
}

.portal-loans-notice-head p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #6e7784;
}

.portal-loans-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    background: #e1f1f6;
    border-radius: 12px;
    padding: 0.8rem 1rem 0.85rem;
}

.portal-loans-tip-icon {
    color: #0c8b8d;
    flex-shrink: 0;
    margin-top: 0.12rem;
}

.portal-loans-tip-icon svg {
    width: 1.15rem;
    height: 1.15rem;
}

.portal-loans-tip strong {
    display: block;
    margin-bottom: 0.18rem;
    font-size: 0.86rem;
    font-weight: 700;
    color: #0c8b8d;
}

.portal-loans-tip p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #7d8793;
}

.portal-loans-how {
    margin-bottom: 1.5rem;
}

.portal-loans-how h2 {
    margin: 0 0 0.28rem;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: #102555;
}

.portal-loans-how-lead {
    margin: 0 0 1.35rem;
    font-size: 0.9375rem;
    font-weight: 400;
    color: #7a818c;
}

.portal-loans-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.portal-loans-steps li {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    position: relative;
}

.portal-loans-step-num {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 50%;
    background: #e7f6f6;
    color: #0c8b8d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.portal-loans-steps li > div {
    min-width: 0;
    flex: 1;
    padding-top: 0.12rem;
}

.portal-loans-steps h3 {
    margin: 0 0 0.28rem;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #102555;
}

.portal-loans-steps p {
    margin: 0;
    max-width: 16.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #7a818c;
}

@media (min-width: 768px) {
    .portal-loans-hero {
        grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.92fr);
        gap: 1.15rem;
        align-items: stretch;
        padding: 1.15rem;
    }

    .portal-loans-steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2.75rem;
    }

    .portal-loans-steps li:not(:last-child)::after {
        content: '';
        position: absolute;
        top: 1rem;
        right: -1.85rem;
        width: 1.1rem;
        height: 1.1rem;
        background: no-repeat center / 1.1rem 1.1rem;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b7c4cc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
    }
}

@media (max-width: 640px) {
    .portal-loans-facts {
        grid-template-columns: 1fr;
    }

    .portal-loans-hero-copy {
        flex-direction: column;
    }
}
