#sidebar .fhn-session-card {
    display: grid;
    gap: 12px;
    margin: 16px;
    padding: 14px;
    border: 1px solid #dbe4ee;
    border-radius: 14px;
    background: #f8fafc;
    color: #334155;
    font-size: .8125rem;
}

.fhn-session-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#sidebar #network-status-badge { color: #115e59; }
#sidebar #network-status-badge.text-amber-400 { color: #92400e; }

#sidebar #network-status-badge > span:first-child { background: currentColor; }

#sidebar .fhn-session-sync,
#sidebar .fhn-session-logout,
.fhn-logout-actions button {
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid #dbe4ee;
    border-radius: 9px;
    background: #fff;
    font-weight: 700;
}

#sidebar .fhn-session-sync { color: #115e59; }
#sidebar .fhn-session-sync:hover { background: #f0fdfa; }

#sidebar .fhn-session-logout {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: #9f1239;
}

#sidebar .fhn-session-logout:hover { background: #fff1f2; }
#sidebar .fhn-session-logout:disabled { opacity: .6; cursor: wait; }
[dir="rtl"] .fhn-session-logout i { transform: scaleX(-1); }

.fhn-session-last-sync {
    padding-block-end: 10px;
    border-block-end: 1px solid #dbe4ee;
    color: #475569;
}

#last-sync-time { direction: ltr; unicode-bidi: isolate; }

dialog.fhn-logout-dialog {
    box-sizing: border-box;
    max-width: min(400px, calc(100% - 32px));
    padding: 24px;
    margin: auto;
    border: 1px solid #dbe4ee;
    border-radius: 16px;
    background: white;
    color: #0f172a;
    box-shadow: 0 16px 40px rgb(15 23 42 / 18%);
}

.fhn-logout-dialog::backdrop { background: rgb(15 23 42 / 45%); }
.fhn-logout-dialog h2 { font-size: 1.25rem; font-weight: 800; }
.fhn-logout-dialog p { margin-block-start: 8px; color: #475569; }

.fhn-logout-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-block-start: 20px;
}

#fhn-logout-cancel:hover { background: #f1f5f9; }
#fhn-logout-confirm { background: #be123c; border-color: #be123c; color: white; }
#fhn-logout-confirm:hover { background: #9f1239; }

#sidebar .fhn-session-card button:focus-visible,
.fhn-logout-dialog button:focus-visible {
    outline: 2px solid #0f766e;
    outline-offset: 2px;
}

/* Keep account actions in view and give the navigation its own scroll area. */
@media screen {
    #sidebar {
        overflow: hidden;
    }

    #sidebar > :first-child {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }

    #sidebar > .fhn-session-card {
        flex: 0 0 auto;
        margin-block: 8px max(8px, env(safe-area-inset-bottom));
    }

    @media (max-height: 420px) {
        #sidebar > .fhn-session-card {
            gap: 6px;
            padding: 8px;
        }

        #sidebar .fhn-session-last-sync {
            display: none;
        }
    }
}

@media screen and (min-width: 1024px) {
    #sidebar {
        position: sticky;
        inset-block-start: 0;
        inset-block-end: auto;
        align-self: flex-start;
        height: 100vh;
        height: 100dvh;
    }
}
