/* ============ Paysa — liquid glass UI ============ */
:root {
  --bg: #f4efe8;
  --ink: #16151a;
  --ink-2: #4a4852;
  --ink-3: #85828e;
  --line: rgba(22, 21, 26, .08);

  --saffron: #ff8a3d;
  --rose: #ff4f7b;
  --teal: #12b3a6;
  --indigo: #5b5bf0;
  --lime: #9bd94a;
  --accent: #ff6a2b;
  --good: #0f9f74;
  --bad: #e0445e;

  --blob-1: #ffb36b;
  --blob-2: #ff7aa2;
  --blob-3: #5ee0cf;
  --blob-4: #8d8cff;

  --glass-tint: rgba(255, 255, 255, .34);
  --glass-tint-thick: rgba(255, 255, 255, .62);
  --glass-rim-hi: rgba(255, 255, 255, .95);
  --glass-rim-lo: rgba(255, 255, 255, .15);
  --glass-inner: rgba(255, 255, 255, .55);
  --glass-shadow: 0 1px 1px rgba(20, 16, 30, .04), 0 12px 32px -8px rgba(40, 20, 60, .18);
  --glare: rgba(255, 255, 255, .55);
  --chip: rgba(255, 255, 255, .5);

  --font-ui: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --r-lg: 30px;
  --r-md: 22px;
  --r-sm: 14px;
  --spring: cubic-bezier(.34, 1.36, .5, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c14;
    --ink: #f3f1f7;
    --ink-2: #bdb9c8;
    --ink-3: #807c8e;
    --line: rgba(255, 255, 255, .08);
    --blob-1: #c2541b;
    --blob-2: #b0215a;
    --blob-3: #0f8b80;
    --blob-4: #3b33c9;
    --good: #3ddc9f;
    --bad: #ff7189;
    --glass-tint: rgba(255, 255, 255, .07);
    --glass-tint-thick: rgba(24, 24, 36, .72);
    --glass-rim-hi: rgba(255, 255, 255, .45);
    --glass-rim-lo: rgba(255, 255, 255, .04);
    --glass-inner: rgba(255, 255, 255, .12);
    --glass-shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 18px 40px -12px rgba(0, 0, 0, .6);
    --glare: rgba(255, 255, 255, .16);
    --chip: rgba(255, 255, 255, .08);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0c14; --ink: #f3f1f7; --ink-2: #bdb9c8; --ink-3: #807c8e; --line: rgba(255,255,255,.08);
  --blob-1: #c2541b; --blob-2: #b0215a; --blob-3: #0f8b80; --blob-4: #3b33c9; --good: #3ddc9f; --bad: #ff7189;
  --glass-tint: rgba(255,255,255,.07); --glass-tint-thick: rgba(24,24,36,.72);
  --glass-rim-hi: rgba(255,255,255,.45); --glass-rim-lo: rgba(255,255,255,.04); --glass-inner: rgba(255,255,255,.12);
  --glass-shadow: 0 1px 1px rgba(0,0,0,.3), 0 18px 40px -12px rgba(0,0,0,.6); --glare: rgba(255,255,255,.16); --chip: rgba(255,255,255,.08);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.defs { position: absolute; }
[hidden] { display: none !important; }
.num, .mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mono { font-family: var(--font-mono); }

/* ============ Backdrop ============ */
.scene { position: fixed; inset: 0; overflow: hidden; z-index: 0; }
.blob {
  position: absolute; width: 62vmax; height: 62vmax; border-radius: 50%;
  opacity: .85; will-change: transform;
  animation: drift 26s var(--ease) infinite alternate;
}
.b1 { background: radial-gradient(circle at 30% 30%, var(--blob-1), transparent 62%); top: -22vmax; left: -18vmax; }
.b2 { background: radial-gradient(circle at 60% 40%, var(--blob-2), transparent 60%); top: 8vmax; right: -28vmax; animation-duration: 31s; animation-delay: -6s; }
.b3 { background: radial-gradient(circle at 40% 60%, var(--blob-3), transparent 60%); bottom: -30vmax; left: -10vmax; animation-duration: 34s; animation-delay: -12s; }
.b4 { background: radial-gradient(circle at 50% 50%, var(--blob-4), transparent 60%); bottom: -20vmax; right: -20vmax; animation-duration: 29s; animation-delay: -3s; opacity: .6; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  50% { transform: translate3d(6vmax, 4vmax, 0) scale(1.08) rotate(20deg); }
  100% { transform: translate3d(-4vmax, 7vmax, 0) scale(.94) rotate(-12deg); }
}
.grain {
  position: absolute; inset: -50%; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ Liquid glass material ============ */
.glass {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(160deg, var(--glass-inner), transparent 38%),
    var(--glass-tint);
  -webkit-backdrop-filter: blur(22px) saturate(185%) brightness(1.04);
  backdrop-filter: blur(22px) saturate(185%) brightness(1.04);
  border-radius: var(--r-lg);
  box-shadow:
    var(--glass-shadow),
    inset 0 1px 0 var(--glass-rim-hi),
    inset 0 -1px 1px var(--glass-rim-lo),
    inset 0 0 24px -6px var(--glass-inner);
}
/* Specular rim: bright where the light hits (top-left), fading around the edge */
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.2px; pointer-events: none; z-index: 2;
  background: linear-gradient(135deg, var(--glass-rim-hi) 0%, var(--glass-rim-lo) 30%, transparent 55%, var(--glass-rim-lo) 75%, var(--glass-rim-hi) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
/* Glare that follows the finger / pointer */
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1;
  background: radial-gradient(420px circle at var(--mx, 20%) var(--my, -20%), var(--glare), transparent 45%);
  opacity: .9; mix-blend-mode: soft-light; transition: opacity .3s;
}
.glass > * { position: relative; z-index: 3; }
/* Lensing: refracts the backdrop (Chromium). Unsupported engines drop this declaration and keep the blur above. */
.glass--lens {
  -webkit-backdrop-filter: blur(22px) saturate(185%) brightness(1.04);
  backdrop-filter: url(#lg-refract) blur(14px) saturate(190%) brightness(1.05);
}
.glass--thick { background: linear-gradient(160deg, var(--glass-inner), transparent 40%), var(--glass-tint-thick); }
.pressable { transition: transform .45s var(--spring), box-shadow .3s var(--ease); }
.pressable:active { transform: scale(.97); }

/* ============ Device frame ============ */
.device {
  position: relative; z-index: 1;
  height: 100dvh; max-width: 440px; margin: 0 auto;
  display: flex; flex-direction: column;
}
@media (min-width: 720px) and (min-height: 760px) {
  body { display: grid; place-items: center; }
  .device {
    height: min(900px, 94dvh); width: 420px; margin: 0;
    border-radius: 52px; overflow: hidden;
    box-shadow: 0 0 0 10px rgba(20, 18, 28, .9), 0 0 0 11px rgba(255,255,255,.18), 0 40px 90px -20px rgba(20, 10, 40, .55);
  }
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 18px) 20px 8px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, var(--saffron), var(--rose) 60%, var(--indigo));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 6px 16px -6px var(--rose);
}
.brand .mark svg { width: 22px; height: 22px; }
.brand .word { font-family: var(--font-display); font-size: 30px; letter-spacing: -.01em; line-height: 1; }
.brand .word em { font-style: italic; color: var(--accent); }
/* Person switcher */
.who {
  display: flex; align-items: center; gap: 6px; border: 0; border-radius: 999px;
  padding: 4px 4px 4px 14px; height: 44px; max-width: 58%;
}
.who-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-chev { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .6; }
.who-av, .pav {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 650; font-size: 13px; letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 4px 12px -4px rgba(40,20,60,.35);
}
.pav--sm { width: 32px; height: 32px; font-size: 12px; }
.who.other { box-shadow: var(--glass-shadow), inset 0 0 0 1.5px var(--indigo), inset 0 1px 0 var(--glass-rim-hi); }

.viewing { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 999px; }
.viewing-txt { flex: 1; min-width: 0; display: grid; font-size: 14px; line-height: 1.2; }
.viewing-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.viewing-txt small { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewing-back {
  flex: none; border: 0; border-radius: 999px; padding: 8px 12px; font-size: 12.5px; font-weight: 600;
  background: var(--ink); color: var(--bg); transition: transform .45s var(--spring);
}
.viewing-back:active { transform: scale(.94); }

/* People list */
.people { display: grid; gap: 8px; }
.person { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 22px; background: var(--chip); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .3s; }
.person.active { box-shadow: inset 0 0 0 1.5px var(--accent); }
.person-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 4px; text-align: left; border-radius: 18px; transition: transform .45s var(--spring); }
.person-main:active { transform: scale(.97); }
.person .pav { width: 42px; height: 42px; font-size: 14px; }
.pinfo { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pname { display: flex; align-items: center; min-width: 0; font-weight: 600; font-size: 15px; }
.pname .pn { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pname .tag { flex: none; }
.psub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: 10px; font-weight: 650; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: #fff; vertical-align: 2px; margin-left: 4px; }
.tag--soft { background: var(--chip); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.tick { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; }
.pedit { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; background: transparent; color: var(--ink-2); }
.pedit:hover { background: var(--chip); }
.pedit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn--danger { color: var(--bad); }

.view {
  flex: 1; overflow-y: auto; overflow-x: hidden; outline: none;
  padding: 8px 16px 128px;
  scrollbar-width: none;
  -webkit-mask: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 40px), transparent);
          mask: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 40px), transparent);
}
.view::-webkit-scrollbar { display: none; }
.screen { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.screen.anim > * { animation: rise .7s var(--spring) both; }
.screen.anim > *:nth-child(2) { animation-delay: .04s; }
.screen.anim > *:nth-child(3) { animation-delay: .08s; }
.screen.anim > *:nth-child(4) { animation-delay: .12s; }
.screen.anim > *:nth-child(5) { animation-delay: .16s; }
.screen.anim > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

/* ============ Tab bar ============ */
.tabbar {
  position: absolute; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 16px); z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; border-radius: 999px;
}
.tab {
  position: relative; z-index: 4; border: 0; background: none; padding: 8px 0 6px; border-radius: 999px;
  display: grid; justify-items: center; gap: 2px; color: var(--ink-2); font-size: 11px; font-weight: 500; letter-spacing: .01em;
  transition: color .3s, transform .45s var(--spring);
}
.tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s var(--spring); }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] svg { transform: translateY(-1px) scale(1.08); stroke-width: 2; }
.tab:active { transform: scale(.9); }
.tab-pill {
  position: absolute; z-index: 3; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 5);
  border-radius: 999px;
  background: linear-gradient(160deg, rgba(255,255,255,.75), rgba(255,255,255,.25));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 -1px 2px rgba(0,0,0,.05), 0 4px 14px -4px rgba(40,20,60,.25);
  transition: transform .6s var(--spring), width .6s var(--spring);
}
:root[data-theme="dark"] .tab-pill { background: linear-gradient(160deg, rgba(255,255,255,.22), rgba(255,255,255,.06)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 14px -4px rgba(0,0,0,.6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tab-pill { background: linear-gradient(160deg, rgba(255,255,255,.22), rgba(255,255,255,.06)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 14px -4px rgba(0,0,0,.6); } }
.tab-pill.squish { animation: squish .6s var(--spring); }
@keyframes squish { 30% { scale: 1.18 .82; } 60% { scale: .96 1.05; } }

/* ============ Cards & type ============ */
.card { padding: 18px; border-radius: var(--r-lg); }
.card--tight { padding: 14px 16px; }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.h2 { font-family: var(--font-display); font-size: 26px; line-height: 1.05; margin: 2px 0 0; font-weight: 400; letter-spacing: -.01em; }
.h2 em { color: var(--accent); }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: grid; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid2 > *, .grid3 > * { min-width: 0; }

.hero { padding: 22px 20px 20px; overflow: hidden; }
.hero .big {
  font-family: var(--font-display); font-size: clamp(52px, 16vw, 64px); line-height: .95; letter-spacing: -.02em;
  margin: 8px 0 6px; font-variant-numeric: tabular-nums lining-nums;
}
.hero .big .rs { font-size: .55em; vertical-align: .38em; margin-right: 2px; opacity: .6; }
.hero-glow {
  position: absolute !important; z-index: 0 !important; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: conic-gradient(from 200deg, var(--saffron), var(--rose), var(--indigo), var(--teal), var(--saffron));
  filter: blur(40px); opacity: .45; animation: spin 18s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  background: var(--chip); font-size: 12px; font-weight: 500; color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.chip--good .dot { background: var(--good); }

/* Segmented control (liquid) */
.seg {
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 999px;
  background: var(--chip); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 3px rgba(0,0,0,.06);
}
.seg button {
  position: relative; z-index: 2; border: 0; background: none; padding: 8px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--ink-2);
  transition: color .3s;
}
.seg button[aria-pressed="true"] { color: var(--ink); }
.seg .seg-pill {
  position: absolute; z-index: 1; top: 4px; bottom: 4px; left: 4px; border-radius: 999px;
  background: linear-gradient(160deg, rgba(255,255,255,.95), rgba(255,255,255,.6));
  box-shadow: 0 3px 10px -3px rgba(40,20,60,.3), inset 0 1px 0 #fff;
  transition: transform .55s var(--spring), width .55s var(--spring);
}
:root[data-theme="dark"] .seg .seg-pill { background: linear-gradient(160deg, rgba(255,255,255,.26), rgba(255,255,255,.1)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg .seg-pill { background: linear-gradient(160deg, rgba(255,255,255,.26), rgba(255,255,255,.1)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); } }

/* Line items */
.lines { display: grid; }
.line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .k { color: var(--ink-2); font-size: 14px; }
.line .k small { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 1px; }
.line .v { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line.total { padding-top: 12px; }
.line.total .k { color: var(--ink); font-weight: 600; }
.line.total .v { font-weight: 650; }
.neg { color: var(--bad); }
.pos { color: var(--good); }

/* Stacked bar */
.split { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; margin: 14px 0 8px; }
.split span { display: block; height: 100%; border-radius: 999px; transition: flex-grow .8s var(--spring); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; vertical-align: 0; }

/* Stat tile */
.tile { padding: 14px; border-radius: var(--r-md); }
.tile .label { font-size: 12px; color: var(--ink-3); }
.tile .value { font-size: 21px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* Slider (liquid knob) */
.slider { width: 100%; appearance: none; -webkit-appearance: none; height: 30px; background: transparent; margin: 6px 0 0; }
.slider::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--saffron), var(--rose) var(--fill, 50%), var(--chip) var(--fill, 50%)); box-shadow: inset 0 0 0 1px var(--line); }
.slider::-moz-range-track { height: 8px; border-radius: 999px; background: var(--chip); }
.slider::-moz-range-progress { height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--saffron), var(--rose)); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 30px; height: 22px; margin-top: -7px; border-radius: 999px;
  background: linear-gradient(160deg, rgba(255,255,255,.95), rgba(255,255,255,.55));
  box-shadow: 0 4px 12px -2px rgba(40,20,60,.35), inset 0 1px 0 #fff, inset 0 -1px 2px rgba(0,0,0,.08);
  transition: transform .4s var(--spring);
}
.slider:active::-webkit-slider-thumb { transform: scale(1.25, 1.12); }
.slider::-moz-range-thumb { width: 30px; height: 22px; border: 0; border-radius: 999px; background: #fff; box-shadow: 0 4px 12px -2px rgba(40,20,60,.35); }

/* Toggle */
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 2; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px; background: var(--chip); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 3px rgba(0,0,0,.08);
  transition: background .3s;
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 999px;
  background: linear-gradient(160deg, #fff, rgba(255,255,255,.8)); box-shadow: 0 3px 8px -2px rgba(0,0,0,.3);
  transition: transform .5s var(--spring), width .3s var(--spring);
}
.switch input:checked + span { background: linear-gradient(90deg, var(--teal), var(--good)); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:active + span::after { width: 30px; }
.switch input:checked:active + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Chart */
.chart { width: 100%; height: auto; margin-top: 10px; display: block; overflow: visible; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--ink-3); font-size: 10px; font-family: var(--font-ui); }
.chart .area { opacity: .9; }
.chart .ln { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart .ln-draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.4s var(--ease) .1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .ev { stroke: #fff; stroke-width: 2; }

/* Timeline */
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 10px; top: 26px; bottom: -10px; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl .node { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); box-shadow: inset 0 0 0 1px var(--line); }
.tl .node i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.tl.macp .node i { background: var(--indigo); }
.tl.increment .node i { background: var(--teal); }
.tl.retire .node i { background: var(--accent); }
.tl .t { font-weight: 550; font-size: 14px; }
.tl .d { font-size: 12px; color: var(--ink-3); }
.tl .amt { font-weight: 550; font-variant-numeric: tabular-nums; text-align: right; font-size: 14px; }

/* Ring */
.ring { width: 118px; height: 118px; flex: none; }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: var(--chip); }
.ring .prog { stroke: url(#ringGrad); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 1.4s var(--ease); }
.ring text { font-family: var(--font-display); fill: var(--ink); }

/* Scheme compare */
.scheme { padding: 14px 12px; border-radius: var(--r-md); text-align: left; border: 0; display: grid; gap: 2px; align-content: start; }
.scheme .name { font-size: 12px; font-weight: 650; letter-spacing: .06em; }
.scheme .amt { font-size: 19px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.scheme .per { font-size: 11px; color: var(--ink-3); }
.scheme.best { box-shadow: var(--glass-shadow), inset 0 0 0 1.5px var(--good), inset 0 1px 0 var(--glass-rim-hi); }
.scheme .badge { justify-self: start; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--good); color: #fff; margin-top: 8px; }
.scheme.na { opacity: .55; }
.scheme.na .badge { background: var(--ink-3); }

/* Matrix */
.levels { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; margin: 10px -4px 0; }
.levels::-webkit-scrollbar { display: none; }
.levels button { flex: none; border: 0; padding: 7px 12px; border-radius: 999px; background: var(--chip); font-size: 13px; font-weight: 550; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); transition: all .35s var(--spring); }
.levels button[aria-pressed="true"] { background: var(--ink); color: var(--bg); transform: scale(1.05); }
.cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.cell { padding: 8px 4px; border-radius: 12px; background: var(--chip); text-align: center; font-size: 12.5px; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px var(--line); }
.cell small { display: block; font-size: 9.5px; color: var(--ink-3); }
.cell.you { background: linear-gradient(145deg, var(--saffron), var(--rose)); color: #fff; box-shadow: 0 6px 16px -6px var(--rose); }
.cell.you small { color: rgba(255,255,255,.85); }

/* DA timeline */
.da-bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; height: 150px; margin-top: 12px; }
.da-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.da-bar .b {
  width: 100%; border-radius: 12px 12px 6px 6px; background: linear-gradient(180deg, var(--saffron), var(--rose));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6); transform-origin: bottom; animation: grow 1s var(--spring) both;
}
.da-bar.expected .b { background: repeating-linear-gradient(135deg, var(--chip) 0 6px, transparent 6px 12px), linear-gradient(180deg, rgba(255,138,61,.35), rgba(255,79,123,.35)); box-shadow: inset 0 0 0 1.5px var(--rose); }
.da-bar .p { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.da-bar .m { font-size: 10.5px; color: var(--ink-3); text-align: center; }
@keyframes grow { from { transform: scaleY(0); } }

table.rt { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.rt th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 11.5px; padding: 6px 0; }
table.rt td { padding: 9px 0; border-top: 1px solid var(--line); }
table.rt td:not(:first-child), table.rt th:not(:first-child) { text-align: right; }
.src a { color: var(--ink-2); text-decoration: none; display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.src a:first-child { border-top: 0; }
.src a span { color: var(--ink-3); }

/* Callout */
.callout { display: flex; gap: 12px; align-items: flex-start; }
.callout .ic { width: 36px; height: 36px; border-radius: 12px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--teal), var(--indigo)); box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
.callout .ic svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.callout.warm .ic { background: linear-gradient(145deg, var(--saffron), var(--rose)); }

.btn {
  border: 0; border-radius: 999px; padding: 13px 18px; font-weight: 600; font-size: 15px;
  background: linear-gradient(145deg, var(--saffron), var(--rose)); color: #fff;
  box-shadow: 0 10px 24px -10px var(--rose), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .45s var(--spring);
}
.btn:active { transform: scale(.96); }
.btn--ghost { background: var(--chip); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

/* ============ Sheet ============ */
.sheet-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(10, 8, 20, .28); animation: fade .3s both; }
.sheet {
  position: fixed; z-index: 50; left: 50%; bottom: 10px; width: min(420px, calc(100% - 20px)); max-height: 86dvh; overflow: auto;
  translate: -50% 0; padding: 10px 18px 20px; border-radius: 34px; scrollbar-width: none;
  animation: sheetIn .6s var(--spring) both;
}
.sheet.closing { animation: sheetOut .35s var(--ease) both; }
.sheet-scrim.closing { animation: fade .3s reverse both; }
@keyframes sheetIn { from { transform: translateY(105%) scale(.96); } to { transform: none; } }
@keyframes sheetOut { to { transform: translateY(105%); } }
@keyframes fade { from { opacity: 0; } }
.grabber { width: 40px; height: 5px; border-radius: 99px; background: var(--ink-3); opacity: .4; margin: 0 auto 10px; }
.form { display: grid; gap: 12px; margin-top: 12px; }
.field { display: grid; gap: 5px; }
.field label { font-size: 12px; color: var(--ink-3); font-weight: 500; padding-left: 4px; }
.field input, .field select {
  width: 100%; min-width: 0; border: 0; border-radius: 14px; padding: 12px 14px; font-size: 15px;
  background: var(--chip); box-shadow: inset 0 0 0 1px var(--line); outline: none; appearance: none;
  transition: box-shadow .25s;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
.field select option { color: #111; }
.field input[type="date"] { padding-right: 10px; font-size: 14px; }
.field input[type="date"]::-webkit-calendar-picker-indicator { margin-left: 0; opacity: .6; }
.field input:focus, .field select:focus { box-shadow: inset 0 0 0 2px var(--accent); }

.footer-note { text-align: center; font-size: 11.5px; color: var(--ink-3); padding: 6px 12px 0; }

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

/* ============ News ============ */
.tab-badge {
  position: absolute; top: 3px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 999px; background: var(--rose); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg); animation: pop .5s var(--spring);
}
@keyframes pop { from { transform: scale(0); } }
.news-filters { margin: 0 -4px; }
.news-list { display: grid; gap: 10px; }
.news { display: grid; gap: 7px; padding: 14px 16px; border-radius: var(--r-md); color: inherit; text-decoration: none; }
.news-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); min-width: 0; }
.news-src { font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.news-dot { opacity: .6; }
.nb { flex: none; font-size: 10px; font-weight: 650; letter-spacing: .03em; padding: 2px 7px; border-radius: 999px; background: var(--chip); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.nb--off { background: var(--good); color: #fff; box-shadow: none; }
.news-new { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--rose); margin-left: auto; box-shadow: 0 0 0 3px color-mix(in srgb, var(--rose) 25%, transparent); }
.news-title { font-size: 15px; font-weight: 580; line-height: 1.35; letter-spacing: -.005em; }
.news-sum { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.news-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.news-tags span { font-size: 10.5px; font-weight: 550; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--ink-3); }
.news-tags .news-go { margin-left: auto; background: none; color: var(--accent); font-size: 12px; padding: 0; }

/* ============ Toast ============ */
.toast {
  position: fixed; z-index: 60; left: 50%; top: calc(env(safe-area-inset-top) + 14px); translate: -50% 0;
  padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.toast.show { animation: toastIn 4.2s var(--spring) both; }
@keyframes toastIn {
  0% { opacity: 0; transform: translateY(-24px) scale(.9); }
  10%, 88% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-12px) scale(.96); }
}
