
    :root {
      --card-bg: #ffffff;
      --surface: #f8f9fa;
      --surface-2: #e9ecef;
      --primary: #000;
      --primary-d: #2d1f0a;
      --primary-light: #faf5ee;
      --muted: #6c757d;
      --border: #edf0f2;
      --shadow-soft: 0 6px 22px rgba(0, 0, 0, 0.06);
      --radius-lg: 18px;
      --radius-md: 14px;
      --danger: #c0392b;
      --danger-bg: #fdf2f2;
      --success: #1a6e38;
      --success-bg: #eaf7ee;
    }

    :root[data-theme="dark"] {
      --card-bg: #1c2027;
      --surface: #14171c;
      --surface-2: #20242c;
      --primary: #f0ede6;
      --primary-d: #ffffff;
      --primary-light: rgba(201, 168, 114, .16);
      --muted: #a7adb8;
      --border: #30353f;
      --shadow-soft: 0 6px 22px rgba(0, 0, 0, .35);
      --danger: #ff8a80;
      --danger-bg: rgba(192, 57, 43, .18);
      --success: #6fcf97;
      --success-bg: rgba(26, 110, 56, .18);
    }

    /* Literal (non-variable) colors from the rules below, patched for dark
       mode. The gold/cream rwd-hero, balance cards, and progress bar are
       left untouched -- brand-accent surfaces meant to look the same in
       both themes. .btn-rwd-primary and .btn-save get explicit black text
       (matching Academy): both use background: var(--primary), which flips
       to a light cream in dark mode, so their hardcoded white text was
       nearly disappearing. */
    [data-theme="dark"] .top-profile,
    [data-theme="dark"] .profile-list { background: var(--card-bg); }
    [data-theme="dark"] .btn-rwd-primary { color: #000; }
    [data-theme="dark"] .rwd-table th { background: var(--surface-2); }
    [data-theme="dark"] .rwd-table td { color: var(--primary); border-bottom-color: var(--border); }
    [data-theme="dark"] .rwd-table tbody tr:hover td { background: var(--surface-2); }
    [data-theme="dark"] .rwd-pagination button { background: var(--card-bg); color: var(--primary); }
    [data-theme="dark"] .rwd-pagination button:not(:disabled):hover { background: var(--surface-2); }
    [data-theme="dark"] .rwd-birthday-form select {
      background: var(--surface-2); color: var(--primary); border-color: var(--border);
    }
    [data-theme="dark"] .rwd-birthday-form select:focus { background: var(--card-bg); }
    [data-theme="dark"] .modal-box { background: var(--card-bg); }
    [data-theme="dark"] .modal-close:hover { color: var(--primary); }
    [data-theme="dark"] .form-group label { color: var(--primary); }
    [data-theme="dark"] .form-group input[type="number"] {
      background: var(--surface-2); color: var(--primary); border-color: var(--border);
    }
    [data-theme="dark"] .form-group input[type="number"]:focus { background: var(--card-bg); }
    [data-theme="dark"] .btn-cancel { background: var(--card-bg); color: var(--primary); }
    [data-theme="dark"] .btn-save { color: #000; }

    body {
      background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%) !important;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }

    .section { background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%); }

    .dashboard-shell { margin-top: 7em; padding-bottom: 60px; }
    .mobile-nav-tools { display: inline-flex; align-items: center; gap: 8px; }
    .profile-dropdown { margin-left: 10px; }
    .profile-toggle { padding: 0; background: transparent; border: none; }
    .profile-toggle .w-icon-dropdown-toggle { display: none; }

    .profile-list {
      left: auto; right: 0;
      min-width: 220px; padding: 8px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #ffffff;
      box-shadow: var(--shadow-soft);
    }

    .profile-list .dropdown-link { border-radius: 8px; margin-bottom: 2px; }
    .profile-list .dropdown-link:last-child { margin-bottom: 0; }

    .top-profile {
      display: inline-flex; align-items: center; gap: 8px;
      margin-left: 10px; padding: 6px 10px;
      border-radius: 999px; border: 1px solid var(--border);
      background: #fff;
    }

    .top-profile-avatar {
      width: 30px; height: 30px; border-radius: 50%;
      background: linear-gradient(135deg, #91621c, #c18a37);
      color: #fff; display: inline-flex; align-items: center;
      justify-content: center; font-size: 12px; font-weight: 700;
    }

    .top-profile-name { font-size: 12px; color: var(--primary); font-weight: 600; line-height: 1; }
    .top-profile-link { font-size: 11px; color: var(--muted); text-decoration: none; line-height: 1; }

    /* ── Page shell ── */
    .rwd-shell {
      max-width: 900px;
      margin: 0 auto;
      padding: 0 clamp(12px, 2.5vw, 24px);
    }

    .rwd-header { text-align: center; padding: 34px 12px 24px; }
    .rwd-header .p-regular { color: var(--muted); margin-top: 8px; }

    /* ── Hero card (tier + balances) ── */
    .rwd-hero {
      background: linear-gradient(135deg, #faf5ee 0%, #f5ead8 60%, #f0dfc0 100%);
      border-radius: var(--radius-lg);
      padding: clamp(28px, 4vw, 48px) clamp(20px, 3vw, 40px);
      box-shadow: 0 4px 20px rgba(140, 94, 26, 0.1);
      border: 1.5px solid rgba(140, 94, 26, 0.16);
      margin-bottom: 20px;
      color: var(--primary);
      text-align: center;
      position: relative;
      overflow: hidden;
    }

    .rwd-hero::before {
      content: '';
      position: absolute; inset: 0;
      background:
        radial-gradient(ellipse at 110% 0%, rgba(140,94,26,.05) 0%, transparent 60%),
        radial-gradient(ellipse at -10% 110%, rgba(140,94,26,.04) 0%, transparent 55%);
      pointer-events: none;
    }

    .rwd-hero-tag {
      display: inline-block;
      margin-bottom: 12px;
      padding: 5px 12px;
      border-radius: 999px;
      font-size: 11px; font-weight: 700;
      letter-spacing: 0.1em; text-transform: uppercase;
      background: rgba(140,94,26,0.1);
      border: 1px solid rgba(140,94,26,0.22);
      color: #9d8248;
    }

    .rwd-tier-name {
      font-size: clamp(20px, 4vw, 28px);
      font-weight: 800;
      color: #0f0f0f;
      margin-bottom: 4px;
    }

    .rwd-tier-sub { font-size: 13px; color: rgba(140,94,26,0.65); margin-bottom: 22px; }

    /* ── Balances grid ── */
    .rwd-balances {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 14px;
      margin-bottom: 22px;
    }

    .rwd-balance-card {
      background: rgba(255,255,255,0.7);
      border: 1px solid #e8cc94;
      border-radius: 14px;
      padding: 16px 14px;
      text-align: center;
    }

    .rwd-balance-value { font-size: 24px; font-weight: 800; color: #0f0f0f; line-height: 1; margin-bottom: 5px; }
    .rwd-balance-label { font-size: 10px; color: rgba(140,94,26,0.65); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }

    .rwd-hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 4px; }

    .btn-rwd {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 11px 22px; border-radius: 999px;
      font-size: 13.5px; font-weight: 700; cursor: pointer;
      border: none; transition: transform .16s, opacity .16s;
      letter-spacing: 0.01em;
    }
    .btn-rwd:hover { transform: translateY(-1px); }
    .btn-rwd:disabled { opacity: .5; cursor: not-allowed; transform: none; }

    .btn-rwd-primary { background: var(--primary); color: #fff; }
    .btn-rwd-secondary { background: #9d8248; color: #fff; }

    /* ── Tier progress ── */
    .rwd-progress-wrap { text-align: left; margin-top: 4px; }
    .rwd-progress-label {
      display: flex; justify-content: space-between;
      font-size: 12px; color: #6b5a35; margin-bottom: 6px; font-weight: 600;
    }
    .rwd-progress-track {
      height: 8px; border-radius: 999px;
      background: rgba(140,94,26,0.14);
      overflow: hidden;
    }
    .rwd-progress-fill {
      height: 100%; border-radius: 999px;
      background: linear-gradient(90deg, #b47d2d, #e0ab55);
      transition: width .4s ease;
    }
    .rwd-progress-note { font-size: 11.5px; color: rgba(140,94,26,0.7); margin-top: 6px; }

    /* ── Expiring rewards banner ── */
    .rwd-expiring {
      display: none;
      background: #fff8ec;
      border: 1px solid #f0d9a8;
      border-radius: 12px;
      padding: 12px 16px;
      margin-bottom: 20px;
      font-size: 12.5px;
      color: #8a5e10;
      line-height: 1.6;
    }
    .rwd-expiring.is-visible { display: block; }
    .rwd-expiring strong { color: #5c3d0a; }

    /* ── Panel shared styles ── */
    .rwd-panel {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-soft);
      overflow: hidden;
      margin-bottom: 24px;
    }

    .rwd-panel-header {
      padding: 18px 22px 14px;
      border-bottom: 1px solid var(--border);
      display: flex; align-items: center; justify-content: space-between; gap: 10px;
      flex-wrap: wrap;
    }

    .rwd-panel-header h3 { margin: 0; color: var(--primary); font-size: 16px; }
    .rwd-badge {
      font-size: 11px; font-weight: 700;
      padding: 3px 9px; border-radius: 999px;
      background: #faf0e0; color: #9d8248; border: 1px solid #e8cc94;
    }

    /* ── Birthday panel ── */
    .rwd-birthday-body { padding: 20px 22px 22px; }
    .rwd-birthday-current {
      display: flex; align-items: center; gap: 12px;
      padding: 14px 16px; border-radius: 12px;
      background: var(--primary-light); border: 1px solid rgba(140,94,26,0.16);
      margin-bottom: 14px;
    }
    .rwd-birthday-icon { font-size: 22px; }
    .rwd-birthday-date { font-weight: 700; color: var(--primary); font-size: 14px; }
    .rwd-birthday-lock-note { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

    .rwd-birthday-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
    .rwd-birthday-form .form-group { min-width: 130px; }
    .rwd-birthday-form select {
      height: 42px; padding: 0 12px; border: 1.5px solid #d1d8cf;
      border-radius: 10px; font-size: 14px; color: #111; background: #fafafa;
      outline: none; width: 100%; box-sizing: border-box;
    }
    .rwd-birthday-form select:focus { border-color: var(--primary); background: #fff; }

    /* ── Transactions table ── */
    .rwd-table-wrap { overflow-x: auto; }
    .rwd-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
    .rwd-table th {
      background: #faf7f2; color: var(--muted);
      font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
      padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap;
    }
    .rwd-table td { padding: 13px 16px; border-bottom: 1px solid #f0ebe0; color: #2d3622; vertical-align: middle; }
    .rwd-table tbody tr:last-child td { border-bottom: none; }
    .rwd-table tbody tr:hover td { background: #faf5ee; }

    .rwd-type-pill {
      display: inline-block; font-size: 10px; font-weight: 700;
      padding: 4px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em;
      white-space: nowrap; border: 1px solid transparent;
    }
    .rwd-type-EARNED      { background: var(--success-bg); color: var(--success); border-color: #c2e8ce; }
    .rwd-type-REDEEMED    { background: #eef2fb; color: #2551a8; border-color: #cddaf2; }
    .rwd-type-TRANSFERRED { background: #eef2fb; color: #2551a8; border-color: #cddaf2; }
    .rwd-type-EXPIRED     { background: #f5f5f5; color: #888; border-color: #ddd; }
    .rwd-type-REVERSED    { background: var(--danger-bg); color: var(--danger); border-color: #f0c9c3; }
    .rwd-type-ADJUSTED    { background: #fdf6e3; color: #8a6d1a; border-color: #f0e0ab; }
    .rwd-type-BIRTHDAY    { background: #fdeef5; color: #a3336b; border-color: #f3c9de; }

    .rwd-reward-kind { font-size: 11px; color: var(--muted); font-weight: 600; }

    .rwd-amount { font-weight: 700; font-family: 'IBM Plex Mono', monospace; }
    .rwd-amount.positive { color: var(--success); }
    .rwd-amount.negative { color: var(--danger); }

    .empty-state { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; }

    /* ── Pagination ── */
    .rwd-pagination {
      display: flex; align-items: center; justify-content: center; gap: 10px;
      padding: 18px 20px; border-top: 1px solid var(--border);
    }
    .rwd-pagination button {
      padding: 7px 18px; border-radius: 999px; border: 1px solid var(--border);
      background: #fff; font-size: 13px; font-weight: 600; color: var(--primary);
      cursor: pointer; transition: background 0.15s, border-color 0.15s;
    }
    .rwd-pagination button:disabled { opacity: 0.4; cursor: default; }
    .rwd-pagination button:not(:disabled):hover { background: #faf5ee; border-color: #b47d2d; }
    .rwd-pagination .page-info { font-size: 12px; color: var(--muted); }

    /* ── Modal (transfer / redeem) ── */
    .modal-overlay {
      display: none; position: fixed; inset: 0;
      background: rgba(0,0,0,.48); z-index: 9999;
      align-items: center; justify-content: center; padding: 16px;
      backdrop-filter: blur(2px);
    }
    .modal-overlay.open { display: flex; }

    .modal-box {
      background: #fff; border-radius: var(--radius-lg);
      width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto;
      padding: 30px 28px 26px; box-shadow: 0 28px 72px rgba(0,0,0,.2);
      position: relative; border: 1px solid rgba(0,0,0,.05);
    }

    .modal-close {
      position: absolute; top: 16px; right: 18px; width: 30px; height: 30px;
      display: flex; align-items: center; justify-content: center;
      background: var(--surface); border: none; border-radius: 50%;
      font-size: 18px; color: var(--muted); cursor: pointer; transition: background .16s, color .16s;
    }
    .modal-close:hover { background: var(--surface-2); color: #111; }

    .modal-header { padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
    .modal-title { font-size: 18px; font-weight: 700; color: var(--primary); margin: 0; }
    .modal-subtitle { font-size: 13px; color: var(--muted); margin: 4px 0 0; }

    .rwd-modal-form { display: flex; flex-direction: column; gap: 14px; }
    .form-group { display: flex; flex-direction: column; gap: 5px; }
    .form-group label { font-size: 12.5px; font-weight: 600; color: #374151; letter-spacing: .01em; }
    .form-group input[type="number"] {
      height: 44px; padding: 0 14px; border: 1.5px solid #d1d8cf; border-radius: 10px;
      font-size: 15px; color: #111; background: #fafafa; outline: none;
      transition: border-color .16s, box-shadow .16s, background .16s; width: 100%; box-sizing: border-box;
    }
    .form-group input[type="number"]:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(140,94,26,.1); }
    .form-hint { font-size: 11.5px; color: var(--muted); }
    .form-error { font-size: 12px; color: var(--danger); display: none; }
    .form-error.is-visible { display: block; }

    .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--border); }
    .btn-cancel {
      min-height: 42px; padding: 9px 22px; border-radius: 999px; border: 1.5px solid var(--border);
      background: #fff; color: #374151; font-size: 14px; font-weight: 600; cursor: pointer;
      transition: background .16s, border-color .16s;
    }
    .btn-cancel:hover { background: var(--surface); border-color: #c8cfc4; }
    .btn-save {
      min-height: 42px; padding: 9px 26px; border-radius: 999px; border: none;
      background: var(--primary); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
      transition: background .16s, box-shadow .16s, transform .16s;
    }
    .btn-save:hover { background: var(--primary-d); transform: translateY(-1px); }
    .btn-save:disabled { opacity: .55; cursor: not-allowed; transform: none; }

    @media (max-width: 700px) {
      .rwd-balances { grid-template-columns: 1fr 1fr; }
    }

    @media (max-width: 479px) {
      .top-profile { width: auto; justify-content: center; margin: 0 0 0 8px; padding: 0; border: none; background: transparent; }
      .top-profile-name, .top-profile-link { display: none; }
      .rwd-birthday-form { flex-direction: column; align-items: stretch; }
      .rwd-birthday-form .form-group { min-width: 0; }
    }
