.google-login-section { margin: 16px 0; }
.google-login-section[hidden] { display: none !important; }
.google-login-button {
    box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px 12px;
    display: flex; align-items: center; justify-content: center; gap: 12px;
    border: 1px solid #747775; border-radius: 8px; background: #fff; color: #1f1f1f;
    font: 500 14px Arial, sans-serif; cursor: pointer;
}
.google-login-button svg { flex-shrink: 0; }
.google-login-button:hover { background: #f2f2f2; }
.google-login-button:focus-visible { outline: 2px solid #4285f4; outline-offset: 3px; }
.google-login-button:disabled { opacity: .6; cursor: wait; }
.google-login-note { font-size: 13px; line-height: 1.5; color: var(--text-secondary, #aaa); overflow-wrap: anywhere; }
.google-login-error { font-size: 13px; color: #ff8a8a; }
.google-login-error:empty { display: none; }

.google-logout-button { display: block; margin: 12px auto 0; padding: 6px 12px; background: transparent; border: 0; color: var(--text-secondary, #aaa); font: inherit; font-size: 13px; cursor: pointer; }

.site-auth-overlay { position: fixed; inset: 0; z-index: 100100; padding: 20px; box-sizing: border-box; background: #0009; display: flex; overflow-y: auto; }
.site-auth-dialog { position: relative; box-sizing: border-box; width: 100%; max-width: 420px; margin: auto; padding: 32px 24px 24px; border: 1px solid var(--border-color,#444); border-radius: 20px; background: var(--bg-primary,#17181d); color: var(--text-primary,#eee); text-align: center; }
.site-auth-dialog h2 { font-size: 22px; margin: 12px 0; }
.site-auth-dialog p { font-size: 14px; line-height: 1.5; color: var(--text-secondary,#aaa); }
.site-auth-close { position: absolute; right: 12px; top: 6px; background: transparent; border: 0; color: inherit; font-size: 28px; padding: 4px 8px; cursor: pointer; }
.site-auth-telegram { width: 100%; padding: 12px; border: 1px solid #548ba9; border-radius: 8px; background: #2481aa; color: white; font: 500 14px Arial,sans-serif; cursor: pointer; }
.site-auth-key a { color: #75c5f3; }
.site-auth-key input { box-sizing: border-box; width: 100%; padding: 12px; margin: 16px 0 10px; background: transparent; border: 1px solid var(--border-color,#777); border-radius: 8px; color: inherit; }
.site-auth-key form button { width: 100%; }
.site-auth-key[hidden] { display: none; }
body.guest-mode .message-actions, body.guest-mode .message-actions-row { display: none !important; }

/* Text-only sign-in, with native button interaction and keyboard access. */
.guest-login-button { font-family: inherit; cursor: pointer; background: transparent; border: 0; border-radius: 0; padding: 0; text-align: left; transition: color .15s; }
html.desktop-browser .guest-login-button:hover { color: #91baff; }
html.desktop-browser .guest-login-button:active { color: #b49aff; }
.guest-login-button:focus-visible { outline: none; color: #91baff; text-decoration: underline; text-underline-offset: 4px; }

.guest-balance-promo { position: relative; box-sizing: border-box; padding: 14px; border: 1px solid #454752; border-radius: 13px; background: #252630; color: #fff; box-shadow: 0 6px 22px #0002; }
.guest-balance-promo p { margin: 0 0 11px; color: #fff; font-size: 13px; line-height: 1.5; }
.guest-balance-promo button { display: block; width: 100%; min-height: 36px; padding: 8px 12px; border: 1px solid #717786; border-radius: 8px; background: #ffffff0d; color: #fff; font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.3; cursor: pointer; }
.guest-balance-promo button:hover { background: #ffffff1a; border-color: #a2b8dc; }
.guest-balance-promo button:focus-visible { outline: 2px solid #91baff; outline-offset: 3px; }
.guest-balance-promo.is-floating { position: fixed; width: min(230px, calc(100vw - 24px)); z-index: 1000; }
.guest-balance-promo.points-left::before { content: ''; position: absolute; top: 14px; left: -6px; width: 10px; height: 10px; transform: rotate(45deg); background: #252630; border-left: 1px solid #454752; border-bottom: 1px solid #454752; }

.guest-balance-promo p { padding-right: 14px; }
.guest-balance-promo .guest-balance-dismiss { position: absolute; top: 3px; right: 3px; width: 24px; min-height: 24px; padding: 0; border: 0; background: transparent; color: #b9bbc5; font-size: 20px; font-weight: 400; }

/* Compact pill-shaped provider buttons, aligned to the centre of the sign-in dialog. */
.site-auth-dialog .google-login-button,
.site-auth-dialog .site-auth-telegram {
    box-sizing: border-box; width: calc(100% - 32px); max-width: 300px;
    min-height: 44px; margin-inline: auto; padding: 10px 16px; border-radius: 999px;
}

/* A slim registration strip between the catalogue filters and character grid. */
.catalog-signup-banner {
    display: flex; align-items: center; gap: 12px; flex: 0 0 auto;
    box-sizing: border-box; min-height: 48px; margin: 8px 12px 0; padding: 8px 14px;
    border: 1px solid #6b86be55; border-radius: 12px;
    background: linear-gradient(105deg, #5cc8ff16, #9b5cf621), #191b28;
    color: #f4f6ff; cursor: pointer; text-align: center; font-family: inherit;
    transition: border-color .16s, background-color .16s;
}
.catalog-signup-banner[hidden] { display: none !important; }
.catalog-signup-banner:hover { border-color: #91baffaa; background-color: #262a3c; }
.catalog-signup-banner:active { background-color: #30354a; }
.catalog-signup-banner:focus-visible { outline: 2px solid #91baff; outline-offset: 3px; }
.catalog-signup-gift { flex: 0 0 24px; color: #a3d7ff; }
.catalog-signup-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; font-weight: 600; }
.catalog-signup-arrow { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px; height: 28px; border-radius: 50%; background: #ffffff0d; color: #ccd7ff; }
@media (max-width: 600px) {
    .catalog-signup-banner { gap: 10px; padding: 9px 12px; text-align: left; }
    .catalog-signup-text { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .catalog-signup-banner { transition: none; } }

/* Account consolidation: explicit comparison, never a one-click silent merge. */
#account-link-modal { z-index: 100200; }
.account-link-dialog { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); overflow: hidden; flex-shrink: 0; max-width: 620px; text-align: left; padding: 28px 20px 20px; }
.account-link-dialog h2 { padding-right: 22px; }
.account-link-dialog h3 { font-size: 15px; margin: 18px 0 10px; }
.account-link-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.account-link-card { display: block; border: 1px solid #ffffff26; border-radius: 14px; padding: 12px; background: #ffffff04; cursor: pointer; min-width: 0; }
.account-link-card:has(input:checked) { border-color: #95baff; background: #8dafff0c; }
.account-link-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.account-link-name { color: var(--text-secondary,#aaa); font-size: 12px; overflow-wrap: anywhere; margin-bottom: 10px; }
.account-link-amount { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 7px 0; font-size: 12px; }
.account-link-amount strong { white-space: nowrap; font-variant-numeric: tabular-nums; color: #fff; }
.account-link-summary { padding: 10px 12px; background: #8dafff0c; border-radius: 12px; margin-top: 16px; }
.account-link-summary .account-link-amount { font-size: 14px; }
.account-link-sub,.account-link-ack { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; font-size: 13px; line-height: 1.45; }
.account-link-dialog input[type=radio],.account-link-dialog input[type=checkbox] { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 2px; accent-color: #9bbfff; }
.account-link-dialog .account-link-note { font-size: 12px; }
.account-link-confirm { width: 100%; margin-top: 12px; min-height: 44px; border-radius: 999px; }
.account-link-confirm:disabled { opacity: .45; cursor: default; }
.account-link-button { display: block; width: 100%; border: 1px solid #ffffff35; background: transparent; color: inherit; border-radius: 999px; min-height: 44px; padding: 10px 16px; margin: 10px 0; cursor: pointer; }
.account-link-button:hover { background: #ffffff0a; }
.account-link-key { display: grid; gap: 12px; margin-top: 16px; }
.account-link-key input { box-sizing: border-box; width: 100%; min-width: 0; padding: 12px; color: inherit; background: #ffffff08; border: 1px solid #ffffff35; border-radius: 10px; }
.account-link-archive { margin: 12px 0; border: 1px solid #ffffff25; border-radius: 10px; padding: 10px; }
.account-link-archive summary { cursor: pointer; font-size: 14px; }
.account-link-messages { max-height: 50vh; overflow: auto; }
.account-link-message { margin-top: 12px; padding: 10px; background: #ffffff08; border-radius: 8px; }
.account-link-message p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; }
@media(max-width:380px) {
 .account-link-dialog { padding-inline: 12px; }
 .account-link-card { padding: 9px; }
 .account-link-amount { flex-wrap: wrap; gap: 2px; }
 .account-link-summary .account-link-amount { font-size: 13px; }
}

.account-link-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.account-link-dialog > h2, .account-link-dialog > .google-login-error { flex-shrink: 0; }
