/* ============================================
   Auth Modal + Settings Page — Balanced
   ============================================ */

/* ── Modal overlay ──────────────────────────── */
.bal-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.bal-modal-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}

/* ── Modal panel ────────────────────────────── */
.bal-modal-panel {
    background: rgba(12, 12, 14, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 32px;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    transform: translateY(8px);
    transition: transform 0.2s ease;
}
.bal-modal-overlay.is-open .bal-modal-panel {
    transform: translateY(0);
}

.bal-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.15s;
}
.bal-modal-close:hover { color: rgba(255, 255, 255, 0.8); }

/* ── Modal tabs ─────────────────────────────── */
.bal-modal-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0;
}
.bal-tab-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
    letter-spacing: 0.02em;
}
.bal-tab-btn:hover { color: rgba(255, 255, 255, 0.7); }
.bal-tab-btn.is-active {
    color: #97ffd7;
    border-bottom-color: #97ffd7;
}

.bal-tab-panel { display: none; }
.bal-tab-panel.is-active { display: block; }

/* ── Form elements ──────────────────────────── */
.bal-form-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 6px;
}
.bal-form-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    margin: 0 0 24px;
    line-height: 1.5;
}

.bal-field {
    margin-bottom: 16px;
}
.bal-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.bal-field input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-family: 'Manrope', sans-serif;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.bal-field input:focus {
    border-color: rgba(151, 255, 215, 0.5);
}
.bal-field input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.bal-btn-primary {
    width: 100%;
    background: #97ffd7;
    border: none;
    border-radius: 8px;
    color: #050507;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 12px;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity 0.15s, transform 0.1s;
    letter-spacing: 0.02em;
}
.bal-btn-primary:hover { opacity: 0.9; }
.bal-btn-primary:active { transform: scale(0.99); }
.bal-btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.bal-btn-ghost {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s;
}
.bal-btn-ghost:hover { color: rgba(255, 255, 255, 0.75); }

.bal-form-footer {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
}

/* ── Alert / status ─────────────────────────── */
.bal-alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
    display: none;
}
.bal-alert.is-visible { display: block; }
.bal-alert-error {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    color: #ff8b83;
}
.bal-alert-success {
    background: rgba(151, 255, 215, 0.08);
    border: 1px solid rgba(151, 255, 215, 0.25);
    color: #97ffd7;
}

/* ── Profile pill — icon only ────────────────── */
.profile-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    transition: border-color 0.15s, color 0.15s;
    padding: 0;
}
.profile-pill svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.profile-pill:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.85);
}
.profile-pill.is-logged-in {
    border-color: rgba(151, 255, 215, 0.35);
    color: rgba(151, 255, 215, 0.8);
}
.profile-pill.is-logged-in:hover {
    border-color: rgba(151, 255, 215, 0.6);
    color: #97ffd7;
}

/* ── User dropdown ───────────────────────────── */
.bal-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(12, 12, 14, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    min-width: 172px;
    padding: 6px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    z-index: 8000;
    display: none;
}
.bal-user-dropdown.is-open { display: block; }
.bal-dropdown-section-label {
    padding: 8px 12px 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    font-family: 'Space Grotesk', sans-serif;
}
.bal-dropdown-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    text-align: left;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
}
.bal-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.bal-dropdown-item.is-danger {
    color: rgba(255, 100, 90, 0.8);
}
.bal-dropdown-item.is-danger:hover {
    background: rgba(255, 59, 48, 0.08);
    color: #ff8b83;
}
.bal-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 4px 0;
}
.bal-dropdown-email {
    padding: 8px 12px 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    font-family: 'IBM Plex Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 168px;
}

/* ── Settings page ───────────────────────────── */
.settings-view {
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}
.settings-view-header {
    margin-bottom: 40px;
}
.settings-view-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 8px;
}
.settings-view-header p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    margin: 0;
}

.settings-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}
.settings-section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 16px;
}
.settings-section-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    margin: -8px 0 16px;
    line-height: 1.5;
}

/* Exchange checkboxes grid */
.settings-exchange-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.settings-exchange-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
    user-select: none;
}
.settings-exchange-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}
.settings-exchange-item.is-checked {
    background: rgba(151, 255, 215, 0.06);
    border-color: rgba(151, 255, 215, 0.2);
}
.settings-exchange-item input[type="checkbox"] {
    accent-color: #97ffd7;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.settings-exchange-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    font-family: 'IBM Plex Mono', monospace;
}
.settings-exchange-item.is-checked .settings-exchange-label {
    color: rgba(255, 255, 255, 0.9);
}

/* Toggle groups */
.settings-toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.settings-toggle-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 7px 14px;
    cursor: pointer;
    transition: all 0.15s;
}
.settings-toggle-btn.is-active {
    background: rgba(151, 255, 215, 0.1);
    border-color: rgba(151, 255, 215, 0.3);
    color: #97ffd7;
}
.settings-toggle-btn:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.75);
}

/* Select */
.settings-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    padding: 9px 12px;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.3)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    min-width: 200px;
}
.settings-select:focus { border-color: rgba(151, 255, 215, 0.4); }
.settings-select option { background: #111; }

/* ── Settings footer (Save / Cancel) ────────── */
.settings-footer {
    position: sticky;
    bottom: 0;
    padding: 16px 24px;
    margin: 0 -24px -80px;
    background: rgba(8, 8, 10, 0.95);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
}
.settings-footer-badge {
    font-size: 12px;
    color: #97ffd7;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
    opacity: 0;
    transition: opacity 0.2s;
}
.settings-footer-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #97ffd7;
}
.settings-footer-badge.is-visible { opacity: 1; }
.settings-footer-badge.is-outdated {
    color: #ffd860;
}
.settings-footer-badge.is-outdated::before {
    background: #ffd860;
}

.settings-btn-cancel {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 9px 18px;
    cursor: pointer;
    transition: all 0.15s;
}
.settings-btn-cancel:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.settings-btn-save {
    background: #97ffd7;
    border: none;
    border-radius: 7px;
    color: #050507;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 20px;
    cursor: pointer;
    transition: opacity 0.15s;
}
.settings-btn-save:hover { opacity: 0.88; }
.settings-btn-save:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.settings-error-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: rgba(255, 59, 48, 0.15);
    border: 1px solid rgba(255, 59, 48, 0.35);
    border-radius: 8px;
    color: #ff8b83;
    font-size: 13px;
    padding: 10px 18px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: all 0.25s ease;
}
.settings-error-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Outdated banner in Settings ─────────────── */
.settings-outdated-banner {
    background: rgba(255, 216, 96, 0.08);
    border: 1px solid rgba(255, 216, 96, 0.2);
    border-radius: 8px;
    color: #ffd860;
    font-size: 13px;
    padding: 10px 16px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.settings-outdated-banner.is-visible { display: flex; }
.settings-outdated-banner button {
    background: none;
    border: none;
    color: #ffd860;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0;
    white-space: nowrap;
}

/* ── Login wall (anon) ───────────────────────── */
.settings-login-wall {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    gap: 16px;
}
.settings-login-wall p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    max-width: 300px;
    line-height: 1.6;
    margin: 0;
}
.settings-login-wall .bal-btn-primary {
    max-width: 200px;
}

/* ============================================
   PROMPT A - AUTH HARMONIZATION
   ============================================ */

.bal-modal-overlay {
    background: rgba(4, 6, 10, 0.84);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: opacity 180ms ease;
}

.bal-modal-panel {
    width: min(520px, calc(100vw - 32px));
    max-width: 520px;
    padding: 24px 24px 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: #131517;
    box-shadow: none;
    transform: translateY(0);
}

.bal-modal-close {
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 0;
    color: #b9b0a3;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bal-modal-close:hover {
    color: #f2eee8;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.18);
}

.bal-modal-tabs {
    gap: 14px;
    margin-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
}

.bal-tab-btn {
    padding: 0 0 6px;
    color: #7f776d;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid transparent;
}

.bal-tab-btn:hover {
    color: #b9b0a3;
}

.bal-tab-btn.is-active {
    color: #f2eee8;
    border-bottom-color: #8fc7b1;
}

.bal-form-title {
    margin: 0 0 8px;
    color: #f2eee8;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(1.7rem, 2.4vw, 2rem);
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 1.02;
}

.bal-form-subtitle {
    margin: 0 0 22px;
    color: #b9b0a3;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.96rem;
    line-height: 1.65;
}

.bal-field {
    margin-bottom: 14px;
}

.bal-field label {
    margin-bottom: 7px;
    color: #7f776d;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bal-field input {
    background: #0f1113;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #f2eee8;
    font-size: 0.96rem;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    padding: 12px 14px;
    transition: border-color 180ms ease, background-color 180ms ease;
}

.bal-field input:focus {
    border-color: rgba(143, 199, 177, 0.34);
    background: #111315;
}

.bal-field input::placeholder {
    color: rgba(127, 119, 109, 0.58);
    font-style: italic;
}

.bal-btn-primary {
    min-height: 44px;
    margin-top: 10px;
    border: 1px solid rgba(143, 199, 177, 0.34);
    border-radius: 4px;
    padding: 0 16px;
    background: #8fc7b1;
    color: #0b0d0d;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    transition: background-color 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.bal-btn-primary:hover {
    opacity: 1;
    background: #9acdb9;
}

.bal-btn-primary:active {
    transform: translateY(-1px);
}

.bal-btn-ghost {
    color: #b9b0a3;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.92rem;
    text-decoration: none;
}

.bal-btn-ghost:hover {
    color: #f2eee8;
}

.bal-form-footer {
    margin-top: 14px;
    text-align: left;
    font-size: 0.92rem;
    color: #7f776d;
}

.bal-alert {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    line-height: 1.55;
    margin-bottom: 14px;
}

.bal-alert-error {
    background: rgba(197, 138, 104, 0.08);
    border: 1px solid rgba(197, 138, 104, 0.22);
    color: #c58a68;
}

.bal-alert-success {
    background: rgba(143, 199, 177, 0.08);
    border: 1px solid rgba(143, 199, 177, 0.22);
    color: #8fc7b1;
}

.bal-user-dropdown {
    top: calc(100% + 8px);
    right: 0;
    background: #131517;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    min-width: 220px;
    padding: 6px;
    box-shadow: none;
}

.bal-dropdown-email {
    padding: 8px 10px 6px;
    color: #7f776d;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    max-width: 208px;
}

.bal-dropdown-divider {
    background: rgba(255, 255, 255, 0.08);
}

.bal-dropdown-item {
    color: #b9b0a3;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.92rem;
    padding: 9px 10px;
    border-radius: 4px;
}

.bal-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #f2eee8;
}

.bal-dropdown-item.is-danger {
    color: #c58a68;
}

.bal-dropdown-item.is-danger:hover {
    background: rgba(197, 138, 104, 0.08);
    color: #c58a68;
}

.settings-login-wall {
    min-height: 300px;
    gap: 14px;
}

.settings-login-wall p {
    color: #b9b0a3;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.96rem;
    line-height: 1.7;
}

.settings-login-wall .bal-btn-primary {
    max-width: 220px;
}

@media (max-width: 640px) {
    .bal-modal-overlay {
        padding: 12px;
    }

    .bal-modal-panel {
        padding: 20px 18px 18px;
    }

    .bal-modal-tabs {
        gap: 12px;
        overflow-x: auto;
    }
}

/* ============================================
   PROMPT A - AUTH HARMONIZATION
   ============================================ */

.bal-modal-overlay {
    background: rgba(4, 6, 10, 0.84);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: opacity 180ms ease;
}

.bal-modal-panel {
    width: min(520px, calc(100vw - 32px));
    max-width: 520px;
    padding: 24px 24px 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: #131517;
    box-shadow: none;
    transform: translateY(0);
}

.bal-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 0;
    color: #b9b0a3;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bal-modal-close:hover {
    color: #f2eee8;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.18);
}

.bal-modal-tabs {
    display: flex;
    gap: 14px;
    margin-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
}

.bal-tab-btn {
    background: none;
    border: none;
    padding: 0 0 6px;
    color: #7f776d;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
}

.bal-tab-btn:hover {
    color: #b9b0a3;
}

.bal-tab-btn.is-active {
    color: #f2eee8;
    border-bottom-color: #8fc7b1;
}

.bal-form-title {
    margin: 0 0 8px;
    color: #f2eee8;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(1.7rem, 2.4vw, 2rem);
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 1.02;
}

.bal-form-subtitle {
    margin: 0 0 22px;
    color: #b9b0a3;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.96rem;
    line-height: 1.65;
}

.bal-field {
    margin-bottom: 14px;
}

.bal-field label {
    display: block;
    margin-bottom: 7px;
    color: #7f776d;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bal-field input {
    width: 100%;
    background: #0f1113;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #f2eee8;
    font-size: 0.96rem;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    padding: 12px 14px;
    outline: none;
    transition: border-color 180ms ease, background-color 180ms ease;
    box-sizing: border-box;
}

.bal-field input:focus {
    border-color: rgba(143, 199, 177, 0.34);
    background: #111315;
}

.bal-field input::placeholder {
    color: rgba(127, 119, 109, 0.58);
    font-style: italic;
}

.bal-btn-primary {
    width: 100%;
    min-height: 44px;
    margin-top: 10px;
    border: 1px solid rgba(143, 199, 177, 0.34);
    border-radius: 4px;
    padding: 0 16px;
    background: #8fc7b1;
    color: #0b0d0d;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    transition: background-color 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.bal-btn-primary:hover {
    opacity: 1;
    background: #9acdb9;
}

.bal-btn-primary:active {
    transform: translateY(-1px);
}

.bal-btn-ghost {
    background: none;
    border: none;
    color: #b9b0a3;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.92rem;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.bal-btn-ghost:hover {
    color: #f2eee8;
}

.bal-form-footer {
    margin-top: 14px;
    text-align: left;
    font-size: 0.92rem;
    color: #7f776d;
}

.bal-alert {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    line-height: 1.55;
    margin-bottom: 14px;
    display: none;
}

.bal-alert.is-visible {
    display: block;
}

.bal-alert-error {
    background: rgba(197, 138, 104, 0.08);
    border: 1px solid rgba(197, 138, 104, 0.22);
    color: #c58a68;
}

.bal-alert-success {
    background: rgba(143, 199, 177, 0.08);
    border: 1px solid rgba(143, 199, 177, 0.22);
    color: #8fc7b1;
}

.profile-pill.is-logged-in .profile-value {
    font-size: 11px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bal-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #131517;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    min-width: 220px;
    padding: 6px;
    box-shadow: none;
    z-index: 8000;
    display: none;
}

.bal-user-dropdown.is-open {
    display: block;
}

.bal-dropdown-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #b9b0a3;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.92rem;
    text-align: left;
    padding: 9px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
}

.bal-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #f2eee8;
}

.bal-dropdown-item.is-danger {
    color: #c58a68;
}

.bal-dropdown-item.is-danger:hover {
    background: rgba(197, 138, 104, 0.08);
    color: #c58a68;
}

.bal-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

.bal-dropdown-email {
    padding: 8px 10px 6px;
    color: #7f776d;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 208px;
}

.settings-login-wall {
    min-height: 300px;
    gap: 14px;
}

.settings-login-wall p {
    color: #b9b0a3;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.96rem;
    max-width: 300px;
    line-height: 1.7;
    margin: 0;
}

.settings-login-wall .bal-btn-primary {
    max-width: 220px;
}

@media (max-width: 640px) {
    .bal-modal-overlay {
        padding: 12px;
    }

    .bal-modal-panel {
        padding: 20px 18px 18px;
    }

    .bal-modal-tabs {
        gap: 12px;
        overflow-x: auto;
    }
}

/* PROMPT A - AUTH TAB STABILITY */
.bal-modal-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.bal-tab-btn {
    width: 100%;
    text-align: center;
}

@media (max-width: 640px) {
    .bal-modal-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }
}

/* PROMPT A - AUTH TAB / MODAL FIXES */
.bal-modal-panel {
    min-height: 430px;
}

.bal-modal-tabs {
    padding-right: 52px;
    align-items: end;
}

.bal-tab-btn {
    min-width: 0;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .bal-modal-panel {
        min-height: 0;
    }

    .bal-modal-tabs {
        padding-right: 0;
    }
}


/* PROMPT A - PROFILE DROPDOWN REWORK */
.profile-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: transparent;
    color: #b9b0a3;
    box-shadow: none;
}

.profile-pill svg {
    width: 17px;
    height: 17px;
}

.profile-pill:hover {
    color: #f2eee8;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.18);
}

.profile-pill.is-logged-in {
    color: #8fc7b1;
    border-color: rgba(143, 199, 177, 0.28);
    background: rgba(143, 199, 177, 0.04);
}

.profile-pill.is-logged-in:hover {
    color: #8fc7b1;
    border-color: rgba(143, 199, 177, 0.36);
    background: rgba(143, 199, 177, 0.07);
}

.bal-user-dropdown {
    top: calc(100% + 10px);
    min-width: 196px;
    padding: 8px;
    border-radius: 12px;
    background: #131517;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.bal-dropdown-anon,
.bal-dropdown-auth {
    display: grid;
    gap: 2px;
}

.bal-dropdown-section-label {
    padding: 6px 8px 4px;
    color: #7f776d;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bal-dropdown-divider {
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.08);
}

.bal-dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #b9b0a3;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.92rem;
    font-weight: 400;
    letter-spacing: 0;
}

.bal-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #f2eee8;
}

.bal-dropdown-item.is-danger {
    color: #c58a68;
}

.bal-dropdown-item.is-danger:hover {
    background: rgba(197, 138, 104, 0.08);
    color: #c58a68;
}

/* PROMPT A - PROFILE DROPDOWN STACK FIX */
.site-header,
.topbar,
.nav-utility {
    overflow: visible;
}

.nav-utility {
    position: relative;
    z-index: 30;
}

.bal-user-dropdown {
    z-index: 120;
}

/* PROMPT A - PROFILE ICON COLOR */
.profile-pill {
    color: #f2eee8;
}


/* PROMPT A - PROFILE WHITE ICON / ANON DIVIDERS */
.profile-pill,
.profile-pill.is-logged-in,
.profile-pill.is-logged-in:hover {
    color: #f2eee8;
}

.profile-pill.is-logged-in {
    border-color: rgba(255, 255, 255, 0.14);
    background: transparent;
}

.profile-pill.is-logged-in:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.03);
}
