:root {
  color-scheme: light;
  --ink: #102a59;
  --text: #243d63;
  --muted: #5b718e;
  --line: #dce8f4;
  --blue: #0873d2;
  --blue-dark: #075eb4;
  --sky: #edf7ff;
  --page: #f6fbff;
  --white: #fff;
  --danger: #a93232;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--page); -webkit-text-size-adjust: 100%; }
body { min-width: 320px; min-height: 100vh; margin: 0; display: flex; flex-direction: column; color: var(--ink); background: var(--page); }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #075eb4; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 10px 14px; transform: translateY(-160%); border-radius: 10px; background: var(--ink); color: var(--white); font-size: 14px; font-weight: 750; }
.skip-link:focus-visible { transform: translateY(0); outline: 3px solid #075eb4; outline-offset: 3px; }

.account-header { width: 100%; min-height: 76px; padding: 12px max(20px, calc((100vw - 1120px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: var(--white); }
.wordmark { width: 202px; min-width: 0; height: 50px; display: inline-flex; align-items: center; gap: 8px; }
.wordmark img { display: block; width: 154px; height: 48px; flex: 0 0 154px; object-fit: contain; object-position: left center; }
.wordmark .brand-pay { color: var(--ink); font-size: 15px; font-weight: 850; letter-spacing: .12em; line-height: 1; }
.header-link { padding: 10px 0; color: var(--muted); font-size: 13px; text-align: right; }
.header-link span { color: var(--blue-dark); font-weight: 750; }
.account-header .header-exchange { min-height: 48px; padding: 0 18px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--blue); color: #fff; font-size: 13px; font-weight: 800; text-align: center; white-space: nowrap; }
.account-header .header-exchange:hover { background: var(--blue-dark); color: #fff; }
.auth-layout { width: 100%; flex: 1; display: grid; place-items: center; padding: 42px 20px 52px; }
.auth-card { width: min(100%, 480px); padding: 38px 40px 34px; border: 1px solid var(--line); border-radius: 24px; background: var(--white); box-shadow: 0 22px 58px rgba(28, 76, 130, .09); }
.eyebrow, .card-kicker { margin: 0; color: #557397; font-size: 11px; font-weight: 800; letter-spacing: .11em; }
.auth-card h1, .page-heading h1, .state-panel h1, .welcome-card h1 { margin: 13px 0 10px; color: var(--ink); font-size: clamp(26px, 4vw, 34px); line-height: 1.15; letter-spacing: -.035em; }
.lead { margin: 0 0 28px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.auth-card form { display: grid; gap: 10px; }
.auth-card label { color: var(--text); font-size: 13px; font-weight: 700; }
.auth-card .consent-control { margin-top: 4px; display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.55; }
.consent-control input { width: 18px; min-width: 18px; height: 18px; min-height: 18px; margin: 1px 0 0; accent-color: var(--blue); }
.consent-control a { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 2px; }
.auth-card input, .copy-row input, .empty-state input { width: 100%; min-width: 0; min-height: 50px; padding: 0 14px; border: 1px solid #c9d9e9; border-radius: 12px; background: #fff; color: var(--ink); font-size: 15px; }
.auth-card input::placeholder { color: var(--muted); }
.auth-card .consent-control input { width: 18px; min-width: 18px; max-width: 18px; height: 18px; min-height: 18px; margin: 1px 0 0; padding: 0; flex: 0 0 18px; border-radius: 4px; accent-color: var(--blue); }
.auth-card input:focus-visible, .copy-row input:focus-visible, .empty-state input:focus-visible { border-color: var(--blue); outline: 3px solid #075eb4; }
.field-error { margin: -4px 0 0; color: var(--danger); font-size: 13px; }
.button { min-height: 46px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 800; line-height: 1.2; text-align: center; transition: background-color .15s ease, border-color .15s ease, transform .15s ease; }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .58; cursor: wait; }
.button-primary { background: var(--blue); color: #fff; }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { border-color: #cbdced; background: #fff; color: #174577; }
.button-secondary:hover { border-color: #9ec1e2; background: #f5faff; }
.auth-card form .button { min-height: 50px; margin-top: 6px; }
.notice { margin-top: 18px; padding: 13px 14px; border: 1px solid #cfe4f5; border-radius: 12px; background: #f1f8ff; color: #234d78; font-size: 13px; line-height: 1.5; }
.notice-invite { margin: 0 0 20px; }
.retry-invite { width: 100%; margin: -10px 0 18px; }
.notice-result { margin-top: 20px; }
.auth-code-input { max-width: 100%; font-size: 28px !important; font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: .42em; text-align: center; }
.auth-code-help { margin: -3px 0 0; color: var(--muted); font-size: 12px; }
.auth-code-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 14px; margin-top: 4px; }
.auth-text-button { padding: 6px 0; border: 0; background: transparent; color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 700; text-align: left; }
.auth-text-button:disabled { color: var(--muted); cursor: wait; }
.preview-code { margin-top: 14px; padding: 16px; border: 1px solid #f2d8a3; border-radius: 14px; background: #fff9ed; color: #583d12; text-align: center; }
.preview-code p { margin: 0 0 8px; font-size: 13px; line-height: 1.55; text-align: left; }
.preview-code output { display: block; color: #183861; font-size: 28px; font-weight: 800; letter-spacing: .35em; font-variant-numeric: tabular-nums; }
.fine-print { margin: 22px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.fine-print a, .settings-note a { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 2px; }
.auth-footer, .account-footer { width: min(100% - 40px, 1120px); margin: 0 auto; padding: 18px 0 24px; display: flex; justify-content: center; gap: 22px; color: var(--muted); font-size: 11px; }
.auth-footer a:hover, .account-footer a:hover { color: var(--blue-dark); }

.account-shell { width: min(100% - 40px, 1120px); margin: 28px auto 38px; flex: 1; }
.account-nav { min-height: 56px; margin-bottom: 16px; padding: 5px; display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.account-nav a { min-width: 0; min-height: 44px; padding: 0 16px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: #4f6682; font-size: 13px; font-weight: 700; white-space: nowrap; }
.account-nav a:hover { background: #f3f8fd; color: var(--blue-dark); }
.account-nav a[aria-current="page"] { background: #eaf5ff; color: #075daa; }
.state-panel { min-height: 270px; padding: 34px 24px; border: 1px solid var(--line); border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #fff; text-align: center; }
.state-panel h1 { margin: 0; }
.state-panel p { max-width: 460px; margin: 0 0 6px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.state-panel .button { margin-top: 4px; }
.state-error { border-color: #efd4d4; }
.state-error h1 { color: #772c2c; }
.spinner { width: 30px; height: 30px; border: 3px solid #dceaf8; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.state-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--sky); color: var(--blue); font-size: 22px; font-weight: 700; }
.account-content { display: grid; gap: 20px; }
.welcome-card { padding: 30px 32px; border: 1px solid #cfe3f4; border-radius: 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: linear-gradient(115deg, #fff 25%, #eef8ff 100%); }
.welcome-card h1 { margin: 12px 0 6px; }
.welcome-card .muted { margin: 0; }
.account-summary { display: block; padding: 22px 28px; }
.account-summary h1 { max-width: 100%; overflow-wrap: anywhere; }
.account-summary [data-display-name], .account-summary [data-email] { overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.65; }
.content-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.content-card { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.content-card h2 { margin: 10px 0 9px; color: var(--ink); font-size: 20px; line-height: 1.25; }
.content-card > .muted { margin: 0 0 18px; }
.copy-row { display: flex; gap: 9px; }
.copy-row input { flex: 1; color: #405c7d; font-size: 12px; }
.copy-row .button { min-width: 128px; }
.account-content .copy-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 8px; }
.account-content .copy-row input { min-width: 0; min-height: 48px; padding: 0 12px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-content .copy-row .button { min-width: 112px; min-height: 48px; padding: 0 12px; white-space: nowrap; }
.text-link { margin-top: 18px; display: inline-flex; align-items: center; gap: 8px; color: var(--blue-dark); font-size: 13px; font-weight: 800; }
.text-link span { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: #eaf5ff; color: #075daa; }
.inline-status { margin: 8px 0 0; color: #315f42; font-size: 12px; }
.share-referral-button { display: none; }
.exchange-card { display: flex; flex-direction: column; align-items: flex-start; }
.exchange-card .button { margin-top: auto; }
.page-heading { padding: 18px 4px 2px; }
.page-heading h1 { margin-top: 11px; }
.page-heading .muted { max-width: 650px; margin-bottom: 0; }
.invite-list-card { padding: 26px; }
.referral-share { padding: 20px 0; border-bottom: 1px solid #eaf0f6; }
.referral-share label { display: block; margin-bottom: 8px; color: var(--ink); font-size: 13px; font-weight: 750; }
.referral-share .copy-row { min-width: 0; }
.referral-share .copy-row input { min-width: 0; }
.referral-share .copy-row .button { flex: 0 0 auto; }
.invite-empty { min-height: 0; padding: 24px 8px 8px; }
.invite-list-intro { margin: 18px 0 10px; }
.invitee-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.invitee-item { min-width: 0; padding: 14px 16px; border: 1px solid #e5edf6; border-radius: 13px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #fbfdff; }
.invitee-main { min-width: 0; }
.invitee-email { color: var(--ink); font-size: 14px; font-weight: 750; overflow-wrap: anywhere; }
.invitee-date { margin-top: 4px; color: var(--muted); font-size: 12px; }
.invitee-status { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; background: #eaf8ef; color: #25633e; font-size: 11px; font-weight: 750; }
.invite-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.invite-pagination .button { min-width: 92px; padding: 10px 14px; }
.invite-pagination span { min-width: 94px; color: var(--muted); font-size: 12px; text-align: center; }
.invite-list-error { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; color: #9d3028; font-size: 13px; }
.invite-list-error button { padding: 6px 0; border: 0; background: transparent; color: var(--blue-dark); cursor: pointer; font: inherit; font-weight: 750; }
.metric { padding-bottom: 20px; border-bottom: 1px solid #eaf0f6; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #405b79; font-size: 14px; }
.metric strong { color: var(--ink); font-size: 30px; line-height: 1; }
.empty-state { min-height: 260px; padding: 30px 16px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-state.invite-empty { min-height: 150px; }
.empty-state h2, .aggregate-state h2 { margin: 13px 0 7px; color: var(--ink); font-size: 19px; }
.empty-state p, .aggregate-state p { max-width: 450px; margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.empty-state input { max-width: 530px; margin: 0 0 10px; color: #405c7d; font-size: 12px; text-align: center; }
.empty-state .button { min-width: 190px; }
.aggregate-state { min-height: 180px; padding: 30px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.aggregate-state p { margin-bottom: 0; }
.settings-card { padding: 6px 24px 22px; }
.setting-row { min-height: 82px; padding: 16px 0; border-bottom: 1px solid #eaf0f6; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.setting-row > div { min-width: 0; flex: 1 1 auto; }
.setting-row p { margin: 6px 0 0; color: var(--ink); font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.read-only, .verified-badge { padding: 7px 10px; border-radius: 999px; background: #f1f6fb; color: #536c89; font-size: 11px; font-weight: 750; white-space: nowrap; }
.verified-badge { background: #eaf8ef; color: #25633e; }
.settings-note { margin: 18px 0 0; }
.settings-actions { margin-top: 20px; padding-top: 18px; border-top: 1px solid #eaf0f6; }
.settings-actions .inline-status { margin-top: 10px; }
.account-footer { width: min(100% - 40px, 1120px); justify-content: flex-start; border-top: 1px solid var(--line); }

@media (max-width: 820px) {
  .account-header { min-height: 68px; }
  .wordmark { width: 174px; height: 46px; }
  .wordmark img { width: 130px; height: 42px; flex-basis: 130px; }
  .wordmark .brand-pay { font-size: 13px; }
  .account-shell { width: min(100% - 32px, 680px); margin-top: 20px; }
  .content-grid { grid-template-columns: 1fr; }
  .invite-list-card { padding: 19px 16px; }
  .invitee-item { align-items: flex-start; padding: 13px 12px; gap: 8px; }
  .invitee-email { font-size: 13px; }
  .invitee-status { margin-top: 1px; }
  .invite-pagination { gap: 9px; }
  .invite-pagination .button { min-width: 80px; padding: 10px; }
  .welcome-card { align-items: flex-start; flex-direction: column; }
  .welcome-card .button { width: 100%; }
  .auth-layout { padding-top: 32px; padding-bottom: 38px; }
}

@media (max-width: 560px) {
  .account-header { min-height: 64px; padding: 8px 16px; }
  .wordmark { width: 130px; height: 42px; gap: 6px; }
  .wordmark img { width: 90px; height: 34px; flex-basis: 90px; }
  .wordmark .brand-pay { font-size: 11px; }
  .header-link { max-width: 155px; font-size: 11px; }
  .account-header .header-exchange { min-height: 48px; padding: 0 12px; flex: 0 0 auto; font-size: 12px; }
  .auth-layout { padding: 24px 14px 30px; align-items: start; }
  .auth-card { padding: 28px 21px 24px; border-radius: 19px; }
  .lead { margin-bottom: 22px; font-size: 14px; }
  .auth-card input { min-height: 48px; }
  .account-shell { width: calc(100% - 24px); margin: 12px auto 20px; }
  .account-nav { min-height: 54px; margin: 0 0 12px; padding: 4px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; overflow: visible; }
  .account-nav a { width: 100%; min-height: 44px; padding: 0 3px; font-size: clamp(14px, 3.5vw, 15px); }
  .state-panel { min-height: 245px; padding: 26px 18px; }
  .welcome-card { padding: 19px 16px; gap: 12px; }
  .account-summary h1 { margin: 9px 0 4px; font-size: clamp(21px, 6vw, 25px); line-height: 1.2; }
  .account-content { gap: 12px; }
  .content-card { padding: 17px 15px; }
  .copy-row { align-items: stretch; flex-direction: column; }
  .copy-row .button { width: 100%; }
  .copy-row input { min-height: 46px; }
  .account-content .copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
  .account-content .copy-row input { min-height: 48px; padding: 0 9px; font-size: 11px; }
  .account-content .copy-row .button { width: auto; min-width: 106px; min-height: 48px; padding: 0 9px; font-size: 12px; }
  .share-referral-button:not([hidden]) { width: 100%; min-height: 46px; margin-top: 8px; display: inline-flex; }
  .invite-list-card { padding: 20px 17px; }
  .metric { align-items: center; gap: 10px; padding-bottom: 14px; font-size: 12px; }
  .metric strong { font-size: 25px; }
  .empty-state { padding-right: 0; padding-left: 0; }
  .empty-state.invite-empty { min-height: 128px; padding-top: 18px; }
  .settings-card { padding: 4px 15px 18px; }
  .setting-row { min-height: 72px; align-items: center; gap: 8px; }
  .read-only, .verified-badge { padding: 6px 8px; font-size: 10px; }
  .settings-actions .button { width: 100%; min-height: 48px; }
  .auth-footer, .account-footer { width: calc(100% - 32px); gap: 10px 18px; flex-wrap: wrap; font-size: 10px; }
  .account-footer a { min-height: 36px; display: inline-flex; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
