.site-auth-login-btn,
.site-auth-signup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.site-auth-login-btn {
    border: 1px solid #d1d5db;
    background: transparent;
    color: #1f2937;
}

.site-auth-login-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.site-auth-signup-btn {
    border: 1px solid #00337c;
    background: #00337c;
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 51, 124, 0.18);
}

.site-auth-signup-btn:hover {
    background: #00285f;
    border-color: #00285f;
}

.site-auth-signup-btn:disabled,
.site-auth-login-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.site-auth-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: #00337c;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.site-auth-avatar:hover {
    background: #00285f;
    color: #ffffff;
}

.site-auth-avatar--compact {
    width: 2.25rem;
    height: 2.25rem;
}

.mobile-account-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.75rem;
    border-radius: 0.5rem;
    color: #1f2937;
    font-size: 1.05rem;
    font-weight: 500;
    text-decoration: none;
}

.mobile-account-link:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.dark .mobile-account-link {
    color: #e5e7eb;
}

.dark .mobile-account-link:hover {
    background: #1f2937;
    color: #e5e7eb;
}

.mobile-account-link--current,
.mobile-account-link--current:hover {
    color: #00337c;
    font-weight: 600;
}

.dark .mobile-account-link--current,
.dark .mobile-account-link--current:hover {
    color: #9fc0e6;
}

.site-auth-avatar__initial {
    line-height: 1;
}

.site-auth-link-btn {
    background: none;
    border: 0;
    padding: 0;
    color: #00337c;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.92rem;
}

.site-auth-link-btn:hover {
    text-decoration: underline;
}

.site-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.site-auth-modal[hidden] {
    display: none !important;
}

.site-auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.site-auth-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 26rem;
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.5rem 1.5rem 1.25rem;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
    z-index: 1;
}

.site-auth-modal__close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    background: transparent;
    color: #6b7280;
    border-radius: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.site-auth-modal__close:hover {
    background: #f3f4f6;
    color: #111827;
}

.site-auth-modal__title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #00337c;
    margin: 0 1.75rem 0.35rem 0;
    overflow-wrap: break-word;
}

.site-auth-modal__subtitle {
    margin: 0 0 1.1rem;
    color: #6b7280;
    font-size: 0.95rem;
}

.site-auth-providers {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
    width: 100%;
    margin-bottom: 0.35rem;
}

.site-auth-provider-google {
    position: relative;
    width: 100%;
}

.site-auth-provider-google[hidden],
.site-auth-provider-btn[hidden] {
    display: none !important;
}

.site-auth-provider-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    height: 48px;
    padding: 0 1rem;
    border: 1.5px solid #00337c;
    border-radius: 0.75rem;
    background: #ffffff;
    color: #00337c;
    font-size: 0.98rem;
    font-weight: 650;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(0, 51, 124, 0.12);
}

.site-auth-provider-google:hover .site-auth-provider-btn,
.site-auth-provider-btn:hover {
    background: #f3f7fc;
}

.site-auth-provider-btn:focus-visible {
    outline: 2px solid rgba(0, 51, 124, 0.35);
    outline-offset: 2px;
}

.site-auth-provider-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.site-auth-provider-btn__icon,
.site-auth-provider-btn__google {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.site-auth-provider-btn__icon {
    color: #00337c;
}

.site-auth-google-overlay {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0.02;
    cursor: pointer;
}

.site-auth-google-overlay > div,
.site-auth-google-overlay iframe {
    width: 100% !important;
    height: 100% !important;
}

.site-auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.site-auth-form[hidden] {
    display: none !important;
}

.site-auth-form__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-top: 0.35rem;
}

.site-auth-form__input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.65rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    color: #111827;
    background: #fff;
}

.site-auth-form__input:focus {
    outline: 2px solid rgba(0, 51, 124, 0.25);
    border-color: #00337c;
}

.site-auth-form__hint {
    margin: 0 0 0.4rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.site-auth-form__actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.85rem;
}

.site-auth-modal__status {
    min-height: 1.25rem;
    margin: 0.85rem 0 0;
    font-size: 0.88rem;
    color: #374151;
}

.site-auth-modal__status.is-error {
    color: #b42318;
}

.site-auth-modal__switch {
    margin: 0.9rem 0 0;
    font-size: 0.9rem;
    color: #6b7280;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}

.account-page {
    max-width: 72rem;
    margin: 0 auto;
}

.account-page__title {
    font-size: 1.85rem;
    font-weight: 700;
    color: #00337c;
    margin: 0 0 1.25rem;
}

.account-tabs {
    display: flex;
    gap: 0.35rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.account-tabs__tab {
    border: 0;
    background: transparent;
    padding: 0.7rem 1rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.account-tabs__tab.is-active {
    color: #00337c;
    border-bottom-color: #00337c;
}

.account-panel[hidden] {
    display: none !important;
}

.account-card,
.account-billing,
.account-lists,
.account-admin {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1rem;
}

.account-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.account-card__email {
    font-size: 1.15rem;
    font-weight: 650;
    color: #111827;
}

.account-card__meta {
    color: #6b7280;
    font-size: 0.92rem;
    margin-top: 0.25rem;
}

.account-logout-btn {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 0.65rem;
    padding: 0.45rem 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.account-logout-btn:hover {
    background: #f9fafb;
}

.account-billing__header,
.account-lists__header,
.account-admin__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.account-billing__title,
.account-lists__title,
.account-admin__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
}

.account-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.account-plan {
    border: 1px solid #e5e7eb;
    border-radius: 0.9rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.account-plan.is-current {
    border-color: #00337c;
    box-shadow: 0 0 0 1px #00337c;
}

.account-plan__name {
    font-weight: 700;
    color: #111827;
}

.account-plan__credits,
.account-plan__price-label {
    color: #6b7280;
    font-size: 0.88rem;
}

.account-plan__price {
    font-size: 1.35rem;
    font-weight: 700;
    color: #00337c;
    margin-top: 0.35rem;
}

.account-plan__action {
    margin-top: 0.75rem;
}

.account-plan__badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: #00337c;
}

.account-note,
.account-status,
.account-lists-status,
.account-admin-status {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0.75rem 0 0;
}

.account-status.is-error,
.account-lists-status.is-error,
.account-admin-status.is-error {
    color: #b42318;
}

.account-promo {
    background: #f3f7fc;
    border: 1px solid #d6e3f3;
    border-radius: 0.9rem;
    padding: 0.9rem 1rem;
    color: #1f3f6f;
    margin-bottom: 1rem;
}

.account-support {
    font-size: 0.92rem;
    color: #4b5563;
}

.account-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid #f3f4f6;
    flex-wrap: wrap;
}

.account-list-row:last-child {
    border-bottom: 0;
}

.account-list-row__name {
    font-weight: 650;
    color: #111827;
}

.account-list-row__count {
    color: #6b7280;
    font-size: 0.88rem;
}

.account-list-row__actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.account-list-row__actions button,
.account-create-btn,
.account-manage-btn,
.account-admin-refresh {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 0.55rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.account-create-btn,
.account-manage-btn {
    border-color: #00337c;
    background: #00337c;
    color: #fff;
    font-weight: 600;
}

.account-list-create {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.account-list-create input,
.account-admin-filter input,
.account-admin-filter select {
    border: 1px solid #d1d5db;
    border-radius: 0.55rem;
    padding: 0.45rem 0.65rem;
    min-width: 12rem;
}

.account-admin-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.85rem;
}

.account-admin-subtabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.account-admin-subtabs button {
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    cursor: pointer;
}

.account-admin-subtabs button.is-active {
    border-color: #00337c;
    color: #00337c;
    font-weight: 700;
}

.account-table-wrap {
    overflow-x: auto;
}

.account-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.account-table th,
.account-table td {
    text-align: left;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid #f3f4f6;
    white-space: nowrap;
}

.account-table th {
    color: #6b7280;
    font-weight: 650;
}

.account-empty {
    color: #6b7280;
    padding: 1rem 0;
}

body.directory-page .site-auth-modal__dialog,
body.directory-page .account-card,
body.directory-page .account-billing,
body.directory-page .account-lists,
body.directory-page .account-admin {
    background: #fff;
}
