/* ============================================================================
   Miles Dashboard — Singapore Airlines batik design language
   Midnight navy + gold · glassmorphism · Fraunces display / Inter body
   ========================================================================== */

:root {
  --ink:        #08132b;   /* deepest background            */
  --ink-2:      #0b1a38;   /* elevated background           */
  --navy:       #12264d;
  --navy-line:  #21376a;
  --gold:       #c8a24c;
  --gold-soft:  #d8b45e;
  --gold-bright:#ecd08a;
  --teal:       #3f9d92;   /* batik accent, sparing         */
  --rose:       #c07a86;   /* batik accent, sparing         */
  --cream:      #f5eede;
  --text:       #e8e6df;
  --muted:      #a7b0c4;
  --muted-2:    #7c8399;
  --danger:     #e6a15a;   /* cap warnings (warm amber)     */
  --good:       #7fd1a6;

  --glass:      rgba(255,255,255,0.045);
  --glass-2:    rgba(255,255,255,0.07);
  --glass-line: rgba(255,255,255,0.10);
  --gold-glass: rgba(200,162,76,0.12);

  --radius:     20px;
  --radius-sm:  13px;
  --shadow:     0 18px 50px -20px rgba(0,0,0,0.65);
  --shadow-lg:  0 40px 90px -35px rgba(0,0,0,0.8);
  --ease:       cubic-bezier(0.22, 1, 0.36, 1);

  --maxw: 1180px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, system-ui, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: #070f22;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* fixed backdrop layer — avoids background-attachment:fixed (janky on iOS/repaint bugs) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 620px at 78% -8%, rgba(200,162,76,0.16), transparent 60%),
    radial-gradient(900px 700px at 8% 4%, rgba(46,86,150,0.35), transparent 55%),
    linear-gradient(180deg, var(--ink-2) 0%, var(--ink) 42%, #050d1f 100%);
}

/* full-page batik texture wash */
.motif-wash {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("assets/batik-motif.svg");
  background-size: 150px;
  opacity: 0.05;
}

main, .site-header, .site-footer { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
em { font-style: italic; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 15px clamp(18px, 5vw, 46px);
  background: rgba(8,17,38,0.55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--glass-line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { display: block; }
.brand-name {
  font-family: var(--serif); font-weight: 600; font-size: 1.18rem;
  letter-spacing: 0.2px; color: var(--cream);
}
.brand-thin { color: var(--gold-soft); font-weight: 400; margin-left: 3px; }
.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a {
  font-size: 0.9rem; font-weight: 500; color: var(--muted);
  position: relative; padding: 4px 0; transition: color 0.25s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width 0.3s var(--ease);
}
.nav a:hover { color: var(--cream); }
.nav a:hover::after { width: 100%; }
.snapshot-badge {
  font-size: 0.72rem; letter-spacing: 0.4px; color: var(--gold-soft);
  border: 1px solid var(--gold-glass); background: var(--gold-glass);
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
@media (max-width: 720px) {
  .nav { display: none; }
  .snapshot-badge { margin-left: auto; }
}

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative;
  padding: clamp(56px, 9vw, 120px) clamp(18px, 5vw, 46px) 80px;
  display: flex; justify-content: center;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
/* real batik hero: the image is the treatment, with a slow drift for life */
.hero-bg::before {
  content: ""; position: absolute; inset: -14% -8% 0;
  background: url("assets/hero-batik.jpg") center / cover no-repeat;
  opacity: 0.66;
  will-change: transform;
  animation: heroDrift 30s ease-in-out infinite alternate;
  -webkit-mask-image: linear-gradient(180deg, #000 44%, transparent 95%);
  mask-image: linear-gradient(180deg, #000 44%, transparent 95%);
}
/* legibility + warmth wash, painted above the image but below the text */
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(720px 360px at 50% 4%, rgba(200,162,76,0.16), transparent 66%),
    radial-gradient(680px 380px at 50% 40%, rgba(6,13,30,0.5), transparent 72%),
    linear-gradient(180deg, rgba(8,17,38,0.25) 0%, rgba(8,17,38,0) 38%, var(--ink) 100%);
}
@keyframes heroDrift { from { transform: scale(1) translateY(0); } to { transform: scale(1.09) translateY(-1.6%); } }
.hero-inner { position: relative; z-index: 1; width: 100%; max-width: 900px; text-align: center; }

.eyebrow, .section-eyebrow {
  font-size: 0.76rem; letter-spacing: 3.4px; text-transform: uppercase;
  color: var(--gold-soft); font-weight: 600; margin: 0 0 18px;
}
.hero-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.3rem, 6vw, 4.3rem); line-height: 1.04;
  letter-spacing: -0.5px; margin: 0 auto 20px; color: var(--cream);
  max-width: 15ch;
}
.hero-title em { color: var(--gold-bright); font-weight: 600; }
.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.18rem); color: var(--muted);
  max-width: 56ch; margin: 0 auto 40px;
}

/* console */
.console {
  background: linear-gradient(180deg, var(--glass-2), var(--glass));
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  max-width: 760px; margin: 0 auto;
  position: relative; overflow: hidden;
}
.console::before { /* gold hairline glow along the top edge */
  content: ""; position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.7;
}
.console-row { display: flex; gap: 10px; }
.query-input, .amount-input {
  font-family: var(--sans); font-size: 1rem; color: var(--cream);
  background: rgba(3,9,22,0.55); border: 1px solid var(--glass-line);
  border-radius: var(--radius-sm); padding: 15px 16px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s;
}
.query-input { flex: 1; min-width: 0; }
.query-input::placeholder { color: var(--muted-2); }
.query-input:focus, .amount-input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glass); background: rgba(3,9,22,0.72);
}
.amount-wrap { position: relative; width: 118px; flex: none; }
.amount-prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted-2); font-size: 0.95rem; pointer-events: none;
}
.amount-input { width: 100%; padding-left: 38px; }
.amount-input::-webkit-outer-spin-button,
.amount-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.rank-btn {
  position: relative; flex: none; overflow: hidden; cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: 1rem; color: #241a05;
  padding: 0 26px; border: none; border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  box-shadow: 0 10px 26px -10px rgba(200,162,76,0.7);
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), filter 0.2s;
}
.rank-btn:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 16px 34px -12px rgba(200,162,76,0.85); }
.rank-btn:active { transform: translateY(0); }
.btn-glow {
  position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-18deg);
}
.rank-btn:hover .btn-glow { animation: sweep 0.75s var(--ease); }
@keyframes sweep { to { left: 130%; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; justify-content: center; }
.chip {
  font-size: 0.82rem; color: var(--muted); cursor: pointer;
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-line);
  border-radius: 999px; padding: 6px 13px;
  transition: all 0.22s var(--ease);
}
.chip:hover { color: var(--cream); border-color: var(--gold); background: var(--gold-glass); transform: translateY(-1px); }

.detected {
  min-height: 1.1em; margin: 14px 2px 0; font-size: 0.82rem;
  color: var(--muted-2); letter-spacing: 0.2px;
}
.detected b { color: var(--gold-soft); font-weight: 600; }

@media (max-width: 560px) {
  .console-row { flex-wrap: wrap; }
  .query-input { flex: 1 1 100%; }
  .amount-wrap { flex: 1 1 auto; width: auto; }
  .rank-btn { flex: 1 1 auto; padding: 15px 20px; }
}

/* ---------------------------------------------------------------- results */
.results { max-width: 760px; margin: 26px auto 0; display: grid; gap: 14px; }
.result-card {
  display: grid; grid-template-columns: 54px 1fr auto; gap: 18px; align-items: start;
  text-align: left; padding: 20px 22px;
  background: linear-gradient(180deg, var(--glass-2), var(--glass));
  border: 1px solid var(--glass-line); border-radius: var(--radius);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  animation: rise 0.55s var(--ease) both;
}
.result-card.rank-1 { border-color: rgba(200,162,76,0.5); background: linear-gradient(180deg, rgba(200,162,76,0.14), var(--glass)); }
.result-card.rank-1::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius); pointer-events: none;
  box-shadow: inset 0 0 60px -20px rgba(236,208,138,0.4);
}
.result-card:nth-child(2) { animation-delay: 0.07s; }
.result-card:nth-child(3) { animation-delay: 0.14s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.rank-medal {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600; font-size: 1.15rem;
  color: var(--ink); background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  box-shadow: 0 8px 20px -8px rgba(200,162,76,0.7);
}
.rank-2 .rank-medal, .rank-3 .rank-medal {
  color: var(--cream); background: var(--glass-2); border: 1px solid var(--glass-line); box-shadow: none;
}
.result-main .rc-name { font-family: var(--serif); font-size: 1.28rem; font-weight: 600; color: var(--cream); margin: 2px 0 3px; }
.rc-issuer { font-size: 0.78rem; color: var(--muted-2); letter-spacing: 0.3px; text-transform: uppercase; }
.rc-why { font-size: 0.9rem; color: var(--muted); margin: 9px 0 0; }
.rc-why .rc-cond { color: var(--gold-soft); }
.rc-warn {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 11px; padding: 9px 12px;
  font-size: 0.84rem; color: var(--danger);
  background: rgba(230,161,90,0.09); border: 1px solid rgba(230,161,90,0.28); border-radius: 11px;
}
.rc-warn svg { flex: none; margin-top: 2px; }
.result-figure { text-align: right; white-space: nowrap; }
.rc-miles { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; color: var(--gold-bright); line-height: 1; }
.rc-miles small { font-family: var(--sans); font-size: 0.7rem; color: var(--muted-2); font-weight: 500; display: block; letter-spacing: 1px; margin-top: 4px; text-transform: uppercase; }
.rc-rate { font-size: 0.82rem; color: var(--muted); margin-top: 8px; }
.rc-rate b { color: var(--cream); }
.rc-value { font-size: 0.8rem; color: var(--muted-2); margin-top: 2px; }

@media (max-width: 560px) {
  .result-card { grid-template-columns: 40px 1fr; }
  .result-figure { grid-column: 1 / -1; text-align: left; display: flex; align-items: baseline; gap: 14px; }
  .rc-rate, .rc-value { margin-top: 0; }
}

.scroll-cue { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); }
.scroll-cue span {
  display: block; width: 22px; height: 34px; border: 1.5px solid var(--glass-line); border-radius: 12px; position: relative;
}
.scroll-cue span::after {
  content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  width: 3px; height: 6px; border-radius: 2px; background: var(--gold-soft);
  animation: cue 1.7s var(--ease) infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translate(-50%, 0); } 40% { opacity: 1; } 80% { opacity: 0; transform: translate(-50%, 11px); } }

/* --------------------------------------------------------------- sections */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(64px, 9vw, 110px) clamp(18px, 5vw, 46px); }
.section-alt { position: relative; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.9rem, 4vw, 2.9rem); letter-spacing: -0.4px; color: var(--cream); margin: 8px 0 14px; line-height: 1.08; }
.section-lede { color: var(--muted); font-size: 1.03rem; max-width: 60ch; margin: 0; }

/* wallet card grid */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 18px; }
.wallet-card {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--glass-2), var(--glass));
  border: 1px solid var(--glass-line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.wallet-card:hover { transform: translateY(-4px); border-color: rgba(200,162,76,0.4); box-shadow: var(--shadow-lg); }
.wallet-card::before { /* issuer colour bloom + batik corner */
  content: ""; position: absolute; top: -40px; right: -40px; width: 150px; height: 150px; border-radius: 50%;
  background: var(--issuer, var(--gold-glass)); opacity: 0.25; filter: blur(24px);
}
.wc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; position: relative; }
.wc-name { font-family: var(--serif); font-size: 1.16rem; font-weight: 600; color: var(--cream); line-height: 1.2; }
.wc-issuer { font-size: 0.74rem; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted-2); margin-top: 3px; }
.wc-net { font-size: 0.66rem; letter-spacing: 1px; text-transform: uppercase; color: var(--gold-soft); border: 1px solid var(--gold-glass); background: var(--gold-glass); padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.wc-ref-tag { color: var(--teal); border-color: rgba(63,157,146,0.3); background: rgba(63,157,146,0.1); }
.wc-stats { display: flex; gap: 20px; margin: 16px 0 4px; }
.wc-stat .k { font-size: 0.7rem; letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted-2); }
.wc-stat .v { font-family: var(--serif); font-size: 1.32rem; font-weight: 600; color: var(--gold-bright); }
.wc-stat .v small { font-family: var(--sans); font-size: 0.68rem; color: var(--muted); font-weight: 500; }
.wc-bonus { font-size: 0.86rem; color: var(--muted); margin-top: 8px; min-height: 1.2em; }
.wc-bonus b { color: var(--cream); font-weight: 600; }

.cap { margin-top: 15px; }
.cap-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.cap-row .cap-label { color: var(--muted-2); text-transform: capitalize; }
.cap-row .cap-val { color: var(--text); }
.cap-track { height: 7px; border-radius: 999px; background: rgba(255,255,255,0.07); overflow: hidden; }
.cap-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); transition: width 0.5s var(--ease); }
.cap-fill.warn { background: linear-gradient(90deg, #d98f45, var(--danger)); }
.cap-fill.full { background: linear-gradient(90deg, #d1685f, #e6a15a); }
.cap-edit { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.cap-edit label { font-size: 0.74rem; color: var(--muted-2); }
.cap-edit input {
  width: 92px; font-family: var(--sans); font-size: 0.82rem; color: var(--cream);
  background: rgba(3,9,22,0.6); border: 1px solid var(--glass-line); border-radius: 9px; padding: 6px 9px;
}
.cap-edit input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-glass); }
.wc-uncapped { font-size: 0.8rem; color: var(--good); margin-top: 15px; letter-spacing: 0.2px; }
.wc-flag { display: inline-block; margin-top: 12px; font-size: 0.74rem; color: var(--danger); }

/* redemptions */
.section-alt { background: linear-gradient(180deg, rgba(18,38,77,0.35), transparent); }
.redeem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.redeem-card {
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius-sm);
  padding: 18px 20px; transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.redeem-card:hover { transform: translateY(-3px); border-color: rgba(200,162,76,0.35); }
.rd-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rd-name { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; color: var(--cream); }
.rd-cpm { font-family: var(--serif); font-size: 1.15rem; color: var(--gold-bright); font-weight: 600; white-space: nowrap; }
.rd-cpm small { font-family: var(--sans); font-size: 0.64rem; color: var(--muted-2); letter-spacing: 0.5px; }
.rd-cur { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gold-soft); margin-top: 2px; }
.rd-meta { margin-top: 13px; display: grid; gap: 7px; }
.rd-meta div { display: flex; justify-content: space-between; gap: 12px; font-size: 0.82rem; }
.rd-meta .k { color: var(--muted-2); }
.rd-meta .v { color: var(--text); text-align: right; }
.rd-expiry-never { color: var(--good); }
.rd-expiry-short { color: var(--danger); }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--glass-line); background: rgba(5,13,31,0.6); margin-top: 40px; padding: clamp(44px, 6vw, 70px) clamp(18px, 5vw, 46px) 40px; }
.footer-cols { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-brand { margin-bottom: 12px; }
.site-footer h4 { font-size: 0.8rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold-soft); margin: 0 0 12px; font-weight: 600; }
.footer-note { font-size: 0.86rem; color: var(--muted); margin: 0 0 8px; max-width: 42ch; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-list li { font-size: 0.84rem; color: var(--muted); padding-left: 16px; position: relative; }
.footer-list li::before { content: ""; position: absolute; left: 0; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold-soft); }
.footer-list b { color: var(--cream); }
.footer-fine { max-width: var(--maxw); margin: 34px auto 0; padding-top: 22px; border-top: 1px solid var(--glass-line); font-size: 0.78rem; color: var(--muted-2); }
@media (max-width: 800px) { .footer-cols { grid-template-columns: 1fr; gap: 30px; } }

/* scroll-reveal */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.card-grid > *, .redeem-grid > * { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.card-grid.in > *, .redeem-grid.in > * { opacity: 1; transform: none; }
.card-grid.in > *:nth-child(n) { transition-delay: calc(var(--i, 0) * 55ms); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal, .card-grid > *, .redeem-grid > * { opacity: 1; transform: none; }
}

/* ============================================================================
   V2 additions — wallet mode, health check, onboarding, quirks, mobile nav
   ========================================================================== */

/* safe-area + room for the mobile tab bar */
:root { --tabbar-h: calc(60px + env(safe-area-inset-bottom, 0px)); }

/* shared ghost button */
.ghost-btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: var(--sans); font-size: 0.84rem; font-weight: 500; color: var(--muted);
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-line);
  border-radius: 999px; padding: 8px 15px;
  transition: color 0.22s var(--ease), border-color 0.22s var(--ease), background 0.22s var(--ease), transform 0.15s var(--ease);
}
.ghost-btn:hover { color: var(--cream); border-color: var(--gold); background: var(--gold-glass); transform: translateY(-1px); }
.ghost-btn svg { flex: none; }

/* active nav underline */
.nav a.is-active { color: var(--cream); }
.nav a.is-active::after { width: 100%; }

/* ------------------------------------------------------------- mode toggle */
.mode-toggle {
  position: relative; display: inline-flex; align-self: center; margin: 0 auto 14px;
  padding: 4px; gap: 2px; border-radius: 999px;
  background: rgba(3,9,22,0.5); border: 1px solid var(--glass-line);
}
.mode-btn {
  position: relative; z-index: 1; cursor: pointer; border: none; background: none;
  font-family: var(--sans); font-size: 0.82rem; font-weight: 600; color: var(--muted);
  padding: 8px 18px; border-radius: 999px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
  transition: color 0.25s var(--ease);
}
.mode-btn:hover { color: var(--cream); }
.mode-btn.is-active { color: #241a05; }
.mode-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(127,209,166,0.18); }
.mode-btn.is-active .mode-dot { background: #241a05; box-shadow: none; }
.mode-count { font-weight: 700; opacity: 0.8; }
.mode-slider {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; width: calc(50% - 4px);
  border-radius: 999px; background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  box-shadow: 0 6px 16px -8px rgba(200,162,76,0.7);
  transition: transform 0.32s var(--ease);
}
.mode-toggle[data-mode="all"] .mode-slider { transform: translateX(100%); }
.mode-toggle[data-mode="wallet"] .mode-slider { transform: translateX(0); }

/* ------------------------------------------------------- result card (v2) */
.result-card { grid-template-columns: 48px 1fr; align-items: start; }
.result-body { min-width: 0; }
.rc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.rc-name { font-family: var(--serif); font-size: 1.24rem; font-weight: 600; color: var(--cream); margin: 1px 0 0; line-height: 1.15; }
.rc-figure { text-align: right; white-space: nowrap; }
.rc-rate { display: flex; align-items: baseline; gap: 4px; justify-content: flex-end; }
.rc-rate b { font-family: var(--serif); font-size: 2.05rem; font-weight: 600; color: var(--gold-bright); line-height: 0.95; }
.rc-rate small { font-family: var(--sans); font-size: 0.72rem; font-weight: 600; color: var(--muted-2); letter-spacing: 1px; text-transform: uppercase; }
.rc-miles { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.rc-miles span { color: var(--muted-2); }
.rc-why { font-size: 0.9rem; color: var(--muted); margin: 10px 0 0; }
.rc-why .rc-cond { color: var(--gold-soft); }

.rc-cap { margin-top: 12px; }
.rc-cap-row { display: flex; justify-content: space-between; gap: 10px; font-size: 0.76rem; color: var(--muted-2); margin-bottom: 6px; }
.rc-cap-row span:first-child { color: var(--muted); }
.rc-cap-uncapped { font-size: 0.8rem; color: var(--good); }

.rc-excl { margin-top: 12px; }
.rc-excl summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 500; color: var(--muted-2);
  padding: 5px 0; transition: color 0.2s var(--ease);
}
.rc-excl summary::-webkit-details-marker { display: none; }
.rc-excl summary:hover { color: var(--gold-soft); }
.rc-excl summary svg { transition: transform 0.25s var(--ease); }
.rc-excl[open] summary svg { transform: rotate(180deg); }
.rc-excl p { font-size: 0.82rem; color: var(--muted); margin: 4px 0 0; padding: 10px 12px; background: rgba(3,9,22,0.4); border: 1px solid var(--glass-line); border-radius: 10px; animation: exclOpen 0.28s var(--ease); }
@keyframes exclOpen { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.rc-foot { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.rc-badge { font-size: 0.66rem; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--glass-line); background: rgba(255,255,255,0.03); padding: 3px 9px; border-radius: 6px; }
.rc-badge-net { color: var(--gold-soft); border-color: var(--gold-glass); background: var(--gold-glass); }
.rc-badge-warn { color: var(--danger); border-color: rgba(230,161,90,0.28); background: rgba(230,161,90,0.09); }

@media (max-width: 560px) {
  .result-card { grid-template-columns: 38px 1fr; padding: 18px; gap: 14px; }
  .rc-rate b { font-size: 1.8rem; }
}

/* ------------------------------------------------------------- empty state */
.empty-state {
  text-align: center; padding: 40px 24px;
  background: linear-gradient(180deg, var(--glass), transparent);
  border: 1px dashed var(--glass-line); border-radius: var(--radius);
  animation: rise 0.5s var(--ease) both;
}
.empty-ico { width: 46px; height: 46px; margin: 0 auto 14px; color: var(--gold-soft); opacity: 0.8; }
.empty-ico svg { width: 100%; height: 100%; }
.empty-title { font-family: var(--serif); font-size: 1.2rem; color: var(--cream); margin: 0 0 6px; }
.empty-sub { font-size: 0.9rem; color: var(--muted); margin: 0 auto 18px; max-width: 34ch; }
.empty-state .rank-btn { padding: 12px 22px; }

/* ------------------------------------------------------------- skeletons */
.result-card.skeleton { pointer-events: none; animation: rise 0.4s var(--ease) both; }
.sk-block, .sk-line { background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 37%, rgba(255,255,255,0.04) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
.sk-block { width: 46px; height: 46px; border-radius: 50%; }
.sk-line { height: 13px; margin-bottom: 11px; }
.sk-line-lg { height: 20px; width: 62%; }
.sk-line-sm { width: 40%; }
.result-card.skeleton .sk-line:last-child { width: 85%; margin-bottom: 0; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ------------------------------------------------------------- wallet extras */
.wallet-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 20px; }
.wallet-owned-note { font-size: 0.82rem; color: var(--muted-2); }
.wallet-card.is-owned { border-color: rgba(200,162,76,0.42); }
.wallet-card.is-owned::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); pointer-events: none; box-shadow: inset 0 0 0 1px rgba(200,162,76,0.22); }
.wc-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.wc-own { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.3px; color: var(--muted-2); border: 1px solid var(--glass-line); border-radius: 999px; padding: 3px 10px; }
.wc-own.is-owned { color: var(--good); border-color: rgba(127,209,166,0.32); background: rgba(127,209,166,0.1); }
.wc-flag { margin-top: 0; }

/* ------------------------------------------------------------- health check */
.health-summary { margin-bottom: 26px; }
.health-line { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; background: linear-gradient(180deg, var(--glass-2), var(--glass)); border: 1px solid var(--glass-line); border-radius: var(--radius); }
.health-line-ico { font-size: 1.1rem; line-height: 1.4; }
.health-line p { margin: 0; font-size: 1rem; color: var(--text); }
.health-line b { color: var(--gold-bright); font-weight: 600; }
.health-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 26px; background: linear-gradient(180deg, var(--glass), transparent); border: 1px dashed var(--glass-line); border-radius: var(--radius); }
.health-empty p { margin: 0; color: var(--muted); max-width: 46ch; }

.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.health-card {
  position: relative; overflow: hidden; padding: 18px 18px 20px;
  background: linear-gradient(160deg, var(--glass-2), var(--glass));
  border: 1px solid var(--glass-line); border-radius: var(--radius-sm);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.health-card:hover { transform: translateY(-3px); }
.health-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.health-card.level-green::before { background: linear-gradient(180deg, #7fd1a6, #4fae82); }
.health-card.level-amber::before { background: linear-gradient(180deg, #e6c15a, #d98f45); }
.health-card.level-red::before { background: linear-gradient(180deg, #e6907a, #d1685f); }
.hc-top { display: flex; align-items: center; gap: 8px; }
.hc-dot { font-size: 0.7rem; }
.hc-verdict { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; }
.level-green .hc-verdict { color: var(--good); }
.level-amber .hc-verdict { color: #e6c15a; }
.level-red .hc-verdict { color: #e6907a; }
.hc-cat { font-family: var(--serif); font-size: 1.16rem; font-weight: 600; color: var(--cream); margin: 8px 0 6px; }
.hc-note { font-size: 0.84rem; color: var(--muted); margin: 0; line-height: 1.5; }

/* ------------------------------------------------------------- overlays / sheets */
.overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: clamp(12px, 4vw, 40px); }
.overlay[hidden] { display: none; }
.overlay-scrim { position: absolute; inset: 0; background: rgba(4,9,20,0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.26s var(--ease); }
.overlay.open .overlay-scrim { opacity: 1; }
.sheet {
  position: relative; width: 100%; max-width: 640px; max-height: min(88vh, 900px); overflow-y: auto;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 1px solid var(--glass-line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: clamp(22px, 4vw, 34px);
  transform: translateY(16px) scale(0.98); opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  -webkit-overflow-scrolling: touch;
}
.overlay.open .sheet { transform: none; opacity: 1; }
.sheet-head { margin-bottom: 20px; }
.sheet-title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem, 4vw, 2rem); color: var(--cream); margin: 6px 0 10px; letter-spacing: -0.3px; }
.sheet-lede { color: var(--muted); font-size: 0.95rem; margin: 0; max-width: 52ch; }
.sheet-x { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 34px; height: 34px; cursor: pointer; color: var(--muted); background: rgba(255,255,255,0.05); border: 1px solid var(--glass-line); border-radius: 50%; transition: color 0.2s, background 0.2s; }
.sheet-x:hover { color: var(--cream); background: var(--gold-glass); }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; flex-wrap: wrap; }

/* pick grid (onboarding) */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pick-card {
  position: relative; cursor: pointer; text-align: left; overflow: hidden;
  display: flex; flex-direction: column; gap: 3px;
  padding: 15px 15px 16px; min-height: 104px;
  background: linear-gradient(160deg, var(--glass-2), var(--glass));
  border: 1.5px solid var(--glass-line); border-radius: var(--radius-sm);
  transition: transform 0.18s var(--ease), border-color 0.22s var(--ease), background 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.pick-card::before { content: ""; position: absolute; top: -30px; right: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--issuer, var(--gold-glass)); opacity: 0.22; filter: blur(20px); transition: opacity 0.25s var(--ease); }
.pick-card:hover { transform: translateY(-2px); border-color: rgba(200,162,76,0.4); }
.pick-card.is-picked { border-color: var(--gold); background: linear-gradient(160deg, var(--gold-glass), var(--glass)); box-shadow: 0 10px 30px -14px rgba(200,162,76,0.6); }
.pick-card.is-picked::before { opacity: 0.4; }
.pick-check {
  position: absolute; top: 11px; right: 11px; display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%; color: #241a05;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  transform: scale(0); transition: transform 0.24s cubic-bezier(0.34,1.56,0.64,1);
}
.pick-card.is-picked .pick-check { transform: scale(1); }
.pick-issuer { font-size: 0.68rem; letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted-2); }
.pick-name { font-family: var(--serif); font-size: 1rem; font-weight: 600; color: var(--cream); line-height: 1.2; margin-top: 2px; }
.pick-bonus { font-size: 0.78rem; color: var(--gold-soft); margin-top: auto; padding-top: 8px; }
.pick-card.pop { animation: pickPop 0.32s var(--ease); }
@keyframes pickPop { 0% { transform: translateY(-2px) scale(1); } 40% { transform: translateY(-2px) scale(1.035); } 100% { transform: translateY(-2px) scale(1); } }
.onboard-save-count { font-weight: 700; }

/* quirk form */
.quirk-form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field-label { font-size: 0.8rem; font-weight: 600; color: var(--gold-soft); letter-spacing: 0.2px; }
.quirk-form .query-input { width: 100%; font-family: var(--sans); line-height: 1.5; resize: vertical; }
.quirk-form textarea.query-input { min-height: 84px; }
.quirk-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 2px; }
.quirk-hint { font-size: 0.8rem; color: var(--muted-2); }
.footer-quirk-btn { margin-top: 16px; }
.quirk-thanks { text-align: center; padding: 14px 0 6px; animation: rise 0.4s var(--ease) both; }
.quirk-thanks-ico { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 50%; color: var(--good); background: rgba(127,209,166,0.12); border: 1px solid rgba(127,209,166,0.3); }
.quirk-thanks-title { font-family: var(--serif); font-size: 1.2rem; color: var(--cream); margin: 0 0 8px; }
.quirk-thanks-sub { font-size: 0.9rem; color: var(--muted); margin: 0 auto 20px; max-width: 40ch; }

/* ------------------------------------------------------------- mobile tab bar */
.tabbar { display: none; }
@media (max-width: 720px) {
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(8,17,38,0.82); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-top: 1px solid var(--glass-line);
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 4px; min-height: 48px; border-radius: 12px;
    font-size: 0.66rem; font-weight: 600; letter-spacing: 0.2px; color: var(--muted-2);
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
  }
  .tab svg { width: 22px; height: 22px; }
  .tab.is-active { color: var(--gold-bright); background: var(--gold-glass); }
  body { padding-bottom: var(--tabbar-h); }
  .site-footer { margin-bottom: 0; }
}

/* keyboard focus visibility everywhere */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.query-input:focus-visible, .amount-input:focus-visible { outline: none; }

@media (prefers-reduced-motion: reduce) {
  .mode-slider, .pick-check, .rc-excl summary svg, .sheet, .overlay-scrim { transition: none !important; }
  .sk-block, .sk-line { animation: none !important; }
  .pick-card.pop { animation: none !important; }
}
