:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #172033;
  --muted: #6b7280;
  --line: #e5eaf2;
  --blue: #0f6bff;
  --blue-dark: #074ed8;
  --yellow: #ffca2f;
  --green: #0c8a56;
  --orange: #c46a00;
  --red: #c73535;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(15, 107, 255, 0.12), transparent 34rem),
    linear-gradient(180deg, #f7faff 0%, #eef3fa 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  position: relative;
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px calc(92px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0 18px;
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 16px;
  color: #101010;
  background: linear-gradient(135deg, #ffe05a, #ffb21d);
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(255, 178, 29, 0.28);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.22rem;
  line-height: 1.1;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
  line-height: 1.16;
}

h3 {
  margin-bottom: 5px;
  font-size: 0.98rem;
  line-height: 1.2;
}

.muted {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill {
  color: var(--blue-dark);
  background: rgba(15, 107, 255, 0.1);
}

.tab-panel {
  display: none;
  animation: fadeIn 180ms ease-out;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-card,
.upload-card,
.deal-card,
.mini-deal,
.history-list article {
  border: 1px solid rgba(229, 234, 242, 0.9);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(32, 42, 68, 0.08);
}

.hero-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 22px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(236, 244, 255, 0.92)),
    var(--card);
}

.balance-card {
  display: grid;
  gap: 5px;
  padding: 18px;
  border-radius: 22px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), #00a6ff);
}

.balance-card span,
.balance-card small {
  opacity: 0.82;
  font-size: 0.82rem;
  font-weight: 700;
}

.balance-card strong {
  font-size: 2rem;
  line-height: 1;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 14px;
}

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

.section-title span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.deal-grid,
.redeemed-list,
.history-list {
  display: grid;
  gap: 14px;
}

.deal-card {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.deal-card img,
.mini-deal img {
  width: 82px;
  height: 82px;
  border-radius: 22px;
  object-fit: cover;
  background: #f0f5ff;
}

.deal-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.deal-brand {
  color: var(--blue) !important;
  font-weight: 800;
}

.deal-card strong {
  align-self: start;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--blue-dark);
  background: rgba(15, 107, 255, 0.1);
  white-space: nowrap;
}

.upload-card {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.primary-button {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), #004de6);
  box-shadow: 0 18px 34px rgba(15, 107, 255, 0.28);
  font-size: 1rem;
  font-weight: 900;
}

.primary-button:active {
  transform: translateY(1px);
}

.preview-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #f8fafc;
}

.preview-wrap img {
  display: block;
  width: 100%;
  max-height: 380px;
  object-fit: contain;
}

.hidden {
  display: none !important;
}

.test-log {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.test-log span {
  padding: 8px 10px;
  border-radius: 999px;
  color: #4b5563;
  background: #f2f5f9;
  font-size: 0.78rem;
  font-weight: 800;
}

.mini-deal,
.history-list article {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.mini-deal {
  grid-template-columns: 66px 1fr auto;
}

.mini-deal img {
  width: 66px;
  height: 66px;
  border-radius: 18px;
}

.mini-deal p,
.history-list p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.mini-deal span {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(12, 138, 86, 0.1);
  font-size: 0.74rem;
  font-weight: 900;
}

.history-list article {
  grid-template-columns: 1fr auto;
}

.approved {
  color: var(--green);
  background: rgba(12, 138, 86, 0.1);
}

.review {
  color: var(--orange);
  background: rgba(255, 190, 70, 0.2);
}

.rejected {
  color: var(--red);
  background: rgba(199, 53, 53, 0.1);
}

.bottom-tabs {
  position: fixed;
  right: max(18px, calc((100vw - 520px) / 2 + 18px));
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(18px, calc((100vw - 520px) / 2 + 18px));
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(229, 234, 242, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 44px rgba(32, 42, 68, 0.16);
  backdrop-filter: blur(22px);
}

.tab-button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  color: #6b7280;
  background: transparent;
  font-weight: 900;
}

.tab-button.active {
  color: #ffffff;
  background: var(--blue);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 480px) {
  .hero-card {
    grid-template-columns: 1fr 160px;
    align-items: center;
  }
}

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