/* ============================================================================
   GRAVELFINDER AUTHENTICATION & USER SYSTEM STYLES
   Matches GravelFinder's earthy palette (#475e41) & modern UI aesthetic
   ============================================================================ */

:root {
    --gf-auth-primary: #475e41;
    --gf-auth-primary-dark: #354730;
    --gf-auth-primary-light: #5d7a55;
    --gf-auth-accent: #688760;
    --gf-auth-bg: #ffffff;
    --gf-auth-surface: #f8faf8;
    --gf-auth-border: #e2e8e2;
    --gf-auth-text: #222b20;
    --gf-auth-muted: #647462;
    --gf-auth-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --gf-auth-radius: 12px;
}

/* ============================================================================
   HEADER AUTHENTICATION WIDGET
   ============================================================================ */

.gf-auth-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 100%;
}

/* Logged out state buttons */
.gf-auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    height: 100%;
}

.gf-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0 0.85rem;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    box-sizing: border-box;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    line-height: 1;
    border: 1px solid transparent;
    white-space: nowrap;
}

.gf-auth-btn-ghost {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(4px);
}

.gf-auth-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.45);
    transform: translateY(-1px);
}

.gf-auth-btn-primary {
    background: #ffffff;
    color: var(--gf-auth-primary);
    border: 1px solid transparent;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.gf-auth-btn-primary:hover {
    background: #f4f6f4;
    color: var(--gf-auth-primary-dark);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

/* Logged in state dropdown / capsule */
.gf-user-capsule {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    color: #ffffff;
    padding: 0 0.65rem 0 0.35rem;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    box-sizing: border-box;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.gf-user-capsule:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.gf-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--gf-auth-primary-dark);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.gf-user-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #ffffff;
}

.gf-auth-btn-logout-tiny {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gf-auth-btn-logout-tiny:hover {
    color: #ff9d9d;
    background: rgba(255, 0, 0, 0.15);
}

/* Mobile Sidebar Auth Item */
.gf-sidebar-auth {
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    background: #edf3ec;
    border-radius: 10px;
    border: 1px solid #dbe6d9;
}

.gf-sidebar-auth-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ============================================================================
   MODALS & OVERLAYS
   ============================================================================ */

.gf-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(18, 25, 17, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: gfFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.gf-modal-backdrop.is-active {
    display: flex;
}

.gf-modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: var(--gf-auth-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--gf-auth-border);
    animation: gfSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.gf-modal-card-wide {
    max-width: 680px;
}

.gf-modal-card-register {
    max-width: 560px;
}

.gf-register-defaults-box {
    margin: 0.95rem 0 1rem;
    padding: 0.75rem 0.85rem;
    background: var(--gf-auth-surface);
    border: 1px solid var(--gf-auth-border);
    border-radius: 10px;
}

.gf-register-defaults-box summary {
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--gf-auth-primary-dark);
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.gf-register-defaults-box summary::-webkit-details-marker {
    display: none;
}

.gf-register-defaults-hint {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gf-auth-muted);
    margin: 0.25rem 0 0.75rem;
}

.gf-form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.gf-register-defaults-box .gf-form-group {
    margin-bottom: 0.55rem;
}

.gf-register-defaults-box .gf-form-label {
    font-size: 0.74rem;
    margin-bottom: 0.22rem;
}

.gf-register-defaults-box .gf-form-input {
    padding: 0.42rem 0.55rem;
    font-size: 0.82rem;
}

@keyframes gfFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes gfSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gf-modal-header {
    padding: 1.25rem 1.5rem 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gf-auth-border);
    background: #fafbfa;
}

.gf-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gf-auth-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.gf-modal-close {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--gf-auth-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 10;
}

.gf-modal-close:hover {
    background: #e7ece6;
    color: var(--gf-auth-text);
    transform: rotate(90deg);
}

.gf-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Form controls */
.gf-form-group {
    margin-bottom: 1.1rem;
}

.gf-form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gf-auth-text);
    margin-bottom: 0.35rem;
}

.gf-form-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 0.92rem;
    font-family: inherit;
    border: 1px solid #ccd6ca;
    border-radius: 8px;
    background: #ffffff;
    color: var(--gf-auth-text);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.gf-form-input:focus {
    outline: none;
    border-color: var(--gf-auth-primary);
    box-shadow: 0 0 0 3px rgba(71, 94, 65, 0.18);
}

.gf-form-input::placeholder {
    color: #97a895;
}

.gf-form-checkbox-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: var(--gf-auth-muted);
}

.gf-form-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    user-select: none;
}

.gf-form-checkbox-label input[type="checkbox"] {
    accent-color: var(--gf-auth-primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Action button inside forms */
.gf-btn-submit {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--gf-auth-primary) 0%, var(--gf-auth-primary-dark) 100%);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(71, 94, 65, 0.25);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.gf-btn-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--gf-auth-primary-light) 0%, var(--gf-auth-primary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(71, 94, 65, 0.35);
}

.gf-btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.gf-modal-switch-text {
    margin-top: 1.2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--gf-auth-muted);
}

.gf-modal-switch-link {
    color: var(--gf-auth-primary);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.gf-modal-switch-link:hover {
    text-decoration: underline;
}

/* ============================================================================
   SOCIAL OAUTH BUTTONS (GOOGLE & STRAVA)
   ============================================================================ */

.gf-social-auth-grid {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.gf-btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    cursor: pointer;
}

.gf-btn-google {
    background: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.08);
}

.gf-btn-google:hover {
    background: #f8f9fa;
    border-color: #c6c9ce;
    box-shadow: 0 2px 6px rgba(60, 64, 67, 0.15);
    color: #202124;
    transform: translateY(-1px);
}

.gf-btn-strava {
    background: #FC4C02;
    color: #ffffff;
    border: 1px solid #e34402;
    box-shadow: 0 2px 6px rgba(252, 76, 2, 0.25);
}

.gf-btn-strava:hover {
    background: #e34402;
    box-shadow: 0 4px 12px rgba(252, 76, 2, 0.35);
    color: #ffffff;
    transform: translateY(-1px);
}

.gf-social-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gf-auth-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    text-align: center;
}

.gf-auth-divider::before,
.gf-auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gf-auth-border);
}

.gf-auth-divider span {
    padding: 0 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gf-auth-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ============================================================================
   PROFILE VIEW MODAL
   ============================================================================ */

.gf-profile-hero {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--gf-auth-border);
    margin-bottom: 1.25rem;
}

.gf-profile-avatar-large {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--gf-auth-primary) 0%, var(--gf-auth-primary-dark) 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.gf-profile-details h3 {
    margin: 0 0 0.2rem 0;
    font-size: 1.25rem;
    color: var(--gf-auth-text);
}

.gf-profile-details p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--gf-auth-muted);
}

.gf-profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.gf-stat-box {
    background: var(--gf-auth-surface);
    border: 1px solid var(--gf-auth-border);
    border-radius: 10px;
    padding: 0.85rem;
    text-align: center;
}

.gf-stat-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gf-auth-primary);
    margin-bottom: 0.15rem;
}

.gf-stat-label {
    font-size: 0.75rem;
    color: var(--gf-auth-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.gf-profile-actions {
    display: flex;
    gap: 0.75rem;
}

.gf-btn-secondary {
    flex: 1;
    padding: 0.65rem 1rem;
    background: #edf2ec;
    color: var(--gf-auth-text);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid #d5ded4;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.gf-btn-secondary:hover {
    background: #e2ebe0;
}

.gf-btn-danger-outline {
    padding: 0.65rem 1rem;
    background: transparent;
    color: #c92a2a;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid #ffc9c9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gf-btn-danger-outline:hover {
    background: #fff5f5;
    border-color: #ffa8a8;
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

.gf-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.gf-toast {
    pointer-events: auto;
    background: #252e24;
    color: #ffffff;
    padding: 0.75rem 1.15rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-left: 4px solid var(--gf-auth-primary-light);
    animation: gfToastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.25s ease;
}

.gf-toast.gf-toast-success {
    border-left-color: #4CAF50;
}

.gf-toast.gf-toast-error {
    border-left-color: #F44336;
}

.gf-toast.gf-toast-out {
    opacity: 0;
    transform: translateY(10px);
}

@keyframes gfToastIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive adjust */
@media (max-width: 768px) {
    .gf-toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
    .gf-user-name {
        display: none;
    }
    .gf-auth-wrapper {
        gap: 0.3rem;
        flex-shrink: 0;
        height: 100%;
    }
    .gf-auth-buttons {
        gap: 0.3rem;
        height: 100%;
    }
    .gf-auth-btn {
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        padding: 0 0.55rem !important;
        font-size: 0.75rem !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
    }
    .gf-user-capsule {
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        padding: 0 0.5rem 0 0.3rem !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 360px) {
    .gf-auth-wrapper {
        gap: 0.2rem;
    }
    .gf-auth-buttons {
        gap: 0.2rem;
    }
    .gf-auth-btn {
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        padding: 0 0.42rem !important;
        font-size: 0.68rem !important;
        border-radius: 6px !important;
        box-sizing: border-box !important;
    }
    .gf-user-capsule {
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        padding: 0 0.4rem 0 0.25rem !important;
        box-sizing: border-box !important;
    }
}


/* ============================================================================
   ACCOUNT SETTINGS, SAVED ROUTES, CONNECTIONS & ACCESSIBILITY
   ============================================================================ */

.gf-modal-card :focus-visible,
.gf-auth-wrapper :focus-visible {
    outline: 2px solid var(--gf-auth-primary);
    outline-offset: 2px;
}

.gf-inline-alert {
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.45;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.gf-inline-alert-error {
    background: #fff5f5;
    border-color: #fecaca;
    color: #991b1b;
}

.gf-inline-alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.gf-inline-alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.gf-inline-alert-info {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #075985;
}

.gf-turnstile-slot {
    margin: 0.75rem 0 1rem 0;
    min-height: 0;
}

.gf-badge-verified,
.gf-badge-unverified {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    vertical-align: middle;
}

.gf-badge-verified {
    background: #dcfce7;
    color: #166534;
}

.gf-badge-unverified {
    background: #fef3c7;
    color: #92400e;
}

.gf-profile-tabs {
    display: flex;
    gap: 0.35rem;
    border-bottom: 1px solid var(--gf-auth-border);
    margin-bottom: 1.1rem;
    overflow-x: auto;
    padding-bottom: 0.1rem;
}

.gf-profile-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.55rem 0.85rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--gf-auth-muted);
    cursor: pointer;
    white-space: nowrap;
    border-radius: 6px 6px 0 0;
    transition: all 0.15s ease;
}

.gf-profile-tab:hover {
    color: var(--gf-auth-text);
    background: var(--gf-auth-surface);
}

.gf-profile-tab.active {
    color: var(--gf-auth-primary);
    border-bottom-color: var(--gf-auth-primary);
    background: var(--gf-auth-surface);
}

.gf-account-section {
    background: var(--gf-auth-surface);
    border: 1px solid var(--gf-auth-border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.gf-account-section h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.94rem;
    color: var(--gf-auth-text);
}

.gf-form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.gf-saved-route-card,
.gf-connection-row,
.gf-session-row {
    background: #ffffff;
    border: 1px solid var(--gf-auth-border);
    border-radius: 8px;
    padding: 0.85rem;
    margin-bottom: 0.65rem;
}

.gf-connection-row,
.gf-session-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.gf-saved-route-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.gf-saved-route-title {
    font-weight: 700;
    font-size: 0.94rem;
    color: var(--gf-auth-text);
    margin: 0;
}

.gf-saved-route-meta {
    font-size: 0.78rem;
    color: var(--gf-auth-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.55rem;
}

.gf-saved-route-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.gf-btn-xs {
    padding: 0.35rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #d5ded4;
    background: #edf2ec;
    color: var(--gf-auth-text);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.gf-btn-xs:hover {
    background: #dde7db;
}

.gf-btn-xs-primary {
    background: var(--gf-auth-primary);
    border-color: var(--gf-auth-primary);
    color: #ffffff;
}

.gf-btn-xs-primary:hover {
    background: var(--gf-auth-primary-dark);
}

.gf-btn-xs-danger {
    background: transparent;
    border-color: #fecaca;
    color: #b91c1c;
}

.gf-btn-xs-danger:hover {
    background: #fef2f2;
}

.gf-danger-zone {
    background: #fff7f7;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 1rem;
}

.gf-danger-zone h4 {
    margin: 0 0 0.4rem 0;
    color: #991b1b;
    font-size: 0.94rem;
}

.gf-sync-prompt-banner {
    position: fixed;
    top: 72px;
    right: 16px;
    z-index: 9999;
    max-width: 360px;
    background: #ffffff;
    border: 1px solid #cbd9c9;
    border-left: 4px solid var(--gf-auth-primary);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

@media (max-width: 600px) {
    .gf-form-grid-2,
    .gf-form-grid-3 {
        grid-template-columns: 1fr;
    }
    .gf-modal-body {
        padding: 1rem;
    }
    .gf-profile-actions {
        flex-direction: column;
    }
    .gf-sync-prompt-banner {
        left: 12px;
        right: 12px;
        max-width: none;
    }
}

/* ==========================================================================
   Browse Routes & Communities Hub
   ========================================================================== */
.gf-modal-card-hub {
    max-width: 840px;
    width: 96%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.gf-hub-body {
    overflow-y: auto;
    max-height: calc(90vh - 68px);
}

.gf-hub-toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.9rem;
}

.gf-hub-search {
    flex: 1 1 200px;
    min-width: 160px;
    padding: 0.45rem 0.7rem !important;
    font-size: 0.85rem !important;
}

.gf-hub-select {
    width: auto !important;
    padding: 0.45rem 0.65rem !important;
    font-size: 0.82rem !important;
}

.gf-hub-cat-pills {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    flex: 1 1 100%;
}

.gf-hub-pill {
    border: 1px solid #d7e2d5;
    background: #f5f8f4;
    color: #354730;
    padding: 0.3rem 0.68rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.gf-hub-pill.active,
.gf-hub-pill:hover {
    background: var(--gf-auth-primary);
    color: #fff;
    border-color: var(--gf-auth-primary);
}

.gf-hub-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gf-hub-loading,
.gf-hub-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--gf-auth-muted);
    font-size: 0.88rem;
    background: #f8faf7;
    border-radius: 10px;
    border: 1px dashed #d5e0d3;
}

.gf-hub-route-card {
    border: 1px solid #dfe7dd;
    border-radius: 12px;
    background: #ffffff;
    padding: 0.85rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.gf-hub-route-card:hover {
    border-color: var(--gf-auth-primary);
    box-shadow: 0 6px 16px rgba(45, 70, 38, 0.1);
}

.gf-hub-route-top {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.gf-hub-route-canvas {
    width: 152px;
    height: 98px;
    display: block;
    flex-shrink: 0;
    background: #e8efe6;
    border: 1px solid #d5e0d3;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.gf-hub-minimap-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    color: var(--gf-auth-muted);
}

.gf-hub-route-main {
    flex: 1;
    min-width: 0;
}

.gf-hub-route-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.gf-hub-route-title-row h4 {
    margin: 0;
    font-size: 0.98rem;
    color: var(--gf-auth-text);
}

.gf-hub-region-badge {
    background: #eaf1e8;
    color: #365031;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.gf-hub-route-note {
    font-size: 0.78rem;
    font-weight: 600;
    color: #854d0e;
    background: #fef9c3;
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    margin-top: 0.3rem;
}

.gf-hub-route-desc {
    margin: 0.3rem 0 0.45rem 0;
    font-size: 0.82rem;
    color: var(--gf-auth-muted);
    line-height: 1.4;
}

.gf-hub-stats-row {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: #2f3b2c;
    margin-bottom: 0.4rem;
}

.gf-hub-surface-bar {
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
    display: flex;
}

.gf-hub-surface-gravel {
    background: #3d8b40;
}

.gf-hub-surface-other {
    background: #cbd5e1;
}

.gf-hub-route-footer {
    margin-top: 0.7rem;
    padding-top: 0.6rem;
    border-top: 1px solid #eef2ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.gf-hub-creator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--gf-auth-muted);
}

.gf-hub-mini-avatar,
.gf-hub-mini-avatar-fallback {
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gf-auth-primary);
    color: #fff;
    font-weight: 700;
    border: 1px solid #fff;
}

.gf-hub-pill-link {
    border: none;
    background: #eff4ee;
    color: #365031;
    border-radius: 999px;
    padding: 0.14rem 0.5rem;
    font-size: 0.73rem;
    font-weight: 600;
    cursor: pointer;
}

.gf-hub-pill-link:hover {
    background: #dfeadc;
}

.gf-hub-route-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.gf-hub-like-btn.is-liked {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.gf-hub-comm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.85rem;
}

.gf-hub-comm-card {
    border: 1px solid #dfe7dd;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gf-hub-comm-banner {
    padding: 0.55rem 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    background-size: cover;
    background-position: center;
}

.gf-hub-comm-banner.has-image {
    aspect-ratio: 16 / 9;
    width: 100%;
    align-items: flex-start;
}

.gf-hub-comm-cat {
    font-size: 0.73rem;
    font-weight: 700;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
}

.gf-hub-comm-body {
    padding: 0.8rem;
    flex: 1;
}

.gf-hub-comm-body h4 {
    margin: 0 0 0.2rem 0;
    font-size: 0.96rem;
    color: var(--gf-auth-text);
}

.gf-hub-comm-loc {
    font-size: 0.76rem;
    color: var(--gf-auth-muted);
    margin-bottom: 0.45rem;
}

.gf-hub-comm-desc {
    font-size: 0.81rem;
    color: #3f4b3c;
    line-height: 1.4;
    margin: 0 0 0.65rem 0;
}

.gf-hub-comm-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.76rem;
    color: var(--gf-auth-muted);
}

.gf-hub-avatar-stack {
    display: flex;
}

.gf-hub-avatar-stack > * {
    margin-left: -6px;
}

.gf-hub-avatar-stack > *:first-child {
    margin-left: 0;
}

.gf-hub-comm-actions {
    padding: 0.6rem 0.8rem;
    border-top: 1px solid #eef2ed;
    display: flex;
    justify-content: space-between;
    gap: 0.45rem;
}

.gf-hub-detail-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.gf-hub-detail-hero {
    background: #f8faf7;
    border: 1px solid #dfe7dd;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.gf-hub-detail-hero.has-banner {
    padding: 0;
}

.gf-hub-detail-hero.has-banner .gf-hub-detail-hero-inner {
    padding: 0.95rem 1rem 1rem 1rem;
}

.gf-hub-detail-banner {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    padding: 0.75rem 0.9rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gf-hub-detail-banner-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.gf-banner-preview-box {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    padding: 0.7rem;
    display: flex;
    align-items: flex-start;
    color: #fff;
    border: 1px solid #d5e0d2;
}

.gf-comm-posts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.gf-comm-posts-header h4 {
    margin: 0;
}

.gf-comm-post-composer {
    background: #f8faf7;
    border: 1px solid #d5e0d2;
    border-radius: 10px;
    padding: 0.85rem;
    margin-bottom: 0.75rem;
}

.gf-comm-post-composer-extras {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.gf-comm-file-label {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 7px;
    border: 1px solid #c9d5c5;
    background: #fff;
    color: var(--gf-auth-text);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.gf-comm-file-label:hover {
    background: #eef4ec;
}

.gf-comm-file-name {
    font-size: 0.76rem;
    color: var(--gf-auth-muted);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gf-comm-pin-check {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.79rem;
    color: var(--gf-auth-text);
    margin-left: auto;
    cursor: pointer;
}

.gf-comm-post-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.gf-comm-post-card {
    background: #ffffff;
    border: 1px solid #dfe7dd;
    border-radius: 10px;
    padding: 0.85rem 0.95rem;
}

.gf-comm-post-card.is-pinned {
    border-color: #84a97c;
    background: #fbfdfb;
}

.gf-comm-post-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.gf-comm-post-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gf-comm-post-author-line {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--gf-auth-text);
}

.gf-comm-role-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    background: #e6efe3;
    color: #2f5428;
}

.gf-comm-post-date {
    font-size: 0.74rem;
    color: var(--gf-auth-muted);
}

.gf-comm-post-badge,
.gf-comm-pinned-tag {
    font-size: 0.71rem;
    font-weight: 700;
    padding: 0.14rem 0.5rem;
    border-radius: 999px;
}

.gf-comm-pinned-tag {
    background: #fef3c7;
    color: #92400e;
}

.gf-comm-post-title {
    margin: 0 0 0.3rem 0;
    font-size: 0.96rem;
    color: var(--gf-auth-text);
}

.gf-comm-post-body {
    font-size: 0.85rem;
    color: #323e30;
    line-height: 1.48;
    white-space: pre-wrap;
    word-break: break-word;
}

.gf-comm-post-image {
    margin-top: 0.6rem;
}

.gf-comm-post-image img {
    max-width: 100%;
    max-height: 280px;
    border-radius: 8px;
    border: 1px solid #dfe7dd;
    object-fit: cover;
    display: block;
}

.gf-comm-post-route-pill {
    margin-top: 0.65rem;
    padding: 0.5rem 0.7rem;
    background: #f4f8f2;
    border: 1px solid #d5e1d2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.gf-comm-post-route-pill strong {
    display: block;
    font-size: 0.83rem;
    color: var(--gf-auth-text);
}

.gf-comm-post-route-pill span {
    font-size: 0.74rem;
    color: var(--gf-auth-muted);
}

.gf-comm-post-owner-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px solid #eef2ed;
}

.gf-hub-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.gf-hub-section {
    margin-bottom: 1rem;
}

.gf-hub-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.92rem;
    color: var(--gf-auth-text);
}

.gf-hub-members-row {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.gf-hub-member-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #f2f6f1;
    border: 1px solid #dce5da;
    border-radius: 999px;
    padding: 0.2rem 0.55rem 0.2rem 0.25rem;
    font-size: 0.78rem;
}

.gf-comm-map-pin {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Route Detail Info & Statistics Modal */
.gf-modal-card-route-detail {
    max-width: 780px;
    width: 96%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

.gf-route-detail-body {
    overflow-y: auto;
    max-height: calc(92vh - 74px);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.gf-route-detail-desc {
    margin: 0;
    font-size: 0.88rem;
    color: #3f4b3c;
    line-height: 1.45;
}

.gf-route-detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 0.55rem;
}

.gf-route-detail-stat-card {
    background: #f6f9f5;
    border: 1px solid #dfe7dd;
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.gf-route-detail-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gf-auth-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.gf-route-detail-stat-val {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gf-auth-text);
}

.gf-route-detail-surface-box {
    background: #ffffff;
    border: 1px solid #dfe7dd;
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
}

.gf-route-detail-surface-bar {
    height: 10px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
    display: flex;
    margin-bottom: 0.5rem;
}

.gf-route-detail-surface-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    font-size: 0.78rem;
    color: #354332;
}

.gf-route-detail-surf-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.gf-route-detail-surf-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.gf-route-detail-map-wrap {
    border: 1px solid #dfe7dd;
    border-radius: 10px;
    overflow: hidden;
    background: #eef3ec;
}

.gf-route-detail-map-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.75rem;
    background: #f7faf6;
    border-bottom: 1px solid #dfe7dd;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gf-auth-text);
}

#gfRouteDetailMap {
    width: 100%;
    height: 260px;
    z-index: 1;
}

.gf-route-detail-elev-wrap {
    position: relative;
    width: 100%;
    height: 150px;
    border: 1px solid #dfe7dd;
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
}

#gfRouteDetailElevCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

.gf-route-detail-elev-hover {
    position: absolute;
    width: 1px;
    background: rgba(71, 94, 65, 0.75);
    pointer-events: none;
    display: none;
}

.gf-route-detail-elev-tip {
    position: absolute;
    background: rgba(29, 42, 31, 0.92);
    color: #ffffff;
    padding: 0.22rem 0.5rem;
    border-radius: 6px;
    font-size: 0.74rem;
    pointer-events: none;
    display: none;
    white-space: nowrap;
}

.gf-route-detail-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding-top: 0.55rem;
    border-top: 1px solid #eef2ed;
}

.gf-btn-load-corridor {
    padding: 0.48rem 0.95rem !important;
    font-size: 0.84rem !important;
}

@media (max-width: 640px) {
    .gf-hub-route-top {
        flex-direction: column;
    }
    .gf-hub-route-canvas {
        width: 100%;
        height: 120px;
    }
    #gfRouteDetailMap {
        height: 210px;
    }
}
