/* BWN Quit, in the Build With Nin brand (the same look as BWN Money): near-black ink, logo lime, cream cards with ink borders
   and a hard sticker shadow, Anton for the big numbers, JetBrains Mono for small labels, Inter for reading. */
@font-face { font-family: Anton; src: url(fonts/anton.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/inter.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Mono; src: url(fonts/jetbrains-mono.woff2) format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --ink: #18181B; --ink2: #26262B; --lime: #A6E22E; --lime-lt: #D8FF7A; --lime-deep: #5E8A10;
  --bg: #F6F3EC; --card: #FFFDF8; --text: #18181B; --mut: #5F5B53; --line: #18181B; --soft: #E7E1D3;
  --red: #B3261E; --red-ink: #fff; --yellow: #FFE86B;
  --shadow: 3px 3px 0 var(--line);
  --tab-h: 66px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --display: Anton, Impact, 'Arial Narrow', sans-serif; --mono: Mono, ui-monospace, Menlo, monospace;
  --body: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0D0C0A; --card: #1C1B19; --text: #F3EFE6; --mut: #A9A397; --line: #3A3833; --soft: #2A2925; --red: #EF4A3F;
    --shadow: 3px 3px 0 #000; color-scheme: dark; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.45 var(--body); -webkit-tap-highlight-color: transparent; }
body { padding-bottom: calc(var(--tab-h) + var(--safe-b)); min-height: 100vh; overflow-x: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; border-radius: 6px; }
svg { display: block; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--lime); color: var(--ink); padding: 8px 12px; font-weight: 700; }
.skip:focus { left: 8px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* header: the reels' dark scenes */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(var(--safe-t) + 14px) 16px 14px; background: var(--ink); color: #F3EFE6; border-bottom: 3px solid var(--lime); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { width: 40px; height: 40px; color: var(--lime); flex: none; }
.eyebrow { white-space: nowrap; font: 700 0.68rem/1 var(--mono); letter-spacing: 2.5px; color: rgba(243, 239, 230, .7); }
.top h1 { margin: 4px 0 0; font: 400 clamp(1.5rem, 7vw, 1.9rem)/1 var(--display); letter-spacing: 1.5px; }
.sync { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; border: 2px solid rgba(243, 239, 230, .35); background: transparent; color: #F3EFE6;
  border-radius: 999px; padding: 6px 13px; font: 700 0.72rem/1 var(--mono); letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; }
.sync .dot { width: 9px; height: 9px; border-radius: 50%; background: #8B8678; }
.sync.ok { border-color: var(--lime); } .sync.ok .dot { background: var(--lime); }
.sync.busy .dot { background: var(--yellow); animation: pulse 1s infinite alternate; }
.sync.err { border-color: #EF4A3F; } .sync.err .dot { background: #EF4A3F; }
@keyframes pulse { to { opacity: .3; } }

main { max-width: 640px; margin: 0 auto; padding: 16px 16px 96px; outline: none; }
.banner { max-width: 608px; margin: 14px 16px 0; padding: 12px 14px; border-radius: 14px; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink); display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: .9rem; }
.banner.warn { background: #FFD9D4; }
@media (min-width: 640px) { .banner { margin-left: auto; margin-right: auto; } }
.banner .btn { margin-left: auto; flex: none; }

/* the hero: one big number, like a reel's frame 0 */
.hero { position: relative; background: var(--ink); color: #F3EFE6; border-radius: 20px; padding: 18px 18px 16px; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--lime); overflow: hidden; }
.hero .k { font: 700 0.72rem/1 var(--mono); letter-spacing: 2.5px; color: rgba(243, 239, 230, .75); }
.hero .v { font: 400 clamp(2.8rem, 15vw, 4.2rem)/1 var(--display); letter-spacing: 1px; margin-top: 8px; color: var(--lime); overflow-wrap: anywhere; }
.hero .s { margin-top: 6px; font-weight: 600; color: rgba(243, 239, 230, .85); font-size: .92rem; }
.hero.clear .v { color: #F3EFE6; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 4px; }
.stat { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 11px 13px; box-shadow: var(--shadow); min-width: 0; }
.stat .k { font: 700 0.66rem/1.2 var(--mono); letter-spacing: 1.8px; color: var(--mut); text-transform: uppercase; }
.stat .v { font: 400 1.75rem/1.1 var(--display); letter-spacing: .5px; margin-top: 4px; overflow-wrap: anywhere; }
.stat.red .v { color: var(--red); }

h3 { margin: 22px 2px 9px; font: 700 0.72rem/1 var(--mono); letter-spacing: 2.5px; text-transform: uppercase; color: var(--mut); display: flex; justify-content: space-between; }
.list { background: var(--card); border: 2px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1.5px solid var(--soft); min-height: 68px; }
.item:last-child { border-bottom: 0; }
.item .main { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 4px 0; border-radius: 8px; }
.item .name { font-weight: 800; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { font-size: .82rem; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .right { text-align: right; flex: none; display: grid; justify-items: end; gap: 4px; }
.item .amt { font: 400 1.25rem/1 var(--display); letter-spacing: .5px; white-space: nowrap; }
.item.paid .name, .item.paid .amt { color: var(--mut); text-decoration: line-through; text-decoration-thickness: 2px; }
.pill { font: 700 0.64rem/1 var(--mono); letter-spacing: .8px; text-transform: uppercase; padding: 5px 8px; border-radius: 999px; white-space: nowrap; border: 1.5px solid var(--line); }
.pill.up { background: transparent; color: var(--mut); border-color: var(--soft); }
.pill.soon { background: var(--yellow); color: var(--ink); border-color: var(--ink); }
.pill.today { background: var(--ink); color: var(--lime); border-color: var(--ink); }
.pill.over { background: var(--red); color: var(--red-ink); border-color: var(--red); }
.pill.paid { background: var(--lime); color: var(--ink); border-color: var(--ink); }
@media (prefers-color-scheme: dark) { .pill.today { background: var(--lime); color: var(--ink); } }
.tick { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 2.5px solid var(--line); background: var(--card); display: grid; place-items: center; padding: 0; }
.tick svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.tick.on { background: var(--lime); border-color: var(--ink); }
.tick.on svg { opacity: 1; }
@media (hover: hover) { .tick:hover svg { opacity: .35; } .tick.on:hover svg { opacity: 1; } }

.empty { text-align: center; padding: 28px 12px 8px; }
.empty .big { font: 400 2.1rem/1.05 var(--display); letter-spacing: 1px; margin: 6px 0 8px; }
.empty p { color: var(--mut); margin: 0 auto 18px; max-width: 30ch; }
.empty .btns { justify-content: center; }

.card { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 15px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card h4 { margin: 0 0 6px; font: 400 1.3rem/1.1 var(--display); letter-spacing: 1px; text-transform: uppercase; }
.card p { margin: 0 0 12px; color: var(--mut); font-size: .92rem; }
.card p b { color: var(--text); }
.card ol { margin: 0 0 4px; padding-left: 20px; color: var(--mut); font-size: .92rem; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { min-height: 46px; border-radius: 12px; padding: 10px 16px; font-weight: 800; border: 2px solid var(--line); background: var(--card); box-shadow: 2px 2px 0 var(--line); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn.primary { background: var(--lime); color: var(--ink); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.btn.danger { color: var(--red); }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .88rem; }
.row-set { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-set select { width: auto; min-width: 110px; }
.note { font-size: .78rem; color: var(--mut); margin: 6px 2px 0; }
.note a { color: inherit; }

.fab { position: fixed; right: max(18px, calc(50vw - 302px)); bottom: calc(var(--tab-h) + var(--safe-b) + 16px); width: 62px; height: 62px; border-radius: 20px;
  border: 3px solid var(--ink); background: var(--lime); box-shadow: 3px 3px 0 var(--ink); z-index: 11; display: grid; place-items: center; padding: 0; }
.fab svg { width: 30px; height: 30px; stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; fill: none; }
.fab:active { transform: translate(3px, 3px); box-shadow: none; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b); background: var(--ink); border-top: 3px solid var(--ink); }
.tabs button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font: 700 0.66rem/1 var(--mono); letter-spacing: 1.2px; text-transform: uppercase; color: rgba(243, 239, 230, .6); }
.tabs svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabs button[aria-current='page'] { color: var(--lime); }

dialog { border: 3px solid var(--ink); border-radius: 22px; padding: 0; width: min(520px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); background: var(--card); color: var(--text); box-shadow: 5px 5px 0 var(--lime); }
dialog::backdrop { background: rgba(13, 12, 10, .6); }
form { padding: 16px 18px 18px; display: grid; gap: 12px; }
.dhead { display: flex; align-items: center; justify-content: space-between; }
.dhead h2 { margin: 0; font: 400 1.6rem/1 var(--display); letter-spacing: 1px; }
.x { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: transparent; font-size: 1rem; }
label { display: grid; gap: 5px; font: 700 0.68rem/1.2 var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--mut); }
input, select { font: 600 1rem/1.2 var(--body); letter-spacing: 0; text-transform: none; color: var(--text); background: var(--bg); border: 2px solid var(--line); border-radius: 12px;
  padding: 11px 12px; width: 100%; min-width: 0; min-height: 48px; }
input[aria-invalid='true'] { border-color: var(--red); }
label.chk { display: flex; align-items: center; gap: 10px; font: 600 .95rem/1.3 var(--body); letter-spacing: 0; text-transform: none; color: var(--text); }
label.chk small { color: var(--mut); font-weight: 500; }
label.chk input { width: 24px; height: 24px; min-height: 0; accent-color: var(--lime-deep); flex: none; }
.err { margin: -6px 2px 0; color: var(--red); font-weight: 700; font-size: .85rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 340px) { .row2 { grid-template-columns: 1fr; } }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.grow { flex: 1; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + var(--safe-b) + 92px); background: var(--ink); color: #F3EFE6; border: 2px solid var(--lime);
  padding: 8px 8px 8px 16px; border-radius: 14px; font-weight: 700; font-size: .92rem; z-index: 20; display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100vw - 32px); box-shadow: 3px 3px 0 #000; min-height: 48px; }
.toast button { background: var(--lime); color: var(--ink); border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 800; min-height: 36px; }

/* small phones (320–359 px): the header keeps the title and a dot-only sync button */
@media (max-width: 359px) {
  .eyebrow, #syncTxt { display: none; }
  .sync { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .sync .dot { width: 12px; height: 12px; }
  .top h1 { font-size: 1.7rem; }
  .logo { width: 34px; height: 34px; }
}
@media (max-width: 360px) { .item { gap: 9px; padding: 11px 10px; } .item .amt { font-size: 1.05rem; } .tick { width: 42px; height: 42px; } }

/* ── v3 sections ── */
.neg { color: var(--red); } .pos { color: var(--lime-deep); }
@media (prefers-color-scheme: dark) { .pos { color: var(--lime); } }
.hero .neg, .hcard .neg { color: #FF7A70; }
.hero.overb { box-shadow: 4px 4px 0 var(--red); }
.hero.overb .v { color: #FF7A70; }
.hero .bar { margin-top: 12px; background: rgba(243, 239, 230, .18); border-color: transparent; }

/* section switcher (Upcoming / Paydays / All) */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; margin: 0 0 14px; background: var(--card); border: 2px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.seg button { min-height: 40px; border: 0; border-radius: 10px; background: transparent; font: 700 .72rem/1.1 var(--mono); letter-spacing: 1px; text-transform: uppercase; color: var(--mut); padding: 4px 6px; }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--lime); }
.seg.mini { margin: 0; box-shadow: none; padding: 3px; }
.seg.mini button { min-height: 34px; padding: 4px 10px; }
@media (prefers-color-scheme: dark) { .seg button[aria-pressed='true'] { background: var(--lime); color: var(--ink); } }

/* month switcher */
.mnav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px 0 12px; }
.mnav b { font: 400 1.25rem/1 var(--display); letter-spacing: 1px; text-transform: uppercase; }
.mnav .btn { min-width: 46px; font-size: 1.2rem; line-height: 1; }

/* progress bars */
.bar { height: 12px; border-radius: 999px; background: var(--soft); border: 1.5px solid var(--line); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; width: 0; background: var(--lime); border-radius: 999px; transition: width .4s ease; }
.bar.over i { background: var(--red); }

/* home cards */
.hgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.hcard { text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 13px; box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hcard:active { transform: translate(2px, 2px); box-shadow: none; }
.hcard .k { font: 700 .62rem/1.2 var(--mono); letter-spacing: 1.6px; color: var(--mut); }
.hcard .v { font: 400 1.6rem/1.05 var(--display); letter-spacing: .5px; overflow-wrap: anywhere; }
.hcard .s { font-size: .78rem; color: var(--mut); line-height: 1.3; }
@media (max-width: 340px) { .hgrid { grid-template-columns: 1fr; } }
.qa { margin-top: 14px; }
.qa .btn { flex: 1; }

/* paydays */
.period { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 13px 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.period.short { box-shadow: 3px 3px 0 var(--red); border-color: var(--red); }
.phead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.phead .k { font: 700 .64rem/1.2 var(--mono); letter-spacing: 1.6px; color: var(--mut); }
.phead .pd { font: 400 1.35rem/1.1 var(--display); letter-spacing: .5px; text-transform: uppercase; margin-top: 2px; }
.pin { font: 400 1.35rem/1 var(--display); color: var(--lime-deep); white-space: nowrap; }
@media (prefers-color-scheme: dark) { .pin { color: var(--lime); } }
.period ul { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1.5px solid var(--soft); }
.period li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1.5px solid var(--soft); font-weight: 700; }
.period li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.period li small { color: var(--mut); font-weight: 500; margin-left: 4px; }
.period .none { color: var(--mut); margin: 10px 0 0; font-size: .9rem; }
.pfoot { display: flex; justify-content: space-between; margin-top: 10px; font-weight: 800; }

/* spending */
.tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 2px; }
.tools select { flex: 1 1 140px; width: auto; min-height: 40px; padding: 6px 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.brow { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1.5px solid var(--soft); padding: 12px 14px; }
.brow:last-child { border-bottom: 0; }
.bt { display: flex; justify-content: space-between; gap: 10px; }
.bt b { font-weight: 800; } .bt span { font-weight: 700; font-size: .88rem; white-space: nowrap; }
.bs { font-size: .78rem; color: var(--mut); margin-top: 4px; }

/* goals */
.goal { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.gtop { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.ring { width: 64px; height: 64px; flex: none; }
.ring .rbg { fill: none; stroke: var(--soft); stroke-width: 8; }
.ring .rfg { fill: none; stroke: var(--lime); stroke-width: 8; stroke-linecap: round; }
.gmain { min-width: 0; }
.gmain .name { font-weight: 800; font-size: 1.05rem; }
.gv { font: 400 1.5rem/1.1 var(--display); letter-spacing: .5px; }
.gv small { font: 600 .85rem var(--body); color: var(--mut); letter-spacing: 0; }
.gmain .sub { font-size: .82rem; color: var(--mut); }
.win { background: var(--lime); color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; padding: 8px 10px; font-weight: 700; font-size: .88rem; margin: 10px 0 0 !important; }
.card .row-set + p { margin-top: 8px; }

/* the form sheet */
.sbody { display: grid; gap: 12px; }
.sbody p { margin: 0; color: var(--text); font-size: .92rem; }
.hint { font: 500 .78rem/1.3 var(--body); letter-spacing: 0; text-transform: none; color: var(--mut); }
.err:empty { display: none; }
.preview { list-style: none; margin: 0; padding: 0; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.preview li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-bottom: 1.5px solid var(--soft); font-size: .85rem; }
.preview li:last-child { border-bottom: 0; }
.preview li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
dialog { overflow-y: auto; }
.tabs button { font-size: .58rem; letter-spacing: .8px; }
.gmain { flex: 1; } .gmain .name, .gmain .sub, .phead .pd, .card p, .sbody p { overflow-wrap: anywhere; }
.hero + .card, .hero + .stats + .card { margin-top: 14px; }

/* privacy page */
.doc-page { padding-bottom: 40px; }
.doc { max-width: 680px; }
.doc h2 { font: 400 1.35rem/1.15 var(--display); letter-spacing: 1px; text-transform: uppercase; margin: 26px 0 8px; }
.doc p { margin: 0 0 12px; line-height: 1.6; }
.doc .lead { font-size: 1.08rem; font-weight: 600; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.doc a { color: inherit; text-decoration-color: var(--lime); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.doc code { font: 600 .88em var(--mono); background: var(--soft); padding: 1px 5px; border-radius: 6px; }
a.sync { text-decoration: none; }
.banner.demo { background: var(--lime); }

/* ── v4: trends chart (colours validated with the dataviz checks: light out #2a78d6 / in #5E8A10, dark #3987e5 / #6E9E14) ── */
:root { --s-out: #2a78d6; --s-in: #5E8A10; }
@media (prefers-color-scheme: dark) { :root { --s-out: #3987e5; --s-in: #6E9E14; } }
.chart h4 { margin: 0; }
.legend { display: flex; gap: 14px; font: 700 .72rem/1 var(--mono); letter-spacing: .8px; text-transform: uppercase; color: var(--mut); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.s-in, path.s-in { background: var(--s-in); fill: var(--s-in); }
.sw.s-out, path.s-out { background: var(--s-out); fill: var(--s-out); }
.tchart { width: 100%; height: auto; display: block; margin-top: 10px; overflow: visible; }
.tchart .axis { stroke: var(--soft); stroke-width: 2; }
.tchart .hit { fill: transparent; }
.tg { cursor: pointer; outline: none; }
.tg.sel .hit, .tg:focus-visible .hit { fill: var(--soft); }
.tg:hover .hit { fill: color-mix(in srgb, var(--soft) 60%, transparent); }
.tchart .ax { font: 600 11px var(--mono); fill: var(--mut); text-anchor: middle; text-transform: uppercase; }
.tchart .ax.b { fill: var(--text); font-weight: 800; }
.readout { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-top: 8px; font-weight: 700; font-size: .92rem; }
.readout b { font: 400 1.15rem/1 var(--display); letter-spacing: .5px; text-transform: uppercase; }
details { margin-top: 8px; font-size: .88rem; }
summary { cursor: pointer; font-weight: 700; color: var(--mut); min-height: 32px; display: flex; align-items: center; }
.ttable { width: 100%; border-collapse: collapse; margin-top: 6px; }
.ttable th, .ttable td { text-align: right; padding: 6px 4px; border-bottom: 1.5px solid var(--soft); }
.ttable th:first-child, .ttable td:first-child { text-align: left; }
.brow.static { cursor: default; }

/* leftover */
.card.lo { border-color: var(--line); box-shadow: 3px 3px 0 var(--lime-deep); }
.hcard.nudge { width: 100%; margin-top: 12px; background: var(--lime); color: var(--ink); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.hcard.nudge .k, .hcard.nudge .s { color: var(--ink); }

/* setup wizard rows */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 12px; font-weight: 700; font-size: .85rem; min-height: 38px; }
.wrows { display: grid; gap: 8px; }
.wrow { display: grid; grid-template-columns: 1.6fr 1fr .8fr 40px; gap: 6px; align-items: center; }
.wrow:has(.w-apr) { grid-template-columns: 1.4fr 1fr .8fr .8fr 40px; }
.wrow input { min-height: 44px; padding: 8px 9px; font-size: .95rem; }
.wrow .x { width: 40px; height: 44px; }
@media (max-width: 360px) { .wrow, .wrow:has(.w-apr) { grid-template-columns: 1fr 1fr 40px; } .wrow .w-name { grid-column: 1 / -1; } }
.readout b { flex-basis: 100%; }
.readout .mut { color: var(--mut); font-weight: 600; }

/* ── v5: the guided walkthrough (tour.js): the app dims, one real control is ringed in lime, a sticker card explains it ── */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.btn.link { background: none; border-color: transparent; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; color: var(--mut); }
.tour { position: fixed; inset: 0; z-index: 60; }
.tour-dim { position: fixed; inset: 0; width: 100%; height: 100%; fill: rgba(13, 12, 10, .66); }
.tour-hole { position: fixed; border-radius: 18px; outline: 3px solid var(--lime); pointer-events: none; }
.tour-card { position: fixed; width: min(360px, calc(100vw - 24px)); overflow-y: auto; background: var(--card); color: var(--text); border: 3px solid var(--ink);
  border-radius: 20px; box-shadow: 5px 5px 0 var(--lime); padding: 12px 16px 16px; animation: tourIn .2s ease; }
.tour-card.mid { left: 50%; top: 50%; transform: translate(-50%, -50%); }
@keyframes tourIn { from { opacity: 0; } to { opacity: 1; } }
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-count { font: 700 .7rem/1 var(--mono); letter-spacing: 2px; text-transform: uppercase; color: var(--mut); }
.tour-x { border: 0; background: none; color: var(--mut); text-decoration: underline; text-underline-offset: 3px; min-height: 40px; padding: 0 2px; font-size: .85rem; }
.tour-card h2 { font: 400 1.7rem/1.05 var(--display); letter-spacing: .5px; margin: 4px 0 6px; overflow-wrap: anywhere; }
.tour-card p { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.tour-dots { display: flex; gap: 5px; margin: 14px 0 0; }
.tour-dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--soft); }
.tour-dots i.on { width: 20px; background: var(--lime-deep); }
.tour-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
@media (prefers-color-scheme: dark) { .tour-card { border-color: var(--lime); box-shadow: 5px 5px 0 #000; } .tour-dots i.on { background: var(--lime); } }
@media (forced-colors: active) { .tour-hole { outline-color: Highlight; } .tour-card { border-color: CanvasText; } }
@media (max-height: 460px) { /* phones on their side: a compact card that fits above the tab bar */
  .tour-card { padding: 8px 14px 12px; } .tour-card h2 { font-size: 1.3rem; margin: 0 0 4px; } .tour-card p { font-size: .9rem; line-height: 1.4; }
  .tour-dots { display: none; } .tour-btns { margin-top: 8px; } .tour-btns .btn { min-height: 40px; padding: 6px 14px; } .tour-x { min-height: 34px; } }

/* ── v6: Money Pro (locked screens, the Pro card, the unlock sheets) ── */
.lock { text-align: center; padding: 26px 8px 8px; }
.lock .big { font: 400 2rem/1.05 var(--display); letter-spacing: 1px; margin: 10px 0 14px; }
.lock .btns { justify-content: center; margin-top: 16px; }
.lock .note { margin-top: 14px; }
.pill.pro { background: var(--ink); color: var(--lime); border: 2px solid var(--ink); font: 800 .78rem/1 var(--mono); letter-spacing: 2px; padding: 6px 10px; border-radius: 8px; }
@media (prefers-color-scheme: dark) { .pill.pro { border-color: var(--lime); } }
.ticks { list-style: none; padding: 0; margin: 0 auto; max-width: 34ch; text-align: left; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 28px; line-height: 1.4; }
.ticks li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 6px; background: var(--lime); color: var(--ink); font-weight: 900; font-size: .8rem; display: grid; place-items: center; }
.sbody .ticks { max-width: none; margin: 10px 0; }
.hcard.procard { background: var(--ink); color: #F3EFE6; border-color: var(--ink); grid-column: 1 / -1; }
.hcard.procard .k { color: var(--lime); } .hcard.procard .s { color: rgba(243, 239, 230, .8); }
@media (prefers-color-scheme: dark) { .hcard.procard { border-color: var(--lime); } }
.card.procard { border-color: var(--lime); box-shadow: 3px 3px 0 var(--lime); }
.btns.col { flex-direction: column; } .btns.col .btn { width: 100%; text-align: left; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; }
a.btn.primary { color: var(--ink); }

/* ── v7: app lock ── */
body.is-locked > :not(.lockscreen):not(script) { display: none !important; }
body.veil #view, body.veil #banner { visibility: hidden; }
.lockscreen { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px 20px; background: var(--ink); color: #F3EFE6; text-align: center; }
.lockscreen .logo { width: 64px; height: 64px; color: var(--lime); }
.lockscreen h2 { font: 400 1.9rem/1.05 var(--display); letter-spacing: 1px; margin: 6px 0 10px; }
.lockscreen form { display: grid; gap: 10px; width: min(320px, calc(100vw - 40px)); }
.lockscreen label { display: grid; gap: 6px; text-align: left; font: 700 .72rem/1 var(--mono); letter-spacing: 2px; color: rgba(243, 239, 230, .75); }
.lockscreen input { font: 600 1.6rem/1 var(--body); letter-spacing: .3em; text-align: center; padding: 12px; border-radius: 14px; border: 3px solid var(--lime); background: #26262B; color: #F3EFE6; }
.lockscreen .err { min-height: 1.4em; margin: 0; color: #FF8A80; font-weight: 600; }
.lockscreen .btn.link { color: rgba(243, 239, 230, .75); }
.btn.link.danger { color: var(--red); }

/* ── BWN Quit additions ── */
.help { gap: 6px; } .help svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.fab.crave { width: auto; height: 58px; padding: 0 18px 0 14px; display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; font: 400 1.15rem/1 var(--display); letter-spacing: 1.2px; color: var(--ink); }
.fab.crave svg { width: 26px; height: 26px; stroke-width: 2.6; }
.center { text-align: center; }
.hero .v small, .hcard .v small, .stat .v small { font-size: .5em; letter-spacing: .5px; opacity: .75; }
.hero .v.small { font-size: clamp(2rem, 11vw, 2.8rem); }
.hero .btns { margin-top: 14px; }
.hero.bad { box-shadow: 4px 4px 0 var(--yellow); }
.hero.bad .v { color: var(--yellow); }
.hcard .v.small { font-size: 1.25rem; line-height: 1.15; }
.hgrid > :nth-child(odd):last-child { grid-column: 1 / -1; }
.cravecard { margin-top: 14px; border-color: var(--ink); box-shadow: 3px 3px 0 var(--lime-deep); }
@media (prefers-color-scheme: dark) { .cravecard { border-color: var(--lime); box-shadow: 3px 3px 0 var(--lime); } }
.btn.big { min-height: 56px; font-size: 1.05rem; flex: 1; }
.btn.ghost { box-shadow: none; display: inline-flex; align-items: center; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; }
a.btn.primary { color: var(--ink); }
.btns.col a.btn { justify-content: flex-start; }
.quote { font: 600 1.05rem/1.4 var(--body); color: var(--text) !important; }
.card.why { border-left: 6px solid var(--lime); }
.card.next { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.card.next .k { font: 700 .64rem/1.2 var(--mono); letter-spacing: 1.6px; color: var(--mut); }
.card.next .v { font: 400 1.5rem/1.1 var(--display); letter-spacing: .5px; }
.card.next .s { font-size: .85rem; color: var(--mut); }
.card.next:active, .hcard:active { transform: translate(2px, 2px); box-shadow: none; }
.card .row-set h4 { margin: 0; }
.card .row-set { margin-bottom: 8px; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.steps li { padding-left: 4px; }
.swaps { display: grid; gap: 8px; }
.swaps div { display: grid; gap: 2px; padding: 9px 11px; border-radius: 12px; background: var(--bg); border: 1.5px solid var(--soft); min-width: 0; }
.swaps b { font-weight: 800; overflow-wrap: anywhere; } .swaps span { color: var(--mut); font-size: .9rem; overflow-wrap: anywhere; }
.card .ticks { max-width: none; margin: 4px 0 0; }
.card .ticks li, .steps li { overflow-wrap: anywhere; }

/* health timeline */
.timeline { list-style: none; margin: 4px 0 14px; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 8px; bottom: 8px; width: 3px; background: var(--soft); border-radius: 3px; }
.timeline li { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 8px 0; }
.timeline .dot { width: 22px; height: 22px; margin: 2px 0 0 3px; border-radius: 50%; border: 3px solid var(--line); background: var(--card); z-index: 1; }
.timeline li.done .dot { background: var(--lime); border-color: var(--ink); }
.timeline li.next .dot { background: var(--yellow); border-color: var(--ink); }
.timeline .when { font: 400 1.15rem/1.15 var(--display); letter-spacing: .5px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.timeline p { margin: 3px 0 2px; font-size: .92rem; overflow-wrap: anywhere; }
.timeline small { color: var(--mut); font-size: .74rem; }
.timeline li.done p { color: var(--mut); }
.src { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .88rem; }
.src a { color: inherit; font-weight: 700; overflow-wrap: anywhere; }
.src small { color: var(--mut); }

/* chips: big one-tap choices */
fieldset.chips { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
fieldset.chips legend { width: 100%; padding: 0; margin-bottom: 6px; font: 700 0.68rem/1.2 var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--mut); }
fieldset.chips label { display: block; position: relative; font: 700 .9rem/1 var(--body); letter-spacing: 0; text-transform: none; color: var(--text); }
fieldset.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
fieldset.chips span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 13px; border-radius: 999px; border: 2px solid var(--line); background: var(--bg); cursor: pointer; }
fieldset.chips input:checked + span { background: var(--lime); color: var(--ink); border-color: var(--ink); }
fieldset.chips input:focus-visible + span { outline: 3px solid var(--lime); outline-offset: 2px; }
textarea { font: 500 1rem/1.35 var(--body); letter-spacing: 0; text-transform: none; color: var(--text); background: var(--bg); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; resize: vertical; min-height: 56px; }
.prows { display: grid; gap: 8px; }
.prow { display: grid; grid-template-columns: 1fr 44px; gap: 6px; align-items: center; }
.prow.pair { grid-template-columns: 1fr 1fr 44px; }
@media (max-width: 380px) { .prow.pair { grid-template-columns: 1fr 44px; } .prow.pair input:nth-child(2) { grid-column: 1; } .prow.pair .x { grid-row: 1 / span 2; grid-column: 2; } }
.prow input { min-width: 0; }

/* the craving timer */
dialog.timer { width: min(480px, calc(100vw - 16px)); }
.tbox { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100dvh - 26px); }
#timerActions { flex: none; }
#timerActions .btn.primary { justify-content: center; text-align: center; min-height: 54px; font-size: 1.05rem; }
#timerActions .btn.link { text-align: center; min-height: 40px; }
#timerBody { overflow-y: auto; min-height: 0; flex: 1 1 auto; border-top: 1.5px solid var(--soft); border-bottom: 1.5px solid var(--soft); padding: 10px 0; }
.breath { --s: min(44vw, 170px); position: relative; flex: none; width: var(--s); height: var(--s); margin: 4px auto 0; display: grid; place-items: center; }
.breath .bring { position: absolute; inset: 0; border-radius: 50%; border: 3px dashed var(--soft); }
.breath .core { width: 46%; height: 46%; border-radius: 50%; background: var(--lime); border: 3px solid var(--ink); animation: breathe 10s ease-in-out infinite; }
@keyframes breathe { 0% { transform: scale(1); } 40% { transform: scale(2); } 100% { transform: scale(1); } }
dialog.timer.ended .core { animation: none; transform: scale(1.6); }
.btxt { margin: 0; text-align: center; font: 700 .8rem/1 var(--mono); letter-spacing: 2px; text-transform: uppercase; color: var(--mut); }
.clock { margin: 0; text-align: center; font: 400 3.4rem/1 var(--display); letter-spacing: 2px; font-variant-numeric: tabular-nums; }
#timerBody { display: grid; gap: 8px; align-content: start; } #timerBody p { margin: 0; } #timerBody .ticks { max-width: none; font-size: .92rem; }
#timerBody .why { font-weight: 700; color: var(--text); }
@media (prefers-reduced-motion: reduce) { .breath .core { transform: scale(1.5); } }
@media (max-height: 700px) { .breath { --s: 110px; } .clock { font-size: 2.6rem; } .tbox { gap: 7px; } }

/* trends: bars and week columns (one series each, one hue) */
.bars ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bars .bl { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; font-size: .92rem; }
.bars .bl span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .bl b { flex: none; font-family: var(--mono); font-size: .8rem; }
.bars small { display: block; margin-top: 4px; color: var(--mut); font-size: .78rem; overflow-wrap: anywhere; }
.bars .bar i, .cols i { background: var(--lime-deep); }
@media (prefers-color-scheme: dark) { .bars .bar i, .cols i { background: var(--lime); } }
.cols { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; height: 150px; align-items: end; }
.cols .col { height: 100%; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 4px; min-width: 0; }
.cols .col b { font: 700 .72rem/1 var(--mono); }
.cols .col i { align-self: end; width: 100%; max-width: 30px; border-radius: 6px 6px 2px 2px; display: block; }
.cols .col span { font: 600 .6rem/1.1 var(--mono); color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.card .row-set .btn.small { min-height: 44px; min-width: 64px; }
