/* ReSync layout and components. Colours, fonts and shape come from /theme.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased; min-height: 100vh; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: .01em; }
h1 { font-size: 2rem; line-height: 1.1; } h2 { font-size: 1.45rem; } h3 { font-size: 1.15rem; }
a { color: var(--gold); text-decoration: none; } a:hover { color: var(--gold-hi); }
button { font: inherit; color: inherit; cursor: pointer; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); } .sub { color: var(--text-2); } .right { text-align: right; } .nowrap { white-space: nowrap; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); } .gold { color: var(--gold); }
.mono { font-variant-numeric: tabular-nums; }
.sr { position: absolute; left: -9999px; }
[hidden] { display: none !important; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, #1a2136 0%, var(--bg) 62%); }
/* .login .bird (Uraeun phoenix behind the login card) REMOVED 01/11/26 - Jim: no Uraeun bird backgrounds */
.login-card { position: relative; width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { text-align: center; font-size: 3.2rem; color: var(--gold-hi); letter-spacing: .06em; margin-bottom: 8px; }
.login-card label { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); margin-bottom: -6px; }
.login-card .links { display: flex; justify-content: space-between; font-size: .85rem; margin-top: 2px; }
.login-card .links button { background: none; border: 0; padding: 0; color: var(--gold); }
.login-card .links button:hover { color: var(--gold-hi); }
.err { color: var(--bad); font-size: .9rem; min-height: 1.2em; margin: 0; } .ok { color: var(--good); font-size: .9rem; margin: 0; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--bg-2); border-right: var(--hair); padding: 18px 14px; gap: 18px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand img { width: 38px; height: 38px; object-fit: cover; border: var(--hair); }
.brand b { font-family: var(--font-display); font-size: 1.7rem; color: var(--gold-hi); font-weight: 600; letter-spacing: .05em; }
.wsw { display: flex; flex-direction: column; gap: 8px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: var(--hair); }
.seg button { background: transparent; border: 0; padding: 9px 8px; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
.seg button + button { border-left: var(--hair); }
.seg button[aria-pressed="true"] { background: var(--gold); color: #1a1405; font-weight: 600; }
.seg button:not([aria-pressed="true"]):hover { background: var(--gold-wash); color: var(--gold-hi); }
.wspick { width: 100%; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button { display: flex; align-items: center; gap: 12px; padding: 11px 12px; color: var(--text-2); background: none; border: 0; border-left: 2px solid transparent; text-align: left; font-size: .98rem; width: 100%; }
.nav a:hover, .nav button:hover { background: var(--gold-wash); color: var(--text); }
.nav a[aria-current="page"] { color: var(--gold-hi); background: var(--gold-wash); border-left-color: var(--gold); }
.nav .badge-n { margin-left: auto; background: var(--bad); color: #fff; font-size: .7rem; padding: 1px 6px; min-width: 20px; text-align: center; }
.rail .foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--muted); border-top: var(--hair); padding-top: 12px; }
.main { min-width: 0; padding: 28px clamp(16px, 3vw, 44px) 60px; max-width: 1320px; width: 100%; }
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; padding-bottom: 14px; border-bottom: var(--hair); }
.phead .kind { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.phead .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.topbar, .tabbar { display: none; }
.sync { font-size: .78rem; color: var(--muted); } .sync.bad { color: var(--bad); } .sync.good { color: var(--good); }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 30; background: var(--bg-2); border-bottom: var(--hair); padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); }
  .topbar .brand img { width: 30px; height: 30px; } .topbar .brand b { font-size: 1.35rem; }
  .topbar { flex-wrap: wrap; } .topbar .wspick { flex: 1 1 100%; order: 3; } .topbar .seg { min-width: 190px; } .topbar .seg button { padding: 7px 6px; font-size: .72rem; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bg-2); border-top: var(--hair); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; background: none; border: 0; color: var(--muted); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; position: relative; }
  .tabbar a[aria-current="page"] { color: var(--gold-hi); }
  .tabbar a[aria-current="page"]::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; background: var(--gold); }
  .main { padding: 18px 14px calc(84px + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.65rem; }
}

/* ---------- surfaces ---------- */
.card { background: var(--panel); border: var(--hair); padding: 18px; }
.card.flat { background: transparent; }
.card > h3, .card .ch { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card .ch h3 { margin: 0; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gauto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
@media (max-width: 860px) { .g2, .g3, .g4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .g4.keep2, .g3.keep2 { grid-template-columns: 1fr 1fr; } }
.stat { background: var(--panel); border: var(--hair); padding: 14px 16px; min-width: 0; }
.stat .k { font-size: .7rem; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-family: var(--font-display); font-size: 1.9rem; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat .s { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.stat.feat { border-color: var(--gold-lo); background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.stat.feat .v { color: var(--gold-hi); }
.stack { display: flex; flex-direction: column; gap: 14px; } .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; }
.hr { border: 0; border-top: var(--hair); margin: 14px 0; }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); }
.empty b { display: block; font-family: var(--font-display); font-size: 1.3rem; color: var(--text-2); margin-bottom: 4px; font-weight: 600; }
.note { border: var(--hair); border-left: 3px solid var(--info); background: var(--panel-2); padding: 10px 14px; font-size: .92rem; color: var(--text-2); }
.note.warn { border-left-color: var(--warn); } .note.bad { border-left-color: var(--bad); } .note.good { border-left-color: var(--good); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; background: transparent; border: 1px solid var(--gold-lo); color: var(--gold-hi); font-size: .78rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 500; transition: background .15s, color .15s, border-color .15s; min-height: 40px; }
.btn:hover { background: var(--gold-wash); border-color: var(--gold); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1a1405; font-weight: 600; } .btn.primary:hover { background: var(--gold-hi); }
.btn.quiet { border-color: var(--line); color: var(--text-2); } .btn.quiet:hover { border-color: var(--text-2); background: var(--panel-2); }
.btn.danger { border-color: #7b3b36; color: var(--bad); } .btn.danger:hover { background: rgba(224, 125, 114, .1); border-color: var(--bad); }
.btn.sm { padding: 5px 11px; min-height: 30px; font-size: .7rem; } .btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.ibtn { background: none; border: 1px solid transparent; color: var(--text-2); width: 36px; height: 36px; display: inline-grid; place-items: center; } .ibtn:hover { color: var(--gold-hi); border-color: var(--line); }
input, select, textarea { width: 100%; background: var(--bg); color: var(--text); border: var(--hair); padding: 10px 12px; font: inherit; border-radius: 0; min-height: 42px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-lo); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--gold); padding: 0; }
input[type="color"] { padding: 2px; height: 42px; }
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; } .field > label, .lbl { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.field .hint { font-size: .8rem; color: var(--muted); }
.fgrid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); } .fgrid .full { grid-column: 1 / -1; } .fgrid.f3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .fgrid, .fgrid.f3 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; } .check span { color: var(--text-2); }

.badge { display: inline-block; padding: 2px 9px; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.badge.paid, .badge.good { color: var(--good); border-color: #36664f; } .badge.unpaid, .badge.warn { color: var(--warn); border-color: #7a6030; } .badge.overdue, .badge.bad { color: var(--bad); border-color: #7b3b36; } .badge.partial { color: var(--info); border-color: #3b5678; } .badge.gold { color: var(--gold); border-color: var(--gold-lo); }
.pills { display: flex; gap: 0; border: var(--hair); width: max-content; max-width: 100%; overflow-x: auto; }
.pills button { background: none; border: 0; padding: 8px 14px; color: var(--text-2); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; } .pills button + button { border-left: var(--hair); }
.pills button[aria-pressed="true"] { background: var(--gold-wash); color: var(--gold-hi); box-shadow: inset 0 -2px 0 var(--gold); }
.subnav { display: flex; gap: 2px; margin: -8px 0 20px; overflow-x: auto; border-bottom: var(--hair); scrollbar-width: none; } .subnav::-webkit-scrollbar { display: none; }
.subnav a { padding: 10px 16px; color: var(--text-2); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--text); } .subnav a[aria-current="page"] { color: var(--gold-hi); border-bottom-color: var(--gold); }

/* ---------- tables (become cards on phones) ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 8px 12px; border-bottom: var(--hair); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--gold-wash); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; } .tbl tfoot td { border-top: var(--hair); font-weight: 500; }
.twrap { border: var(--hair); background: var(--panel); overflow-x: auto; }
@media (max-width: 700px) {
  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; }
  .tbl.cards tr { padding: 12px 14px; border-bottom: var(--hair); }
  .tbl.cards td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tbl.cards td::before { content: attr(data-l); color: var(--muted); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; text-align: left; flex: none; padding-top: 3px; }
  .tbl.cards td[data-l=""]::before { display: none; } .tbl.cards td.first { font-weight: 500; font-size: 1.02rem; justify-content: flex-start; text-align: left; }
}
.list { border: var(--hair); background: var(--panel); }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); } .li:last-child { border-bottom: 0; }
.li.click { cursor: pointer; } .li.click:hover { background: var(--gold-wash); }
.li .grow { flex: 1; min-width: 0; } .li .t { font-weight: 500; overflow-wrap: break-word; word-break: normal; }
@media (max-width: 700px) { .li:has(> .mono) { flex-wrap: wrap; gap: 8px 10px; } .li:has(> .mono) .grow { flex: 1 1 100%; } .li .mono { margin-right: auto; } } .li .m { font-size: .85rem; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--gold); }

/* ---------- modal / sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(4, 6, 10, .72); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .15s var(--ease); backdrop-filter: blur(2px); }
.dlg { background: var(--panel); border: 1px solid var(--gold-lo); width: min(640px, 100%); max-height: min(90vh, 900px); display: flex; flex-direction: column; box-shadow: var(--shadow); animation: rise .2s var(--ease); }
.dlg.wide { width: min(880px, 100%); } .dlg.narrow { width: min(420px, 100%); }
.dlg header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: var(--hair); } .dlg header h2 { font-size: 1.5rem; }
.dlg .body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.dlg footer { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 20px; border-top: var(--hair); background: var(--bg-2); } .dlg footer .l { margin-right: auto; }
@media (max-width: 700px) {
  .scrim { place-items: end center; padding: 0; }
  .dlg, .dlg.wide, .dlg.narrow { width: 100%; max-height: 92vh; border-width: 1px 0 0; animation: sheet .25s var(--ease); }
  .dlg footer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); } .dlg footer .btn { flex: 1; }
}
@keyframes fade { from { opacity: 0; } } @keyframes rise { from { opacity: 0; transform: translateY(10px); } } @keyframes sheet { from { transform: translateY(40px); opacity: .6; } }
.toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: 24px; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (max-width: 860px) { .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); } }
.toast { background: var(--panel-3); border: 1px solid var(--gold-lo); padding: 10px 18px; box-shadow: var(--shadow); animation: rise .2s var(--ease); max-width: min(92vw, 520px); } .toast.err { border-color: var(--bad); color: #ffd7d2; }
.menu { position: fixed; z-index: 90; background: var(--panel-2); border: 1px solid var(--gold-lo); box-shadow: var(--shadow); min-width: 220px; max-width: 92vw; padding: 4px; }
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; background: none; border: 0; padding: 10px 12px; text-align: left; color: var(--text); } .menu button:hover { background: var(--gold-wash); }
.menu .grp { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); padding: 8px 12px 4px; }
.spin { width: 28px; height: 28px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: rot .8s linear infinite; margin: 60px auto; } @keyframes rot { to { transform: rotate(360deg); } }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0; } .cal-nav h2 { margin: 0; text-align: center; min-width: 11ch; white-space: nowrap; } .cal-nav .ibtn { flex: none; } .cal-nav .btn { flex: none; margin-left: 6px; }
@media (max-width: 520px) { .cal-nav { width: 100%; justify-content: space-between; } .cal-nav h2 { flex: 1; font-size: 1.25rem; min-width: 0; } .cal-nav .btn { margin-left: 0; } }
.cal-opts { display: flex; gap: 4px 18px; flex-wrap: wrap; margin-left: auto; } .toast-act { margin-left: 14px; background: none; border: 0; color: var(--gold-hi); text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; font-weight: 600; padding: 4px 2px; }
.tick { flex: none; width: 30px; height: 30px; margin: 3px; display: inline-grid; place-items: center; background: transparent; border: 1.5px solid var(--gold-lo); color: #1a1405; padding: 0; } .tick:hover { border-color: var(--gold); } .tick.on { background: var(--gold); border-color: var(--gold); } .tick svg { width: 18px; height: 18px; stroke-width: 2.4; }
.agenda .dayh { scroll-margin-top: 16px; }
.tfield { position: relative; display: flex; gap: 6px; align-items: stretch; width: 100%; min-width: 0; } .tfield .tf-txt { flex: 1; min-width: 0; } .tfield .tf-txt:invalid:not(:placeholder-shown) { border-color: var(--bad); }
.tf-pick { flex: none; width: 44px; background: var(--bg); border: var(--hair); color: var(--gold); display: inline-grid; place-items: center; padding: 0; } .tf-pick:hover { border-color: var(--gold); color: var(--gold-hi); }
.tf-native { position: absolute !important; right: 0; bottom: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; opacity: 0; pointer-events: none; padding: 0 !important; border: 0 !important; }
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: var(--hair); border-left: var(--hair); background: var(--panel); }
.mgrid .dow { padding: 8px 6px; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-right: var(--hair); border-bottom: var(--hair); text-align: center; }
.mgrid .day { min-height: 118px; padding: 4px; border-right: var(--hair); border-bottom: var(--hair); cursor: pointer; overflow: hidden; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mgrid .day:hover { background: var(--gold-wash); } .mgrid .day.out { background: var(--bg-2); opacity: .55; }
.mgrid .day .n { font-size: .82rem; color: var(--text-2); padding: 1px 5px; align-self: flex-start; } .mgrid .day.today .n { background: var(--gold); color: #1a1405; font-weight: 600; }
.mgrid .day .wx { font-size: .68rem; color: var(--muted); align-self: flex-end; margin-top: -18px; }
.ev { font-size: .74rem; line-height: 1.25; padding: 2px 5px; border-left: 3px solid var(--gold); background: var(--panel-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; display: block; width: 100%; text-align: left; color: var(--text); border-top: 0; border-right: 0; border-bottom: 0; }
.ev.done { opacity: .5; text-decoration: line-through; } .ev.fin { background: transparent; border-left-style: dashed; color: var(--text-2); }
.ev.fin.out::after { content: ' -'; } .ev.fin.in { color: var(--good); } .ev.fin.paid { opacity: .55; text-decoration: line-through; } .ev.fin.over { color: var(--bad); }
.more { font-size: .7rem; color: var(--muted); padding-left: 5px; }
@media (max-width: 700px) {
  .mgrid .day { min-height: 58px; padding: 2px; align-items: center; } .mgrid .day .ev, .mgrid .day .more { display: none; } .mgrid .day .wx { display: none; }
  .mgrid .day .dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; } .mgrid .day .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); display: block; }
  .mgrid .dow { padding: 6px 0; font-size: .6rem; letter-spacing: .04em; }
}
@media (min-width: 701px) { .dots { display: none; } }
.agenda .dayh { font-family: var(--font-display); font-size: 1.25rem; padding: 14px 4px 6px; color: var(--gold-hi); border-bottom: var(--hair); } .agenda .dayh.today { color: var(--gold); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); } .legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- money ---------- */
.bar { height: 8px; background: var(--panel-3); position: relative; } .bar > i { position: absolute; inset: 0 auto 0 0; background: var(--gold); display: block; } .bar.good > i { background: var(--good); } .bar.bad > i { background: var(--bad); }
.acct { display: flex; flex-direction: column; gap: 6px; }
.acct .nm { font-family: var(--font-display); font-size: 1.3rem; } .acct .bal { font-family: var(--font-display); font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.linked { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold-lo); padding: 1px 7px; width: max-content; }
.fc { overflow-x: auto; border: var(--hair); background: var(--panel); } .fc table { min-width: 640px; }
.fc tr.eom td { border-top: var(--hair); font-weight: 600; } .fc td.low { color: var(--bad); }
.chart { width: 100%; height: 220px; display: block; } .chart .ax { stroke: var(--line); stroke-width: 1; } .chart .ln { fill: none; stroke: var(--gold); stroke-width: 2; } .chart .ar { fill: var(--gold-wash); } .chart text { fill: var(--muted); font-size: 11px; font-family: var(--font-ui); } .chart .fl { stroke: var(--bad); stroke-dasharray: 4 4; opacity: .6; }

/* ---------- invoices & documents ---------- */
.li-rows { display: grid; gap: 8px; } .li-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 100px 90px 34px; gap: 8px; align-items: center; }
.li-row .tot { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .li-row { grid-template-columns: 1fr 1fr 1fr; } .li-row > :first-child { grid-column: 1 / -1; } .li-row .tot { text-align: left; } }
.doc { background: #fff; color: #1b2233; padding: clamp(18px, 4vw, 44px); font-family: var(--font-ui); max-width: 820px; margin: 0 auto; border: 0; }
.doc h1, .doc h2, .doc h3 { color: #1b2233; font-family: var(--font-display); } .doc table { width: 100%; border-collapse: collapse; } .doc th { text-align: left; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #6a7186; border-bottom: 2px solid #1b2233; padding: 8px 6px; } .doc td { padding: 9px 6px; border-bottom: 1px solid #dde0ea; vertical-align: top; } .doc .num { text-align: right; font-variant-numeric: tabular-nums; }
.doc .tot { text-align: right; font-size: 1.3rem; margin-top: 14px; } .doc .meta { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: 22px 0; font-size: .92rem; } .doc .meta b { display: block; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: #6a7186; margin-bottom: 4px; font-weight: 500; }
.doc .stamp { display: inline-block; border: 2px solid; padding: 2px 12px; font-size: .9rem; letter-spacing: .2em; text-transform: uppercase; transform: rotate(-6deg); } .doc .stamp.paid { color: #1d7a4b; } .doc .stamp.due { color: #a9552c; }
.pay-page { min-height: 100vh; background: radial-gradient(120% 90% at 50% 0%, #1a2136 0%, var(--bg) 62%); padding: 24px 14px 60px; }
.pay-page .bar-top { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 18px; } .pay-page .bar-top img { width: 36px; height: 36px; } .pay-page .bar-top b { font-family: var(--font-display); font-size: 1.6rem; color: var(--gold-hi); letter-spacing: .06em; }
.pay-actions { max-width: 820px; margin: 16px auto 0; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- shape: square = important, rounded = everything else ----------
   Square: primary and danger buttons, featured totals, warnings and alerts, overdue/unpaid flags, dialogs, the Personal/Business switch, navigation bars.
   Rounded: cards, lists, tables, inputs, ordinary buttons, chips, tabs, menus, info notes. */
:root { --r-card: 10px; --r-ctl: 8px; --r-chip: 6px; }
.card, .stat, .list, .twrap, .empty, .note, .menu, .toast { border-radius: var(--r-card); }
.list, .twrap, .pills { overflow: hidden; }
input, select, textarea, .btn, .ibtn, .tf-pick, .pills, .subnav a, .tick { border-radius: var(--r-ctl); }
.pills { border-radius: var(--r-ctl); } .pills button:first-child { border-radius: var(--r-ctl) 0 0 var(--r-ctl); } .pills button:last-child { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.tick { border-radius: var(--r-chip); } .tfield .tf-txt { border-radius: var(--r-ctl); }
.subnav a { border-radius: var(--r-ctl) var(--r-ctl) 0 0; }
.badge, .ev, .linked, .badge-n { border-radius: var(--r-chip); }
input[type="checkbox"] { border-radius: 4px; }
.mgrid .day .ev { border-radius: 4px; }
/* important stays square */
.btn.primary, .btn.danger, .stat.feat, .note.warn, .note.bad, .badge.overdue, .badge.bad, .badge.warn, .badge.unpaid, .toast.err, .dlg, .seg, .seg button, .tabbar, .rail, .topbar, .ev.fin.over { border-radius: 0; }
.dlg header, .dlg footer { border-radius: 0; }
.ibtn.on { color: var(--gold-hi); border-color: var(--line); } .acct.masked { opacity: .85; }

@media print {
  body { background: #fff !important; } .rail, .topbar, .tabbar, .toasts, .pay-actions, .bar-top, .noprint, .scrim { display: none !important; } .main, .pay-page { padding: 0 !important; max-width: none; background: #fff !important; } .doc { padding: 0; max-width: none; }
}
.hero-num { font-family: var(--font-display); font-size: 2.6rem; color: var(--gold-hi); line-height: 1; font-variant-numeric: tabular-nums; }
.kbd { font-size: .72rem; border: 1px solid var(--line); padding: 1px 6px; color: var(--muted); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 600; color: #11141c; flex: none; }
.tag { font-size: .72rem; padding: 1px 8px; border: 1px solid var(--line); color: var(--text-2); }
.sticky-save { position: sticky; bottom: 0; background: var(--bg-2); border-top: var(--hair); padding: 12px 0; display: flex; gap: 8px; justify-content: flex-end; }
.doc .r, .doc th.r { text-align: right; } .doc th.r { text-align: right; }
.sec { margin-bottom: 18px; } .sec > h3 { margin: 0 0 10px; } .kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); } .kv:last-child { border-bottom: 0; }
.drop { border: 1px dashed var(--gold-lo); padding: 18px; text-align: center; color: var(--text-2); }

.ro .phead .acts{display:none}
.ro .ro-hide{display:none}
