/* pwa-kit design system. Colors are overridden in each app.css (same structure as BuildOS v3)
   Deep blue primary, marigold for the current turn, soft surfaces, matching dark theme, big touch targets, tabular numbers.
   Theme: auto (follows the phone) or forced with <html data-theme>. */
:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --card-2: #f4f6f9;
  --ink: #17212b;
  --ink-2: #374451;
  --muted: #5b6875;
  --line: #dfe5ea;
  --primary: #1b4f7c;
  --primary-2: #2768a0;
  --primary-ink: #ffffff;
  --primary-soft: #e1edf7;
  --accent: #e2a11b;
  --accent-ink: #2b1d00;
  --accent-soft: #fcefd0;
  --good: #17713f;
  --good-soft: #def3ea;
  --bad: #d23f3a;
  --bad-soft: #fde8e7;
  --warn: #945800;
  --warn-soft: #fdf0d9;
  --shadow: 0 1px 2px rgba(20, 32, 50, .05), 0 6px 18px rgba(20, 32, 50, .05);
  --radius: 18px;
  --tabbar: 66px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10151a; --card: #181f26; --card-2: #1f2831; --ink: #e8eef3; --ink-2: #c4ced8; --muted: #92a0ad; --line: #2b3641;
    --primary: #7fbcec; --primary-2: #4c96cf; --primary-ink: #06192a; --primary-soft: #1a3145; --accent: #f0b73c; --accent-ink: #2b1d00; --accent-soft: #3a2d10;
    --good: #4cc893; --good-soft: #15302a; --bad: #ff7a70; --bad-soft: #3a1d20; --warn: #f0b552; --warn-soft: #362a14;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10151a; --card: #181f26; --card-2: #1f2831; --ink: #e8eef3; --ink-2: #c4ced8; --muted: #92a0ad; --line: #2b3641;
  --primary: #7fbcec; --primary-2: #4c96cf; --primary-ink: #06192a; --primary-soft: #1a3145; --accent: #f0b73c; --accent-ink: #2b1d00; --accent-soft: #3a2d10;
  --good: #4cc893; --good-soft: #15302a; --bad: #ff7a70; --bad-soft: #3a1d20; --warn: #f0b552; --warn-soft: #362a14;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  padding-bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { background: var(--card-2); color: var(--ink); border-color: var(--line); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
.price, .stat .n, .big-bal, .hero .amt, input[type=number] { font-variant-numeric: tabular-nums; }
svg.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }

/* ---------- header ---------- */
.top { background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 12px 16px 10px; padding-top: calc(12px + env(safe-area-inset-top)); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); }
.top .row { gap: 8px; }
.brandmark { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 35%, transparent); }
.brandmark svg.ic { width: 21px; height: 21px; vertical-align: 0; }
.brand { font-weight: 750; font-size: 16px; line-height: 1.2; letter-spacing: -.01em; }
.sub { font-size: 12.5px; color: var(--muted); }
.hbtn { border: 0; background: transparent; color: var(--ink-2); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; text-decoration: none; }
.hbtn:active { background: var(--line); }
.hbtn svg.ic { width: 22px; height: 22px; vertical-align: 0; }

main { max-width: 720px; margin: 0 auto; padding: 14px 16px 24px; }

/* ---------- tab bar ---------- */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 6; }
.tabs a { flex: 1; text-align: center; padding: 4px 0; font-size: 11.5px; color: var(--muted); text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; }
.tabs a svg.ic { width: 22px; height: 22px; vertical-align: 0; }
.tabs a.on { color: var(--primary); font-weight: 700; }
.tabs .pillbg { border-radius: 99px; padding: 3px 18px; display: grid; place-items: center; transition: background .15s; }
.tabs a.on .pillbg { background: var(--primary-soft); }
.tabs .badge { position: absolute; top: 0; left: calc(50% + 8px); min-width: 18px; height: 18px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--card); }

/* ---------- type ---------- */
h1 { font-size: 23px; margin: 2px 0 4px; letter-spacing: -.02em; }
h3 { font-size: 12.5px; margin: 24px 2px 8px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; align-items: center; }
h3 a { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 650; text-decoration: none; }
.pagehead { margin: 4px 0 14px; }
.pagehead p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.card.alert { background: var(--warn-soft); border-color: transparent; box-shadow: none; }
.card.danger-card { background: var(--bad-soft); border-color: transparent; box-shadow: none; }
.card.ok-card { background: var(--good-soft); border-color: transparent; box-shadow: none; }
.card.info { background: var(--primary-soft); border-color: transparent; box-shadow: none; }
.card.flat { box-shadow: none; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.stat .sic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 6px; background: var(--primary-soft); color: var(--primary); }
.stat .sic svg.ic { width: 18px; height: 18px; vertical-align: 0; }
.stat .sic.bad { background: var(--bad-soft); color: var(--bad); }
.stat .sic.good { background: var(--good-soft); color: var(--good); }
.stat .sic.warn { background: var(--warn-soft); color: var(--warn); }
.stat .n { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.stat .l { font-size: 13px; color: var(--muted); }
a.stat:active, .tile:active, .li:active, .hero:active { transform: scale(.99); }

/* quick actions */
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 2px; }
.tile { background: none; border: 0; padding: 4px 0; text-decoration: none; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; font-size: 12.5px; font-weight: 600; text-align: center; line-height: 1.2; }
.tile .tic { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: var(--card); color: var(--primary); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tile .tic svg.ic { width: 24px; height: 24px; vertical-align: 0; }
.tile.main .tic { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* "needs attention" rows */
.attn { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.attn:last-child { border-bottom: 0; }
.aic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.aic svg.ic { vertical-align: 0; }
.aic.bad { background: var(--bad-soft); color: var(--bad); }
.aic.warn { background: var(--warn-soft); color: var(--warn); }
.aic.good { background: var(--good-soft); color: var(--good); }
.chev { color: var(--muted); }

/* ---------- helpers ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.right { text-align: right; }
.bold { font-weight: 700; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
code { background: var(--card-2); border-radius: 6px; padding: 1px 5px; font-size: 12.5px; }

/* ---------- search + filters ---------- */
.search { position: sticky; top: 64px; z-index: 4; background: var(--bg); padding: 4px 0 8px; }
.search input { width: 100%; padding: 13px 14px 13px 42px; border-radius: 14px; border: 1px solid var(--line); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238a94a3' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center; font-size: 16px; box-shadow: var(--shadow); }
.seg { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button, .seg select { border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 99px; padding: 7px 13px; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; flex: none; }
.seg button .c { opacity: .6; font-weight: 700; margin-left: 3px; }
.seg button.on { background: var(--ink); color: var(--bg); border-color: transparent; }
.seg button.on .c { opacity: .75; }

/* ---------- lists ---------- */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; text-decoration: none; color: inherit; }
.li:last-child { border-bottom: 0; }
.li .t { font-weight: 650; }
.li .s { font-size: 13px; color: var(--muted); }
.li.voided .t, .li.voided .price { text-decoration: line-through; color: var(--muted); }
.price { font-weight: 750; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 9px; border-radius: 99px; background: var(--card-2); color: var(--ink-2); font-weight: 650; border: 1px solid var(--line); text-decoration: none; white-space: nowrap; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.info { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.empty { text-align: center; color: var(--muted); padding: 30px 14px; }
.empty .eic { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.empty .eic svg.ic { width: 26px; height: 26px; vertical-align: 0; }
.empty b { color: var(--ink); display: block; margin-bottom: 2px; }

/* avatar with status ring */
.av { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 750; font-size: 14.5px; letter-spacing: .02em; color: var(--av-ink, var(--primary)); background: var(--av-bg, var(--primary-soft)); position: relative; }
.av::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--good); border: 2.5px solid var(--card); }
.av.cut::after { background: var(--bad); }
.av.late::after { background: var(--warn); }
.av.off::after { background: var(--muted); }
.av.lg { width: 64px; height: 64px; font-size: 22px; }
.av.lg::after { width: 16px; height: 16px; border-width: 3px; }

/* ledger icons */
.lic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--card-2); color: var(--ink-2); }
.lic svg.ic { width: 18px; height: 18px; vertical-align: 0; }
.lic.pay { background: var(--good-soft); color: var(--good); }

/* ---------- subscriber detail ---------- */
.profile { display: flex; gap: 14px; align-items: center; margin: 4px 0 14px; }
.profile h1 { margin: 0; font-size: 21px; }
.balcard { padding: 18px; }
.big-bal { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2); color: var(--ink-2); font-size: 12.5px; font-weight: 650; cursor: pointer; text-decoration: none; }
.act svg.ic { vertical-align: 0; }
.act.bad { color: var(--bad); }
.act.good { color: var(--good); }
.act[disabled] { opacity: .4; cursor: default; }
.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 550; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 11px 15px; font-weight: 650; cursor: pointer; text-decoration: none; color: var(--ink); min-height: 46px; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: transparent; }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: 14px; border-radius: 11px; min-height: 36px; }
.btn.big { padding: 15px 16px; font-size: 17px; min-height: 54px; border-radius: 16px; }
.btn.ghost { box-shadow: none; background: transparent; }
.btn[disabled] { opacity: .5; cursor: default; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btns .btn { flex: 1 1 auto; }
.fab { position: fixed; right: 16px; bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); z-index: 5; border-radius: 18px; padding: 14px 18px; box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 35%, transparent); }

/* ---------- forms ---------- */
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.f input, .f select, .f textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.f textarea { min-height: 76px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type=number] { -moz-appearance: textfield; }
.chk { width: 22px; height: 22px; flex: none; accent-color: var(--primary); }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 12px; }
.tplrow { font-size: 12.5px; color: var(--muted); margin: -2px 0 12px; }
.amount-in { font-size: 26px !important; font-weight: 800; text-align: center; padding: 14px !important; }

/* ---------- sheets ---------- */
.modal { position: fixed; inset: 0; background: rgba(8, 12, 20, .5); z-index: 20; display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.modal[hidden] { display: none; }
.sheet { background: var(--bg); width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; border-radius: 24px 24px 0 0; padding: 0 16px calc(18px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: .6; } }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--bg); padding: 10px 0; z-index: 1; gap: 10px; }
.sheet-head h2 { font-size: 18px; margin: 0; }
.x { border: 0; background: var(--card-2); color: var(--ink-2); width: 36px; height: 36px; border-radius: 99px; cursor: pointer; flex: none; display: grid; place-items: center; }
.x svg.ic { width: 18px; height: 18px; vertical-align: 0; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + 24px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 99px; z-index: 30; font-size: 14px; font-weight: 600; max-width: 90vw; box-shadow: 0 8px 22px rgba(0, 0, 0, .25); }

/* demo bar (?demo) */
.demobar { position: sticky; top: 0; z-index: 7; background: var(--accent); color: var(--accent-ink); text-align: center; font-size: 13px; font-weight: 700; padding: 6px 12px; }
.demobar a { color: inherit; }

/* ---------- print ---------- */
.print-area { display: none; }
@media print {
  body { background: #fff; padding: 0; }
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block; color: #000; font-size: 12pt; padding: 0; }
  .print-area table { width: 100%; border-collapse: collapse; margin: 12px 0; }
  .print-area th, .print-area td { border-bottom: 1px solid #bbb; padding: 6px 4px; text-align: left; }
  .print-area .r { text-align: right; }
  .print-area h1 { font-size: 18pt; margin: 0; }
  .print-area .doc-title { font-size: 14pt; font-weight: 700; margin-top: 14px; letter-spacing: .05em; }
  .print-area .tot { font-size: 14pt; font-weight: 700; }
  .print-area .note { font-size: 9pt; color: #555; margin-top: 18px; }
  @page { margin: 14mm; }
}

/* ---------- shared bits ---------- */
.brandmark { background: var(--primary); box-shadow: none; color: var(--primary-ink); }
.sum { display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; }
.sum > div { padding: 14px 16px; min-width: 0; }
.sum > div + div { border-left: 1px solid var(--line); }
.sum .n { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sum .l { font-size: 13px; color: var(--muted); }
.ring { flex: none; display: block; }
.ring .seg-off { stroke: var(--line); } .ring .seg-on { stroke: var(--primary); } .ring .seg-cur { stroke: var(--accent); }
.ring text { fill: var(--ink); font-weight: 800; text-anchor: middle; font-size: 25px; }
.ring text.s { fill: var(--muted); font-weight: 600; font-size: 12px; }
.ghead { display: flex; align-items: center; gap: 16px; margin: 2px 0 14px; }
.ghead h1 { margin: 0 0 2px; overflow-wrap: anywhere; }
.tabs2 { display: flex; gap: 4px; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 12px; }
.tabs2 button { flex: 1; border: 0; background: none; padding: 9px 2px; border-radius: 10px; font-size: 14px; font-weight: 650; color: var(--muted); cursor: pointer; min-height: 40px; }
.tabs2 button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.roundnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; text-align: center; }
.roundnav .hbtn[disabled] { opacity: .25; }
.pbar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 10px 0 8px; }
.pbar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.tick { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); color: transparent; display: grid; place-items: center; flex: none; cursor: pointer; padding: 0; }
.tick svg.ic { vertical-align: 0; }
.tick.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.tick.part { border-color: var(--accent); border-style: dashed; }
.tick.late { border-color: var(--bad); }
.av { color: var(--ink-2); background: var(--primary-soft); }
.av::after { display: none; }
.no { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 750; font-size: 14px; background: var(--card-2); border: 1px solid var(--line); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.no.on { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.no.cur { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.mini { border: 0; background: none; color: var(--muted); width: 38px; height: 40px; display: grid; place-items: center; cursor: pointer; padding: 0; border-radius: 10px; flex: none; }
.mini[disabled] { opacity: .25; } .mini svg.ic { vertical-align: 0; }
.mini.up svg { transform: rotate(-90deg); } .mini.dn svg { transform: rotate(90deg); }
.gridwrap { overflow: auto; max-height: 70vh; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.gridwrap table { border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.gridwrap th, .gridwrap td { padding: 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; min-width: 40px; }
.gridwrap thead th { position: sticky; top: 0; background: var(--card); z-index: 1; color: var(--muted); font-weight: 650; }
.gridwrap th:first-child { position: sticky; left: 0; background: var(--card); text-align: left; max-width: 130px; overflow: hidden; text-overflow: ellipsis; z-index: 2; font-weight: 650; color: var(--ink); }
.gridwrap .ok { color: var(--good); } .gridwrap .late { color: var(--bad); font-weight: 750; } .gridwrap .due { color: var(--warn); font-weight: 750; } .gridwrap .next { color: var(--muted); opacity: .5; }
.gridwrap td.own { background: var(--accent-soft); }
.gridwrap .ic { width: 16px; height: 16px; }
.msgbox { white-space: pre-wrap; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-size: 14px; overflow-wrap: anywhere; }
.toast { display: flex; align-items: center; gap: 14px; width: max-content; }
.toast[hidden] { display: none; }
.toast button { border: 0; background: none; color: inherit; font-weight: 800; text-decoration: underline; padding: 6px 2px; cursor: pointer; }
.err { color: var(--bad); font-weight: 600; font-size: 14px; margin: 0 0 10px; }
.drawnow { text-align: center; padding: 26px 10px; font-size: 26px; font-weight: 800; min-height: 96px; overflow-wrap: anywhere; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button.li, button.attn { font: inherit; width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; color: inherit; }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
:root[data-theme="dark"] .tabs2 button.on { background: var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabs2 button.on { background: var(--line); } }
.tabs2 button { font-size: 13.5px; }

.hero2 .big-bal { font-size: 36px; margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.pbar.over i { background: var(--bad); }
.plainbtn { border: 0; background: none; text-align: left; padding: 4px 0; cursor: pointer; min-width: 0; min-height: 44px; }
.tick.part { border-style: dashed; border-color: var(--muted); }
.fab { padding: 0; width: 58px; height: 58px; }
.bars { margin-top: 10px; display: grid; gap: 4px; }
.bar { display: grid; grid-template-columns: 104px 1fr auto; gap: 10px; align-items: center; border: 0; background: none; padding: 7px 6px; margin: 0 -6px; text-align: left; border-radius: 10px; font-size: 14px; }
button.bar { cursor: pointer; min-height: 40px; }
.bar.on { background: var(--primary-soft); font-weight: 700; }
.bt { height: 10px; } .bt i { display: block; height: 100%; min-width: 2px; background: var(--primary); border-radius: 0 4px 4px 0; }
.bv { font-variant-numeric: tabular-nums; min-width: 66px; text-align: right; }
main { padding-bottom: 90px; }
