/* ── NAV ────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(253, 251, 249, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    transition: box-shadow 0.3s;
}

.nav.scrolled {
    box-shadow: var(--shadow-soft);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 72px;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--color-primary-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: white;
}

.nav-logo .logo-icon img {
    width: 140%;
    height: 140%;
    object-fit: cover;
    object-position: center 40%;
    margin: -20% 0 0 -20%;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--color-text-light);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.nav-links a:hover {
    color: var(--color-primary-dark);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* The hamburger-menu "Chat with Doris" CTA is mobile-only. On desktop
   the inline pink-pill styling never applies (those rules live inside
   the @media (max-width: 900px) block), so without this default rule
   the <li> falls through to standard nav-link styling and shows as a
   plain text link in the desktop nav row. Mobile re-shows it via the
   nested rule in the media query below. */
.nav-cta-item {
    display: none;
}

/* Same reasoning for the in-menu language toggle <li>. Inside the
   hamburger drop-down on mobile, but hidden on desktop where the
   nav-row toggle (in .nav-inner) is the visible one. */
.nav-lang-item {
    display: none;
}

/* ── LANGUAGE TOGGLE ────────────────────────── */
/* Pill-shaped switch with a label on each side and a sliding knob.
   Currently visual-only — clicking flips the active label and saves
   the preference to localStorage, but the site doesn't translate yet.
   Functional translations are tracked as a separate follow-up.
   See the running tech-debt list for details. */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    user-select: none;
}
.lang-toggle-label {
    transition: color 0.2s;
    cursor: pointer;
    letter-spacing: 0.5px;
}
.lang-toggle-label.is-active {
    color: var(--color-text);
}
.lang-toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--color-border);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    padding: 0;
    transition: background 0.25s ease;
    flex-shrink: 0;
}
.lang-toggle-switch:hover {
    background: var(--color-text-muted);
}
.lang-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
}
/* When English is active, knob slides to the right (English label side) */
.lang-toggle[data-active="en"] .lang-toggle-knob {
    transform: translateX(18px);
}
.lang-toggle[data-active="en"] .lang-toggle-switch {
    background: var(--color-primary);
}
.lang-toggle[data-active="en"] .lang-toggle-switch:hover {
    background: var(--color-primary-dark);
}
.lang-toggle:focus-within .lang-toggle-switch {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ── LOGGED-IN USER BOX ─────────────────────── */
/* Base (desktop) — mirrors the old inline styles from header.js so the
   visual appearance on desktop is unchanged. The mobile override later in
   this file collapses everything except the avatar. */
.nav-user-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
}
.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.nav-user-name {
    color: #333;
}
.nav-user-logout {
    color: #999;
    cursor: pointer;
}

/* ── LOGIN MODAL ────────────────────────────── */
.login-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(58, 46, 63, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.login-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

.login-modal {
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    width: 400px;
    max-width: calc(100vw - 48px);
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow:
        0 24px 80px rgba(60, 40, 60, 0.2),
        0 0 0 1px var(--color-border);
    z-index: 310;
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1),
        opacity 0.3s ease;
}

.login-modal.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: all;
}

.login-modal-header {
    padding: 20px 32px 0;
    text-align: center;
}

.login-modal-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 10px;
    background: white;
    box-shadow: 0 4px 16px rgba(212, 120, 158, 0.2);
}

.login-modal-avatar img {
    width: 140%;
    height: 140%;
    object-fit: cover;
    object-position: center 40%;
    margin: -20% 0 0 -20%;
}

.login-modal-header h2 {
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.login-modal-header p {
    font-size: 15px;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.login-modal-body {
    padding: 14px 32px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 13px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-card);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.login-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-alt);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(60, 40, 60, 0.06);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 4px 0;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.login-divider span {
    font-size: 12px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Subtle "Skip for now" link below the social-login buttons. Lets users
   exit the login flow and land on the home page without authenticating.
   Visible on both voluntary modals (e.g. home page nav) and forced modals
   (dashboard) — on the dashboard it's the only escape hatch since the
   close X is hidden when window.loginLocked is set. */
.login-skip-link {
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.login-skip-link:hover {
    color: var(--color-text);
    text-decoration: underline;
}

/* ── EMAIL / PASSWORD FORM ─────────────────── */
/* Force the [hidden] attribute to win against display: flex / display: block
   rules below. Without this, .login-email-form's `display: flex` overrides
   the `hidden` attribute and the form renders inline alongside the social
   login buttons. */
.login-modal [hidden] {
    display: none !important;
}

.login-email-form {
    padding: 14px 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-email-back {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    color: var(--color-text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.login-email-back:hover {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.05);
}

.login-email-tabs {
    display: flex;
    gap: 4px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 6px;
}
.login-email-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 14px;
    border-radius: calc(var(--radius-md) - 4px);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.login-email-tab.is-active {
    background: var(--color-bg-card);
    color: var(--color-text);
    box-shadow: 0 1px 3px rgba(60, 40, 60, 0.08);
}

.login-email-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.login-email-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.login-email-optional {
    font-weight: 400;
    color: var(--color-text-muted);
    opacity: 0.7;
}
.login-email-hint {
    font-weight: 400;
    font-size: 12px;
    color: var(--color-text-muted);
}
.login-email-field input {
    padding: 11px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-text);
    background: var(--color-bg-alt);
    outline: none;
    transition: border-color 0.2s;
}
.login-email-field input:focus { border-color: var(--color-primary); }
.login-email-field input.has-error { border-color: #c0392b; }

/* Password field — show/hide toggle. The input is wrapped in a flex
   container so the eye button can sit absolutely-positioned at the
   right edge of the input without disrupting the field's normal flow.
   Extra right padding on the input itself prevents typed text from
   running under the icon. */
.login-email-pwd-wrap {
    position: relative;
}
.login-email-pwd-wrap input {
    width: 100%;
    padding-right: 44px;
    box-sizing: border-box;
}
.login-email-pwd-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}
.login-email-pwd-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text);
}
.login-email-pwd-toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
.login-email-pwd-toggle .icon-eye-off { display: none; }
.login-email-pwd-toggle.is-visible .icon-eye { display: none; }
.login-email-pwd-toggle.is-visible .icon-eye-off { display: block; }

.login-email-error {
    min-height: 18px;
    font-size: 13px;
    color: #c0392b;
}

.login-email-submit {
    margin-top: 4px;
    background: var(--color-cta);
    color: white;
    border: none;
    padding: 13px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.login-email-submit:hover { background: var(--color-cta-hover); transform: translateY(-1px); }
.login-email-submit:active { transform: translateY(0); }
.login-email-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.login-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    color: var(--color-text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 44×44 tap target. The X icon inside stays visually small;
       padding expands the click area to meet touch guidelines. */
    min-width: 44px;
    min-height: 44px;
    box-sizing: border-box;
}

.login-modal-close:hover {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.05);
}

/* Forced login (un-logged-in user on the dashboard): the user must sign in,
   so hide the close button entirely. The backdrop click is also neutralised
   here, and header.js ignores close requests while window.loginLocked is set. */
.login-modal.forced .login-modal-close {
    display: none;
}

.login-footer {
    text-align: center;
    padding: 0 32px 18px;
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.login-footer a {
    color: var(--color-primary-dark);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* ── DRAGGABLE CHAT TAB (mobile) ────────────── */
/* JS adds .is-dragging while the user is moving the tab. Subtle scale +
   shadow change so the tab feels "lifted" during the drag. */
.chat-tab.is-dragging {
    transform: scale(0.96);
    opacity: 0.85;
    transition: none !important;
}

/* ── DONATE NAV LINK ────────────────────────── */
/* Sits inline with the other text links but gets a small heart icon to
   signal "this is an action, not a destination". Heart icon inherits text
   colour (currentColor) so it picks up :hover / .is-active automatically. */
.nav-donate-link {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
}
.nav-donate-icon {
    color: var(--color-cta);
    flex-shrink: 0;
}

/* ── DONATE MODAL ───────────────────────────── */
.donate-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(58, 46, 63, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.donate-backdrop.open {
    opacity: 1;
    pointer-events: all;
}
.donate-modal {
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    width: 420px;
    max-width: calc(100vw - 48px);
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow:
        0 24px 80px rgba(60, 40, 60, 0.2),
        0 0 0 1px var(--color-border);
    z-index: 310;
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1),
        opacity 0.3s ease;
}
.donate-modal.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: all;
}
.donate-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    color: var(--color-text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    /* 44×44 tap target. */
    min-width: 44px;
    min-height: 44px;
    box-sizing: border-box;
}
.donate-modal-close:hover {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.05);
}
.donate-modal-header {
    padding: 28px 32px 0;
    text-align: center;
}
.donate-modal-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 14px;
    background: white;
    box-shadow: 0 4px 16px rgba(212, 120, 158, 0.2);
}
.donate-modal-avatar img {
    width: 140%;
    height: 140%;
    object-fit: cover;
    margin: -20% 0 0 -20%;
}
.donate-modal-header h2 {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--color-text);
    margin: 0 0 4px;
    line-height: 1.3;
}
.donate-modal-body {
    padding: 18px 32px 28px;
}
.donate-modal-body p {
    font-size: 15px;
    line-height: 1.55;
    color: var(--color-text);
    margin: 0 0 14px;
}
.donate-modal-body p:nth-child(2) {
    color: var(--color-text-muted);
    font-size: 14px;
}
.donate-continue-btn {
    display: block;
    text-align: center;
    background: var(--color-cta);
    color: white !important;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 28px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    margin-top: 18px;
    transition: background 0.2s, transform 0.15s;
}
.donate-continue-btn:hover {
    background: var(--color-cta-hover);
}
.donate-continue-btn:active {
    transform: scale(0.98);
}

.mobile-login-link {
    color: var(--color-primary-dark) !important;
    font-weight: 600 !important;
}

@media (min-width: 901px) {
    .mobile-login-link {
        display: none !important;
    }
}

@media (max-width: 900px) {
    .nav-login {
        display: none;
    }

    /* Option B: the "Continue with WeChat" button is shown on mobile browsers
       too. When tapped outside the WeChat in-app browser, wechatlogin() in
       header.js calls showWeChatMobileHint(), which explains the link must be
       opened inside WeChat and offers a copy-link button (rather than sending
       the user to the desktop QR page, which renders blank on a phone).
       (Previously this button + its divider were hidden here on mobile web.) */
}

/* ── LOGIN BUTTON ───────────────────────────── */
.nav-login {
    background: var(--color-cta);
    color: white;
    border: none;
    padding: 9px 24px;
    border-radius: 22px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(212, 120, 158, 0.25);
}

.nav-login:hover {
    background: var(--color-cta-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212, 120, 158, 0.35);
}

.nav-login:active {
    transform: translateY(0);
}

/* ── MOBILE MENU ─────────────────────────────── */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 110;
    position: relative;
    /* 44×44 tap target — the visual hamburger bars stay the same size,
       but the click area expands to meet Apple HIG / Material guidelines.
       Flex centering keeps the bars visually centred inside the larger area. */
    min-width: 44px;
    min-height: 44px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    margin: 5px 0;
    border-radius: 2px;
    transition:
        transform 0.3s ease,
        opacity 0.2s ease;
}

.mobile-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(58, 46, 63, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-overlay.show {
    display: block;
    opacity: 1;
}

.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.7s ease,
        transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 900px) {
    /* ── Drop-down hamburger menu (slide-down from header, full width,
       light background, no item dividers, generous spacing, prominent
       CTA pill at the bottom). Replaces the previous slide-from-right
       side panel.
       Extra top padding leaves room for the language toggle, which is
       absolutely positioned in the top-right corner of the menu. */
    .nav-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--color-bg, #faf6f2);
        padding: 52px 32px 36px;
        box-shadow: 0 8px 24px rgba(60, 40, 60, 0.08);
        border-top: 1px solid var(--color-border);
        z-index: 100;
        transform: translateY(-110%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.35s ease, opacity 0.25s ease;
    }

    .nav-links.show {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    /* No more dividers between items */
    .nav-links li {
        border-bottom: none;
    }

    /* Roomier menu items — bigger touch targets, more spacing */
    .nav-links a {
        display: block;
        padding: 14px 0;
        font-size: 17px;
        font-weight: 500;
        color: var(--color-text);
    }

    .nav-links a::after {
        display: none;
    }

    /* Highlight the current page's nav link in the brand colour, like
       "About Us" in the PawPath reference. The .is-active class is
       expected to be applied by header.js based on window.location. */
    .nav-links a.is-active {
        color: var(--color-primary-dark);
    }

    /* "Chat with Doris" CTA item — solid pink pill, centered, sits at
       the bottom of the menu list to mirror the "Start Free" pattern.
       Mobile-only — the desktop nav has plenty of room and the floating
       Chat tab serves the same purpose, so showing this as a plain inline
       link in the desktop nav row is visual noise. */
    .nav-cta-item {
        display: block;
        margin-top: 18px;
    }
    .nav-cta-link {
        display: block;
        background: var(--color-cta);
        color: white !important;
        padding: 14px 24px !important;
        border-radius: 28px;
        text-align: center;
        font-weight: 600 !important;
        font-size: 16px !important;
        transition: background 0.2s, transform 0.15s;
    }
    .nav-cta-link:hover,
    .nav-cta-link:active {
        background: var(--color-cta-hover);
    }
    .nav-cta-link:active {
        transform: scale(0.98);
    }

    .nav-lang,
    /* Hide the desktop-position language toggle on mobile — the in-menu
       copy (.nav-menu-lang inside the hamburger drop-down) takes over. */
    .nav-inner > .lang-toggle {
        display: none;
    }

    /* In-menu language toggle: absolutely positioned in the top-right
       corner of the hamburger drop-down. Compact size — bigger isn't
       better here since the menu items below want the user's primary
       attention, and the toggle is a secondary control. */
    .nav-lang-item {
        display: flex;
        position: absolute;
        top: 14px;
        right: 20px;
        padding: 0;
        margin: 0;
    }
    .nav-menu-lang {
        font-size: 12px;
        gap: 7px;
    }
    .nav-menu-lang .lang-toggle-switch {
        width: 34px;
        height: 18px;
    }
    .nav-menu-lang .lang-toggle-knob {
        width: 14px;
        height: 14px;
    }
    .nav-menu-lang[data-active="en"] .lang-toggle-knob {
        transform: translateX(16px);
    }
    /* Visual switch is intentionally compact (34×18) but that's well
       below tap-target minimums. Extend the invisible hit area via
       a ::before pseudo so a 44×44 zone around the switch is tappable
       without changing how it looks. */
    .nav-menu-lang .lang-toggle-switch {
        position: relative;
    }
    .nav-menu-lang .lang-toggle-switch::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 44px;
        height: 44px;
    }

    .mobile-toggle {
        display: flex;
    }

    /* ── LOGGED-IN USER BOX on mobile ─────────────
       Compress to just the avatar so the hamburger sits in its natural
       spot at the far right. The avatar still indicates logged-in state.
       Name and "| Logout" text are hidden — logout is reachable via the
       hamburger menu (mobileLoginLink, retitled to "Logout" in header.js). */
    .nav-user-box {
        padding: 0;
        gap: 0;
        /* Push to the right so it sits next to the hamburger toggle */
        margin-left: auto;
        order: 2;
    }
    .nav-user-avatar {
        width: 30px;
        height: 30px;
    }
    .nav-user-name,
    .nav-user-logout {
        display: none;
    }
    .mobile-toggle {
        order: 3;
        margin-left: 8px;
    }
    .nav-logo {
        order: 1;
    }
    /* The "Logout" link in the slide-out hamburger menu — visually
       distinguish it from a regular nav link so it doesn't get mistaken
       for navigation. */
    .nav-links a.mobile-login-link.is-logout {
        color: var(--color-text-muted);
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 48px 24px 40px;
    }

    .hero-text h1 {
        font-size: 36px;
    }

    .chat-widget {
        height: 480px;
    }

    .split {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .split.reverse .split-image,
    .split.reverse .split-content {
        order: 0;
    }

    .trust-grid {
        grid-template-columns: 1fr;
    }

    .donor-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .section {
        padding: 56px 24px;
    }

    .section-header h2 {
        font-size: 30px;
    }

    .split-content h2,
    .donor-content h2 {
        font-size: 28px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

.login-prompt-benefits-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin: 4px 0 6px;
}

.login-prompt-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
}

.login-prompt-benefits li {
    position: relative;
    padding: 4px 0 4px 24px;
    font-size: 13px;
    color: var(--color-text);
    line-height: 1.4;
}

.login-prompt-benefits li::before {
    content: "✓";
    position: absolute;
    left: 4px;
    top: 4px;
    color: var(--color-primary-dark);
    font-weight: 700;
    font-size: 13px;
}

/* .mobile-toggle {
    display: block;
} */
/* ── ACCESSIBLE FOCUS RINGS ──────────────────────────
   Several primary CTAs (login button, upload button, donate continue,
   etc.) previously had a 1.5px white :focus outline that was effectively
   invisible against light/pink backgrounds — keyboard users couldn't see
   where focus was. This applies a consistent dark ring with offset that
   reads cleanly across the palette. Using :focus-visible (not :focus)
   means the ring only appears on keyboard navigation, not on mouse
   clicks, so sighted mouse users see no visual noise. */
:focus-visible {
    outline: 2px solid var(--color-primary-dark);
    outline-offset: 2px;
}
/* Pink/CTA buttons need a slightly larger offset so the dark ring sits
   clearly outside the pink fill rather than blending with it. */
.nav-login:focus-visible,
.nav-cta-link:focus-visible,
.upload-btn:focus-visible,
.donate-continue-btn:focus-visible,
.hero-chat-cta:focus-visible,
.login-email-submit:focus-visible {
    outline: 3px solid var(--color-primary-dark);
    outline-offset: 3px;
}

/* ── LANGUAGE TOGGLE ──────────────────────────────
   Visually present but currently visual-only (does not translate UI
   strings). Will be wired up when the i18n work lands (running list
   item: "Working translations behind the language toggle"). Kept
   visible by user request as a placeholder for the upcoming feature. */

/* ── TOAST NOTIFICATIONS ──────────────────────────────
   Pairs with window.showToast() in header.js. The container is fixed
   to the bottom-center of the viewport and stacks toasts vertically.
   pointer-events: none on the container so it never blocks clicks on
   the page behind; toasts themselves re-enable pointer events. */
#doris-toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    display: flex;
    flex-direction: column-reverse; /* newest toast at bottom of stack */
    gap: 10px;
    pointer-events: none;
    max-width: calc(100% - 32px);
    width: max-content;
}
.doris-toast {
    background: white;
    color: var(--color-text);
    border-radius: 999px;
    padding: 11px 20px 11px 16px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(60, 40, 60, 0.18);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
    pointer-events: auto;
    border: 1px solid var(--color-border);
    white-space: nowrap;
    max-width: 100%;
}
.doris-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}
.doris-toast-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.doris-toast--success .doris-toast-icon { color: #2e8b57; }
.doris-toast--error .doris-toast-icon { color: #c0392b; }
.doris-toast--info .doris-toast-icon { color: var(--color-primary-dark); }
.doris-toast-text {
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 600px) {
    #doris-toast-container {
        bottom: 16px;
    }
    .doris-toast {
        font-size: 13px;
        padding: 10px 16px 10px 14px;
        white-space: normal;
    }
}

/* ── SKELETON LOADERS ─────────────────────────────────
   Animated shimmer placeholders shown while data is being fetched.
   Used by the dashboard's profile card during the initial profile.php
   fetch. The shimmer is a left-to-right gradient sweep that conveys
   "loading" without a spinner — feels more polished and indicates
   structure rather than just "wait". */
@keyframes doris-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.skeleton-bar,
.skeleton-circle {
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.04) 0%,
        rgba(0, 0, 0, 0.08) 50%,
        rgba(0, 0, 0, 0.04) 100%
    );
    background-size: 400px 100%;
    animation: doris-shimmer 1.4s ease-in-out infinite;
    border-radius: 6px;
}
.skeleton-circle {
    border-radius: 50%;
}
