/* Account menu (header dropdown), profile panel, and neko connect modal. */

.profile-button-wrap { position: relative; display: inline-flex; }
.profile-button .avatar-initials {
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ff-site-fg, #1d1d1f);
}
.profile-button.is-authed {
    border-color: var(--ff-site-accent, #0071e3);
    color: var(--ff-site-accent, #0071e3);
}
.profile-button.is-authed .avatar-initials {
    display: inline-flex !important;
}
.header .header-right #profile-button.profile-button.is-authed .avatar-initials,
.ff-site-actions #profile-button.profile-button.is-authed .avatar-initials {
    display: inline-flex !important;
}
.header .header-right #profile-button.is-authed svg,
.ff-site-actions #profile-button.profile-button.is-authed svg,
.ff-site-actions #profile-button.profile-button.is-authed .ff-site-profile-desktop-icon,
.ff-site-actions #profile-button.profile-button.is-authed .ff-site-action-mobile-icon {
    display: none !important;
}
.profile-button:not(.is-authed) .avatar-initials {
    display: none !important;
}
.profile-button:not(.is-authed) .ff-nav-glyph-regular {
    display: block !important;
}
.profile-button:not(.is-authed) .ff-nav-glyph-fill {
    display: none !important;
}

.account-menu {
    --surface: var(--ff-site-surface, #fff);
    --border: var(--ff-site-border, #d9e0ea);
    --text: var(--ff-site-fg, #1d1d1f);
    --muted: var(--ff-site-muted, #667085);
    --accent: var(--ff-site-accent, #0071e3);
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e4e4e4);
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(0,0,0,0.16);
    padding: 14px;
    z-index: 1200;
    color: var(--text, #171a20);
}
.account-menu[hidden] { display: none; }

.acct-head { font-size: 16px; font-weight: 750; color: var(--text, #171a20); margin: 0; }
.acct-user { margin-bottom: 12px; }
.acct-user strong { display: block; font-size: 15px; }
.acct-user span { display: block; font-size: 12px; color: var(--muted, #5c5e62); margin-top: 2px; word-break: break-all; }

.acct-section { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted, #5c5e62); margin: 8px 0 8px; }

.acct-hint { font-size: 12px; line-height: 1.45; color: var(--muted, #5c5e62); margin: 8px 0 0; }
.acct-login-head {
    display: grid;
    gap: 3px;
    margin: 0 0 14px;
}
.acct-login-head .acct-hint {
    margin: 0;
}

.acct-btn {
    display: block;
    width: 100%;
    text-align: center;
    border: 1px solid var(--border, #e4e4e4);
    background: var(--surface, #fff);
    color: var(--text, #171a20);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    transition: border-color .15s ease, background .15s ease;
}
.acct-btn:hover { border-color: var(--accent, #3e6ae1); }
.acct-btn.primary { background: var(--accent, #3e6ae1); border-color: var(--accent, #3e6ae1); color: #fff; }
.acct-btn.danger { color: #b91c1c; border-color: rgba(239,68,68,0.4); }
.acct-btn.danger:hover { background: #fef2f2; }
.acct-btn:disabled { opacity: 0.6; cursor: default; }

.acct-conn {
    border: 1px solid var(--border, #e4e4e4);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.acct-conn.is-compact {
    padding: 9px 10px;
}
.acct-conn-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.acct-conn-name { font-size: 13px; font-weight: 700; }
.acct-conn-email { font-size: 12px; color: var(--muted, #5c5e62); margin: 2px 0 0; word-break: break-all; }
.acct-conn-detail { font-size: 11px; color: var(--muted, #5c5e62); margin: 4px 0 0; }
.acct-conn-detail.warning { color: #92400e; }
.acct-conn-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.acct-conn-actions button {
    border: 1px solid var(--border, #e4e4e4);
    background: var(--surface, #fff);
    border-radius: 8px;
    padding: 6px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.acct-conn-actions button:hover { border-color: var(--accent, #3e6ae1); }
.acct-conn-actions button.danger { color: #b91c1c; }

.acct-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: capitalize;
}
.acct-badge.connected { background: #dcfce7; color: #166534; }
.acct-badge.expired { background: #fef3c7; color: #92400e; }
.acct-badge.disconnected { background: #f1f5f9; color: #475569; }

.acct-status-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148,163,184,0.16);
}
.acct-status-icon.connected {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22,163,74,0.16);
}
.acct-status-icon.expired {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245,158,11,0.18);
}
.acct-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted, #5c5e62);
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 750;
    line-height: 1;
}
.acct-status-pill.connected { color: #166534; }
.acct-status-pill.expired { color: #92400e; }
.acct-status-pill.disconnected { color: #475569; }

.acct-menu-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
}

.acct-preview-toggle {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin: 0 0 10px;
    border: 1px solid var(--border, #e4e4e4);
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    user-select: none;
}

.acct-inventory-view-toggle {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.acct-preview-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.acct-preview-switch {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background .15s ease;
}

.acct-preview-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
    transition: transform .15s ease;
}

.acct-preview-toggle input:checked + .acct-preview-switch {
    background: var(--accent, #3e6ae1);
}

.acct-preview-toggle input:checked + .acct-preview-switch::after {
    transform: translateX(18px);
}

.acct-preview-toggle input:focus-visible + .acct-preview-switch {
    outline: 2px solid var(--accent, #3e6ae1);
    outline-offset: 2px;
}

.acct-preview-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.acct-preview-copy strong {
    color: var(--text, #171a20);
    font-size: 13px;
    line-height: 1.2;
}

.acct-preview-copy small {
    color: var(--muted, #5c5e62);
    font-size: 11px;
    line-height: 1.3;
}

.acct-menu-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border, #e4e4e4);
    border-radius: 10px;
    background: var(--surface, #fff);
    color: var(--text, #171a20);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
}

.acct-menu-link:hover,
.acct-menu-link:focus-visible {
    border-color: var(--accent, #3e6ae1);
}

.acct-menu-link.danger {
    color: #b91c1c;
    border-color: rgba(239,68,68,0.4);
}

.acct-menu-link.danger:hover,
.acct-menu-link.danger:focus-visible {
    background: #fef2f2;
}

.vault-add-modal {
    position: fixed;
    inset: 0;
    z-index: 11060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.46);
}

.vault-add-modal[hidden] {
    display: none;
}

.vault-add-card {
    width: min(520px, 100%);
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e4e4e4);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
    padding: 18px;
}

.vault-add-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 14px;
}

.vault-add-head h2 {
    margin: 0;
    color: var(--text, #171a20);
    font-size: 17px;
    line-height: 1.25;
    font-weight: 750;
    letter-spacing: 0;
}

.vault-add-head p {
    margin: 4px 0 0;
    color: var(--muted, #5c5e62);
    font-size: 12px;
    line-height: 1.4;
}

.vault-icon-button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border, #e4e4e4);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--text, #171a20);
    cursor: pointer;
    font: inherit;
    font-size: 20px;
    line-height: 1;
}

.vault-icon-button:hover,
.vault-icon-button:focus-visible {
    border-color: var(--accent, #3e6ae1);
}

.vault-title-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.vault-card-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
}

.vault-card-status button {
    min-height: 26px;
    border: 1px solid var(--border, #e4e4e4);
    border-radius: 7px;
    background: var(--surface, #fff);
    color: var(--text, #171a20);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
}

.vault-card-status button:hover,
.vault-card-status button:focus-visible {
    border-color: var(--accent, #3e6ae1);
}

.vault-grid {
    display: grid;
    gap: 8px;
}

.vault-row {
    display: grid;
    gap: 0;
    border: 1px solid var(--border, #e4e4e4);
    border-radius: 8px;
    background: var(--surface, #fff);
    overflow: hidden;
}

.vault-row-top {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.16s ease;
}

.vault-row-top:hover,
.vault-row-top:focus-visible {
    background: rgba(62, 106, 225, 0.04);
    outline: none;
}

.vault-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.vault-expand-button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted, #5c5e62);
    pointer-events: none;
    padding: 0;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.vault-row-top:hover .vault-expand-button,
.vault-row-top:focus-visible .vault-expand-button {
    color: var(--accent, #3e6ae1);
    background: rgba(62, 106, 225, 0.08);
    border-color: rgba(62, 106, 225, 0.16);
}

.vault-expand-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.16s ease;
}

.vault-row.expanded .vault-expand-button svg {
    transform: rotate(180deg);
}

.vault-delete-button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted, #5c5e62);
    cursor: pointer;
    padding: 0;
}

.vault-delete-button:hover,
.vault-delete-button:focus-visible {
    color: #b91c1c;
    background: #fef2f2;
    border-color: rgba(239, 68, 68, 0.28);
    outline: none;
}

.vault-delete-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.vault-row-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vault-row-heading {
    min-width: 0;
}

.vault-row-title {
    color: var(--text, #171a20);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
}

.vault-row-details {
    display: grid;
    gap: 12px;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border, #e4e4e4);
    background: linear-gradient(180deg, #fbfbfc 0%, #f7f8fa 100%);
}

.vault-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 34px;
    padding-bottom: 2px;
}

.vault-detail-head > span {
    color: var(--muted, #5c5e62);
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.vault-detail-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 38px;
    color: var(--text, #171a20);
    font-size: 13px;
    line-height: 1.35;
    padding: 0 2px;
}

.vault-detail-row > span {
    color: var(--muted, #5c5e62);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.vault-detail-row a,
.vault-detail-row div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.vault-detail-row a {
    color: var(--accent, #3e6ae1);
    text-decoration: none;
}

.vault-detail-row a:hover,
.vault-detail-row a:focus-visible {
    text-decoration: underline;
}

.vault-detail-password {
    align-items: stretch;
}

.vault-logo {
    width: 74px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    padding: 7px;
}

.vault-logo img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.vault-logo.fallback {
    background: linear-gradient(180deg, rgba(62, 106, 225, 0.1) 0%, rgba(62, 106, 225, 0.04) 100%);
    color: var(--accent, #3e6ae1);
    font-size: 18px;
    font-weight: 850;
}

.vault-add-button {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(62, 106, 225, 0.9);
    border-radius: 8px;
    background: var(--accent, #3e6ae1);
    color: #fff;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 8px 18px rgba(62, 106, 225, 0.2);
    transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.vault-add-button:hover,
.vault-add-button:focus-visible {
    background: #3459bd;
    border-color: #3459bd;
    box-shadow: 0 10px 22px rgba(62, 106, 225, 0.26);
    transform: translateY(-1px);
    outline: none;
}

.vault-add-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.vault-admin-section {
    display: grid;
    gap: 8px;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border, #e4e4e4);
}

.vault-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.vault-section-head h2 {
    margin: 0;
    color: var(--text, #171a20);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
}

.vault-section-head span {
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(62, 106, 225, 0.18);
    border-radius: 999px;
    background: rgba(62, 106, 225, 0.08);
    color: var(--accent, #3e6ae1);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    padding: 0 8px;
    white-space: nowrap;
}

.vault-secret {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px 34px;
    align-items: center;
    min-height: 42px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: #f7f7f7;
    border: 1px solid var(--border, #e4e4e4);
    border-radius: 8px;
    color: var(--text, #171a20);
    cursor: copy;
    overflow: hidden;
}

.vault-totp-code {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px 34px;
    align-items: center;
    min-height: 42px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: #f7f7f7;
    border: 1px solid var(--border, #e4e4e4);
    border-radius: 8px;
    color: var(--text, #171a20);
    cursor: copy;
    overflow: hidden;
}

.vault-secret:active {
    transform: translateY(1px);
}

.vault-totp-code:active {
    transform: translateY(1px);
}

.vault-secret > span {
    min-width: 0;
    padding: 9px 10px;
    word-break: break-all;
}

.vault-totp-digits {
    min-width: 0;
    padding: 9px 10px;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.1;
    letter-spacing: 0;
    word-break: normal;
}

.vault-totp-timer {
    min-width: 48px;
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-left: 1px solid var(--border, #e4e4e4);
    background: var(--surface, #fff);
    color: var(--muted, #5c5e62);
    font-size: 12px;
    font-weight: 800;
    word-break: normal;
}

.vault-secret > .vault-copy-feedback {
    width: 34px;
    min-width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    padding: 0;
    border-left: 1px solid var(--border, #e4e4e4);
    background: var(--surface, #fff);
    color: var(--muted, #5c5e62);
    word-break: normal;
    transition: color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.vault-totp-code > .vault-copy-feedback {
    width: 34px;
    min-width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    padding: 0;
    border-left: 1px solid var(--border, #e4e4e4);
    background: var(--surface, #fff);
    color: var(--muted, #5c5e62);
    word-break: normal;
    transition: color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.vault-copy-feedback.ok {
    color: #166534;
    background: #dcfce7;
    transform: scale(1.04);
}

.vault-copy-feedback.error {
    color: #b91c1c;
    background: #fef2f2;
}

.vault-copy-feedback svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.vault-secret:hover,
.vault-secret:focus-visible,
.vault-totp-code:hover,
.vault-totp-code:focus-visible {
    border-color: var(--accent, #3e6ae1);
    outline: none;
}

.vault-eye-button {
    width: 34px;
    height: 100%;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-left: 1px solid var(--border, #e4e4e4);
    background: var(--surface, #fff);
    color: var(--muted, #5c5e62);
    cursor: pointer;
    padding: 0;
}

.vault-eye-button:hover,
.vault-eye-button:focus-visible {
    color: var(--accent, #3e6ae1);
    outline: none;
}

.vault-eye-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.acct-error {
    font-size: 12px;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 8px;
    padding: 8px 10px;
    margin: 0 0 8px;
}
.acct-error[hidden] { display: none; }

/* neko connect modal */
.acct-modal {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 11050;
}
.acct-modal[hidden] { display: none; }
.acct-modal-card {
    background: var(--surface, #fff);
    color: var(--text, #171a20);
    border-radius: 16px;
    width: min(960px, 100%);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.acct-modal-head { padding: 14px 18px; border-bottom: 1px solid var(--border, #e4e4e4); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acct-modal-title { font-size: 16px; font-weight: 700; margin: 0; }
.acct-modal-sub { font-size: 12px; color: var(--muted, #5c5e62); margin: 4px 0 0; }
.acct-modal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.acct-frame-wrap { flex: 1; min-height: 420px; background: #0b0b0b; }
.acct-frame { width: 100%; height: 100%; min-height: 420px; border: 0; display: block; }
.acct-modal-foot { padding: 12px 18px; border-top: 1px solid var(--border, #e4e4e4); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.acct-modal-note { font-size: 12px; color: var(--muted, #5c5e62); margin: 0; }
.acct-modal-actions { display: flex; gap: 8px; }
.acct-modal-actions button {
    border-radius: 999px;
    padding: 9px 16px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--border, #e4e4e4);
    background: var(--surface, #fff);
    color: var(--text, #171a20);
}
.acct-modal-actions .finish { background: var(--accent, #3e6ae1); border-color: var(--accent, #3e6ae1); color: #fff; }
.acct-modal-actions button:disabled { opacity: 0.6; cursor: default; }

/* Focused first-login passkey onboarding. Kept separate from the large
   connector-browser modal so its spacing and hierarchy stay intentional. */
.passkey-onboarding-modal {
    padding: 24px;
    background: rgba(15, 23, 42, 0.62);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.passkey-onboarding-card {
    position: relative;
    width: min(520px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 22px;
    background: #fff;
    color: #111827;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.34), 0 2px 8px rgba(15, 23, 42, 0.08);
}

.passkey-onboarding-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 2px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #9ca3af;
    font: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.passkey-onboarding-close:hover,
.passkey-onboarding-close:focus-visible {
    background: #f3f4f6;
    color: #4b5563;
    outline: 2px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}

.passkey-onboarding-icon {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 16px;
    background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.passkey-onboarding-icon svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.passkey-onboarding-eyebrow {
    margin: 0 0 8px;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.passkey-onboarding-card h2 {
    max-width: 420px;
    margin: 0;
    color: #111827;
    font-size: 27px;
    font-weight: 780;
    line-height: 1.16;
    letter-spacing: -0.025em;
}

.passkey-onboarding-lead {
    margin: 12px 0 22px;
    color: #5b6472;
    font-size: 14px;
    line-height: 1.55;
}

.passkey-onboarding-benefits {
    display: grid;
    gap: 13px;
    padding: 17px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    background: #f8fafc;
}

.passkey-onboarding-benefits > div {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
}

.passkey-onboarding-benefits > div > span {
    width: 21px;
    height: 21px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    border-radius: 50%;
    background: #dcfce7;
    color: #15803d;
    font-size: 12px;
    font-weight: 900;
}

.passkey-onboarding-benefits p {
    display: grid;
    gap: 2px;
    margin: 0;
}

.passkey-onboarding-benefits strong {
    color: #1f2937;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.35;
}

.passkey-onboarding-benefits small {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.4;
}

.passkey-onboarding-actions {
    display: block;
}

.passkey-onboarding-primary {
    width: 100%;
    min-height: 46px;
    border-radius: 11px;
    padding: 0 18px;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}

.passkey-onboarding-primary {
    border: 1px solid #1d4ed8;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 7px 16px rgba(37, 99, 235, 0.2);
}

.passkey-onboarding-primary:hover,
.passkey-onboarding-primary:focus-visible {
    border-color: #1e40af;
    background: #1d4ed8;
    outline: 3px solid rgba(37, 99, 235, 0.2);
    outline-offset: 2px;
}

.passkey-onboarding-primary:disabled {
    opacity: 0.62;
    cursor: wait;
}

.passkey-onboarding-note {
    margin: 13px 0 0;
    color: #9ca3af;
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
}

@media (max-width: 600px) {
    .acct-modal.passkey-onboarding-modal { inset: 0; padding: 14px; align-items: flex-end; justify-content: center; }
    .passkey-onboarding-card { max-height: calc(100vh - 28px); padding: 27px 22px 22px; border-radius: 20px; }
    .passkey-onboarding-card h2 { padding-right: 20px; font-size: 23px; }
}

.acct-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(0,0,0,0.2); border-top-color: var(--accent, #3e6ae1); border-radius: 50%; animation: acct-spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes acct-spin { to { transform: rotate(360deg); } }

.acct-login-form {
    display: grid;
    gap: 12px;
    margin-top: 2px;
}

.acct-field {
    display: grid;
    gap: 6px;
}

.acct-field label {
    color: var(--text, #171a20);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.acct-input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--border, #e4e4e4);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--text, #171a20);
    font: inherit;
    font-size: 13px;
    padding: 9px 10px;
}

.acct-input:focus {
    outline: 2px solid rgba(62, 106, 225, 0.18);
    border-color: var(--accent, #3e6ae1);
}

.acct-btn.subtle {
    background: transparent;
    color: var(--muted, #5c5e62);
}

.acct-link-btn {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--accent, #3e6ae1);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    padding: 4px 6px;
    text-align: center;
}

.acct-link-btn:hover,
.acct-link-btn:focus-visible {
    text-decoration: underline;
}

.acct-link-btn:focus-visible {
    outline: 2px solid rgba(62, 106, 225, 0.24);
    outline-offset: 2px;
    border-radius: 6px;
}

/* uniform feature access gate */
.acct-gate {
    position: fixed;
    inset: 0;
    z-index: 11040;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: var(--text, #171a20);
}

.acct-gate[hidden] { display: none; }

.acct-gate-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.56);
    cursor: default;
}

.acct-gate-card {
    position: relative;
    width: min(430px, 100%);
    max-height: min(720px, calc(100dvh - 32px));
    overflow: auto;
    background: var(--surface, #fff);
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.32);
    padding: 26px 28px 22px;
}

.acct-gate-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted, #5c5e62);
    font: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.acct-gate-close:hover,
.acct-gate-close:focus-visible {
    border-color: var(--border, #e4e4e4);
    color: var(--text, #171a20);
}

.acct-gate-mark {
    width: 54px;
    height: 28px;
    margin: 0 auto 14px;
    border: 3px solid #0b5cab;
    border-radius: 999px;
    box-shadow: inset 0 0 0 3px #fff, 0 0 0 1px rgba(11, 92, 171, 0.16);
}

.acct-gate-mark.has-logo {
    width: min(180px, 54%);
    height: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.acct-gate-mark.has-logo.is-ford {
    width: min(96px, 30%);
}

.acct-gate-mark.has-logo img {
    display: block;
    width: 100%;
    height: auto;
}

.acct-gate-title {
    margin: 0;
    text-align: center;
    font-size: 24px;
    line-height: 1.18;
    font-weight: 780;
    letter-spacing: 0;
}

.acct-gate-sub {
    margin: 8px auto 20px;
    max-width: 32ch;
    text-align: center;
    color: var(--muted, #5c5e62);
    font-size: 13px;
    line-height: 1.45;
}

.acct-gate-steps {
    display: grid;
    gap: 0;
    margin: 0 0 20px;
}

.acct-gate-step {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    position: relative;
    min-height: 58px;
}

.acct-gate-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 16px;
    top: 34px;
    bottom: 0;
    width: 1px;
    background: #d8dee8;
}

.acct-gate-step-index {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    font-weight: 780;
    line-height: 1;
    z-index: 1;
}

.acct-gate-step.is-active .acct-gate-step-index,
.acct-gate-step.is-done .acct-gate-step-index {
    border-color: var(--accent, #3e6ae1);
    background: var(--accent, #3e6ae1);
    color: #fff;
}

.acct-gate-step-copy {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 3px;
    padding-top: 2px;
}

.acct-gate-step-copy strong {
    font-size: 13px;
    line-height: 1.25;
}

.acct-gate-step-copy small {
    color: var(--muted, #5c5e62);
    font-size: 12px;
    line-height: 1.35;
}

.acct-gate-primary {
    min-height: 44px;
    margin-bottom: 8px;
}

.acct-gate-help {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted, #5c5e62);
    font-size: 13px;
    line-height: 1.45;
}

.acct-gate-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    color: var(--muted, #5c5e62);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.acct-gate-divider::before,
.acct-gate-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--border, #e4e4e4);
}

.acct-gate-master-form {
    margin-top: 0;
}

.acct-gate-status {
    margin-top: 18px;
    border-top: 1px solid var(--border, #e4e4e4);
    padding-top: 12px;
}

.acct-gate-status:empty {
    display: none;
}

.acct-gate-status-title {
    margin: 0 0 8px;
    color: var(--text, #171a20);
    font-size: 12px;
    font-weight: 700;
}

.acct-gate-row {
    min-height: 52px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    padding: 8px 0;
}

.acct-gate-row:first-of-type {
    border-top: 0;
}

.acct-gate-row-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.acct-gate-row-icon.has-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.acct-gate-row-icon.has-logo img {
    display: block;
    width: 26px;
    height: auto;
}

.acct-gate-row strong,
.acct-gate-row small {
    display: block;
    min-width: 0;
}

.acct-gate-row strong {
    font-size: 12px;
    line-height: 1.25;
}

.acct-gate-row small {
    margin-top: 2px;
    color: var(--muted, #5c5e62);
    font-size: 11px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.acct-gate-row em {
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    padding: 4px 8px;
    font-size: 11px;
    font-style: normal;
    font-weight: 750;
    white-space: nowrap;
}

.acct-gate-row em.connected {
    background: #dcfce7;
    color: #166534;
}

.acct-gate-row em.expired {
    background: #fef3c7;
    color: #92400e;
}

@media (max-width: 700px) {
    .account-menu {
        position: fixed;
        top: calc(58px + env(safe-area-inset-top, 0px));
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        max-height: calc(100dvh - 70px - env(safe-area-inset-top, 0px));
        overflow: auto;
        border-radius: 12px;
    }
    .acct-modal {
        inset: var(--ff-mobile-top-bar-height, 59px) 0 calc(var(--ff-mobile-bottom-bar-height, 64px) + env(safe-area-inset-bottom, 0px));
        align-items: stretch;
        justify-content: stretch;
        padding: 0;
    }
    .acct-modal-card {
        width: 100%;
        max-height: none;
        height: 100%;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .acct-modal-head {
        padding: 10px 12px;
        gap: 8px;
    }
    .acct-modal-title {
        font-size: 15px;
    }
    .acct-modal-sub {
        font-size: 11px;
    }
    .acct-modal-body {
        min-height: 0;
    }
    .acct-frame-wrap,
    .acct-frame {
        min-height: 0;
        height: 100%;
    }
    .acct-modal-foot {
        padding: 10px 12px;
        align-items: stretch;
    }
    .acct-modal-actions {
        width: 100%;
    }
    .acct-modal-actions button {
        flex: 1 1 0;
        border-radius: 8px;
        min-height: 40px;
        padding: 8px 10px;
    }
    .acct-gate {
        inset: var(--ff-mobile-top-bar-height, 59px) 0 calc(var(--ff-mobile-bottom-bar-height, 64px) + env(safe-area-inset-bottom, 0px));
        display: block;
        padding: 0;
        background: var(--surface, #fff);
    }
    .acct-gate-backdrop,
    .acct-gate-close { display: none; }
    .acct-gate-card {
        width: 100%;
        height: 100%;
        max-height: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 24px 18px 28px;
        overscroll-behavior: contain;
    }
    .acct-gate-title {
        font-size: 22px;
    }
    .acct-gate-sub {
        margin-bottom: 18px;
    }
    .acct-gate-row {
        grid-template-columns: 34px minmax(0, 1fr);
    }
    .acct-gate-row em {
        grid-column: 2;
        justify-self: start;
    }
    .vault-add-modal {
        align-items: flex-end;
        padding: 10px;
    }
    .vault-add-card {
        max-height: calc(100dvh - 20px);
        overflow: auto;
    }
    .vault-row-identity {
        gap: 8px;
    }
    .vault-row-top {
        min-height: 66px;
        gap: 8px;
        padding: 9px 10px;
    }
    .vault-actions {
        gap: 6px;
    }
    .vault-card-status {
        min-height: 30px;
    }
    .acct-status-pill {
        gap: 6px;
        font-size: 10px;
    }
    .vault-logo {
        width: 60px;
        height: 40px;
        padding: 6px;
    }
    .vault-row-details {
        gap: 10px;
        padding: 10px 10px 12px;
    }
    .vault-detail-head {
        min-height: 32px;
    }
    .vault-detail-row {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 5px;
        min-height: 0;
        padding: 0;
    }
    .vault-secret {
        grid-template-columns: minmax(0, 1fr) 34px 34px;
    }
    .vault-totp-code {
        grid-template-columns: minmax(0, 1fr) 44px 34px;
    }
    .vault-totp-digits {
        font-size: 17px;
    }
    .vault-totp-timer {
        min-width: 44px;
        padding: 0 6px;
    }
    .vault-secret > .vault-copy-feedback {
        grid-column: auto;
        min-height: 40px;
        border-left: 1px solid var(--border, #e4e4e4);
        border-top: 0;
    }
    .vault-totp-code > .vault-copy-feedback {
        grid-column: auto;
        min-height: 40px;
        border-left: 1px solid var(--border, #e4e4e4);
        border-top: 0;
    }
}

/* Shared account/vault control behavior. Keep this late so generated modal buttons match the site controls. */
:root {
    --acct-control-radius: 8px;
    --acct-control-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 1px 2px rgba(15,23,42,0.05);
    --acct-control-shadow-hover: inset 0 1px 0 rgba(255,255,255,0.84), 0 8px 20px rgba(15,23,42,0.08);
    --acct-control-ring: 0 0 0 4px rgba(62, 106, 225, 0.18);
    --acct-ease: cubic-bezier(0.23, 1, 0.32, 1);
}

.acct-btn,
.acct-menu-link,
.acct-conn-actions button,
.acct-modal-actions button,
.vault-icon-button,
.vault-card-status button,
.vault-delete-button,
.vault-add-button,
.vault-eye-button,
.vault-totp-code {
    border-radius: var(--acct-control-radius);
    box-shadow: var(--acct-control-shadow);
    transition:
        background 0.14s var(--acct-ease),
        border-color 0.14s var(--acct-ease),
        box-shadow 0.14s var(--acct-ease),
        color 0.14s var(--acct-ease),
        transform 0.14s var(--acct-ease);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.acct-btn:hover,
.acct-menu-link:hover,
.acct-conn-actions button:hover,
.acct-modal-actions button:hover:not(:disabled),
.vault-icon-button:hover,
.vault-card-status button:hover,
.vault-delete-button:hover,
.vault-add-button:hover,
.vault-eye-button:hover,
.vault-totp-code:hover {
    border-color: var(--accent, #3e6ae1);
    box-shadow: var(--acct-control-shadow-hover);
    transform: translateY(-1px);
}

.acct-btn:focus-visible,
.acct-menu-link:focus-visible,
.acct-conn-actions button:focus-visible,
.acct-modal-actions button:focus-visible,
.vault-icon-button:focus-visible,
.vault-card-status button:focus-visible,
.vault-delete-button:focus-visible,
.vault-add-button:focus-visible,
.vault-eye-button:focus-visible,
.vault-totp-code:focus-visible,
.acct-link-btn:focus-visible {
    outline: none;
    border-color: var(--accent, #3e6ae1);
    box-shadow: var(--acct-control-ring), var(--acct-control-shadow);
}

.acct-btn:active,
.acct-menu-link:active,
.acct-conn-actions button:active,
.acct-modal-actions button:active:not(:disabled),
.vault-icon-button:active,
.vault-card-status button:active,
.vault-delete-button:active,
.vault-add-button:active,
.vault-eye-button:active,
.vault-totp-code:active {
    box-shadow: var(--acct-control-shadow);
    transform: translateY(0) scale(0.98);
}

.acct-btn.primary,
.acct-modal-actions .finish,
.vault-add-button {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.24), 0 1px 2px rgba(62,106,225,0.12);
}

.acct-btn.primary:hover,
.acct-modal-actions .finish:hover:not(:disabled),
.vault-add-button:hover {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.30), 0 8px 18px rgba(62,106,225,0.18);
}

.acct-btn.danger,
.acct-menu-link.danger,
.acct-conn-actions button.danger,
.vault-delete-button {
    color: #b91c1c;
}

.acct-btn.danger:hover,
.acct-menu-link.danger:hover,
.acct-conn-actions button.danger:hover,
.vault-delete-button:hover {
    border-color: rgba(239, 68, 68, 0.34);
    background: #fef2f2;
    color: #991b1b;
}

.acct-btn:disabled,
.acct-modal-actions button:disabled {
    box-shadow: none;
    transform: none;
}

@media (hover: none), (pointer: coarse) {
    .acct-btn:hover,
    .acct-menu-link:hover,
    .acct-conn-actions button:hover,
    .acct-modal-actions button:hover:not(:disabled),
    .vault-icon-button:hover,
    .vault-card-status button:hover,
    .vault-delete-button:hover,
    .vault-add-button:hover,
    .vault-eye-button:hover,
    .vault-totp-code:hover {
        box-shadow: var(--acct-control-shadow);
        transform: none;
    }
}
