:root {
  --bg: #f6f6f2;
  --card: #ffffff;
  --text: #111111;
  --muted: #6c6c67;
  --border: #e3e3dc;
  --soft: #efefe9;
  --accent: #111111;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, select, input { font: inherit; }
.app-shell {
  width: min(100%, 570px);
  margin: 0 auto;
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.brand { font-weight: 850; font-size: 1.45rem; letter-spacing: -0.055em; }
.brand-sub { margin-top: 1px; color: var(--muted); font-size: .76rem; }
.text-button, .close-button { border: 0; background: transparent; color: var(--text); cursor: pointer; }
.text-button { padding: 8px 0 8px 12px; font-weight: 700; }
.hero { padding: 43px 0 24px; }
.quarter-pill {
  display: inline-block; background: var(--soft); border-radius: 999px;
  padding: 6px 9px; font-size: .75rem; font-weight: 780; margin-bottom: 13px;
}
.hero h1 {
  margin: 0; max-width: 440px; font-size: clamp(2.2rem, 10vw, 3.7rem);
  line-height: .98; letter-spacing: -0.065em;
}
.hero p { margin: 14px 0 0; color: var(--muted); font-size: 1rem; }
.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.category-button {
  border: 1px solid var(--border); background: var(--card); min-height: 89px;
  border-radius: 18px; padding: 15px; text-align: left; cursor: pointer;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.category-button:active { transform: scale(.985); }
.category-emoji { display: block; font-size: 1.55rem; margin-bottom: 9px; }
.category-name { font-weight: 730; letter-spacing: -0.02em; }
.result-panel {
  position: fixed; z-index: 10; inset: auto 0 0 0; width: min(100%, 570px); margin: auto;
  background: var(--card); border-radius: 28px 28px 0 0;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -18px 50px rgba(0,0,0,.13); max-height: 86vh; overflow-y: auto;
}
.hidden { display: none; }
.close-button { float: right; font-size: 1.7rem; line-height: 1; padding: 5px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 820; color: var(--muted); }
.best-card { padding: 20px 0 16px; }
.use-label { font-size: .83rem; color: var(--muted); font-weight: 760; }
.best-card-name { margin: 5px 0 0; font-size: 2rem; font-weight: 850; letter-spacing: -0.05em; }
.reward-value { margin: 3px 0 10px; font-size: 1.55rem; font-weight: 790; }
.why-line { margin-top: 9px; padding: 10px 12px; background: var(--soft); border-radius: 12px; font-size: .9rem; line-height: 1.4; }
.rule-line { color: var(--muted); font-size: .9rem; line-height: 1.45; margin-top: 4px; }
.alt-title { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 6px; font-weight: 780; }
.alt-row { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.alt-card { font-weight: 680; }
.alt-note { color: var(--muted); font-size: .82rem; margin-top: 2px; max-width: 340px; }
.alt-reward { font-weight: 780; white-space: nowrap; }
.no-result { padding: 24px 0 12px; color: var(--muted); line-height: 1.5; }
.inactive-box { margin-top: 14px; padding: 12px; border-radius: 13px; background: var(--soft); font-size: .86rem; line-height: 1.45; }
.status-strip { margin: 20px 0 4px; color: var(--muted); font-size: .75rem; text-align: center; line-height: 1.45; }
.status-strip strong { color: var(--text); font-weight: 720; }
dialog { width: min(calc(100% - 24px), 530px); border: 0; padding: 0; border-radius: 24px; background: transparent; }
dialog::backdrop { background: rgba(0,0,0,.35); backdrop-filter: blur(2px); }
.dialog-card { background: var(--card); border-radius: 24px; padding: 20px; }
.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; }
.dialog-header h2 { margin: 4px 0 0; font-size: 1.9rem; letter-spacing: -0.05em; }
.dialog-copy { color: var(--muted); line-height: 1.45; }
.wallet-list { display: grid; gap: 8px; margin: 18px 0; }
.wallet-item, .toggle-row {
  display: flex; align-items: center; gap: 11px; padding: 12px;
  border: 1px solid var(--border); border-radius: 14px;
}
.wallet-item input, .toggle-row input { width: 20px; height: 20px; flex: 0 0 auto; }
.wallet-card-name { font-weight: 690; }
.wallet-issuer { color: var(--muted); font-size: .8rem; margin-top: 1px; }
.settings-card { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.settings-title { display: block; font-weight: 790; margin-bottom: 9px; }
.toggle-row { margin: 8px 0; }
.toggle-row small { display: block; color: var(--muted); margin-top: 2px; }
select { width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); padding: 0 11px; }
.setting-help { display: block; color: var(--muted); margin-top: 7px; line-height: 1.4; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }
.primary-button, .secondary-button { min-height: 48px; border-radius: 14px; padding: 0 14px; font-weight: 760; cursor: pointer; }
.primary-button { border: 1px solid var(--accent); background: var(--accent); color: white; }
.secondary-button { border: 1px solid var(--border); background: var(--card); color: var(--text); }
@media (min-width: 520px) { .category-grid { grid-template-columns: repeat(3, 1fr); } }
