.account-btn {
    position: relative;
    font-size: 1.15rem;
}

.account-btn::after {
    content: '';
    position: absolute;
    top: -1px;
    inset-inline-end: -1px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--danger);
    border: 1.5px solid var(--bg-elevated);
}

.account-btn.is-signed-in::after {
    background-color: var(--success);
}

#accountSidebar {
    overflow-y: auto;
}

.account-panel {
    padding: 1.4rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.account-panel[hidden] {
    display: none;
}

.account-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0 0 0.2rem;
    text-align: center;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.btn-google:hover:not(:disabled) {
    border-color: var(--text-muted);
    background-color: var(--card-bg-hover);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.google-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.account-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

.auth-tabs {
    display: inline-flex;
    align-self: center;
    gap: 0.25rem;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.2rem;
}

.auth-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.4rem 1.2rem;
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.auth-tab:hover {
    color: var(--text-main);
}

.auth-tab.is-active {
    background-color: var(--accent);
    color: #04121c;
}

.account-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.account-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 0;
}

.account-field input,
.account-field select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.account-field input {
    font-size: 0.95rem;
}

/* Emails, passwords, and clock times are always Latin / numeric. Do not
   inherit this onto free-text fields (place names, etc.) in the same
   .account-field wrapper - those need dir=auto for Hebrew. */
.account-field input[type="email"],
.account-field input[type="password"],
.account-field input[type="time"] {
    direction: ltr;
    text-align: left;
    unicode-bidi: isolate;
}

.account-submit {
    width: 100%;
}

.account-switch {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin: -0.3rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.account-switch[hidden] {
    display: none;
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s ease;
}

.link-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.link-btn:hover:not(:disabled) {
    text-decoration: underline;
}

.account-status {
    min-height: 1.1rem;
    font-size: 0.8rem;
    color: var(--danger);
    margin: 0;
    text-align: center;
}

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

.account-profile {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.account-profile-text {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.account-profile-text .current-plan-badge {
    align-self: flex-start;
}

.account-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    text-transform: uppercase;
}

.account-email {
    font-weight: 600;
    margin: 0;
    word-break: break-all;
    direction: ltr;
    text-align: left;
}

.account-section {
    gap: 0.55rem;
    border-top: 1px solid var(--border-soft);
    padding-top: 1.05rem;
    padding-bottom: 1.05rem;
}

.account-section-kicker {
    margin: 0 0 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

[dir="rtl"] .account-section-kicker {
    letter-spacing: 0.02em;
    text-transform: none;
}

.account-tools {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

#obReplayBtn {
    margin-top: 0;
}

.account-tool {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.65rem 0.8rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    color: inherit;
    font-family: inherit;
    text-align: start;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.account-tool[hidden] {
    display: none;
}

.account-tool:hover {
    background-color: var(--card-bg-hover);
    border-color: var(--border);
}

.account-tool:active {
    transform: scale(0.985);
}

.account-tool-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background-color: var(--accent-soft);
    font-size: 0.9rem;
    color: var(--text-main);
}

.account-lock-glyph {
    width: 14px;
    height: 16px;
    overflow: visible;
}

.account-lock-glyph .applock-shackle,
.account-lock-glyph .applock-body-shape {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.account-tool-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.account-tool-label {
    font-size: 0.88rem;
    font-weight: 600;
}

.account-tool-label-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.account-pref-block {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.account-tool--composite {
    padding: 0;
    gap: 0;
}

.account-tool-hit {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 1;
    min-width: 0;
    padding: 0.65rem 0.4rem 0.65rem 0.8rem;
    background: transparent;
    border: none;
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.account-info-btn {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
    cursor: pointer;
}

.account-info-btn[aria-expanded="true"] {
    border-color: var(--accent);
    color: var(--accent);
}

.account-tool--composite .account-info-btn {
    margin-inline-end: 0.65rem;
}

.account-tool-help {
    margin: 0;
    padding: 0 0.15rem 0.15rem;
    font-size: 0.74rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.account-tool-help[hidden] {
    display: none;
}

.account-tool-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-pref {
    cursor: pointer;
    transition: opacity 0.05s linear;
}

.account-pref.is-off {
    opacity: 0.55;
}

.account-pref.is-busy {
    pointer-events: none;
    cursor: default;
}

.pref-switch {
    position: relative;
    width: 46px;
    height: 26px;
    padding: 0;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background-color: var(--bg-elevated);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.pref-switch-thumb {
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--text-muted);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.pref-switch[aria-checked="true"] {
    background-color: color-mix(in srgb, var(--accent) 42%, var(--bg-elevated));
    border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
}

.pref-switch[aria-checked="true"] .pref-switch-thumb {
    background-color: var(--accent);
    transform: translateX(20px);
}

html[dir="rtl"] .pref-switch[aria-checked="true"] .pref-switch-thumb {
    transform: translateX(-20px);
}

.account-tool-chevron {
    flex-shrink: 0;
    display: inline-block;
    color: var(--text-muted);
    font-size: 1rem;
    /* Freeze the glyph as drawn, then scaleX in RTL. Without direction:ltr
       the browser mirrors › first and the flip cancels out. */
    unicode-bidi: isolate;
    direction: ltr;
}

[dir="rtl"] .account-tool-chevron {
    transform: scaleX(-1);
}
