.account-access-modal {
    width: min(440px, calc(100vw - 32px));
}

.account-entry-page {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
    width: 100%;
    min-height: 100vh;
    background: var(--bg-page);
}

.account-entry-page .development-account-form {
    margin-top: 25px;
}

.account-entry-forgot {
    justify-self: end;
    margin-top: -5px;
}

.account-entry-back {
    justify-self: start;
    margin-top: -5px;
}

.account-invite-only-note {
    margin: 18px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.6;
    text-align: center;
}

.account-access-switch,
.development-entry-mode-switch {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    padding: 3px;
    margin-bottom: 27px;
    border-radius: 999px;
    background: var(--control-bg);
}

.account-access-switch-indicator,
.development-entry-mode-indicator {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 4.5px);
    border-radius: 999px;
    background: linear-gradient(145deg, var(--lifecycle-pending-header-start), var(--lifecycle-pending-header-end));
    box-shadow: 0 6px 16px rgba(79, 140, 255, .18);
    transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}

.account-access-switch-indicator.is-sign-up,
.development-entry-mode-indicator.is-sign-up {
    transform: translateX(calc(100% + 3px));
}

.account-access-switch button,
.development-entry-mode-switch button {
    position: relative;
    z-index: 1;
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 11px;
    font-weight: var(--weight-semibold);
    cursor: pointer;
    transition: color .18s ease;
}

.account-access-switch button[aria-selected="true"],
.development-entry-mode-switch button[aria-selected="true"] {
    color: white;
}

.account-access-heading,
.account-access-form-transition {
    animation: account-form-enter .2s ease both;
}

.account-access-eyebrow {
    color: var(--accent-hover);
    font-size: 10px;
    font-weight: var(--weight-bold);
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

@keyframes account-form-enter {
    from { opacity: .35; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.account-password-control {
    position: relative;
    display: block;
}

.account-password-control .ui-input {
    width: 100%;
    padding-right: 58px;
}

.account-password-control button {
    position: absolute;
    top: 50%;
    right: 13px;
    padding: 4px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 10px;
    font-weight: var(--weight-semibold);
    cursor: pointer;
    transform: translateY(-50%);
}

.account-password-control button:hover {
    color: var(--text-primary);
}

.account-password-match-status {
    display: block;
    min-height: 15px;
    margin-top: -2px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: var(--weight-medium);
    line-height: 1.5;
    transition: color .18s ease;
}

.account-password-match-status[data-match-state="mismatch"] {
    color: var(--danger);
}

.account-password-match-status[data-match-state="too-short"] {
    color: var(--warning);
}

.account-password-match-status[data-match-state="match"] {
    color: var(--success);
}

.application-load-state {
    min-height: 70vh;
    display: grid;
    place-items: center;
    padding: 48px 24px;
    text-align: center;
}

.application-load-content {
    width: min(420px, 100%);
    display: grid;
    justify-items: center;
    gap: 10px;
}

.application-load-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 20px;
    margin-bottom: 6px;
}

.application-load-indicator span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 32%, transparent);
    animation: application-load-pulse .9s ease-in-out infinite alternate;
}

.application-load-indicator span:nth-child(2) { animation-delay: .16s; }
.application-load-indicator span:nth-child(3) { animation-delay: .32s; }

.application-load-title,
.application-load-error-title {
    margin: 0;
    color: var(--text-primary);
    font-size: var(--font-heading-sm);
    font-weight: var(--weight-semibold);
}

.application-load-helper {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--font-body-sm);
    line-height: var(--line-relaxed);
}

.application-load-retry {
    margin-top: 12px;
}

@keyframes application-load-pulse {
    from { opacity: .35; transform: translateY(1px) scale(.86); }
    to { opacity: 1; transform: translateY(-1px) scale(1); }
}

.account-access-form {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.account-field {
    display: grid;
    gap: 8px;
    color: var(--text-secondary);
    font-size: var(--font-label);
    font-weight: var(--weight-semibold);
}

.account-form-message {
    min-height: 18px;
    margin: 0;
    color: var(--danger);
    font-size: var(--font-caption);
    line-height: var(--line-compact);
}

.account-form-message[data-message-type="success"] {
    color: var(--lifecycle-decided);
}

.account-mode-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: -6px;
}

.app-sync-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: var(--weight-medium);
    white-space: nowrap;
}

.app-sync-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--lifecycle-decided);
    box-shadow: 0 0 7px color-mix(in srgb, var(--lifecycle-decided) 35%, transparent);
}

.app-sync-status[data-sync-state="saving"] .app-sync-dot {
    background: var(--accent);
    animation: account-sync-pulse .9s ease-in-out infinite alternate;
}

.app-sync-status[data-sync-state="offline"] .app-sync-dot,
.app-sync-status[data-sync-state="error"] .app-sync-dot {
    background: var(--danger);
    box-shadow: 0 0 7px color-mix(in srgb, var(--danger) 35%, transparent);
}

@keyframes account-sync-pulse {
    from { opacity: .4; transform: scale(.82); }
    to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .application-load-indicator span,
    .app-sync-status[data-sync-state="saving"] .app-sync-dot {
        animation: none;
    }

    .account-access-switch-indicator,
    .development-entry-mode-indicator,
    .account-access-heading,
    .account-access-form-transition {
        transition: none;
        animation: none;
    }
}

.account-mode-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: var(--font-caption);
    cursor: pointer;
    transition: color .18s ease;
}

.account-mode-button:hover {
    color: var(--text-primary);
}

.account-current-user {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: var(--control-radius-md);
    background: var(--control-bg);
    color: var(--text-primary);
    font-size: var(--font-body);
    overflow-wrap: anywhere;
}

.account-menu {
    position: fixed;
    z-index: 175;
    width: min(290px, calc(100vw - 32px));
    padding: 10px;
    border-radius: 16px;
    background: #1B2432;
    box-shadow: 0 20px 48px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .05);
    animation: account-menu-enter .16s ease both;
}

.account-menu-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 10px 14px;
}

.account-menu-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent-surface);
    color: var(--accent-hover);
    font-size: 12px;
    font-weight: var(--weight-bold);
}

.account-menu-identity > span:last-child {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.account-menu-identity strong,
.account-menu-identity small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu-identity strong {
    color: var(--text-primary);
    font-size: 12px;
}

.account-menu-identity small {
    color: var(--text-muted);
    font-size: 10px;
}

.account-menu-actions {
    display: grid;
    gap: 4px;
    padding-top: 8px;
    box-shadow: inset 0 1px 0 var(--divider-soft);
}

.account-menu-actions button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 39px;
    padding: 0 11px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 11px;
    font-weight: var(--weight-semibold);
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.account-menu-actions button:hover {
    background: var(--control-bg-hover);
    color: var(--text-primary);
}

.account-menu-actions button.is-sign-out:hover {
    color: var(--danger);
}

@keyframes account-menu-enter {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-account-button.is-authenticated .app-account-avatar {
    background: var(--accent-surface);
    color: var(--accent-hover);
}

.app-account-button:not(:disabled) {
    cursor: pointer;
    opacity: .82;
    transition:
        background-color .18s ease,
        color .18s ease,
        opacity .18s ease;
}

.app-account-button:not(:disabled):hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    opacity: 1;
}

.app-account-button .app-account-label {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .account-access-modal {
        width: min(100% - 24px, 440px);
    }
}

@media (max-width: 1400px) {
    .account-entry-page {
        grid-template-columns: 1fr;
    }
}
