.account-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  flex-wrap: wrap;
  gap: 12px;
}

.account-topnav { display: flex; gap: 24px; }
.account-topnav a { font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); }
.account-topnav a.active { color: var(--text); }

.account-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

#auth-section[hidden],
#dashboard[hidden],
.auth-success-banner[hidden] {
  display: none !important;
}

body.is-logged-in #auth-section {
  display: none !important;
}

body.is-logged-in #dashboard {
  display: grid !important;
}

body:not(.is-logged-in) #dashboard {
  display: none !important;
}

.auth-success-banner {
  margin-bottom: 24px;
  background: linear-gradient(135deg, #ecfdf3 0%, #f0fdf4 100%);
  border: 1px solid #86efac;
  border-radius: var(--radius);
  padding: 20px 24px;
}

.auth-success-inner { text-align: center; }

.auth-success-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: #166534;
}

.auth-success-sub {
  margin: 0 0 16px;
  font-size: 0.875rem;
  color: #15803d;
}

.auth-success-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.auth-section { display: flex; justify-content: center; }

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 36px;
  box-shadow: var(--shadow-sm);
}

.auth-card h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 8px;
}

.auth-sub { color: var(--text-muted); font-size: 0.9375rem; margin-bottom: 28px; }

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--bg);
  transition: all var(--transition);
}

.auth-tab.active { background: var(--text); color: var(--white); }

.auth-mode-panel[hidden] {
  display: none !important;
}

.auth-mode-kicker {
  margin: 0 0 6px;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
}

.pace-auth-login .auth-mode-kicker { color: var(--text); }
.pace-auth-register .auth-mode-kicker { color: #166534; }

.auth-text-link {
  display: inline-block;
  margin-top: 10px;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-text-link:hover {
  color: #1d4ed8;
}

.referral-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.referral-input-row input {
  flex: 1;
  min-width: 0;
}

.referral-input-row .btn {
  flex-shrink: 0;
  align-self: stretch;
  padding-left: 14px;
  padding-right: 14px;
}

.register-referral-box,
#register-referral-section {
  margin-bottom: 22px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fafaf8 0%, #f7f7f4 100%);
}

#register-referral-section[hidden] {
  display: none !important;
}

#register-referral-section {
  display: block;
  margin-top: 20px;
  margin-bottom: 0;
}

/* Page invitation parrain (?ref=) */
.invite-landing-hero {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 0;
}

.invite-landing-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  margin-bottom: 14px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #141414;
  background: #c8f542;
  border-radius: 999px;
}

.invite-landing-title {
  margin: 0 0 10px;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--text);
}

.invite-landing-sub {
  margin: 0 auto;
  max-width: 34ch;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.invite-login-link {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

html.pace-invite-landing .invite-login-link {
  margin: 12px 0 20px;
}

.invite-login-link a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.invite-logged-banner {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #713f12;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  text-align: center;
}

.invite-logged-banner .btn {
  margin-top: 10px;
}

.referral-compact-label {
  display: none;
  margin: 0 0 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

html.pace-invite-landing .auth-card {
  max-width: 480px;
  margin-inline: auto;
  padding: 32px 28px 36px;
}

html.pace-invite-landing .auth-card > h1,
html.pace-invite-landing .auth-card > .auth-sub {
  display: none;
}

html.pace-invite-landing .auth-tabs {
  display: none;
}

html.pace-invite-landing .auth-mode-kicker,
html.pace-invite-landing .auth-method-label {
  display: none;
}

html.pace-invite-landing .auth-method-sub {
  display: none;
}

/* Invitation parrain (?ref=) — carte code parrain */
.referral-invite-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8eaed;
}

.referral-invite-gift {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  color: #141414;
  background: #c8f542;
}

.referral-invite-gift svg {
  width: 14px;
  height: 14px;
}

.referral-invite-gift-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.referral-invite-gift-text strong {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

#register-ref-reward-amount {
  color: #15803d;
}

.referral-invite-gift-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.referral-invite-parrain {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.referral-invite-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #141414;
  background: #e8f5a0;
  border: 1.5px solid #c8f542;
}

.referral-invite-parrain-msg {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.referral-invite-parrain-msg strong {
  color: var(--text);
}

.referral-invite-parrain-msg strong {
  color: var(--text);
  font-weight: 700;
}

.referral-invite-check {
  flex-shrink: 0;
  align-self: center;
  padding: 4px 9px;
  font-size: 0.625rem;
  font-weight: 700;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 999px;
  white-space: nowrap;
}

html.pace-invite-landing #auth-register-picker {
  display: flex;
  flex-direction: column;
}

html.pace-invite-landing #register-referral-section {
  order: 10;
  margin-top: 14px;
  margin-bottom: 0;
  width: 100%;
  max-width: none;
}

html.pace-invite-landing .register-referral-box {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  border-radius: 4px;
  border: 1px solid #dadce0;
  background: #fff;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}

/* Lien parrain (?ref=) : mix compact + visuel (résumé parrain + code) */
html.pace-invite-landing #register-referral-section.is-invite-balanced {
  margin-top: 16px;
}

html.pace-invite-landing #register-referral-section.is-invite-balanced .referral-invite-top {
  display: none !important;
}

html.pace-invite-landing #register-referral-section.is-invite-balanced .referral-invite-parrain {
  display: flex;
  padding: 8px 10px;
  border-radius: 4px;
  background: rgba(200, 245, 66, 0.14);
  border: 1px solid rgba(200, 245, 66, 0.35);
}

html.pace-invite-landing #register-referral-section.is-invite-balanced.is-valid {
  border-color: #86efac;
  background: linear-gradient(180deg, #f8fef9 0%, #f0fdf4 100%);
  box-shadow: 0 1px 3px rgba(34, 197, 94, 0.1);
}

html.pace-invite-landing #register-referral-section.is-invite-balanced.is-valid .referral-invite-parrain {
  background: rgba(134, 239, 172, 0.2);
  border-color: rgba(134, 239, 172, 0.55);
}

html.pace-invite-landing .referral-box-head,
html.pace-invite-landing .referral-box-lead {
  display: none !important;
}

html.pace-invite-landing .referral-compact-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
}

html.pace-invite-landing #register-referral-section.is-invite-locked #register-ref-code {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  border-radius: 4px;
  line-height: 40px;
  color: #6b7280;
  background: #f8f9fa;
  border: 1px solid #dadce0;
  cursor: default;
  user-select: all;
  box-sizing: border-box;
}

html.pace-invite-landing #register-referral-section.is-invite-locked.is-valid {
  border-color: #86efac;
  background: #f6fef9;
  box-shadow: 0 1px 2px rgba(34, 197, 94, 0.12);
}

html.pace-invite-landing #register-referral-section.is-invite-locked.is-valid #register-ref-code {
  color: #166534;
  background: #ecfdf3;
  border-color: #86efac;
}

html.pace-invite-landing #register-referral-section.is-invite-locked.is-validating {
  border-color: #dadce0;
  background: #fff;
}

html.pace-invite-landing #register-referral-section.is-invite-locked.is-invalid {
  border-color: #fca5a5;
  background: #fffafa;
}

html.pace-invite-landing #register-referral-section.is-invite-locked.is-invalid #register-ref-code {
  border-color: #fca5a5;
  color: #991b1b;
}

html.pace-invite-landing #register-referral-section.is-invite-locked .referral-input-row {
  width: 100%;
  gap: 6px;
  align-items: center;
  justify-content: stretch;
}

html.pace-invite-landing #register-referral-section.is-invite-locked #register-ref-validate-btn {
  display: none !important;
}

html.pace-invite-landing #register-referral-section.is-invite-locked .referral-valid-badge {
  margin: 8px 0 0;
  padding: 0;
  background: none;
  border: none;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #166534;
}

html.pace-invite-landing #register-referral-section.is-invite-locked.is-valid .referral-valid-badge {
  display: none !important;
}

html.pace-invite-landing #register-referral-section.is-invite-locked .referral-valid-badge.is-pending {
  color: #6b7280;
  font-style: italic;
  font-weight: 500;
}

html.pace-invite-landing #register-referral-section.is-invite-locked .form-hint {
  margin: 8px 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: left;
  color: var(--text-muted);
}

html.pace-invite-landing #register-referral-section.is-invite-locked.is-valid .form-hint {
  color: #166534;
  font-weight: 600;
}

html.pace-invite-landing .referral-box-title {
  display: none;
}

html.pace-invite-landing #register-ref-validate-btn {
  display: none !important;
}

html.pace-invite-landing.pace-ref-invalid-ui #register-ref-validate-btn {
  display: inline-flex !important;
}

html.pace-invite-landing #register-ref-manual-row .input-locked {
  font-weight: 700;
  letter-spacing: 0.08em;
}

html.pace-invite-landing .referral-valid-badge {
  margin: 8px 0 0;
  font-size: 0.8125rem;
}

.referral-box-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.referral-box-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #141414;
  background: #c8f542;
  border-radius: 999px;
}

.referral-box-title {
  margin: 0 !important;
  font-size: 0.9375rem !important;
  font-weight: 700 !important;
}

.referral-box-lead {
  margin: 0 0 14px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.referral-box-lead strong {
  color: var(--text);
}

.referral-valid-badge.is-pending {
  color: var(--muted, #888);
  font-style: italic;
}

.register-referral-box.is-valid {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf3 100%);
}

.register-referral-box.is-valid .referral-box-badge {
  background: #22c55e;
  color: #fff;
}

.register-referral-box.has-invite {
  border-color: #c8f542;
  background: linear-gradient(180deg, #fafef0 0%, #f5fae8 100%);
}

.register-referral-box.has-invite .referral-box-badge {
  background: #141414;
  color: #c8f542;
}

.register-referral-box.is-invalid input {
  border-color: #fca5a5;
}

.register-referral-box .input-valid {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.referral-valid-badge {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
}

.referral-valid-badge[hidden] {
  display: none !important;
}

.oauth-login-stack--register {
  margin-bottom: 0;
}

.pace-google-register-btn {
  width: 100%;
}

.auth-form .field,
.auth-email-flow .field { margin-bottom: 0; }

.auth-form label,
.auth-email-flow label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.auth-form input,
.auth-email-flow input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form input:focus,
.auth-email-flow input:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(20, 20, 20, 0.06);
  outline: none;
}

.auth-form input::placeholder,
.auth-email-flow input::placeholder {
  color: #a3a3a3;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-error { color: #dc2626; font-size: 0.8125rem; margin-bottom: 12px; min-height: 1.2em; }
.form-success { color: #16a34a; font-size: 0.8125rem; margin-bottom: 12px; }

#auth-email-btn {
  padding: 14px 20px;
  font-size: 0.9375rem;
  border-radius: 10px;
  font-weight: 600;
}

.referral-promo-mini {
  margin-top: 28px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #fafaf8 0%, #f0fdf4 100%);
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.55;
}

.referral-promo-mini strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9375rem;
}

.code-sent-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.45;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.code-sent-banner[hidden] {
  display: none !important;
}

.code-sent-banner strong {
  font-weight: 600;
}

.dev-code-banner {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #92400e;
}

.dev-code-banner[hidden] {
  display: none !important;
}

.dev-code-banner strong {
  font-size: 1.25rem;
  letter-spacing: 0.2em;
  color: #78350f;
}

.auth-email-flow .form-error {
  margin-bottom: 14px;
}

.auth-referral-field {
  margin-top: 20px;
}

.label-optional {
  font-weight: 500;
  color: var(--text-muted);
}

/* ——— Flux e-mail (connexion / inscription) ——— */
.auth-email-flow {
  margin-top: 4px;
}

.auth-email-head {
  margin-bottom: 24px;
}

.auth-email-title {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0 0 8px;
  line-height: 1.2;
}

.auth-email-desc {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.auth-fields {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.pwd-field-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.pwd-field-wrap input {
  width: 100%;
  padding-right: 48px !important;
}

.pwd-toggle-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.pwd-toggle-btn:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

.auth-email-cta {
  margin-top: 4px;
  padding: 15px 20px !important;
  font-size: 0.9375rem !important;
  border-radius: 10px !important;
}

.auth-email-secondary {
  margin-top: 10px;
}

.referral-optional {
  padding: 16px 18px;
  background: linear-gradient(180deg, #fafaf8 0%, #f5f5f2 100%);
  border-radius: 12px;
  border: none;
}

.referral-optional-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.referral-optional-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #166534;
  background: #ecfdf3;
  border-radius: 999px;
}

.referral-optional-label {
  margin: 0 !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
}

.referral-optional input,
.auth-referral-field input {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--white);
}

.referral-optional .form-hint,
.auth-referral-field .form-hint {
  margin: 10px 0 0;
  font-size: 0.8125rem;
}

.field--code input {
  font-size: 1.375rem !important;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-align: center;
  padding: 16px !important;
}

.reg-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
  padding: 0 8px;
}

.reg-progress--3 .reg-progress-line {
  max-width: 48px;
}

.reg-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.reg-progress-step span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.8125rem;
  font-weight: 700;
  background: var(--bg);
  color: var(--text-muted);
  border: 2px solid var(--border);
  transition: all 0.25s;
}

.reg-progress-step small {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reg-progress-line {
  flex: 1;
  height: 2px;
  margin: 0 12px 18px;
  background: var(--border);
  border-radius: 1px;
  transition: background 0.25s;
}

.reg-progress-step.is-active span {
  background: var(--text);
  color: var(--white);
  border-color: var(--text);
}

.reg-progress-step.is-active small {
  color: var(--text);
}

.reg-progress-step.is-done span {
  background: #ecfdf3;
  color: #166534;
  border-color: #86efac;
}

.reg-progress[data-step="verify"] .reg-progress-line {
  background: linear-gradient(90deg, #86efac 0%, var(--border) 100%);
}

.reg-progress[data-step="verify"] .reg-progress-step:first-child span {
  background: #ecfdf3;
  color: #166534;
  border-color: #86efac;
}

.reg-progress[data-step="verify"] .reg-progress-step:last-child span {
  background: var(--text);
  color: var(--white);
  border-color: var(--text);
}

.reg-progress[data-step="verify"] .reg-progress-step:last-child small {
  color: var(--text);
}

#auth-ref-code,
#reg-ref-code {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-method-label {
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: 20px;
  text-align: center;
}

.auth-checkout-hint {
  margin-top: 16px;
  text-align: center;
  line-height: 1.5;
}

.auth-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 24px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: left;
  padding: 4px 0;
}

.auth-back-btn:hover { color: var(--text); }

.social-auth {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.social-auth-stack {
  grid-template-columns: 1fr;
  gap: 10px;
}

.auth-method-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: -4px 0 18px;
  line-height: 1.5;
}

.oauth-login-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 4px;
}

.oauth-slot {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 44px;
}

.oauth-slot--google iframe,
.oauth-slot--google > div {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 44px !important;
}

.pace-google-touch-btn {
  width: 100%;
  min-height: 48px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.pace-google-touch-btn.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

.pace-google-gis-host {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

#auth-email-btn,
.auth-email-cta,
.auth-tab,
.auth-back-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.pace-auth-hidden {
  display: none !important;
}

.pace-auth-visible {
  display: block !important;
}

.auth-form:not([hidden]),
.auth-email-flow:not([hidden]),
#register-flow:not([hidden]),
#login-form:not([hidden]) {
  display: block;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 4px;
  border: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.oauth-btn:hover {
  opacity: 0.92;
}

.oauth-btn:active {
  transform: scale(0.99);
}

.oauth-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.oauth-btn-text {
  flex: 1;
  text-align: center;
  margin-right: 20px;
}

.oauth-btn--google {
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
  box-sizing: border-box;
}

#register-ref-code.input-locked {
  background: #f6f8fa;
  color: var(--text-muted);
  cursor: default;
}

.oauth-btn--google:hover {
  background: #f8f9fa;
  border-color: #d2d4d7;
}

.oauth-btn--apple {
  background: #000;
  color: #fff;
}

.oauth-btn--facebook {
  background: #1877f2;
  color: #fff;
}

.oauth-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
  padding: 6px 0 0;
}

.oauth-status--error {
  color: #b91c1c;
}

.social-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--white);
  transition: border-color var(--transition);
}

.social-btn-row {
  flex-direction: row;
  justify-content: center;
  padding: 14px 16px;
  font-size: 0.8125rem;
  gap: 10px;
}

.google-signin-host {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 44px;
}

.google-signin-host > div {
  width: 100% !important;
  max-width: 400px;
}

.google-setup-hint {
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

.social-btn:hover { border-color: var(--text); }

.social-oauth-btn:disabled,
.social-oauth-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.social-oauth-btn:not(:disabled):hover {
  border-color: var(--text);
}

.reg-step,
.login-step { display: none; }
.reg-step.active,
.login-step.active { display: block; }

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.demo-code {
  font-size: 0.8125rem;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  padding: 12px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  line-height: 1.5;
}

.form-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.info-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.info-box strong { display: block; margin-bottom: 6px; font-size: 0.875rem; }
.info-box p { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 12px; }

.credit-balances {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.credit-pending-balance {
  background: #fffbeb;
  border-color: #fde68a;
}

.credit-pending-balance strong {
  color: #b45309;
}

.credit-pending-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.credit-pending-row span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.order-timeline {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.order-timeline li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}

.order-timeline li:last-child { border-bottom: none; }

.order-tracking a {
  font-weight: 600;
  text-decoration: underline;
}

.credit-welcome-box {
  padding: 20px;
  margin-bottom: 20px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
}

.credit-welcome-box strong {
  display: block;
  font-size: 1.125rem;
  margin-bottom: 8px;
  color: #047857;
}

.credit-welcome-box p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.credit-welcome-box--pending {
  background: #fffbeb;
  border-color: #fde68a;
}

.credit-welcome-box--pending strong {
  color: #b45309;
}

.credit-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.credit-section-lead {
  margin-bottom: 16px;
}

.credit-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.credit-option-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.credit-option-card--shop {
  border-color: #a7f3d0;
  background: #f0fdf9;
}

.credit-option-card--iban {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.credit-option-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.credit-option-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.credit-option-card strong {
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 4px;
}

.credit-option-card p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.credit-action-notice {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.875rem;
  line-height: 1.55;
}

.credit-withdraw-locked {
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.credit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.credit-withdraw-form {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft, #fafafa);
}

.credit-withdraw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.credit-withdraw-row span {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

.referral-invited-by {
  margin: 16px 0 8px;
}

.referral-invited-line {
  font-size: 0.9rem;
  padding: 12px 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  color: var(--text);
}

.referral-invited-line strong {
  color: #047857;
}

.referral-credit-cta {
  margin-bottom: 20px;
}

.credit-pending-badge.awaiting {
  background: #fef3c7;
  color: #b45309;
}

.credit-pending-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  white-space: nowrap;
}

.credit-balance {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
}

.credit-balance span { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.credit-balance strong { font-size: 2rem; color: #16a34a; }

.credit-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.order-return-btn { margin-top: 12px; }

.dashboard {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
}

.dashboard-nav {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 24px;
}

.user-badge {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.user-avatar {
  width: 48px;
  height: 48px;
  background: var(--text);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-badge strong { display: block; font-size: 0.9375rem; }
.user-badge span { font-size: 0.75rem; color: var(--text-muted); }

.dashboard-nav nav { display: flex; flex-direction: column; gap: 4px; margin-bottom: 24px; }

.dash-nav-btn {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.875rem;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.dash-nav-btn:hover { background: var(--bg); }
.dash-nav-btn.active { background: var(--text); color: var(--white); }

.dash-nav-link {
  display: block;
  text-decoration: none;
  color: inherit;
  font-weight: 500;
}

.dashboard-content {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  min-height: 480px;
}

.panel { display: none; }
.panel.active { display: block; }

.panel h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 400;
  margin-bottom: 8px;
}

.panel-desc { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 28px; }

.overview-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 28px 0;
}

.overview-card {
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius);
}

.overview-card span { font-size: 0.75rem; color: var(--text-muted); display: block; margin-bottom: 4px; }
.overview-card strong { font-size: 1.5rem; }
.overview-card.highlight { background: #ecfdf5; border: 1px solid #bbf7d0; }
.overview-card.highlight strong { color: #16a34a; }

.order-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.order-id { font-weight: 600; font-size: 0.875rem; }
.order-date { font-size: 0.75rem; color: var(--text-muted); }
.order-status {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #ecfdf5;
  color: #16a34a;
  padding: 4px 10px;
  border-radius: 100px;
}

.order-items { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 8px; }
.order-tracking,
.order-delivery {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.order-total { font-weight: 600; margin-top: 8px; }

.empty-orders {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

.referral-hero {
  background: linear-gradient(135deg, #141414 0%, #2a2a2a 100%);
  color: var(--white);
  padding: 32px;
  border-radius: var(--radius);
  margin-bottom: 28px;
}

.referral-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fbbf24;
}

.referral-hero h3 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.75rem;
  margin: 12px 0;
  font-weight: 400;
}

.referral-hero p { opacity: 0.9; font-size: 0.9375rem; line-height: 1.6; }
.referral-conditions { font-size: 0.75rem !important; opacity: 0.6 !important; margin-top: 12px !important; }

.referral-link-box { margin-bottom: 28px; }
.referral-link-box label { font-size: 0.75rem; font-weight: 600; display: block; margin-bottom: 8px; }

.referral-code-display {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.875rem;
}

.referral-code-display span { color: var(--text-muted); }
.referral-code-display strong {
  font-family: monospace;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  color: #16a34a;
}

.referral-share-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.referral-link-row { display: flex; gap: 8px; }
.referral-link-row input {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  background: var(--bg);
}

.copy-feedback { font-size: 0.75rem; color: #16a34a; margin-top: 8px; min-height: 1em; }

.referral-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.referral-stats > div {
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  text-align: center;
}

.referral-stats span { display: block; font-size: 0.6875rem; color: var(--text-muted); margin-bottom: 4px; }
.referral-stats strong { font-size: 1.25rem; }
.referral-stats .highlight { background: #ecfdf5; }

.invite-row small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.invite-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
}

.invite-status { font-weight: 600; }
.invite-status.confirmed { color: #16a34a; }

.credit-pending-row--locked .credit-amount-muted {
  color: #9ca3af;
}

.credit-pending-badge.awaiting {
  background: #f3f4f6;
  color: #6b7280;
}
.invite-status.pending { color: #ea580c; }

.email-change-box {
  margin: 4px 0 16px;
  padding: 16px;
  border: 1px solid #86efac;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf3 100%);
  max-width: 400px;
}

.email-change-box[hidden] {
  display: none !important;
}

.email-change-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.profile-form .field { margin-bottom: 16px; }
.profile-form label { display: block; font-size: 0.75rem; font-weight: 600; margin-bottom: 6px; }
.profile-form input {
  width: 100%;
  max-width: 400px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
}

.profile-form input:disabled,
.profile-form input[readonly].field-locked {
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
  border-color: #e5e7eb;
}

.profile-form .field:has(input.field-locked) label {
  color: #9ca3af;
}

#prof-email-field.is-locked .form-hint {
  margin-top: 6px;
  color: #6b7280;
}

@media (max-width: 768px) {
  .account-topbar {
    padding: 12px 16px;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .account-topbar .logo { font-size: 1rem; flex-shrink: 0; }

  .account-topnav { display: none; }

  .account-topbar .btn-ghost {
    margin-left: auto;
    padding: 10px 12px;
    font-size: 0.6875rem;
    white-space: nowrap;
  }

  .account-page {
    padding: 24px 16px calc(88px + env(safe-area-inset-bottom));
  }

  .auth-card {
    padding: 28px 20px;
    border-radius: 10px;
  }

  .auth-email-title { font-size: 1.35rem; }

  .auth-form input,
  .auth-email-flow input,
  .profile-form input {
    font-size: 16px;
    padding: 15px 16px;
    max-width: 100%;
  }

  .field--code input {
    font-size: 1.25rem !important;
    letter-spacing: 0.28em;
  }

  .auth-tab { min-height: 48px; }

  .auth-form .btn,
  .profile-form .btn {
    padding: 16px;
    font-size: 0.875rem;
  }

  .dashboard { grid-template-columns: 1fr; }
  .dashboard-nav { position: static; padding: 20px 16px; }

  .dashboard-nav nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .dash-nav-btn {
    text-align: center;
    padding: 14px 10px;
    font-size: 0.8125rem;
    min-height: 48px;
  }

  .dashboard-content { padding: 24px 16px; }
  .credit-balances { grid-template-columns: 1fr; }
  .credit-options { grid-template-columns: 1fr; }
  .overview-cards, .referral-stats { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }

  .referral-link-row { flex-direction: column; }
  .referral-link-row .btn { width: 100%; padding: 14px; }

  .invite-row { flex-direction: column; gap: 4px; }

  .order-card { padding: 16px; }
  .order-card-header { flex-direction: column; gap: 8px; align-items: flex-start; }

  .social-auth { grid-template-columns: 1fr; }
  .social-btn { flex-direction: row; justify-content: center; padding: 14px; }
  .credit-balance strong { font-size: 1.5rem; }

  .oauth-login-stack { gap: 10px; }
  .oauth-btn { min-height: 48px; font-size: 0.9375rem; }
  .oauth-btn-text { margin-right: 0; }

  .auth-method-picker,
  #auth-method-picker { margin-bottom: 8px; }

  .auth-tabs { gap: 0; }
}