.profile-page {
  --bg: rgb(237 242 240); --surface: rgb(255 255 255); --surface-2: rgb(243 246 244);
  --text: rgb(37 59 52); --muted: rgb(92 112 104); --line: rgb(212 222 217);
  --accent: rgb(17 123 114); --lime: rgb(198 238 112); --lime-text: rgb(40 57 25); --teal-wash: rgb(228 242 237);
  background: var(--bg); color: var(--text); font: 16px/1.5 "Segoe UI", Arial, sans-serif; min-height: 100dvh;
}
[data-theme=dark] .profile-page {
  --bg: rgb(21 26 24); --surface: rgb(32 39 36); --surface-2: rgb(38 47 43);
  --text: rgb(237 244 239); --muted: rgb(175 190 181); --line: rgb(59 72 65);
  --accent: rgb(121 215 199); --teal-wash: rgb(38 61 52);
}
.profile-page *, .profile-page *::before, .profile-page *::after { letter-spacing: 0; }
.profile-page :is(button, input, a):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.profile-page .lucide { width: 20px; height: 20px; flex: none; }
.profile-skip { position: absolute; top: -100px; left: 16px; z-index: 5; padding: 12px; background: var(--surface); }
.profile-skip:focus { top: 8px; }
.profile-notice { padding: 8px 28px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 12px; }
.profile-notice strong { color: var(--accent); flex: none; font-size: 11px; }
.profile-header { min-height: 80px; display: flex; align-items: center; gap: 32px; padding: 10px 28px; border-bottom: 1px solid var(--line); background: var(--surface); }
.profile-brand { display: flex; gap: 10px; align-items: center; font-size: 28px; white-space: nowrap; }
.profile-brand img { flex: none; }
.profile-brand strong { color: var(--accent); }
.profile-nav { display: flex; gap: 6px; align-self: stretch; }
.profile-nav a { display: flex; gap: 8px; align-items: center; padding: 10px 14px; font-weight: 700; color: var(--muted); border-radius: 4px; }
.profile-nav a[aria-current], .profile-nav a:hover { color: var(--accent); background: var(--teal-wash); }
.profile-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; min-width: 0; }
.profile-header-account { display: flex; align-items: center; gap: 9px; min-width: 0; max-width: 240px; font-size: 14px; font-weight: 700; }
.profile-header-account > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.profile-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--teal-wash); color: var(--accent); overflow: hidden; font-size: 13px; font-weight: 750; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-large { width: 64px; height: 64px; font-size: 21px; }
.profile-main { width: min(1180px, 100%); padding: 32px 28px 64px; margin-inline: auto; flex: 1; min-width: 0; }
.profile-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 24px; }
.profile-heading h1 { font-size: 30px; font-weight: 750; line-height: 1.3; }
.profile-eyebrow { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.profile-safety { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.profile-message { color: var(--muted); overflow-wrap: anywhere; }
.profile-message:not(:empty) { margin: 14px 0; }
.profile-segments { display: flex; border-bottom: 1px solid var(--line); gap: 8px; margin-top: 12px; }
.profile-segments a { display: flex; align-items: center; gap: 8px; padding: 14px 18px; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; text-align: center; min-height: 54px; }
.profile-segments a:hover { color: var(--accent); }
.profile-segments a[aria-current] { color: var(--accent); border-color: var(--accent); background: var(--teal-wash); }
.profile-panel { scroll-margin-top: 20px; }
.profile-panel:focus { outline: none; }
.profile-section { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; padding: 32px 0; border-bottom: 1px solid var(--line); }
.profile-panel h2, .profile-section h2 { font-size: 20px; font-weight: 700; line-height: 1.5; }
.profile-panel h3 { font-size: 20px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.profile-section p { overflow-wrap: anywhere; }
.profile-section > div:first-child > p { color: var(--muted); margin-top: 5px; font-size: 14px; }
.profile-section-content { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.profile-account-name { display: flex; gap: 16px; align-items: center; max-width: 100%; }
.profile-account-name > div { min-width: 0; }
.profile-facts { width: 100%; margin: 2px 0; display: grid; gap: 14px; font-size: 15px; }
.profile-facts > div { display: grid; grid-template-columns: 155px minmax(0, 1fr); gap: 20px; }
.profile-facts dt { color: var(--muted); }
.profile-facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.profile-referral-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.profile-referral-stats > div { display: flex; flex-direction: column; gap: 6px; }
.profile-referral-stats dd { font-size: 22px; }
.profile-section :is(form, label) { width: 100%; }
.profile-section form { display: flex; flex-direction: column; gap: 9px; }
.profile-section label { font-size: 14px; font-weight: 700; }
.profile-input-row { display: flex; gap: 10px; width: 100%; min-width: 0; align-items: start; }
.profile-page input { min-height: 46px; flex: 1; width: 100%; min-width: 0; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 11px 12px; font-size: 16px; }
.profile-page input[readonly] { color: var(--muted); }
.profile-page input:focus { border-color: var(--accent); }
.profile-button, .profile-icon-button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text); padding: 10px 16px; font-size: 14px; font-weight: 700; line-height: 24px; flex: none; max-width: 100%; }
.profile-button:hover, .profile-icon-button:hover { border-color: var(--accent); }
.profile-button:disabled, .profile-icon-button:disabled { cursor: not-allowed; opacity: .55; }
.profile-icon-button { width: 46px; height: 46px; padding: 0; }
.profile-primary { background: var(--lime); border-color: var(--lime); color: var(--lime-text); }
.profile-primary:hover { color: var(--lime-text); border-color: var(--accent); }
.profile-text-link { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 700; min-height: 44px; }
.profile-text-link:hover { text-decoration: underline; }
.profile-promotion-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile-reward { font-size: 28px; color: var(--accent); font-variant-numeric: tabular-nums; }
.profile-status { font-size: 13px; font-weight: 700; color: var(--muted); }
.profile-status[data-qualified="true"] { color: var(--accent); }
.profile-note { color: var(--muted); font-size: 14px; max-width: 70ch; }
.profile-feedback { min-height: 24px; color: var(--accent); overflow-wrap: anywhere; }
.profile-page [data-error="true"] { color: var(--red); }
.profile-page code { font-family: Consolas, monospace; font-size: 14px; overflow-wrap: anywhere; }
.profile-history-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 28px 0 20px; }
.profile-history-heading .profile-note { margin-top: 5px; }
.profile-history-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; }
.profile-filters { display: inline-flex; gap: 4px; background: var(--surface-2); padding: 4px; border: 1px solid var(--line); border-radius: 4px; }
.profile-filters button { padding: 8px 16px; min-height: 44px; min-width: 76px; color: var(--muted); border-radius: 3px; font-weight: 700; font-size: 14px; }
.profile-filters button[aria-pressed=true] { background: var(--surface); color: var(--accent); }
.profile-history-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.profile-history-row { display: grid; grid-template-columns: minmax(190px, 1.25fr) minmax(150px, 1fr) minmax(115px, .7fr) minmax(165px, 1fr); gap: 20px; padding: 18px 10px; border-bottom: 1px solid var(--line); }
.profile-history-row:nth-child(odd) { background: var(--surface); }
.profile-history-row > div { min-width: 0; overflow-wrap: anywhere; }
.profile-history-row small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.profile-history-row strong { font-size: 15px; font-weight: 700; }
.profile-history-row time { font-size: 14px; }
.profile-round-link { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-weight: 700; min-height: 28px; }
.profile-round-link:hover { text-decoration: underline; }
.profile-round-link .lucide { width: 16px; height: 16px; }
.profile-history-state { font-size: 13px; color: var(--muted); }
.profile-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding-top: 20px; font-size: 14px; font-variant-numeric: tabular-nums; }
.profile-empty { display: flex; align-items: flex-start; flex-direction: column; gap: 10px; padding: 36px 0; }
.profile-empty > .lucide { width: 32px; height: 32px; color: var(--accent); }
.profile-empty p { color: var(--muted); }
.profile-footer { padding: 20px 28px; border-top: 1px solid var(--line); display: flex; gap: 24px; align-items: center; background: var(--surface); font-size: 12px; color: var(--muted); }
.profile-footer > span:first-child { color: var(--text); font-size: 16px; font-weight: 700; }
.profile-footer nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.profile-footer a { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); font-weight: 700; min-height: 36px; }
@media (max-width: 900px) {
  .profile-header { gap: 16px; }
  .profile-header-account { max-width: 150px; }
  .profile-nav a { padding-inline: 8px; font-size: 14px; }
  .profile-section { grid-template-columns: 170px minmax(0, 1fr); gap: 24px; }
  .profile-history-row { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .profile-header { padding: 12px 16px 0; flex-wrap: wrap; gap: 12px; }
  .profile-brand { font-size: 24px; }
  .profile-brand img { width: 30px; height: 30px; }
  .profile-actions { gap: 5px; }
  .profile-actions .profile-icon-button { width: 40px; height: 44px; min-height: 44px; }
  .profile-header-account { max-width: 100px; }
  .profile-header-account > span:last-child { display: none; }
  .profile-nav { order: 3; width: 100%; min-height: 48px; border-top: 1px solid var(--line); gap: 0; }
  .profile-nav a { flex: 1; justify-content: center; border-radius: 0; }
  .profile-notice { padding: 8px 16px; gap: 10px; font-size: 11px; }
  .profile-main { padding: 24px 16px 40px; }
  .profile-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .profile-segments { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .profile-segments a { padding: 10px 8px; font-size: 14px; justify-content: center; }
  .profile-segments .lucide { width: 18px; height: 18px; }
  .profile-section { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 24px 0; }
  .profile-facts > div { grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
  .profile-referral-stats > div { display: flex; }
  .profile-input-row:has(.profile-button) { flex-wrap: wrap; }
  .profile-input-row:has(.profile-button) input { flex-basis: 100%; }
  .profile-history-row { gap: 16px; padding: 16px 10px; }
  .profile-history-row strong, .profile-round-link { font-size: 14px; }
  .profile-footer { flex-wrap: wrap; gap: 10px 16px; padding: 16px; }
  .profile-footer > span:nth-child(2) { width: 100%; order: 3; }
  .profile-footer nav { order: 4; width: 100%; margin-left: 0; }
}
@media (max-width: 360px) {
  .profile-header { gap: 6px; }
  .profile-brand { font-size: 21px; gap: 6px; }
  .profile-avatar { width: 30px; height: 30px; }
  .profile-avatar-large { width: 56px; height: 56px; }
  .profile-facts:not(.profile-referral-stats) > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .profile-referral-stats { grid-template-columns: minmax(0, 1fr); }
  .profile-segments a { gap: 5px; font-size: 13px; }
}
.profile-notice[hidden] { display: none; }
