:root {
  --bg: #101113; --card: #1c1d21; --card2: #26272c; --line: #2e2f35;
  --gold: #d9b44a; --goldtext: #e5c463; --goldsoft: #2a2517;
  --ink: #f3f0ea; --ink2: #b3afa7; --ink3: #8a867f;
  --up: #6fd79a; --down: #e88a76;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); -webkit-tap-highlight-color: transparent; }
body { font: 16px/1.5 "Segoe UI", -apple-system, BlinkMacSystemFont, Heebo, Arial, sans-serif; }
main { max-width: 520px; margin: 0 auto; padding: calc(var(--sat) + 18px) 16px calc(var(--sab) + 28px); }
h1 { font-size: 24px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }
.sub { margin: 2px 0 0; color: var(--ink2); font-size: 13px; }
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.pill { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--card2); color: var(--ink2); white-space: nowrap; }
.pill::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-inline-end: 6px; background: var(--ink3); vertical-align: 1px; }
.pill.ok { color: var(--up); } .pill.ok::before { background: var(--up); }
.pill.warn { color: var(--goldtext); } .pill.warn::before { background: var(--gold); }
.pill.bad { color: var(--down); } .pill.bad::before { background: var(--down); }
.card { background: var(--card); border-radius: 20px; padding: 18px; margin-bottom: 14px; }
.hero { background: linear-gradient(160deg, var(--goldsoft), var(--card) 60%); }
.label { display: block; color: var(--ink2); font-size: 13px; margin: 0; }
.big { font-size: 40px; font-weight: 700; margin: 4px 0 14px; letter-spacing: -0.02em; color: var(--ink); }
.num { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.deltas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.deltas > div { background: rgba(0,0,0,.18); border-radius: 14px; padding: 10px 12px; }
.deltas .num { display: block; font-size: 18px; font-weight: 600; margin-top: 2px; text-align: right; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--ink2); }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.row-head h2 { margin: 0; }
.seg { display: inline-flex; background: var(--card2); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--ink2); font: inherit; font-size: 13px; padding: 5px 11px; border-radius: 999px; cursor: pointer; min-height: 32px; }
.seg button[aria-selected="true"] { background: var(--gold); color: #101113; font-weight: 600; }
.chart { position: relative; height: 190px; margin: 6px -4px 0; touch-action: pan-y; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--ink3); font-size: 11px; font-family: inherit; }
.chart .line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#fill); }
.chart .base { stroke: var(--ink3); stroke-dasharray: 3 4; stroke-width: 1; }
.chart .cross { stroke: var(--ink2); stroke-width: 1; }
.chart .dot { fill: var(--gold); stroke: var(--card); stroke-width: 2; }
.tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 5px 9px; font-size: 12px; pointer-events: none; white-space: nowrap; }
.tip b { display: block; font-size: 14px; }
.members { list-style: none; margin: 0; padding: 0; }
.members li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.members li:first-child { border-top: 0; padding-top: 2px; }
.members .name { font-weight: 600; font-size: 17px; }
.members .val { font-size: 17px; font-weight: 600; text-align: left; }
.members .meta { color: var(--ink2); font-size: 13px; }
.members .chg { font-size: 13px; text-align: left; }
.bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--card2); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
.facts div { background: var(--card2); border-radius: 14px; padding: 10px 12px; }
.facts dt { color: var(--ink2); font-size: 12px; }
.facts dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; }
.muted { color: var(--ink2); } .small { font-size: 12.5px; margin: 8px 0 0; }
.foot { text-align: center; color: var(--ink3); font-size: 12px; padding: 8px 12px 0; }
.foot a { color: var(--ink2); }
.lock { margin-top: 30px; text-align: center; }
.lockform { display: flex; gap: 8px; margin-top: 14px; }
.lockform input { flex: 1; min-width: 0; font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); color: var(--ink); direction: ltr; text-align: center; }
.lockform input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.lockform button { font: inherit; font-weight: 600; padding: 12px 18px; border-radius: 14px; border: 0; background: var(--gold); color: #101113; cursor: pointer; }
.err { color: var(--down); font-size: 14px; margin: 10px 0 0; }
.alert { background: rgba(232,138,118,.12); border: 1px solid rgba(232,138,118,.4); color: var(--ink); }
@media (prefers-reduced-motion: no-preference) { .card { animation: rise .35s ease-out both; } @keyframes rise { from { opacity: 0; transform: translateY(6px); } } }
.topright { display: flex; align-items: center; gap: 8px; }
.lang { font: inherit; font-size: 13px; font-weight: 600; min-width: 40px; min-height: 32px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink2); cursor: pointer; }
.link { font: inherit; font-size: 13px; border: 0; background: transparent; color: var(--goldtext); cursor: pointer; padding: 4px 0; min-height: 32px; }
.me { border: 1px solid rgba(217,180,74,.35); }
.me .row-head { margin-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips button { font: inherit; font-size: 16px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card2); color: var(--ink); cursor: pointer; min-height: 44px; }
.chips button:active { background: var(--goldsoft); }
.members li.mine { background: var(--goldsoft); margin: 0 -10px; padding-inline: 10px; border-radius: 12px; border-top-color: transparent; }
html[dir="ltr"] .deltas .num { text-align: left; }
html[dir="ltr"] .members .val, html[dir="ltr"] .members .chg { text-align: right; }
