:root {
  --bg: #0b0d10;
  --card: #14181d;
  --line: #232a32;
  --text: #e8ecf0;
  --muted: #8a96a3;
  --red: #ff3b3b;
  --red-glow: rgba(255, 59, 59, .35);
  --amber: #ffb347;
  --green: #4cd08a;
  --radius: 14px;
  --openai: #3ec9b0;
  --anthropic: #ff9f45;
  --google: #5b8cff;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) 16px calc(76px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
h1 { font-size: 26px; margin: 2px 0 4px; font-weight: 650; }
h2 { font-size: 13px; margin: 0 0 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }

.wordmark { font-weight: 800; letter-spacing: .32em; color: var(--red); text-shadow: 0 0 18px var(--red-glow); font-size: 32px; }
.wordmark.small { font-size: 12px; letter-spacing: .4em; }

/* Login */
#login { min-height: 90vh; display: grid; place-items: center; }
.login-box { width: 100%; max-width: 340px; text-align: center; }
.eye { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 8%, var(--red) 20%, #6b0000 60%, transparent 70%);
  box-shadow: 0 0 40px var(--red-glow); animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 70px var(--red-glow); transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .eye { animation: none; } }
#login-form { display: grid; gap: 12px; margin-top: 22px; }

input {
  width: 100%; font: inherit; color: var(--text); background: #0f1317;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }

.btn { font: inherit; font-weight: 600; color: var(--text); background: #1d232a;
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 16px; cursor: pointer; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger { color: var(--red); }
.btn[disabled] { opacity: .5; }
.icon-btn { font-size: 22px; background: none; border: 0; color: var(--muted); padding: 8px; cursor: pointer; }
.icon-btn.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.msg { min-height: 1.2em; margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }

/* Today */
.top { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 0 12px; }
.weather { font-size: 15px; }
.banner { background: #2a2110; color: var(--amber); border-radius: 10px; padding: 8px 12px; font-size: 14px; margin-bottom: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.empty { margin: 0; color: var(--muted); }
.badge { background: var(--red); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 8px; letter-spacing: 0; }
.asof { font-size: 12px; color: var(--muted); margin-top: 8px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list a, .list .item { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; color: inherit; text-decoration: none; }
.list a:active { opacity: .7; }
.list .when { color: var(--red); font-variant-numeric: tabular-nums; min-width: 68px; font-weight: 600; }
.list .label { color: var(--red); font-weight: 700; min-width: 28px; }
.list .sub { display: block; color: var(--muted); font-size: 13px; }
.list.small li { font-size: 14px; display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }

/* Link cards, spend */
.link-card { display: block; color: inherit; text-decoration: none; }
.link-card:active { opacity: .8; }
.chev { margin-left: auto; font-size: 18px; letter-spacing: 0; }
.spend-brief { display: flex; align-items: baseline; gap: 8px; }
.big { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.huge { font-size: 40px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hero { text-align: center; padding: 20px 16px; }
.center { text-align: center; }
.month-nav { display: flex; justify-content: center; align-items: center; gap: 12px; margin: -4px 0 10px; font-weight: 600; }
.month-nav .icon-btn[disabled] { opacity: .25; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 2px; font-size: 13px; }
.stat b { font-size: 17px; font-variant-numeric: tabular-nums; }
.chart { display: flex; align-items: flex-end; gap: 2px; height: 120px; }
.chart .col { flex: 1; display: flex; flex-direction: column-reverse; min-width: 0; height: 100%; justify-content: flex-start; }
.chart .seg { width: 100%; }
.chart .seg.openai, .dot.openai { background: var(--openai); }
.chart .seg.anthropic, .dot.anthropic { background: var(--anthropic); }
.chart .seg.google { background: var(--google); }
.chart .col.today { opacity: .55; }
.legend { display: flex; gap: 6px 12px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: -6px; }
.dot.google { background: var(--google); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 14px; }
.bars .name small { color: var(--muted); margin-left: 6px; }
.bars .amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.bars .track { grid-column: 1 / -1; height: 6px; background: #0f1317; border-radius: 3px; overflow: hidden; }
.bars .fill { height: 100%; border-radius: 3px; }
.bars .off { color: var(--muted); }

/* Menu */
.menu-list { display: grid; gap: 8px; }
.menu-list a, .menu-list .soon { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 17px; }
.menu-list small { color: var(--muted); font-weight: 400; font-size: 13px; }
.menu-list .soon { color: #4a545e; }

.tiers { display: flex; gap: 14px; justify-content: center; align-items: baseline; color: #4a545e; font-size: 14px; padding: 8px 0 4px; flex-wrap: wrap; }
.tiers small { width: 100%; text-align: center; font-size: 11px; }

.row { display: flex; gap: 10px; }
.row input { flex: 1; }

/* Bottom tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 8px;
  background: rgba(11, 13, 16, .94); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); }
.tabs button { flex: 1; max-width: 200px; font: inherit; font-weight: 600; background: none; border: 0; color: var(--muted); padding: 10px; border-radius: 10px; cursor: pointer; }
.tabs button.on { color: var(--text); background: #1a1f25; box-shadow: inset 0 -2px 0 var(--red); }
