
/* Layout: sticky header with a scrolling tab rail; one working column (max 1120px) of panels; two-column grids stack under 760px */
:root{
  --bg:#f2f5f3; --surface:#ffffff; --surface-2:#e8eeeb; --ink:#16252c; --muted:#56676d; --line:#d3dcd8;
  --accent:#1b6784; --accent-ink:#ffffff; --accent-soft:#d9eaf0; --sand:#b5652c; --sand-soft:#f5e3d4;
  --good:#2b7349; --good-soft:#dcefe3; --warn:#94600e; --warn-soft:#f6ead2; --bad:#ad3636; --bad-soft:#f6dddd;
  --shadow:0 1px 2px rgb(22 37 44 / .06), 0 8px 24px rgb(22 37 44 / .06);
  --f-display:'Bricolage Grotesque','Segoe UI',system-ui,sans-serif;
  --f-body:'Source Sans 3','Segoe UI',system-ui,sans-serif;
  --f-mono:'JetBrains Mono',ui-monospace,Consolas,monospace;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#0e161a; --surface:#152127; --surface-2:#1c2c33; --ink:#e3ebe8; --muted:#93a5a9; --line:#283a41;
  --accent:#5eb3d2; --accent-ink:#08191f; --accent-soft:#17343f; --sand:#e39a63; --sand-soft:#3a2617;
  --good:#6dc28f; --good-soft:#173326; --warn:#e2b25c; --warn-soft:#382a12; --bad:#ee8080; --bad-soft:#3b1b1b;
  --shadow:0 1px 2px rgb(0 0 0 / .3); color-scheme:dark }}
:root[data-theme="dark"]{
  --bg:#0e161a; --surface:#152127; --surface-2:#1c2c33; --ink:#e3ebe8; --muted:#93a5a9; --line:#283a41;
  --accent:#5eb3d2; --accent-ink:#08191f; --accent-soft:#17343f; --sand:#e39a63; --sand-soft:#3a2617;
  --good:#6dc28f; --good-soft:#173326; --warn:#e2b25c; --warn-soft:#382a12; --bad:#ee8080; --bad-soft:#3b1b1b;
  --shadow:0 1px 2px rgb(0 0 0 / .3); color-scheme:dark }
*{box-sizing:border-box}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:16px;line-height:1.5}
h1,h2,h3{font-family:var(--f-display);font-weight:700;margin:0;text-wrap:balance;letter-spacing:-.01em}
h1{font-size:clamp(1.6rem,3.5vw,2.1rem);line-height:1.15}
h2{font-size:1.25rem}
h3{font-size:1.02rem;font-weight:500}
p{margin:0}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.num{font-variant-numeric:tabular-nums}
.muted{color:var(--muted)}
.small{font-size:.875rem}
.eyebrow{font-size:.74rem;letter-spacing:.09em;text-transform:uppercase;color:var(--muted);font-weight:600}

.demo-unused{background:var(--ink);color:var(--bg);font-size:.85rem;padding:6px 16px;display:flex;gap:12px;align-items:center;justify-content:center;flex-wrap:wrap}
.demo button{background:transparent;border:1px solid currentColor;color:inherit;border-radius:999px;padding:1px 10px;cursor:pointer;font-size:.8rem}
header.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:20;background:var(--surface);border-bottom:1px solid var(--line)}
.top-in{max-width:1120px;margin:0 auto;padding:12px 16px 0;display:flex;flex-direction:column;gap:10px}
.top-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.brand{display:flex;align-items:center;gap:10px;font-family:var(--f-display);font-weight:700;font-size:1.1rem}
.brand svg{flex:none}
.who{display:flex;align-items:center;gap:10px;font-size:.9rem}
.tabs{display:flex;gap:2px;overflow-x:auto;scrollbar-width:none;margin:0 -4px}
.tabs::-webkit-scrollbar{display:none}
.tab{background:none;border:0;padding:8px 12px 10px;border-bottom:2px solid transparent;color:var(--muted);cursor:pointer;white-space:nowrap;font-weight:600;font-size:.94rem;display:flex;gap:6px;align-items:center}
.tab:hover{color:var(--ink)}
.tab[aria-current="page"]{color:var(--ink);border-bottom-color:var(--accent)}
.badge{background:var(--sand);color:var(--surface);border-radius:999px;font-size:.72rem;padding:0 7px;line-height:1.5}

main{max-width:1120px;margin:0 auto;padding:28px 16px 64px;display:flex;flex-direction:column;gap:20px}
.head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap}
.head .sub{color:var(--muted);margin-top:4px}
.grid2{display:grid;grid-template-columns:1.25fr 1fr;gap:20px}
.grid2.even{grid-template-columns:1fr 1fr}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
@media (max-width:760px){.grid2,.grid2.even{grid-template-columns:1fr}.grid3{grid-template-columns:1fr}.grid4{grid-template-columns:1fr 1fr}}
.grid2>*,.grid3>*,.grid4>*{min-width:0}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:20px;display:flex;flex-direction:column;gap:14px;min-width:0}
.panel-h{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.stat{display:flex;flex-direction:column;gap:2px;padding:14px 16px;background:var(--surface);border:1px solid var(--line);border-radius:10px}
.stat b{font-family:var(--f-display);font-size:1.5rem;font-weight:700;font-variant-numeric:tabular-nums}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:8px 14px;cursor:pointer;font-weight:600;font-size:.94rem;white-space:nowrap}
.btn:hover{border-color:var(--muted)}
.btn.primary{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.btn.primary:hover{filter:brightness(1.07)}
.btn.big{padding:12px 20px;font-size:1rem}
.btn.link{border:0;background:none;padding:0;color:var(--accent)}
.btn:disabled{opacity:.5;cursor:not-allowed}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}

.pill{display:inline-flex;align-items:center;gap:5px;font-size:.8rem;font-weight:600;padding:1px 9px;border-radius:999px;white-space:nowrap}
.pill::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.p-good{background:var(--good-soft);color:var(--good)}
.p-warn{background:var(--warn-soft);color:var(--warn)}
.p-bad{background:var(--bad-soft);color:var(--bad)}
.p-info{background:var(--accent-soft);color:var(--accent)}
.p-mute{background:var(--surface-2);color:var(--muted)}

.tw{overflow-x:auto;margin:0 -4px}
table.t{width:100%;border-collapse:collapse;font-size:.92rem;font-variant-numeric:tabular-nums}
.t th{text-align:left;font-size:.74rem;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);font-weight:600;padding:8px;border-bottom:1px solid var(--line);white-space:nowrap}
.t td{padding:10px 8px;border-bottom:1px solid var(--line);vertical-align:middle}
.t tr:last-child td{border-bottom:0}
.t .r{text-align:right}
.t tbody tr.click{cursor:pointer}
.t tbody tr.click:hover td{background:var(--surface-2)}

.balance{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.balance .amt{font-family:var(--f-display);font-size:clamp(2.4rem,6vw,3.2rem);font-weight:700;line-height:1;font-variant-numeric:tabular-nums}
.balance .muted{color:inherit;opacity:.8}
.balance .btn{background:var(--accent-ink);color:var(--accent);border-color:var(--accent-ink)}

.odo{display:inline-flex;gap:3px;font-family:var(--f-mono);font-weight:700;font-size:1.35rem}
.odo span{background:var(--ink);color:var(--surface);border-radius:4px;padding:2px 6px;min-width:1.35em;text-align:center}
.odo span.sweep{background:var(--sand);color:var(--surface)}
.odo-l{display:flex;flex-direction:column;gap:6px}

.ann{border-left:3px solid var(--sand);padding:2px 0 2px 12px;display:flex;flex-direction:column;gap:2px}
.note{background:var(--sand-soft);border-radius:8px;padding:10px 12px;font-size:.94rem}
.callout{background:var(--accent-soft);border-radius:8px;padding:12px 14px;display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap}

.field{display:flex;flex-direction:column;gap:4px;min-width:0}
.field label{font-size:.85rem;font-weight:600}
.field input,.field select,.field textarea{border:1px solid var(--line);background:var(--bg);border-radius:8px;padding:9px 11px;width:100%}
.field textarea{min-height:96px;resize:vertical}
.fgrid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:600px){.fgrid{grid-template-columns:1fr}}
.switch{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:10px 0;border-bottom:1px solid var(--line)}
.switch:last-child{border-bottom:0}
.switch input{width:42px;height:24px;appearance:none;background:var(--line);border-radius:999px;position:relative;cursor:pointer;flex:none;transition:background .15s}
.switch input::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:var(--surface);transition:transform .15s}
.switch input:checked{background:var(--accent)}
.switch input:checked::after{transform:translateX(18px)}

.seg{display:inline-flex;background:var(--surface-2);border-radius:8px;padding:3px;gap:2px;flex-wrap:wrap}
.seg button{border:0;background:none;padding:5px 12px;border-radius:6px;cursor:pointer;font-weight:600;font-size:.88rem;color:var(--muted)}
.seg button[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:var(--shadow)}

.prog{display:flex;height:14px;border-radius:999px;overflow:hidden;background:var(--surface-2)}
.prog i{display:block;height:100%}
.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:.85rem;color:var(--muted)}
.legend span{display:inline-flex;align-items:center;gap:6px}
.legend i{width:10px;height:10px;border-radius:2px;display:inline-block}

.list{display:flex;flex-direction:column}
.li{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid var(--line)}
.li:last-child{border-bottom:0}
.li>div{min-width:0}

.msg{border:1px solid var(--line);border-radius:8px;padding:12px 14px;display:flex;flex-direction:column;gap:6px}
.reply{background:var(--surface-2);border-radius:8px;padding:10px 12px;font-size:.94rem}

.login{max-width:980px;margin:0 auto;padding:48px 16px 64px;display:grid;grid-template-columns:1.1fr 1fr;gap:28px;align-items:start}
@media (max-width:820px){.login{grid-template-columns:1fr;padding-top:28px}}
.hero h1{font-size:clamp(2rem,5vw,2.9rem)}
.hero p{color:var(--muted);max-width:44ch;margin-top:12px;font-size:1.08rem}
.facts{display:flex;flex-direction:column;gap:12px;margin-top:24px}
.fact{display:flex;gap:12px;align-items:flex-start}
.fact svg{flex:none;margin-top:3px;color:var(--accent)}

.scrim{position:fixed;inset:0;background:rgb(10 20 24 / .5);display:flex;align-items:center;justify-content:center;padding:16px;z-index:50}
.modal{background:var(--surface);border-radius:12px;width:min(560px,100%);max-height:90vh;overflow:auto;padding:22px;display:flex;flex-direction:column;gap:16px;box-shadow:0 20px 60px rgb(0 0 0 / .3)}
.modal.wide{width:min(820px,100%)}
.opt{display:flex;gap:12px;align-items:flex-start;border:1px solid var(--line);border-radius:8px;padding:12px;cursor:pointer}
.opt:has(input:checked){border-color:var(--accent);background:var(--accent-soft)}
.opt input{margin-top:4px;accent-color:var(--accent)}
.toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);background:var(--ink);color:var(--bg);padding:10px 18px;border-radius:8px;z-index:60;font-weight:600;max-width:calc(100% - 32px);box-shadow:var(--shadow)}
svg.chart text{fill:var(--muted);font-family:var(--f-body);font-size:11px}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}

.wrap-center{max-width:520px;margin:0 auto;padding:48px 16px;display:flex;flex-direction:column;gap:16px}
.err{color:var(--bad);font-size:.9rem;min-height:1.2em}
.flag{font-size:.82rem;color:var(--warn)}
.flag.bad{color:var(--bad)}
.spinner{width:22px;height:22px;border:3px solid var(--line);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.loading{display:flex;align-items:center;gap:10px;color:var(--muted);padding:40px 0;justify-content:center}
.logo-ph{width:34px;height:34px;border-radius:8px;border:2px dashed var(--line);display:grid;place-items:center;font-size:.6rem;color:var(--muted);font-weight:700;letter-spacing:.04em}
.kv{display:grid;grid-template-columns:auto 1fr;gap:4px 14px;font-size:.94rem}
.kv dt{color:var(--muted)} .kv dd{margin:0}
.confirm{border:1px solid var(--warn);background:var(--warn-soft);border-radius:8px;padding:12px 14px;display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:space-between}
.chips{display:flex;gap:6px;flex-wrap:wrap}
.chk{display:inline-flex;gap:6px;align-items:center;font-size:.9rem}
.chk input{accent-color:var(--accent)}
/* A printed bill is one letter-size page that tri-folds into a #10 window envelope.
   Everything is measured in inches from the edge of the paper so it lines up with the window. */
.statement{position:relative;width:8.5in;height:11in;margin:0 auto 24px;background:#fff;color:#111;border:1px solid var(--line);border-radius:4px;overflow:hidden;box-sizing:border-box;font-size:.92rem}
.st-head{position:absolute;left:.55in;top:.5in;display:flex;flex-direction:column;gap:2px}
.st-sum{position:absolute;right:.55in;top:.5in;width:2.4in;text-align:right;display:flex;flex-direction:column;gap:1px}
.st-due{font-size:1.35rem;font-weight:700}
.st-addr{position:absolute;width:3.1in;font-size:11pt;line-height:1.2;overflow:hidden}
.st-fold{position:absolute;left:0;width:.3in;border-top:1px solid #bbb}
.st-fold::after{content:'';position:absolute;left:8.2in;width:.3in;border-top:1px solid #bbb}
.st-body{position:absolute;left:.55in;right:.55in;bottom:.45in;display:flex;flex-direction:column;gap:8px;overflow:hidden}
.st-body p{margin:0}
.st-body .t td,.st-body .t th{padding-top:4px;padding-bottom:4px}
.memo{flex:1 1 0;min-height:0;display:flex;flex-direction:column;gap:8px;border-top:1px dashed #bbb;padding-top:8px;overflow:hidden}
.memo-text{white-space:pre-wrap;font-size:.95rem;flex:0 0 auto}
.memo img{flex:1 1 0;min-height:0;width:100%;object-fit:contain;object-position:top center}
.memo-edit{border:1px solid var(--line);border-radius:8px;padding:10px 14px}
.memo-edit[open]{display:flex;flex-direction:column;gap:10px}
@page{size:letter;margin:0}
@media print{
  header.top,.demo,.noprint{display:none!important}
  body{background:#fff;color:#000}
  main{padding:0;max-width:none;margin:0}
  .statement{margin:0;border:0;border-radius:0;height:10.98in;page-break-after:always;break-after:page}
  .statement:last-child{page-break-after:auto;break-after:auto}
}

.modal > *{flex-shrink:0}
@media (max-width:600px){.who .muted{display:none}}
.btn.danger{color:var(--bad);border-color:var(--bad)}
.btn.danger.armed{background:var(--bad);color:#fff}
.btn.mini{padding:3px 10px;font-size:.82rem}
.actions{display:flex;flex-wrap:wrap;gap:12px;padding-top:6px;border-top:1px solid var(--line)}
.actions .btn{flex:1 1 220px}
.pay-group{display:flex;flex-direction:column;gap:8px}
.pay-h{font-weight:600;font-size:.9rem}
.pay-amt{margin-top:8px;width:160px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;font:inherit;background:var(--surface);color:inherit}
