
/* ============ Auth / Wallet / User pill ============ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.48); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 9000; padding: 20px; animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; padding: 32px 28px; box-shadow: 0 24px 64px rgba(2, 6, 23, 0.28); position: relative; animation: pop 0.22s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { transform: translateY(8px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; font-size: 22px; color: #64748b; display: flex; align-items: center; justify-content: center; }
.modal-x:hover { background: #f1f5f9; color: #0f172a; }
.login-modal .login-head { text-align: center; margin-bottom: 20px; }
.login-head h2 { margin: 12px 0 4px; font-size: 22px; }
.login-head p { color: #64748b; font-size: 14.5px; margin: 0; }
.brand-mark.big { width: 48px; height: 48px; font-size: 24px; display: inline-flex; }
.g-btn { width: 100%; padding: 12px 16px; border-radius: 10px; border: 1px solid #d4d4d8; background: #fff; display: flex; align-items: center; justify-content: center; gap: 12px; cursor: pointer; font-size: 15px; font-weight: 500; color: #0f172a; transition: background 0.12s, border-color 0.12s; }
.g-btn:hover:not(:disabled) { background: #f9fafb; border-color: #94a3b8; }
.g-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.g-btn.alt { color: #475569; }
.g-btn .em { font-size: 18px; }
.login-or { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: #94a3b8; font-size: 12.5px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: #e5e7eb; }
.login-foot { font-size: 12px; color: #94a3b8; text-align: center; margin: 18px 0 0; line-height: 1.5; }

.g-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid #f1f5f9; margin-bottom: 12px; }
.g-titles { line-height: 1.3; }
.g-title { font-size: 17px; font-weight: 500; color: #0f172a; }
.g-sub { font-size: 13px; color: #64748b; }
.g-list { display: flex; flex-direction: column; }
.g-row { display: flex; align-items: center; gap: 14px; padding: 10px 4px; border-radius: 8px; cursor: pointer; }
.g-row:hover { background: #f8fafc; }
.g-row.muted { color: #64748b; }
.g-avatar { width: 38px; height: 38px; border-radius: 50%; color: #fff; font-weight: 600; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.g-avatar.ghost { background: #e5e7eb; color: #64748b; font-size: 22px; font-weight: 300; }
.g-name { font-size: 14.5px; color: #0f172a; }
.g-email { font-size: 12.5px; color: #64748b; }
.link-back { margin-top: 14px; background: 0; border: 0; color: #64748b; cursor: pointer; font-size: 13px; padding: 6px; }
.link-back:hover { color: #0f172a; }
.g-loading { text-align: center; padding: 28px 8px; }
.g-loading .dots { display: inline-flex; gap: 5px; margin: 20px 0 12px; }
.g-loading .dots span { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: dotPulse 1s infinite; }
.g-loading .dots span:nth-child(2) { animation-delay: 0.15s; }
.g-loading .dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotPulse { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }
.g-loading-text { font-size: 14px; color: #64748b; }

/* User pill in top bar */
.user-pill { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid #e5e7eb; background: #fff; cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.user-pill:hover { border-color: var(--accent); background: var(--accent-soft); }
.user-pill-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.user-pill-meta { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.user-pill-name { font-size: 12.5px; font-weight: 500; color: #0f172a; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pill-credits { font-size: 11px; color: #64748b; }

/* Invited banner */
.invited-banner { background: linear-gradient(90deg, #fef3c7, #fde68a); padding: 10px 20px; display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 13.5px; color: #78350f; }
.invited-banner button { background: rgba(120, 53, 15, 0.1); border: 0; padding: 4px 10px; border-radius: 6px; color: #78350f; cursor: pointer; font-size: 12px; }
.invited-banner button:hover { background: rgba(120, 53, 15, 0.2); }

/* Wallet page */
.wallet-page { min-height: 100vh; background: var(--bg-2, #f7f8fa); }
.wallet-wrap { max-width: 920px; margin: 0 auto; padding: 36px 24px 80px; }
.wallet-grid { display: grid; gap: 20px; }
.wallet-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 24px; }
.profile-card .profile-row { display: flex; align-items: center; gap: 16px; }
.profile-avatar { width: 52px; height: 52px; border-radius: 50%; color: #fff; font-weight: 600; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.profile-meta { flex: 1; }
.profile-name { font-size: 17px; font-weight: 600; color: #0f172a; }
.profile-email { font-size: 13.5px; color: #64748b; }
.profile-plan { margin-top: 14px; padding-top: 14px; border-top: 1px solid #f1f5f9; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.plan-pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f1f5f9; color: #475569; }
.plan-pill.plan-pro { background: #ede9fe; color: #5b21b6; }
.plan-pill.plan-pack { background: #dbeafe; color: #1e40af; }
.plan-pill.plan-invited { background: #fef3c7; color: #78350f; }
.invite-note { font-size: 12.5px; color: #64748b; }
.invite-note code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 11.5px; }

.credits-card .credits-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.credits-label { font-size: 13px; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; }
.credits-big { font-size: 56px; font-weight: 700; color: #0f172a; line-height: 1; margin: 6px 0 4px; }
.credits-sub { font-size: 13px; color: #94a3b8; }
.credits-actions { display: flex; flex-direction: column; gap: 8px; min-width: 200px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.cap-bar { margin-top: 22px; height: 8px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.cap-bar-fill { height: 100%; border-radius: 999px; transition: width 0.3s ease; }
.cap-note { margin: 10px 0 0; font-size: 12.5px; color: #64748b; line-height: 1.5; }

.history-card h3 { margin: 0 0 14px; font-size: 15px; }
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: 13.5px; }
.history-list li:last-child { border-bottom: 0; }
.h-type { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; background: #f1f5f9; color: #475569; }
.h-credit-add { background: #dcfce7; color: #166534; }
.h-credit-spend, .h-session { background: #dbeafe; color: #1e40af; }
.h-plan { background: #ede9fe; color: #5b21b6; }
.h-invite { background: #fef3c7; color: #78350f; }
.h-time { font-size: 12px; color: #94a3b8; }
.muted { color: #94a3b8; font-size: 13px; }
