/* ===== Design tokens =====
   Clean, light "fintech dashboard" palette: cash green as the primary brand
   color, a soft light blue as the secondary/info accent, and a calm
   near-white neutral base — no gold, no heavy gradients. The goal is
   something that reads as trustworthy and simple rather than flashy.
*/
:root {
  --paper: #F6F9F7;
  --paper-raised: #FFFFFF;
  --ink: #1B2621;
  --ink-soft: #66766F;
  --line: #E3EAE6;
  --credit: #159A50;
  --credit-bg: #E7F7ED;
  --debit: #C6473F;
  --debit-bg: #FBEBE9;
  --pending: #B8790E;
  --pending-bg: #FBF1DC;
  --accent: #1BAE5C;
  --accent-strong: #0F7D42;
  --blue: #4C9CDB;
  --blue-soft: #EAF4FC;
  --blue-strong: #2A6FA0;
  --bg-soft: #EEF2EF;
  --ink-lighter: #9AA79F;
  --success: #159A50;
  --warning: #B8790E;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20,32,26,0.04), 0 8px 20px rgba(20,32,26,0.06);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.4em;
  color: var(--accent-strong);
}

.mono { font-family: var(--font-mono); }

/* ===== Layout shells ===== */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}

.auth-card .eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Top nav (admin) =====
   Light-green bar, light-blue hover/active state — dropdown menus built
   with <details>/<summary> so they work with a tap, not just hover, and
   need no JS.
*/
.topnav {
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  position: relative;
  z-index: 20;
}

.topnav .brand {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--accent-strong);
  padding: 12px 14px 12px 4px;
  margin-right: 6px;
  white-space: nowrap;
}

.topnav > a.nav-link {
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 600;
  padding: 14px 12px;
  border-radius: 6px 6px 0 0;
  white-space: nowrap;
}
.topnav > a.nav-link:hover,
.topnav > a.nav-link.active {
  background: var(--blue-soft);
  color: var(--blue-strong);
  text-decoration: none;
}

.nav-dropdown { position: relative; }
.nav-dropdown > summary {
  list-style: none;
  cursor: pointer;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 600;
  padding: 14px 12px;
  border-radius: 6px 6px 0 0;
  white-space: nowrap;
  user-select: none;
}
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.nav-dropdown > summary::after { content: ' \25BE'; font-size: 11px; }
.nav-dropdown[open] > summary,
.nav-dropdown > summary:hover {
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.nav-dropdown .menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 0 8px 8px 8px;
  box-shadow: var(--shadow);
  min-width: 210px;
  padding: 6px;
}

.nav-dropdown .menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
}
.nav-dropdown .menu a:hover {
  background: var(--blue-soft);
  color: var(--blue-strong);
  text-decoration: none;
}

.nav-dropdown .menu .group-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  padding: 8px 12px 2px;
}
.nav-dropdown .menu .menu-divider {
  height: 1px;
  background: var(--line);
  margin: 6px 4px;
}

.topnav-spacer { flex: 1; }
.topnav-right { display: flex; align-items: center; gap: 8px; padding: 8px 0; }

.main {
  flex: 1;
  padding: 28px clamp(16px, 4vw, 40px) 60px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.topbar { display: none; }

/* ===== Cards ===== */
.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card + .card { margin-top: 16px; }
.card h2 { font-size: 17px; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* Balance hero: a calm, flat brand-green card — no gradients, no decorative
   edge treatment. The number does the work; nothing else competes with it. */
.ledger-tape {
  position: relative;
  background: var(--accent-strong);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px 26px;
}
.ledger-tape .label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.78);
}
.ledger-tape .amount {
  font-family: var(--font-mono);
  font-size: clamp(34px, 5.5vw, 46px);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 4px 0;
  color: #fff;
}
.ledger-tape .sub {
  font-size: 13px;
  color: rgba(255,255,255,0.78);
}

/* Quick-action row on the user dashboard — the "easy paths" to earning and
   cashing out, so those two jobs are never more than one tap away. */
.quick-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.quick-actions a {
  flex: 1;
  min-width: 140px;
  text-align: center;
  background: rgba(255,255,255,0.16);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
}
.quick-actions a:hover { background: rgba(255,255,255,0.26); text-decoration: none; }

.badge.gold { background: var(--blue-soft); color: var(--blue-strong); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.stat.stat-blue { background: var(--blue-soft); border-color: #C6E7F8; }
.stat .num {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 600;
}
.stat .label {
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat .num-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

/* Day-over-day +/- % badge shown next to each Overview stat's number.
   "—" (muted) means there's no prior-day snapshot to compare against yet. */
.stat-delta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
}
.stat-delta-up { background: var(--credit-bg); color: var(--credit); }
.stat-delta-down { background: var(--debit-bg); color: var(--debit); }
.stat-delta-flat { background: #EEF2EF; color: var(--ink-soft); }
.stat-delta-muted { background: transparent; color: var(--ink-soft); font-weight: 500; }

/* ===== Tables (transactions / users) ===== */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
tr:hover td { background: rgba(63,174,107,0.06); }
tr.row-highlight td { background: var(--blue-soft); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--font-mono);
}
.badge.credited { background: var(--credit-bg); color: var(--credit); }
.badge.reversed { background: var(--debit-bg); color: var(--debit); }
.badge.pending { background: var(--pending-bg); color: var(--pending); }
.badge.active { background: var(--credit-bg); color: var(--credit); }
.badge.inactive { background: #EEF2EF; color: var(--ink-soft); }
.badge.blue { background: var(--blue-soft); color: var(--blue-strong); }

.amt-positive { color: var(--credit); font-family: var(--font-mono); }
.amt-negative { color: var(--debit); font-family: var(--font-mono); }

/* Tabs styling (payouts split view, etc.) */
.tabs-nav {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab {
  padding: 12px 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab:hover {
  border-bottom-color: var(--ink-soft);
}

.tab.active {
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ===== Forms ===== */
label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
input[type="email"], input[type="password"], input[type="text"], input[type="number"],
input[type="url"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-family: var(--font-body);
  background: var(--paper-raised);
  color: var(--ink);
  margin-bottom: 16px;
}
textarea { font-family: var(--font-mono); font-size: 13px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -6px 0 16px;
}
.checkbox-row input[type="checkbox"] { width: auto; margin: 0; }
.checkbox-row label { margin: 0; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0 16px;
}

button, .btn {
  display: inline-block;
  background: var(--accent-strong);
  color: #fff;
  border: none;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
button:hover, .btn:hover { background: var(--accent); text-decoration: none; }
.btn-blue { background: var(--blue); }
.btn-blue:hover { background: var(--blue-strong); }
.btn-outline {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid var(--line);
}
.btn-outline:hover { background: var(--paper); }
.btn-danger { background: var(--debit); }
.btn-danger:hover { background: #8f2e24; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline; }
/* Selected state for the outline "filter tab" buttons (e.g. User Offers status tabs). */
.btn-outline.btn-active { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }

.error-box {
  background: var(--debit-bg);
  color: var(--debit);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}

.hint {
  font-size: 13px;
  color: var(--ink-soft);
  margin: -10px 0 16px;
}

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--ink-soft);
}

.code-block {
  background: var(--accent-strong);
  color: #EAF7EE;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue-strong);
  margin: 20px 0 8px;
}

.offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 10px;
}
.offer-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--paper-raised);
}
.offer-card h3 { font-size: 15px; margin-bottom: 4px; }
.offer-card p { font-size: 13px; color: var(--ink-soft); margin: 0 0 12px; }

/* Reward picker: radio-card grid for the redemption catalog */
.reward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}
.reward-option { position: relative; }
.reward-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.reward-option label {
  display: block;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--paper-raised);
  cursor: pointer;
  margin: 0;
}
.reward-option input:checked + label {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 3px rgba(59,159,224,0.15);
}
.reward-option .reward-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.reward-option .reward-net { font-family: var(--font-mono); font-size: 20px; color: var(--credit); margin: 4px 0; }
.reward-option .reward-fee { font-size: 12px; color: var(--ink-soft); }
.reward-option .reward-cost { font-size: 12px; color: var(--ink-soft); font-family: var(--font-mono); }

/* ===== Success banner (mirrors .error-box) ===== */
.success-box {
  background: var(--credit-bg);
  color: var(--credit);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ===== Payment method picker: square boxes on the Cash out page ===== */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.provider-option { position: relative; }
.provider-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.provider-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  aspect-ratio: 1 / 1;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  cursor: pointer;
  padding: 14px;
  margin: 0;
}
.provider-option input:checked + label {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 3px rgba(59,159,224,0.15);
}
.provider-icon { font-size: 26px; }
.provider-name { font-weight: 600; font-size: 13px; color: var(--ink); }
.provider-min { font-size: 11px; color: var(--ink-soft); }

/* ===== Cash out page: one self-contained card per payment method — no
   shared wizard, no separate "amount" step to reconcile against a provider.
   Each card owns its own points input, fee preview, and address field. ===== */
.cashout-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.cashout-method-card { display: flex; flex-direction: column; }
.cashout-preview {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink-soft);
  margin: -6px 0 14px;
}
.cashout-preview strong { color: var(--credit); font-size: 15px; }

/* ===== Activity ticker: a slim, quiet strip above the nav — a light card
   with a small pulsing dot, not a loud solid-color marquee banner. Speed is
   intentionally slow (90s per loop) so it reads as ambient, not distracting. ===== */
.ticker-bar {
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 0;
  font-size: 12.5px;
}
.ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: ticker-scroll 90s linear infinite;
  will-change: transform;
}
.ticker-bar:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px;
  border-right: 1px solid var(--line);
}
.ticker-item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

.payout-field { display: none; max-width: 420px; margin-top: 4px; }

/* ===== Stat strip: compact single-row summary under the balance hero,
   replacing the old bulkier stat-grid on the dashboard so it stays calm. ===== */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.stat-chip {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-chip .num {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-strong);
}
.stat-chip .label {
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===== Dashboard square-box grid: Earn / Cash out / Refer / News — a calm,
   uniform front door: white cards, a small tinted icon badge per tile, no
   per-tile gradient washes or mismatched title colors. ===== */
.tile-grid {
  display: grid;
  /* auto-fit rather than a fixed repeat(4, 1fr) — Earn/Cash out/Refer/News
     is the steady set now that the daily goal lives in its own bar above
     this grid (see .daily-goal-bar-wrap), but auto-fit still keeps room
     for a tile to be added later without the grid looking unbalanced. */
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.tile {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper-raised);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  color: var(--ink);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}
a.tile:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(20,32,26,0.06), 0 12px 24px rgba(20,32,26,0.08);
}

.tile-icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tile-icon-badge svg { width: 22px; height: 22px; }
.tile-earn .tile-icon-badge { background: var(--credit-bg); color: var(--accent-strong); }
.tile-cashout .tile-icon-badge { background: var(--blue-soft); color: var(--blue-strong); }
.tile-refer .tile-icon-badge { background: var(--paper); color: var(--ink-soft); border: 1px solid var(--line); }

.tile-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.tile-sub { font-size: 12.5px; color: var(--ink-soft); }

.tile-news {
  cursor: default;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  padding: 16px 18px;
  text-align: left;
}
.tile-news .tile-icon-badge { width: 34px; height: 34px; margin-bottom: 2px; background: var(--paper); color: var(--ink-soft); border: 1px solid var(--line); }
.tile-news .tile-icon-badge svg { width: 16px; height: 16px; }
.tile-news .tile-title { font-size: 14px; margin-bottom: 4px; }
.tile-news-list {
  width: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tile-news-item {
  display: flex;
  flex-direction: column;
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.tile-news-item:last-child { border-bottom: none; padding-bottom: 0; }
.tile-news-item-title { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.tile-news-item-date { font-size: 10.5px; color: var(--ink-soft); margin-top: 1px; }
.tile-news-empty { font-size: 13px; color: var(--ink-soft); }

/* ===== Daily goal bar: a slim, sleek linear indicator above the tiles —
   thin line that fills left to right, percentage sits right beside it —
   two rows total, nothing else competing for attention. ===== */
.daily-goal-bar-wrap {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 16px;
}
.daily-goal-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.daily-goal-label { font-weight: 600; font-size: 13px; color: var(--ink); }
.daily-goal-top-row .btn-sm { padding: 6px 14px; }

.daily-goal-line-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.daily-goal-line {
  position: relative;
  flex: 1;
  height: 26px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.daily-goal-line-fill {
  position: absolute;
  inset: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--blue);
  transition: width 0.6s ease, background 0.3s ease;
}
.daily-goal-bar-wrap.is-complete .daily-goal-line-fill { background: var(--credit); }

/* Progress label lives inside the bar itself (e.g. "620 / 1000 pts · 62%").
   A single text layer is colored with a hard-stop gradient clipped to the
   text glyphs: white up to --goal-pct (readable over the fill), ink after
   it (readable over the empty track). The stop always matches the fill's
   width exactly since both read the same --goal-pct value, so the label
   never drifts out of sync with the bar as it animates. */
.daily-goal-line-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
  color: var(--ink);
  background-image: linear-gradient(
    to right,
    #fff 0%, #fff var(--goal-pct),
    var(--ink) var(--goal-pct), var(--ink) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .daily-goal-line-label { color: transparent; }
}
.daily-goal-bar-wrap.is-complete .daily-goal-line-label {
  background-image: linear-gradient(
    to right,
    #fff 0%, #fff var(--goal-pct),
    var(--credit) var(--goal-pct), var(--credit) 100%
  );
}

/* Compact variant of the tile grid, reused at the top of Earn/Cashout/Refer/
   Recent pages so the news box always sits alongside the other three quick
   links, not just on the dashboard. */
.tile-grid-compact {
  margin-top: 0;
  margin-bottom: 20px;
}
.tile-grid-compact .tile { aspect-ratio: auto; min-height: 128px; padding: 16px; gap: 6px; }
.tile-grid-compact .tile-icon-badge { width: 38px; height: 38px; }
.tile-grid-compact .tile-icon-badge svg { width: 18px; height: 18px; }
.tile-grid-compact .tile-title { font-size: 14px; }
.tile-current { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ===== Offer wall: grid of network boxes on /earn, each linking to its own
   dedicated wall page. ===== */
.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 10px;
}
.wall-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  aspect-ratio: 1 / 1;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  padding: 16px;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.wall-tile:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.wall-tile-icon { font-size: 30px; }
.wall-tile-name { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.wall-tile-desc { font-size: 11.5px; color: var(--ink-soft); }
.wall-embed { min-height: 200px; }
.wall-embed iframe { width: 100%; border: none; }

/* ===== Mobile ===== */
@media (max-width: 820px) {
  .topnav { padding: 0 8px; }
  .topnav .brand { padding: 10px 8px 10px 2px; font-size: 16px; }
  .topnav > a.nav-link, .nav-dropdown > summary { padding: 10px 8px; font-size: 13px; }
  .topnav-right { flex-basis: 100%; justify-content: flex-end; }
  .main { padding: 20px 16px 80px; }
  .provider-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  table { font-size: 13px; }
  th, td { padding: 8px; }
}

/* ===== Site footer + cookie banner (injected by public/js/site-footer.js) ===== */
.site-footer {
  max-width: 1040px;
  margin: 32px auto 24px;
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  font-size: 13px;
  color: var(--ink-soft);
}
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer span { color: var(--ink-soft); opacity: 0.5; }

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 999;
  max-width: 640px;
  margin: 0 auto;
  background: var(--ink, #1a1a1a);
  color: #fff;
  padding: 14px 16px;
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.cookie-banner a { color: #fff; text-decoration: underline; }
.cookie-banner .cookie-accept {
  background: #fff;
  color: #111;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* ===== CMS page (Terms/Privacy/Cookies/FAQ) ===== */
.page-content {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 20px;
  line-height: 1.6;
}
.page-content h2 { margin-bottom: 12px; }
.page-content p { margin-bottom: 12px; color: var(--ink-soft); }


/* ===== XTRA sleek mobile-first home/account refresh ===== */
.points-nav {
  display:flex;
  align-items:baseline;
  gap:5px;
  color:var(--accent-strong);
  font-family:var(--font-mono);
  font-weight:700;
  padding:9px 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--paper-raised);
  white-space:nowrap;
  box-shadow:0 1px 2px rgba(0,0,0,.03);
}
.points-nav:hover { text-decoration:none; border-color:var(--accent); background:var(--credit-bg); }
.points-nav-value { font-size:15px; }
.points-nav-label { font-size:10px; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.05em; }

.home-main { max-width:1100px; padding-top:22px; }
.home-welcome {
  display:flex; align-items:center; justify-content:space-between; gap:20px;
  margin-bottom:18px;
}
.home-welcome .eyebrow, .account-heading .eyebrow {
  color:var(--ink-soft); font-size:11px; font-weight:700;
  text-transform:uppercase; letter-spacing:.12em; margin-bottom:4px;
}
.home-welcome h1 { font-size:clamp(27px,5vw,38px); margin-bottom:3px; }
.home-welcome p { margin:0; color:var(--ink-soft); font-size:14px; }
.home-balance {
  min-width:150px; text-align:right; color:var(--ink);
}
.home-balance:hover { text-decoration:none; }
.home-balance span, .home-balance small { display:block; color:var(--ink-soft); font-size:11px; text-transform:uppercase; letter-spacing:.08em; }
.home-balance strong { display:block; font:600 clamp(25px,5vw,36px)/1 var(--font-mono); letter-spacing:-.04em; margin:3px 0; }

.featured-wall {
  background:var(--paper-raised); border:1px solid var(--line); border-radius:16px;
  box-shadow:var(--shadow); overflow:hidden;
}
.featured-wall-head {
  display:flex; align-items:flex-start; justify-content:space-between; gap:16px;
  padding:18px 20px 14px; border-bottom:1px solid var(--line);
}
.featured-wall-head h2 { margin:2px 0 2px; font-family:var(--font-body); font-size:18px; color:var(--ink); }
.featured-wall-head p { margin:0; color:var(--ink-soft); font-size:13px; }
.section-kicker { font:600 10px var(--font-mono); color:var(--accent); text-transform:uppercase; letter-spacing:.1em; }
.home-wall-embed { min-height:480px; padding:10px; }
.featured-empty {
  display:flex; align-items:center; gap:16px; padding:24px;
  background:var(--paper-raised); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow);
}
.featured-empty h2 { color:var(--ink); font-family:var(--font-body); margin:0 0 2px; }
.featured-empty p { color:var(--ink-soft); margin:0; font-size:13px; }
.featured-empty .btn { margin-left:auto; }
.featured-empty-icon {
  width:42px; height:42px; display:grid; place-items:center; border-radius:12px;
  background:var(--credit-bg); color:var(--accent); font-size:20px;
}
.home-quick-links {
  display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:12px;
}
.home-quick-links a {
  display:flex; flex-direction:column; gap:2px; padding:13px 15px;
  background:var(--paper-raised); border:1px solid var(--line); border-radius:12px; color:var(--ink);
}
.home-quick-links a:hover { text-decoration:none; border-color:var(--accent); }
.home-quick-links strong { font-size:14px; }
.home-quick-links span { color:var(--ink-soft); font-size:12px; }

.account-main { max-width:1050px; }
.account-heading {
  display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:18px;
}
.account-heading h1 { font-size:34px; }
.account-balance { text-align:right; }
.account-balance span { display:block; color:var(--ink-soft); font-size:11px; text-transform:uppercase; letter-spacing:.1em; }
.account-balance strong { font:600 28px var(--font-mono); }
.account-stats {
  display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:14px;
}
.account-stats > div {
  min-width:0; padding:13px 14px; background:var(--paper-raised);
  border:1px solid var(--line); border-radius:12px;
}
.account-stats strong { display:block; font:600 21px var(--font-mono); overflow:hidden; text-overflow:ellipsis; }
.account-stats span { display:block; color:var(--ink-soft); font-size:11px; margin-top:2px; }
.account-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.account-grid .card { padding:18px; }
.account-grid .card + .card { margin-top:0; }
.account-grid h2 { color:var(--ink); font-family:var(--font-body); font-size:16px; }
.detail-list { display:grid; gap:0; }
.detail-list > div {
  display:flex; justify-content:space-between; gap:12px; align-items:center;
  padding:10px 0; border-bottom:1px solid var(--line); font-size:13px;
}
.detail-list > div:last-child { border-bottom:0; }
.detail-list span:first-child { color:var(--ink-soft); }
.account-footer { color:var(--ink-soft); font-size:12px; margin-top:14px; }

@media (max-width: 720px) {
  .topnav { padding:8px 10px; gap:5px; overflow-x:auto; flex-wrap:nowrap; -webkit-overflow-scrolling:touch; }
  .topnav .brand { font-size:16px; padding:8px 8px 8px 2px; margin-right:0; }
  .topnav > a.nav-link { font-size:12px; padding:9px 10px; border-radius:999px; }
  .points-nav { order:-1; padding:8px 10px; }
  .topnav-spacer { display:none; }
  .topnav-right { padding:0 0 0 4px; }
  .topnav-right button { padding:8px 10px; font-size:12px; }
  .main { padding:18px 12px 38px; }
  .home-welcome { align-items:flex-start; }
  .home-welcome h1 { font-size:27px; }
  .home-balance { min-width:112px; }
  .home-balance strong { font-size:24px; }
  .featured-wall-head { padding:15px; }
  .featured-wall-head .btn-outline { padding:6px 9px; }
  .home-wall-embed { min-height:420px; padding:4px; }
  .featured-empty { align-items:flex-start; flex-wrap:wrap; padding:18px; }
  .featured-empty .btn { width:100%; margin-left:0; text-align:center; }
  .home-quick-links { grid-template-columns:1fr; }
  .home-quick-links a { flex-direction:row; justify-content:space-between; align-items:center; }
  .account-heading { align-items:flex-start; }
  .account-heading h1 { font-size:28px; }
  .account-balance strong { font-size:23px; }
  .account-stats { grid-template-columns:repeat(2,1fr); }
  .account-stats > div { padding:11px 12px; }
  .account-stats strong { font-size:18px; }
  .account-grid { grid-template-columns:1fr; }
  .account-grid .card { padding:16px; }
}


/* Offerwall mobile scrolling: keep the embedded wall inside its own area so the page itself does not drift while the wall is being scrolled. */
.wall-embed { overflow: hidden; max-width: 100%; }
.wall-embed iframe { display:block; width:100%; max-width:100%; border:0; }
@media (max-width:720px) {
  .wall-embed {
    height:calc(100dvh - 185px);
    min-height:420px;
    max-height:760px;
    overflow:hidden;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }
  .wall-embed iframe {
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
    max-height:none !important;
    display:block;
  }
}

/* XtraCash visibility patch: admin Overview percentages and stat text */
.stat-delta{
  opacity:1!important;visibility:visible!important;
  font-size:12px!important;font-weight:900!important;
  line-height:1.35!important;
  border:1px solid rgba(255,255,255,.16)!important;
  text-shadow:0 0 8px rgba(255,255,255,.10)!important;
}
.stat-delta-up{color:#7CFFB2!important;-webkit-text-fill-color:#7CFFB2!important;background:rgba(34,197,94,.16)!important;}
.stat-delta-down{color:#FF8FA3!important;-webkit-text-fill-color:#FF8FA3!important;background:rgba(239,68,68,.16)!important;}
.stat-delta-flat{color:#E8EDF5!important;-webkit-text-fill-color:#E8EDF5!important;background:rgba(148,163,184,.16)!important;}
.stat-delta-muted{color:#C9D2DF!important;-webkit-text-fill-color:#C9D2DF!important;background:rgba(148,163,184,.10)!important;}
.stat .num{opacity:1!important;visibility:visible!important;-webkit-text-fill-color:currentColor!important;}
.stat .label{opacity:1!important;visibility:visible!important;}
