:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #f9fafb;
  --text: #17191d;
  --muted: #6a7079;
  --line: #e3e6ea;
  --accent: #242833;
  --accent-soft: #eef0f4;
  --success: #1e6d46;
  --warning: #8a6217;
  --danger: #a43b3b;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(18, 22, 28, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
}

.header-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.3px;
  text-decoration: none;
}

.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link,
.account-button,
.secondary-button,
.text-button,
.filter-button,
.offer-button,
.reward-button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
}

.nav-link {
  padding: 9px 11px;
  color: var(--muted);
}

.nav-link:hover,
.nav-link.active { background: var(--accent-soft); color: var(--text); }

.account-button,
.offer-button,
.reward-button {
  background: var(--accent);
  color: white;
  padding: 9px 14px;
  font-weight: 650;
}

.account-button:hover,
.offer-button:hover,
.reward-button:hover { opacity: 0.9; }

.top-ad-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 0;
  display: flex;
  justify-content: center;
}

.ad-slot {
  border: 1px dashed #c8ccd3;
  background: #eceef1;
  color: #8b919a;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.ad-slot-top {
  width: min(728px, 100%);
  height: 90px;
}

.page-shell {
  width: min(1380px, calc(100% - 32px));
  margin: 18px auto 34px;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 160px;
  gap: 18px;
  align-items: start;
}

.ad-column { position: sticky; top: 84px; }
.ad-slot-rail { width: 160px; height: 600px; }

.app-card {
  min-height: 680px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.view { display: none; }
.active-view { display: block; }

.page-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 29px; letter-spacing: -0.6px; }
h2 { font-size: 18px; letter-spacing: -0.2px; }
.subtext { color: var(--muted); margin-bottom: 0; }

.secondary-button {
  padding: 9px 13px;
  border: 1px solid var(--line);
  background: white;
  font-weight: 650;
}

.secondary-button:hover { background: var(--panel-2); }
.text-button { color: var(--muted); font-weight: 650; }
.text-button:hover { color: var(--text); }

.balance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.balance-card {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 9px;
  padding: 18px;
}

.balance-card strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 28px;
  letter-spacing: -0.5px;
}

.primary-balance { background: #f3f5f8; }
.balance-label, .balance-note { color: var(--muted); font-size: 13px; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-heading h2 { margin-bottom: 0; }

.activity-list { border-top: 1px solid var(--line); }
.activity-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.activity-main strong { display: block; margin-bottom: 3px; }
.activity-meta { color: var(--muted); font-size: 13px; }
.activity-amount { text-align: right; font-weight: 700; }
.status { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.status.available { color: var(--success); }
.status.pending { color: var(--warning); }
.status.redeemed { color: var(--muted); }

.filter-row { display: flex; gap: 7px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-button {
  border: 1px solid var(--line);
  padding: 8px 12px;
  background: white;
  color: var(--muted);
}
.filter-button.active { background: var(--accent); color: white; border-color: var(--accent); }

.offers-list { display: grid; gap: 10px; }
.offer-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}
.offer-card h3 { margin: 0 0 5px; font-size: 16px; }
.offer-card p { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.offer-side { text-align: right; min-width: 125px; }
.offer-amount { display: block; margin-bottom: 8px; font-size: 17px; font-weight: 750; }
.offer-button.started { background: #59606b; }

.wallet-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.wallet-summary div { border: 1px solid var(--line); border-radius: 9px; padding: 16px; }
.wallet-summary span { display: block; color: var(--muted); font-size: 13px; }
.wallet-summary strong { display: block; margin-top: 5px; font-size: 23px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
table { width: 100%; border-collapse: collapse; min-width: 580px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-weight: 650; background: var(--panel-2); }
tbody tr:last-child td { border-bottom: 0; }
td:last-child, th:last-child { text-align: right; }

.rewards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.reward-card { border: 1px solid var(--line); border-radius: 9px; padding: 18px; }
.reward-card h3 { margin: 0 0 4px; }
.reward-card p { color: var(--muted); font-size: 13px; min-height: 40px; }
.reward-price { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.reward-price strong { font-size: 18px; }

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 28px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
.site-footer div { display: flex; gap: 15px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.modal { border: 0; padding: 0; border-radius: 10px; box-shadow: 0 20px 70px rgba(0,0,0,.2); }
.modal::backdrop { background: rgba(14,16,20,.45); }
.modal-box { width: min(440px, calc(100vw - 34px)); padding: 24px; }
.modal-box h2 { margin-bottom: 8px; font-size: 22px; }
.modal-message { color: var(--muted); line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

@media (max-width: 1120px) {
  .page-shell { grid-template-columns: 1fr; max-width: 920px; }
  .ad-column { display: none; }
}

@media (max-width: 720px) {
  .header-inner { gap: 12px; width: min(100% - 20px, 1180px); }
  .main-nav { overflow-x: auto; }
  .nav-link { padding: 8px; white-space: nowrap; }
  .brand { font-size: 16px; }
  .account-button { padding: 8px 10px; }
  .top-ad-wrap, .page-shell, .site-footer { width: calc(100% - 20px); }
  .app-card { padding: 20px 16px; }
  .balance-grid { grid-template-columns: 1fr; }
  .wallet-summary { grid-template-columns: 1fr; }
  .rewards-grid { grid-template-columns: 1fr; }
  .offer-card { grid-template-columns: 1fr; }
  .offer-side { text-align: left; }
  .offer-button { width: 100%; }
  .page-title-row { flex-direction: column; }
  .site-footer { flex-direction: column; gap: 10px; }
}
