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

.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-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;
}

.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);
    }
}
