/* FD Finance · emerald + gold, dark by default */
:root, [data-mode="dark"] {
  --bg: #000000;
  --bg2: #050806;
  --card: #0a0f0c;
  --card2: #0f1612;
  --raise: #141d18;
  --line: rgba(255, 255, 255, .07);
  --line2: rgba(255, 255, 255, .12);
  --gold-line: rgba(214, 176, 92, .26);
  --tx: #edf3ef;
  --tx2: #a7b6ae;
  --tx3: #6d7e75;
  --em: #22c48a;          /* UI accent */
  --em-2: #17a673;
  --em-ink: #04140d;
  --em-soft: rgba(34, 196, 138, .12);
  --gold: #d9b45e;
  --gold-2: #f2d892;
  --gold-soft: rgba(217, 180, 94, .12);
  --pos: #3fd39b;
  --neg: #f08a7c;
  --good: #3fd39b; --warn: #e6b04a; --bad: #f06a5c;
  --s1: #0c8052;  /* chart series: business (emerald) */
  --s2: #ba8c22;  /* chart series: personal (gold) */
  --grid: rgba(255, 255, 255, .06);
  --shadow: 0 10px 40px rgba(0, 0, 0, .5);
  --hero: radial-gradient(130% 150% at 0% 0%, #0f5a3d 0%, #083a27 34%, #05170f 70%, #030a07 100%);
  color-scheme: dark;
}
[data-mode="light"] {
  --bg: #f3f1ea;
  --bg2: #ebe8df;
  --card: #ffffff;
  --card2: #f8f7f2;
  --raise: #f1efe8;
  --line: rgba(10, 30, 20, .08);
  --line2: rgba(10, 30, 20, .14);
  --gold-line: rgba(168, 125, 18, .3);
  --tx: #0e1a14;
  --tx2: #45554c;
  --tx3: #77857d;
  --em: #0a7a50;
  --em-2: #08643f;
  --em-ink: #ffffff;
  --em-soft: rgba(10, 122, 80, .09);
  --gold: #9c7410;
  --gold-2: #7d5d0a;
  --gold-soft: rgba(168, 125, 18, .1);
  --pos: #0a7a50;
  --neg: #b4402f;
  --good: #0a7a50; --warn: #9a6a00; --bad: #c03a2b;
  --s1: #0a7a50;
  --s2: #c0901f;
  --grid: rgba(10, 30, 20, .08);
  --shadow: 0 10px 30px rgba(20, 30, 25, .12);
  --hero: radial-gradient(130% 150% at 0% 0%, #0f6b48 0%, #0a4f35 40%, #073826 100%);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--tx);
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
.ic { width: 20px; height: 20px; flex: none; }
.ic.big { width: 40px; height: 40px; color: var(--gold); }
.muted { color: var(--tx2); }
.small { font-size: 13px; }
.grow { flex: 1; }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; } .row.wrap { flex-wrap: wrap; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.boot { display: grid; place-items: center; height: 100vh; }
.boot img { width: 96px; opacity: .9; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.97); } }

/* ── shell */
.shell { min-height: 100vh; }
.side { display: none; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 34px; height: auto; }
.brand b { font-family: "Cormorant Garamond", Georgia, serif; font-size: 21px; font-weight: 700; letter-spacing: .02em; color: var(--gold-2); }
[data-mode="light"] .brand b { color: var(--em-2); }
main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; outline: none; }
.bnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(env(safe-area-inset-bottom) + 6px);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.bnav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--tx3); border-radius: 12px; }
.bnav a.on { color: var(--em); }
.bnav a.on .ic { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--em) 50%, transparent)); }
.fab {
  position: fixed; right: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 31; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; color: var(--em-ink);
  background: linear-gradient(145deg, var(--em) 0%, var(--em-2) 100%);
  box-shadow: 0 0 0 1.5px var(--gold-line), 0 10px 28px color-mix(in srgb, var(--em) 35%, transparent);
}
.fab .ic { width: 26px; height: 26px; stroke-width: 2.2; }
.fab:active { transform: scale(.95); }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 240px 1fr; }
  .top, .bnav, .fab { display: none; }
  .side {
    display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; padding: 24px 16px;
    background: var(--bg2); border-right: 1px solid var(--line);
  }
  .side .brand img { width: 44px; }
  .side .brand span { display: flex; flex-direction: column; line-height: 1.05; }
  .side .brand b { font-size: 24px; }
  .side .brand em { font-style: normal; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--tx3); margin-top: 3px; }
  .snav { display: flex; flex-direction: column; gap: 2px; }
  .snav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--tx2); font-weight: 600; }
  .snav a:hover { background: var(--card); color: var(--tx); }
  .snav a.on { background: var(--em-soft); color: var(--tx); box-shadow: inset 2px 0 0 var(--em); }
  .snav a.on .ic { color: var(--em); }
  .snav a[data-nav="settings"] { margin-top: 10px; }
  .side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
  main { padding: 32px 36px 60px; }
  .desk { display: inline-flex !important; }
}
.desk { display: none !important; }
.add-side { width: 100%; justify-content: center; }

.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--tx2); flex: none; }
.icon-btn:hover { background: var(--card2); color: var(--tx); }
.icon-btn:disabled { opacity: .3; pointer-events: none; }
.sync-dot { width: 30px; height: 30px; display: grid; place-items: center; }
.sync-dot i, .sync-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--tx3); display: inline-block; }
.sync-chip { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tx2); padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); }
[data-state="idle"] i { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); }
[data-state="syncing"] i { background: var(--gold); animation: pulse 1s infinite; }
[data-state="error"] i, [data-state="signin"] i { background: var(--bad); }
.run-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--gold-soft); color: var(--gold-2); border: 1px solid var(--gold-line); white-space: nowrap; }
[data-mode="light"] .run-pill { color: var(--gold); }
.run-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); animation: pulse 1.2s infinite; }

/* ── page */
.page { display: flex; flex-direction: column; gap: 16px; animation: rise .28s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.page-h h1 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; font-size: 36px; line-height: 1; letter-spacing: .01em; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--tx3); margin-bottom: 6px; }
.eyebrow.gold { color: var(--gold); }
.page-h .date { text-align: right; }
.foot { text-align: center; padding: 10px 0 0; }
.cmd-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.cmd-grid > div { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) {
  .cmd-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .cmd-grid .col-full { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .cmd-grid .col-full > [data-fold="forecast"] { grid-column: 1 / -1; }
  .cols { grid-template-columns: 1fr 1fr; }
}

/* ── cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 4px 10px; flex-wrap: wrap; }
.card-h h3 { white-space: nowrap; }
.card h3 { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card h3 .ic { width: 18px; height: 18px; color: var(--gold); }
.link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--em); }
.link .ic { width: 15px; height: 15px; }
.empty-line { padding: 4px 0; }
.empty-card { align-items: center; text-align: center; padding: 28px 18px; gap: 10px; }
.empty-card.in { display: flex; flex-direction: column; }
.empty-card p { max-width: 460px; }

/* ── hero */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 20px 18px 16px; color: #f3f7f4;
  background: var(--hero); border: 1px solid var(--gold-line);
  box-shadow: inset 0 1px 0 rgba(242, 216, 146, .18), var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(242, 216, 146, .07) 50%, transparent 60%); }
.hero-mark { position: absolute; right: -30px; top: -14px; width: 210px; opacity: .1; pointer-events: none; filter: saturate(.6); }
.hero .eyebrow.gold { color: #e9c978; margin: 0; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; }
.hero-num { position: relative; text-align: left; font-size: clamp(38px, 10vw, 52px); font-weight: 800; letter-spacing: -.03em; line-height: 1; color: #fff; }
.hero-sub { position: relative; font-size: 14px; color: #d5e5dc; }
.hero-sub b { color: #fff; }
.hero-sub .muted { color: #9fc0b0; display: block; font-size: 12.5px; margin-top: 2px; }
.hero h2 { font-size: 22px; position: relative; }
.hero.empty p { position: relative; color: #cfe0d6; }
.hero.empty .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .25); }
.meter { position: relative; height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .1); margin: 8px 0 18px; }
.meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, #1aa874, #3fe0a4); box-shadow: 0 0 14px rgba(63, 224, 164, .45); }
.meter-fill.covered { background: linear-gradient(90deg, #b8892a, #f0cf7a); box-shadow: 0 0 14px rgba(240, 207, 122, .35); }
.meter-fill.below { background: linear-gradient(90deg, #b4402f, #f07a6a); box-shadow: none; }
.mk { position: absolute; top: -4px; width: 2px; height: 18px; background: #fff; border-radius: 2px; transform: translateX(-1px); box-shadow: 0 0 0 2px rgba(5, 23, 15, .9); }
.mk span { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #cfe0d6; font-style: normal; }
.mk.rec { background: #f2d892; }
.mk.rec span { color: #f2d892; }
.hero-stats { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid rgba(242, 216, 146, .18); padding-top: 12px; }
.hero-stats div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hero-stats span { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #9fc0b0; }
.hero-stats b { font-size: 18px; font-weight: 750; color: #fff; }
.hero-stats em { font-style: normal; font-size: 11.5px; color: #9fc0b0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-nudge { position: relative; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: rgba(0, 0, 0, .22); color: #f2d892; font-size: 13px; font-weight: 600; }
.hero-nudge .ic:last-child { margin-left: auto; width: 16px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.pill.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.hero .pill.good { background: rgba(63, 224, 164, .16); color: #6ff0bd; }
.hero .pill.warn { background: rgba(240, 207, 122, .16); color: #f2d892; }
.hero .pill.bad { background: rgba(240, 106, 92, .2); color: #ff9c90; }

/* ── tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 900px) { .tiles:not(.three) { grid-template-columns: repeat(4, minmax(0, 1fr)); } .col-a .tiles:not(.three) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 13px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
a.tile:hover { border-color: var(--line2); }
.tile span { font-size: 11.5px; font-weight: 600; color: var(--tx3); text-transform: uppercase; letter-spacing: .05em; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile b { font-size: 19px; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile b em, .tile > em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--tx3); }
.hint-line { display: flex; align-items: center; gap: 6px; margin-top: -6px; }
.hint-line .ic { width: 15px; height: 15px; }

/* ── lists */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-radius: 12px; text-align: left; width: 100%; min-width: 0; }
button.li:hover { background: var(--card2); }
.li + .li { border-top: 1px solid var(--line); }
.li.dim { opacity: .5; }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.li-main b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-amt { font-weight: 700; font-size: 14.5px; text-align: right; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; }
.li-amt em { font-style: normal; font-weight: 500; color: var(--tx3); font-size: 12px; display: inline; }
.li-amt.muted { color: var(--tx3); font-weight: 500; }
.av { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; font-weight: 750; font-size: 14px;
  background: var(--raise); color: var(--tx2); border: 1px solid var(--line); }
.av .ic { width: 18px; height: 18px; }
.av.em { background: var(--em-soft); color: var(--em); border-color: color-mix(in srgb, var(--em) 25%, transparent); }
.av.gold { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-line); }
.av.mute { opacity: .55; }
.tag { display: inline-block; font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px;
  background: var(--raise); color: var(--tx2); border: 1px solid var(--line); vertical-align: 2px; margin-left: 4px; }
.tag.gold { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-line); }
.day-h { font-size: 12px; font-weight: 700; color: var(--tx3); text-transform: uppercase; letter-spacing: .06em; padding: 12px 4px 2px; }
.day-h:first-child { padding-top: 0; }
.trial-alert, .spot { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; background: var(--gold-soft); border: 1px solid var(--gold-line); font-size: 13.5px; }
.trial-alert .ic, .spot .ic { color: var(--gold); }
.trial-alert > .ic:last-child, .spot > .ic:last-child { margin-left: auto; width: 16px; }
.spot { flex-direction: row; }
.spot > span { display: flex; flex-direction: column; flex: 1; min-width: 0; }

/* ── buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 44px; padding: 0 18px; border-radius: 13px; font-weight: 650; font-size: 14.5px; white-space: nowrap; transition: transform .08s, background .15s; }
.btn:active { transform: scale(.97); }
.btn .ic { width: 18px; height: 18px; }
.btn.sm { height: 36px; padding: 0 13px; font-size: 13.5px; border-radius: 11px; }
.btn.big { height: 54px; font-size: 16px; border-radius: 16px; }
.btn.wide { width: 100%; }
.btn.primary { background: linear-gradient(145deg, var(--em) 0%, var(--em-2) 100%); color: var(--em-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn.ghost { border: 1px solid var(--line2); color: var(--tx); background: transparent; }
.btn.ghost:hover { background: var(--card2); }
.btn.danger { background: var(--bad); color: #fff; }
.danger-t { color: var(--bad) !important; }
.btn:disabled { opacity: .5; pointer-events: none; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form.tight { gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lbl { font-size: 12.5px; font-weight: 650; color: var(--tx2); }
.hint { font-size: 12px; color: var(--tx3); }
.field input, .field select, .search, .acc-row input {
  height: 46px; width: 100%; padding: 0 13px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card2); outline: none; font-size: 16px;
}
.field input:focus, .field select:focus, .search:focus, .acc-row input:focus { border-color: var(--em); box-shadow: 0 0 0 3px var(--em-soft); }
.field input[type="date"], .field input[type="time"] { min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.suffix { position: relative; }
.suffix span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--tx3); pointer-events: none; }
.seg { display: flex; padding: 4px; gap: 4px; background: var(--card2); border: 1px solid var(--line); border-radius: 13px; flex-wrap: wrap; }
.seg label, .seg button { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .seg button { display: block; text-align: center; padding: 8px 10px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--tx2); cursor: pointer; white-space: nowrap; }
.seg input:checked + span, .seg button.on { background: var(--raise); color: var(--tx); box-shadow: 0 1px 0 var(--line2), inset 0 0 0 1px var(--line2); }
.seg input:focus-visible + span { outline: 2px solid var(--em); }
.seg.small { display: inline-flex; flex-wrap: nowrap; }
.seg.small button { padding: 6px 12px; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips.quick { margin-top: -4px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span, .chip-btn { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line2); font-size: 13px; font-weight: 600; color: var(--tx2); cursor: pointer; }
.chip input:checked + span, .chip-btn.on { background: var(--em-soft); border-color: var(--em); color: var(--tx); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--tx2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--em); margin-top: 1px; flex: none; }
.note { font-size: 13px; padding: 9px 12px; border-radius: 12px; display: flex; gap: 8px; align-items: center; }
.note.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.note .ic { width: 16px; height: 16px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--tx2); }
.steps b { color: var(--tx); }
.search { height: 38px !important; font-size: 14px !important; max-width: 260px; flex: 1; min-width: 140px; }
.filter-bar { justify-content: space-between; }

/* ── tabs & nav bits */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { padding: 10px 14px; font-weight: 650; font-size: 14.5px; color: var(--tx3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.on { color: var(--tx); border-color: var(--gold); }
.tab i { font-style: normal; font-size: 11px; background: var(--gold); color: #1a1205; border-radius: 99px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }
.month-nav { display: flex; align-items: center; gap: 4px; }
.month-nav b { min-width: 130px; text-align: center; font-weight: 700; }
.month-bar { margin-top: -4px; }

/* ── folding chart cards */
.fold { padding: 0; gap: 0; }
.fold summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 16px; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary > span { display: flex; flex-direction: column; gap: 2px; }
.fold-i { transition: transform .2s; color: var(--tx3); }
.fold[open] .fold-i { transform: rotate(180deg); }
.fold-b { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; }

/* ── charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; touch-action: pan-y; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .grid.zero { stroke: var(--line2); }
.chart .ax { fill: var(--tx3); font-size: 11px; }
.chart .ln { fill: none; stroke: var(--em); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--em); opacity: .08; }
.chart .ref { stroke: var(--gold); stroke-width: 1.2; stroke-dasharray: 4 4; }
.chart .ref-l { fill: var(--gold); font-size: 11px; font-weight: 600; }
.chart .lab { fill: var(--tx2); font-size: 11.5px; font-weight: 600; }
.chart .dot-low { fill: var(--card); stroke: var(--gold); stroke-width: 2; }
.chart .cross { stroke: var(--line2); stroke-width: 1; }
.chart .dot { fill: var(--em); stroke: var(--card); stroke-width: 2; }
.chart .b-s1 { fill: var(--s1); } .chart .b-s2 { fill: var(--s2); }
.tip { position: absolute; z-index: 5; pointer-events: none; background: var(--raise); border: 1px solid var(--line2); border-radius: 10px; padding: 7px 10px;
  font-size: 12px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); min-width: 120px; }
.tip[hidden] { display: none; }
.tip b { font-size: 13.5px; }
.tip span { color: var(--tx2); display: flex; align-items: center; gap: 6px; }
.tip .ev { color: var(--tx); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--tx2); }
.legend span { display: flex; align-items: center; gap: 6px; }
.key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.key.s1 { background: var(--s1); } .key.s2 { background: var(--s2); }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hb { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.hb-l { color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { height: 10px; border-radius: 3px; overflow: hidden; }
.hb-track i { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.hb-track.personal i { background: var(--s2); }
.hb-v { font-weight: 650; min-width: 54px; text-align: right; }

/* ── math */
.math h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); margin-top: 6px; }
.mrow { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 3px 0; }
.mrow em { font-style: normal; color: var(--tx3); font-size: 12px; margin-left: 4px; }
.mrow.tot { border-top: 1px solid var(--line2); padding-top: 7px; font-weight: 750; }

/* ── trials */
.trial { gap: 12px; }
.trial.hot { border-color: var(--gold-line); background: linear-gradient(180deg, var(--gold-soft), var(--card) 60%); }
.trial-top { display: flex; gap: 14px; align-items: flex-start; }
.trial h3 { font-size: 17px; }
.count { width: 62px; height: 62px; border-radius: 18px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--raise); border: 1px solid var(--line2); }
.count b { font-size: 24px; line-height: 1; font-weight: 800; }
.count span { font-size: 10.5px; color: var(--tx3); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.trial.hot .count { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold); }
.bar { height: 5px; border-radius: 99px; background: var(--raise); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--em), var(--gold)); border-radius: 99px; }

/* ── time */
.timer { align-items: flex-start; }
.timer.live { border-color: var(--gold-line); background: linear-gradient(180deg, var(--gold-soft), var(--card) 70%); align-items: center; text-align: center; }
.timer h2 { font-size: 20px; }
.clock { font-size: 54px; font-weight: 800; letter-spacing: -.02em; line-height: 1; margin: 4px 0; font-variant-numeric: tabular-nums; }
.time-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
.tc { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--line2); font-weight: 650; text-align: left; }
.tc .ic { width: 16px; height: 16px; padding: 7px; box-sizing: content-box; border-radius: 10px; background: var(--em-soft); color: var(--em); }
.tc.personal .ic { background: var(--gold-soft); color: var(--gold); }
.tc:hover { background: var(--card2); }

/* ── plug-ins */
.plugs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 700px) { .plugs { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .plugs { grid-template-columns: 1fr 1fr 1fr; } }
.plug { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--card2); text-align: left; position: relative; }
button.plug:hover { border-color: var(--line2); }
.plug-i { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--raise); color: var(--tx2); flex: none; }
.plug.ready .plug-i, .plug.on .plug-i { background: var(--em-soft); color: var(--em); }
.plug-t { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.plug-t b { padding-right: 96px; }
.plug-t b { font-size: 14px; }
.plug-s { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--tx3); }
.plug-s i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--tx3); }
.plug.ready .plug-s, .plug.on .plug-s { color: var(--good); }
.plug.ready .plug-s i, .plug.on .plug-s i { background: var(--good); border-color: var(--good); }
.plug.p2 .plug-s, .plug.p3 .plug-s { color: var(--gold); }
.plug.p2 .plug-s i, .plug.p3 .plug-s i { border-color: var(--gold); }
.plug.off .plug-s { color: var(--warn); } .plug.off .plug-s i { border-color: var(--warn); }

/* ── accounts sheet */
.acc-row { display: flex; align-items: center; gap: 10px; }
.acc-n { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.acc-row input { max-width: 150px; text-align: right; }
.add-acc { border: 1px dashed var(--line2); border-radius: 14px; padding: 10px 12px; }
.add-acc summary { cursor: pointer; font-weight: 650; color: var(--em); display: flex; gap: 6px; align-items: center; list-style: none; }
.add-acc summary::-webkit-details-marker { display: none; }
.add-acc[open] summary { margin-bottom: 10px; }
.add-acc .grid2 { margin-bottom: 10px; }

/* ── add menu */
.add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.add-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; border-radius: 16px; border: 1px solid var(--line2); background: var(--card2); text-align: left; }
.add-tile:hover { border-color: var(--em); }
.add-tile .ic { color: var(--em); margin-bottom: 6px; }
.add-tile:first-child { border-color: var(--gold-line); background: var(--gold-soft); }
.add-tile:first-child .ic { color: var(--gold); }
.add-tile b { font-size: 14.5px; }
.add-tile span { font-size: 12px; color: var(--tx3); }

/* ── install banner */
.install { flex-direction: row; align-items: center; border-color: var(--gold-line); }
.install > .ic { color: var(--gold); }
.install > span { flex: 1; display: flex; flex-direction: column; }

/* ── sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .2s; }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border: 1px solid var(--line2); border-bottom: 0; border-radius: 24px 24px 0 0;
  padding: 8px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px;
  transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow); }
.sheet-wrap.open .sheet-bg { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line2); margin: 4px auto 0; flex: none; }
.sh-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.sh-head h2 { font-size: 20px; font-weight: 750; }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 22px; border-bottom: 1px solid var(--line2); transform: translateY(16px) scale(.98); opacity: 0; transition: transform .2s, opacity .2s; padding-bottom: 20px; }
  .sheet-wrap.open .sheet { opacity: 1; }
  .grab { display: none; }
}

/* ── toast */
.toast { position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 200;
  display: flex; align-items: center; gap: 14px; max-width: min(92vw, 520px); padding: 12px 16px; border-radius: 14px;
  background: var(--raise); border: 1px solid var(--line2); box-shadow: var(--shadow); font-size: 14px; transition: .22s; }
.toast.in { transform: translate(-50%, 0); opacity: 1; }
.toast button, .toast a { color: var(--em); font-weight: 700; white-space: nowrap; }
@media (min-width: 900px) { .toast { bottom: 28px; } }

@media (max-width: 380px) {
  .hero-stats b { font-size: 16px; }
  .tiles.three .tile b { font-size: 16px; }
  .page-h h1 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
