/* QReward Customer App — Mobile Design System
   Premium-financial with warm-consumer finish.
   JP-first, EN parity. iOS-inspired but platform-agnostic. */

:root {
  /* Brand — deep "trust blue" with warm cream surface */
  --brand-50:  #eff5ff;
  --brand-100: #dce8ff;
  --brand-200: #b9d2ff;
  --brand-300: #8db1ff;
  --brand-400: #5c8aff;
  --brand-500: #2563eb;
  --brand-600: #1f4fd1;
  --brand-700: #1e3aa3;
  --brand-800: #1b2d6f;
  --brand-900: #131e4a;
  --brand-950: #0a1330;

  /* Warm consumer cream — surface tone */
  --cream-50:  #fbfaf6;
  --cream-100: #f6f3ec;
  --cream-150: #efece3;
  --cream-200: #e7e3d6;

  /* Neutrals */
  --ink-0:    #ffffff;
  --ink-25:   #fafafa;
  --ink-50:   #f4f4f5;
  --ink-100:  #e7e7ea;
  --ink-150:  #dadadd;
  --ink-200:  #c8c8cd;
  --ink-300:  #a1a1a8;
  --ink-400:  #79797f;
  --ink-500:  #5b5b62;
  --ink-600:  #3f3f45;
  --ink-700:  #2c2c33;
  --ink-800:  #1c1c22;
  --ink-900:  #0e0e14;

  /* Semantic */
  --green-50:  #eefbf3;
  --green-100: #d3f5de;
  --green-500: #16a34a;
  --green-600: #15803d;
  --green-700: #166534;

  --red-50:  #fef2f2;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;

  --amber-50:  #fffbeb;
  --amber-100: #fef3c7;
  --amber-500: #f59e0b;
  --amber-600: #d97706;

  --info-50:  #eff6ff;
  --info-100: #dbeafe;
  --info-500: #3b82f6;
  --info-600: #2563eb;

  --purple-50:  #faf5ff;
  --purple-100: #f3e8ff;
  --purple-500: #a855f7;
  --purple-600: #9333ea;
  --purple-700: #7e22ce;

  /* Surface (light) */
  --bg:           var(--cream-50);
  --surface:      #ffffff;
  --surface-2:    var(--cream-100);
  --surface-3:    var(--cream-150);
  --border:       rgba(16,16,24,0.08);
  --border-strong:rgba(16,16,24,0.14);
  --fg:           var(--ink-900);
  --fg-muted:     var(--ink-500);
  --fg-subtle:    var(--ink-400);

  /* Card hero gradient — premium navy with hint of warmth */
  --card-grad-start: #131e4a;
  --card-grad-mid:   #1b2d6f;
  --card-grad-end:   #0a1330;
  --card-foil:       linear-gradient(135deg, rgba(255,215,170,0.4), rgba(180,200,255,0.25), rgba(255,255,255,0.15) 40%, rgba(180,200,255,0.18) 60%, rgba(255,215,170,0.3));

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, monospace;

  --radius-sm:  6px;
  --radius:     10px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --t-fast:  120ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base:  220ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow:  400ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg:        #0a0d18;
  --surface:   #131626;
  --surface-2: #181c2e;
  --surface-3: #1f2438;
  --border:    rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.14);
  --fg:        #f4f4f7;
  --fg-muted:  #a5a5b1;
  --fg-subtle: #71717f;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  color: var(--fg);
  background: #ebe8e0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}

button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; padding: 0; }
input, textarea { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* === Mobile screen base — everything inside an iOS frame === */
.scr {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  position: relative;
}

.scr-pad-status { padding-top: 54px; }
.scr-pad-home { padding-bottom: 34px; }

/* === Top bar (in-screen) === */
.tbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px;
  min-height: 44px;
  position: relative;
  z-index: 5;
}
.tbar-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.tbar-back { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; margin-left: -6px; color: var(--brand-600); }
.tbar-back svg { width: 20px; height: 20px; }
.tbar-action { font-size: 15px; font-weight: 500; color: var(--brand-600); padding: 4px 6px; }
.tbar-action-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--fg); position: relative; }
.tbar-action-icon svg { width: 21px; height: 21px; }
.tbar-action-dot {
  position: absolute; top: 7px; right: 7px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red-500);
  border: 2px solid var(--bg);
}

.brand-wordmark {
  display: inline-flex; align-items: baseline; gap: 3px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 22px;
  color: var(--brand-700);
}
.brand-wordmark .r-glyph {
  font-style: italic;
  color: var(--brand-500);
  margin-left: 2px;
}

/* === Bottom tab bar === */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 12px 28px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-top: 0.5px solid var(--border);
  display: flex;
  justify-content: space-around;
  z-index: 20;
}
.tab {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  padding: 4px;
  color: var(--fg-muted);
  font-size: 10px;
  font-weight: 500;
  position: relative;
}
.tab.active { color: var(--brand-600); }
.tab svg { width: 22px; height: 22px; stroke-width: 1.8; }
.tab.elevated {
  position: relative;
  margin-top: -14px;
}
.tab.elevated .tab-glyph {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  display: grid; place-items: center;
  color: white;
  box-shadow: 0 8px 16px rgba(31, 79, 209, 0.32), 0 2px 4px rgba(0,0,0,0.08);
  margin-bottom: 4px;
}
.tab.elevated .tab-glyph svg { width: 22px; height: 22px; color: white; stroke-width: 2; }
.tab.elevated .tab-label { color: var(--brand-600); font-weight: 600; }

/* === The 3D points card (hero) === */
.qcard {
  position: relative;
  width: 100%;
  aspect-ratio: 1.585 / 1; /* credit card ratio */
  border-radius: 18px;
  background:
    radial-gradient(circle at 80% 0%, rgba(255,200,140,0.18), transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(120,160,255,0.12), transparent 50%),
    linear-gradient(135deg, var(--card-grad-start) 0%, var(--card-grad-mid) 50%, var(--card-grad-end) 100%);
  color: white;
  padding: 18px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow:
    0 1px 1px rgba(255,255,255,0.06) inset,
    0 0 0 1px rgba(0,0,0,0.3),
    0 18px 34px -12px rgba(10,19,48,0.55),
    0 6px 14px -4px rgba(10,19,48,0.35);
  overflow: hidden;
  transform: perspective(1200px) rotateX(2deg) rotateY(-2deg);
  transition: transform var(--t-slow);
}
.qcard::before {
  /* Holographic foil sheen */
  content: "";
  position: absolute;
  inset: 0;
  background: var(--card-foil);
  opacity: 0.4;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.qcard::after {
  /* Top shine */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), transparent);
  border-radius: 18px 18px 0 0;
  pointer-events: none;
}
.qcard-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  position: relative; z-index: 2;
}
.qcard-cobrand {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}
.qcard-cobrand-sep {
  width: 8px; height: 1px;
  background: rgba(255,255,255,0.5);
}
.qcard-status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.2);
  color: #5eea98;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.qcard-status-dot { width: 5px; height: 5px; border-radius: 50%; background: #5eea98; }
.qcard-status.locked {
  background: rgba(168, 85, 247, 0.22);
  color: #d8b4fe;
}
.qcard-status.locked .qcard-status-dot { background: #d8b4fe; }

.qcard-body { position: relative; z-index: 2; }
.qcard-label {
  font-size: 10px;
  opacity: 0.65;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.qcard-balance {
  display: flex; align-items: baseline; gap: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 38px;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
  line-height: 1;
}
.qcard-balance-r {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  font-style: italic;
  color: rgba(255,200,140,0.95);
  margin-left: 2px;
  text-shadow: 0 0 12px rgba(255,200,140,0.5);
}
.qcard-foot {
  display: flex; justify-content: space-between;
  position: relative; z-index: 2;
  font-size: 10px;
  letter-spacing: 0.04em;
}
.qcard-foot-item { opacity: 0.92; }
.qcard-foot-item .label { display: block; opacity: 0.6; text-transform: uppercase; font-size: 9px; margin-bottom: 2px; letter-spacing: 0.06em; }
.qcard-foot-item .val {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
}
.qcard-foot-item .val .r-mini { font-style: italic; color: rgba(255,200,140,0.9); margin-left: 1px; font-size: 12px; }

.qcard.locked-state .qcard-body,
.qcard.locked-state .qcard-foot { opacity: 0.4; }
.qcard-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  background: rgba(10,19,48,0.45);
  backdrop-filter: blur(6px);
  z-index: 3;
}
.qcard-lock-overlay svg { width: 28px; height: 28px; opacity: 0.92; }

/* zero-state */
.qcard.zero-state .qcard-balance { opacity: 0.5; }
.qcard.zero-state .qcard-balance::after {
  content: "Start earning";
  position: absolute;
  bottom: 22px; left: 18px;
  font-family: var(--font-sans);
  font-size: 12px; font-weight: 500;
  opacity: 0.7;
  letter-spacing: 0;
}

/* Card chip stack illustration (subtle) */
.qcard-chip {
  position: absolute;
  right: 18px; bottom: 18px;
  width: 26px; height: 20px;
  border-radius: 3px;
  background: linear-gradient(135deg, #d4af6d, #b8923f 50%, #d4af6d);
  opacity: 0.45;
  z-index: 1;
  box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.3);
}
.qcard-chip::before, .qcard-chip::after {
  content: "";
  position: absolute;
  background: rgba(0,0,0,0.25);
}
.qcard-chip::before { top: 5px; left: 0; right: 0; height: 0.5px; }
.qcard-chip::after { top: 0; bottom: 0; left: 8px; width: 0.5px; }

/* === r-glyph everywhere === */
.r-glyph {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--brand-600);
  font-weight: 600;
  margin-left: 1px;
}
.r-glyph-amber {
  font-style: italic;
  color: #c89c4d;
  font-weight: 600;
  font-family: var(--font-display);
}

/* === Sections, headings, etc === */
.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-subtle);
  font-weight: 600;
  margin: 18px 20px 8px;
}
.section-title-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 20px;
  margin: 18px 0 8px;
}
.section-title-row .title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-subtle);
  font-weight: 600;
}
.section-title-row .action {
  font-size: 13px; font-weight: 500;
  color: var(--brand-600);
}

.h1 { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }

.muted { color: var(--fg-muted); }
.subtle { color: var(--fg-subtle); }

/* === Pills (status language) === */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.5;
  white-space: nowrap;
}
.pill-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-green   { background: var(--green-100); color: var(--green-700); }
.pill-blue    { background: var(--info-100); color: var(--info-600); }
.pill-red     { background: var(--red-100); color: var(--red-700); }
.pill-amber   { background: var(--amber-100); color: var(--amber-600); }
.pill-purple  { background: var(--purple-100); color: var(--purple-700); }
.pill-teal    { background: #ccfbf1; color: #0f766e; }
.pill-neutral { background: var(--ink-100); color: var(--ink-600); }
[data-theme="dark"] .pill-green { background: rgba(22,163,74,0.18); color: #6ee7b7; }
[data-theme="dark"] .pill-blue { background: rgba(59,130,246,0.18); color: #93c5fd; }
[data-theme="dark"] .pill-red { background: rgba(239,68,68,0.18); color: #fca5a5; }
[data-theme="dark"] .pill-amber { background: rgba(245,158,11,0.18); color: #fcd34d; }
[data-theme="dark"] .pill-purple { background: rgba(168,85,247,0.18); color: #d8b4fe; }
[data-theme="dark"] .pill-neutral { background: rgba(255,255,255,0.08); color: var(--fg-muted); }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  height: 50px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: background var(--t-fast), transform 80ms ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.985); }
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(180deg, var(--brand-600), var(--brand-700));
  color: white;
  box-shadow: 0 2px 6px rgba(31,79,209,0.28), inset 0 0.5px 0 rgba(255,255,255,0.15);
}
.btn-primary:disabled, .btn-primary.disabled {
  background: var(--ink-150); color: var(--ink-400); box-shadow: none;
  cursor: not-allowed;
}
.btn-secondary {
  background: var(--surface);
  color: var(--brand-600);
  border: 1px solid var(--brand-200);
}
.btn-ghost {
  background: transparent;
  color: var(--brand-600);
  font-weight: 500;
}
.btn-danger {
  background: var(--red-600);
  color: white;
}
.btn-sm { height: 36px; font-size: 14px; border-radius: 10px; padding: 0 14px; }
.btn-icon { width: 50px; padding: 0; }
.btn-icon svg { width: 18px; height: 18px; }

/* CTA pinned to bottom (above home indicator) */
.cta-pinned {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px 20px 30px;
  background: linear-gradient(180deg, transparent, var(--bg) 30%);
  z-index: 10;
}

/* === Cards / surfaces === */
.surface {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border);
}
.surface-bordered { padding: 16px; }
.list {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 0.5px solid var(--border);
  margin: 0 16px;
}
.list-row {
  display: flex; align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 0.5px solid var(--border);
  min-height: 52px;
}
.list-row:last-child { border-bottom: 0; }
.list-row-press { transition: background var(--t-fast); }
.list-row-press:active { background: var(--surface-2); }
.list-row-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--brand-50);
  color: var(--brand-600);
  display: grid; place-items: center;
  flex-shrink: 0;
}
[data-theme="dark"] .list-row-icon { background: rgba(37,99,235,0.18); }
.list-row-icon svg { width: 16px; height: 16px; }
.list-row-body { flex: 1; min-width: 0; }
.list-row-title { font-size: 15px; font-weight: 500; line-height: 1.3; }
.list-row-sub { font-size: 12px; color: var(--fg-subtle); margin-top: 2px; }
.list-row-trail { color: var(--fg-subtle); display: flex; align-items: center; gap: 6px; font-size: 14px; }
.list-row-trail svg { width: 14px; height: 14px; color: var(--ink-300); }

/* === Quick action buttons (home) === */
.qab-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 0 16px;
  margin-top: 14px;
}
.qab {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  transition: background var(--t-fast), transform 80ms ease;
}
.qab:active { transform: scale(0.96); background: var(--surface-2); }
.qab-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--brand-50);
  color: var(--brand-600);
  display: grid; place-items: center;
}
[data-theme="dark"] .qab-icon { background: rgba(37,99,235,0.18); }
.qab-icon svg { width: 18px; height: 18px; }
.qab-icon-amber { background: var(--amber-100); color: var(--amber-600); }
.qab-icon-purple { background: var(--purple-100); color: var(--purple-700); }
.qab-icon-green { background: var(--green-100); color: var(--green-700); }
.qab-label { font-size: 11px; font-weight: 500; color: var(--fg); text-align: center; line-height: 1.2; }

/* === Featured offers carousel === */
.offers-scroll {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding: 4px 16px 8px;
  scroll-snap-type: x mandatory;
}
.offer-card {
  flex: 0 0 240px;
  height: 124px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
  background: linear-gradient(135deg, #1e40af, #1b2d6f);
  color: white;
}
.offer-card.warm  { background: linear-gradient(135deg, #b45309, #92400e); }
.offer-card.green { background: linear-gradient(135deg, #166534, #14532d); }
.offer-card.pink  { background: linear-gradient(135deg, #be185d, #831843); }
.offer-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 100%, rgba(255,255,255,0.18), transparent 50%);
}
.offer-card-body {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 12px;
}
.offer-card-name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.offer-card-scope { font-size: 10px; opacity: 0.85; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }
.offer-card-tag {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 8px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* === Activity row (Home + Points history) === */
.activity-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--border);
}
.activity-row:last-child { border-bottom: 0; }
.activity-tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  margin-top: 3px;
}
.activity-tag-lifecard { background: #dbeafe; color: #1d4ed8; }
.activity-tag-qualia   { background: #ede9fe; color: #6d28d9; }
.activity-tag-admin    { background: #fef3c7; color: #92400e; }
.activity-tag-redeem   { background: var(--ink-100); color: var(--ink-700); }
[data-theme="dark"] .activity-tag-lifecard { background: rgba(59,130,246,0.18); color: #93c5fd; }
[data-theme="dark"] .activity-tag-qualia { background: rgba(139,92,246,0.22); color: #c4b5fd; }
[data-theme="dark"] .activity-tag-admin { background: rgba(245,158,11,0.22); color: #fcd34d; }
[data-theme="dark"] .activity-tag-redeem { background: rgba(255,255,255,0.1); color: var(--fg-muted); }

.activity-row-body { flex: 1; min-width: 0; }
.activity-row-desc { font-size: 14px; font-weight: 500; line-height: 1.35; }
.activity-row-date { font-size: 11px; color: var(--fg-subtle); margin-top: 2px; font-feature-settings: "tnum"; }
.activity-row-amt {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
}
.activity-row-amt.pos { color: var(--green-600); }
.activity-row-amt.neg { color: var(--ink-700); }
[data-theme="dark"] .activity-row-amt.neg { color: var(--fg); }
.activity-row-bal {
  font-size: 10px;
  color: var(--fg-subtle);
  text-align: right;
  margin-top: 2px;
  font-feature-settings: "tnum";
}

/* === Form fields === */
.field { margin-bottom: 14px; padding: 0 20px; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  margin-bottom: 6px;
  letter-spacing: 0.005em;
}
.input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 16px;
  color: var(--fg);
  font-family: inherit;
  outline: 0;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.input-affix { position: relative; }
.input-affix-eye {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--fg-subtle);
  width: 22px; height: 22px;
  display: grid; place-items: center;
}
.input-affix-check {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--green-600);
  width: 22px; height: 22px;
  display: grid; place-items: center;
}
.field-help { font-size: 12px; color: var(--fg-subtle); margin-top: 6px; line-height: 1.5; }
.field-error { font-size: 12px; color: var(--red-600); margin-top: 6px; display: flex; align-items: center; gap: 4px; }

/* OTP slots */
.otp { display: flex; gap: 10px; justify-content: center; padding: 0 20px; }
.otp-slot {
  flex: 1;
  max-width: 48px;
  height: 60px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  font-feature-settings: "tnum";
  color: var(--fg);
  transition: all var(--t-fast);
}
.otp-slot.active { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.otp-slot.filled { border-color: var(--ink-200); }
.otp-slot.error { border-color: var(--red-500); animation: shake 250ms ease; }
.otp-slot.success { border-color: var(--green-500); background: var(--green-50); }
[data-theme="dark"] .otp-slot.success { background: rgba(22,163,74,0.18); }

.pin { display: flex; gap: 14px; justify-content: center; padding: 0 20px; }
.pin-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
  transition: all var(--t-fast);
}
.pin-dot.filled { background: var(--brand-600); border-color: var(--brand-600); }
.pin-dot.success { background: var(--green-500); border-color: var(--green-500); }
.pin-dot.error { background: var(--red-500); border-color: var(--red-500); animation: shake 250ms ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* Password meter */
.pw-meter {
  display: flex; gap: 4px;
  margin-top: 8px;
}
.pw-meter-bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--ink-100);
}
.pw-meter-bar.on { background: var(--brand-500); }
.pw-meter-bar.on.weak    { background: var(--red-500); }
.pw-meter-bar.on.fair    { background: var(--amber-500); }
.pw-meter-bar.on.good    { background: var(--info-500); }
.pw-meter-bar.on.strong  { background: var(--green-500); }

/* Checkboxes */
.checkbox {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.checkbox.checked {
  background: var(--brand-600);
  border-color: var(--brand-600);
}
.checkbox.checked::after {
  content: "";
  width: 12px; height: 7px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translate(0, -1px);
}

/* Toggle */
.toggle {
  width: 50px; height: 30px;
  background: var(--ink-150);
  border-radius: 999px;
  position: relative;
  transition: background var(--t-fast);
}
[data-theme="dark"] .toggle { background: rgba(255,255,255,0.16); }
.toggle::after {
  content: "";
  position: absolute;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: white;
  top: 2px; left: 2px;
  transition: left var(--t-fast);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.toggle.on { background: var(--green-500); }
.toggle.on::after { left: 22px; }

/* Progress bar (onboarding) */
.progress {
  height: 3px;
  background: var(--ink-100);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 20px;
}
[data-theme="dark"] .progress { background: rgba(255,255,255,0.1); }
.progress-bar { height: 100%; background: var(--brand-600); border-radius: 999px; transition: width var(--t-slow); }

/* === Splash screen === */
.splash {
  height: 100%;
  background: linear-gradient(180deg, var(--brand-700), var(--brand-900));
  color: white;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative;
}
.splash::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,200,140,0.16), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(140,170,255,0.18), transparent 60%);
}
.splash-mark {
  position: relative;
  width: 96px; height: 96px;
  border-radius: 24px;
  background: linear-gradient(135deg, white, #e0e8ff);
  display: grid; place-items: center;
  box-shadow: 0 24px 48px rgba(255,255,255,0.18), 0 0 0 1px rgba(255,255,255,0.2);
  margin-bottom: 18px;
}
.splash-mark-r {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 56px;
  font-weight: 700;
  color: var(--brand-700);
  letter-spacing: -0.04em;
}
.splash-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: white;
}

/* === First-run tour === */
.tour {
  height: 100%;
  display: flex; flex-direction: column;
  background: var(--bg);
  position: relative;
}
.tour-skip {
  position: absolute; top: 56px; right: 20px;
  font-size: 15px; color: var(--brand-600);
  font-weight: 500;
  z-index: 10;
  padding: 8px;
}
.tour-illust {
  flex: 1;
  display: grid; place-items: center;
  padding: 80px 20px 0;
  background: linear-gradient(180deg, var(--brand-50), transparent);
}
[data-theme="dark"] .tour-illust { background: linear-gradient(180deg, rgba(37,99,235,0.18), transparent); }
.tour-illust-art {
  width: 220px; height: 220px;
  position: relative;
}
.tour-body {
  padding: 0 32px 28px;
  text-align: left;
}
.tour-headline {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 10px;
}
.tour-body-text {
  font-size: 15px; line-height: 1.55;
  color: var(--fg-muted);
}
.tour-dots {
  display: flex; gap: 6px;
  justify-content: center;
  margin: 14px 0 18px;
}
.tour-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-200);
}
.tour-dot.active { background: var(--brand-600); width: 18px; border-radius: 999px; }

/* === Product tile === */
.prod-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
}
.prod-tile {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border);
  overflow: hidden;
  display: flex; flex-direction: column;
  position: relative;
}
.prod-img {
  height: 124px;
  background: linear-gradient(135deg, #f3f0e8, #e7e3d6);
  position: relative;
  display: grid; place-items: center;
  color: rgba(0,0,0,0.2);
  overflow: hidden;
}
.prod-img-dots {
  position: absolute;
  bottom: 8px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px;
}
.prod-img-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
}
.prod-img-dot.active { background: white; }
.prod-heart {
  position: absolute;
  top: 8px; right: 8px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  color: var(--ink-500);
}
.prod-heart.on { color: var(--red-500); }
.prod-heart svg { width: 16px; height: 16px; }
.prod-offer-chip {
  position: absolute;
  top: 8px; left: 8px;
  padding: 3px 7px;
  background: var(--red-500);
  color: white;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}
.prod-body { padding: 10px 12px 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.prod-brand { font-size: 10px; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: 0.04em; }
.prod-name { font-size: 13px; font-weight: 500; line-height: 1.3; min-height: 34px; }
.prod-price {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin-top: 2px;
  font-feature-settings: "tnum";
}
.prod-qty-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.prod-qty {
  display: flex; align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
}
.prod-qty button { width: 24px; height: 24px; display: grid; place-items: center; color: var(--fg-muted); }
.prod-qty span { width: 22px; text-align: center; font-weight: 500; font-size: 13px; }
.prod-add {
  flex: 1;
  height: 26px;
  background: var(--brand-600);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
}
.prod-tile.out-of-stock .prod-img,
.prod-tile.out-of-stock .prod-body { opacity: 0.4; }
.prod-unavail {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}

/* === Category strip === */
.cat-strip {
  display: flex; gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
}
.cat-chip {
  padding: 7px 12px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--fg);
  transition: all var(--t-fast);
}
.cat-chip.active { background: var(--brand-600); color: white; border-color: var(--brand-600); }

/* Search field */
.search {
  margin: 8px 16px;
  position: relative;
}
.search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  background: var(--surface-2);
  border: 0;
  border-radius: 12px;
  font-size: 15px;
  outline: 0;
  color: var(--fg);
}
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--fg-subtle); width: 16px; height: 16px; }

/* Floating cart bubble */
.cart-fab {
  position: absolute;
  bottom: 96px;
  right: 20px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--ink-900);
  color: white;
  display: grid; place-items: center;
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
  z-index: 15;
}
.cart-fab svg { width: 22px; height: 22px; }
.cart-fab-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--red-500);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--bg);
}

/* === Order status stepper === */
.stepper {
  padding: 0 20px;
}
.step {
  display: flex; gap: 14px;
  position: relative;
  padding-bottom: 20px;
}
.step:last-child { padding-bottom: 0; }
.step-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--ink-100);
  display: grid; place-items: center;
  flex-shrink: 0;
  z-index: 2;
  position: relative;
}
[data-theme="dark"] .step-dot { background: rgba(255,255,255,0.1); }
.step-dot.done {
  background: var(--green-500);
  color: white;
}
.step-dot.active {
  background: var(--brand-600);
  color: white;
}
.step-dot.failed {
  background: var(--red-500); color: white;
}
.step-dot svg { width: 12px; height: 12px; stroke-width: 3; }
.step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 11px; top: 22px;
  width: 1.5px;
  height: calc(100% - 22px);
  background: var(--ink-100);
}
[data-theme="dark"] .step:not(:last-child)::before { background: rgba(255,255,255,0.1); }
.step.done:not(:last-child)::before { background: var(--green-500); }
.step-body { flex: 1; padding-top: 1px; }
.step-title { font-size: 14px; font-weight: 500; }
.step-time { font-size: 11px; color: var(--fg-subtle); margin-top: 2px; font-feature-settings: "tnum"; }
.step-meta { font-size: 12px; color: var(--fg-muted); margin-top: 2px; line-height: 1.5; }

/* === Bottom sheet === */
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 30;
}
.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 8px 0 28px;
  z-index: 31;
  max-height: 75%;
  display: flex; flex-direction: column;
}
.sheet-handle {
  width: 36px; height: 4px;
  border-radius: 999px;
  background: var(--ink-200);
  margin: 0 auto 8px;
}
[data-theme="dark"] .sheet-handle { background: rgba(255,255,255,0.2); }
.sheet-content { padding: 12px 20px; overflow-y: auto; }
.sheet-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }

/* === Toast (inline at top in mobile context) === */
.toast {
  position: absolute;
  top: 60px; left: 16px; right: 16px;
  padding: 12px 16px;
  background: var(--ink-900);
  color: white;
  border-radius: 12px;
  display: flex; align-items: center; gap: 10px;
  z-index: 50;
  box-shadow: 0 12px 28px rgba(0,0,0,0.25);
  font-size: 14px;
  font-weight: 500;
}
.toast-icon { width: 18px; height: 18px; }

/* Confetti decoration */
.confetti-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Pie chart */
.pie-wrap {
  display: flex; align-items: center; gap: 20px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-md);
  margin: 0 16px;
  border: 0.5px solid var(--border);
}
.pie-svg { width: 100px; height: 100px; flex-shrink: 0; }
.pie-legend { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.pie-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pie-legend-swatch { width: 10px; height: 10px; border-radius: 3px; }

/* Banner */
.banner {
  margin: 12px 16px;
  padding: 12px 14px;
  background: var(--info-50);
  border: 1px solid var(--info-100);
  border-radius: var(--radius-md);
  display: flex; gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--info-600);
}
[data-theme="dark"] .banner { background: rgba(59,130,246,0.14); color: #93c5fd; border-color: rgba(59,130,246,0.3); }
.banner svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.banner-amber { background: var(--amber-50); border-color: var(--amber-100); color: var(--amber-600); }
[data-theme="dark"] .banner-amber { background: rgba(245,158,11,0.14); color: #fcd34d; border-color: rgba(245,158,11,0.3); }
.banner-green { background: var(--green-50); border-color: var(--green-100); color: var(--green-700); }
[data-theme="dark"] .banner-green { background: rgba(22,163,74,0.14); color: #6ee7b7; border-color: rgba(22,163,74,0.3); }
.banner-red { background: var(--red-50); border-color: var(--red-100); color: var(--red-700); }
[data-theme="dark"] .banner-red { background: rgba(239,68,68,0.14); color: #fca5a5; border-color: rgba(239,68,68,0.3); }

/* === Linked accounts tile === */
.linked-tile {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  margin: 0 16px 10px;
}
.linked-logo {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: grid; place-items: center;
  color: white;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 18px;
  flex-shrink: 0;
}
.linked-body { flex: 1; min-width: 0; }
.linked-name { font-size: 15px; font-weight: 600; }
.linked-meta { font-size: 12px; color: var(--fg-subtle); margin-top: 2px; }
.linked-cta {
  height: 32px; padding: 0 14px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
}
.linked-cta.link { background: var(--brand-600); color: white; }
.linked-cta.unlink { background: var(--surface-2); color: var(--fg-muted); border: 1px solid var(--border); }
.linked-cta.locked { background: var(--ink-100); color: var(--fg-subtle); cursor: not-allowed; }

/* Marketplace banner (large) */
.market-banner-large {
  margin: 0 16px;
  height: 156px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1e40af, #1b2d6f);
  position: relative;
  overflow: hidden;
  color: white;
  padding: 18px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.market-banner-large::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 30%, rgba(255,200,140,0.18), transparent 60%);
}
.market-banner-large h3 { position: relative; font-family: var(--font-display); font-size: 22px; letter-spacing: -0.02em; }
.market-banner-large p { position: relative; font-size: 13px; opacity: 0.88; margin-top: 4px; }

/* Cart item row */
.cart-row {
  display: flex; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius-md);
  margin: 0 16px 10px;
  border: 0.5px solid var(--border);
}
.cart-row-thumb {
  width: 60px; height: 60px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f3f0e8, #e7e3d6);
  flex-shrink: 0;
  display: grid; place-items: center;
  color: rgba(0,0,0,0.2);
}
.cart-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Checkout summary block */
.summary {
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border);
  margin: 0 16px;
}
.summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--border);
  font-size: 14px;
}
.summary-row:last-child { border-bottom: 0; padding-bottom: 0; }
.summary-row.hero {
  padding: 12px 0 4px;
}
.summary-row.hero .summary-after {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-600);
  letter-spacing: -0.01em;
}
.summary-row .label { color: var(--fg-muted); }
.summary-row .val { font-feature-settings: "tnum"; font-weight: 600; }
.summary-row .val.red { color: var(--red-600); }
.summary-row .val.green { color: var(--green-600); }

/* Address tile */
.addr-tile {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  margin: 0 16px 10px;
}
.addr-tile.selected { border-color: var(--brand-500); background: var(--brand-50); }
[data-theme="dark"] .addr-tile.selected { background: rgba(37,99,235,0.14); }
.addr-tile-radio {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  display: grid; place-items: center;
  margin-top: 2px;
}
.addr-tile.selected .addr-tile-radio { border-color: var(--brand-500); }
.addr-tile.selected .addr-tile-radio::after {
  content: "";
  width: 11px; height: 11px;
  background: var(--brand-500);
  border-radius: 50%;
}
.addr-tile-body { flex: 1; min-width: 0; }
.addr-tile-name { font-size: 14px; font-weight: 600; }
.addr-tile-text { font-size: 13px; color: var(--fg-muted); margin-top: 3px; line-height: 1.5; }
.addr-tile-actions { display: flex; gap: 4px; }
.addr-tile-actions button { padding: 6px; color: var(--fg-subtle); }
.addr-tile-actions svg { width: 16px; height: 16px; }

/* Avatar */
.avatar-circle {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b9d2ff, #1f4fd1);
  color: white;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
}

/* Section group (Profile) */
.group {
  margin: 0 16px 16px;
}
.group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-subtle);
  padding: 0 4px 8px;
}
.group-list {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border);
  overflow: hidden;
}
.group-list .list-row { padding: 13px 16px; }
.group-list .list-row:last-child { border-bottom: 0; }

/* Misc */
.empty-state {
  padding: 60px 32px;
  text-align: center;
  color: var(--fg-muted);
}
.empty-state-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid; place-items: center;
  margin: 0 auto 14px;
  color: var(--fg-subtle);
}
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--fg); margin-bottom: 4px; }
.empty-state-body { font-size: 13px; line-height: 1.5; }

/* Loading skeleton */
.skel {
  background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-50) 50%, var(--ink-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
[data-theme="dark"] .skel { background: linear-gradient(90deg, rgba(255,255,255,0.07) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.07) 75%); background-size: 200% 100%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Big rolled-up number animation hint */
.balance-big {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-feature-settings: "tnum";
  line-height: 1;
  color: var(--fg);
}
.balance-big .r-glyph { font-size: 32px; margin-left: 4px; color: var(--brand-500); }
