/* WILDMAN FARMS BILLING - looks */
:root {
  --g900: #1d3812;
  --g800: #26471a;
  --g700: #375623;
  --g600: #46702c;
  --g500: #5b8a3c;
  --g200: #cfe2c1;
  --g100: #e7f1df;
  --g50: #f3f8ef;
  --bg: #f2f4f7;
  --surface: #ffffff;
  --border: #e1e5eb;
  --border2: #c6cdd6;
  --text: #19202a;
  --muted: #566170;
  --faint: #8590a0;
  --hover: #f3f6f9;
  --red: #b42318;
  --red-bg: #fdeceb;
  --amber: #8a5300;
  --amber-bg: #fff3d9;
  --blue: #1f5fa8;
  --blue-bg: #e8f1fb;
  --radius: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 10px rgba(16, 24, 40, .04);

  /* one color for each kind of thing, used everywhere it shows up */
  --charge: #1d5fb8; --charge-bg: #e8f0fb; --charge-tile: #2f72d6;
  --pay: #1b7a3d;    --pay-bg: #e2f3e7;    --pay-tile: #2b9653;
  --past: #8a5317;   --past-bg: #f6ebda;   --past-tile: #b0702a;
  --wait: #b44a07;   --wait-bg: #fdeedf;   --wait-tile: #e07a1f;
  --cust: #0b6c80;   --cust-bg: #dff1f5;   --cust-tile: #1592ab;
  --stmt: #6a3db8;   --stmt-bg: #efe9fb;   --stmt-tile: #8457d6;
  --year: #a3285e;   --year-bg: #f9e6ef;   --year-tile: #c43c78;
  --admin: #485264;  --admin-bg: #eceef2;  --admin-tile: #6b7586;
  --home: #375623;   --home-bg: #e7f1df;   --home-tile: rgba(255, 255, 255, .16);
  --side: 252px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15.5px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
body.busy, body.busy * { cursor: progress !important; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 650; }
p { margin: .45em 0; }
a { color: var(--g700); }
.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--blue); }
.red { color: var(--red); }
.right { text-align: right; }
.loading { min-height: 60vh; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; color: var(--muted); font-size: 17px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--g100); border-top-color: var(--g600); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- color by kind ---------- */
.t-charge { --tc: var(--charge); --tb: var(--charge-bg); --tt: var(--charge-tile); }
.t-pay    { --tc: var(--pay);    --tb: var(--pay-bg);    --tt: var(--pay-tile); }
.t-past   { --tc: var(--past);   --tb: var(--past-bg);   --tt: var(--past-tile); }
.t-wait   { --tc: var(--wait);   --tb: var(--wait-bg);   --tt: var(--wait-tile); }
.t-cust   { --tc: var(--cust);   --tb: var(--cust-bg);   --tt: var(--cust-tile); }
.t-stmt   { --tc: var(--stmt);   --tb: var(--stmt-bg);   --tt: var(--stmt-tile); }
.t-year   { --tc: var(--year);   --tb: var(--year-bg);   --tt: var(--year-tile); }
.t-admin  { --tc: var(--admin);  --tb: var(--admin-bg);  --tt: var(--admin-tile); }
.t-home   { --tc: var(--home);   --tb: var(--home-bg);   --tt: var(--home-tile); }
.nav-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--tt); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.nav-ic .ic { width: 18px; height: 18px; }
.page-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--tb); color: var(--tc); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.page-ic .ic { width: 22px; height: 22px; }

/* ---------- layout ---------- */
.layout { min-height: 100vh; }
.main { margin-left: var(--side); min-height: 100vh; }
.content { max-width: 1200px; margin: 0 auto; padding: 26px 32px 48px; }

/* ---------- side menu (computers) ---------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--g800); color: #fff;
  display: flex; flex-direction: column; z-index: 30; overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; cursor: pointer; }
.side-brand img { width: 42px; height: 42px; }
.side-biz { font-weight: 700; font-size: 15px; line-height: 1.2; }
.side-app { font-size: 12.5px; opacity: .7; letter-spacing: .04em; text-transform: uppercase; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #e6eedf;
  text-decoration: none; font-size: 15px; position: relative;
}
.side-link { padding: 7px 10px; }
.side-link:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.side-link.on { background: #fff; color: var(--text); font-weight: 650; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.side-link.on .nav-ic.t-home { background: var(--g600); }
.side-link.on .side-sub { color: var(--muted); opacity: 1; }
.side-text { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.side-sub { font-size: 12.5px; opacity: .75; font-weight: 400; margin-top: 2px; }
.side-sep { height: 1px; background: rgba(255, 255, 255, .14); margin: 10px 8px; }
.side-foot { margin-top: auto; padding: 12px 12px 16px; display: grid; gap: 10px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: rgba(0, 0, 0, .14); }
.side-who { flex: 1; min-width: 0; font-size: 14px; line-height: 1.25; }
.side-who > div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.side-role { font-size: 12.5px; opacity: .75; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--g500); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.badge { background: #e5484d; color: #fff; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.practice { background: #fff8db; color: var(--text); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; font-size: 13px; }
.practice-title { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--amber); }
.practice-title .ic { width: 17px; height: 17px; }
.practice-text { color: var(--muted); }

/* ---------- top bar + bottom tabs (phones) ---------- */
.topbar { display: none; }
.tabbar { display: none; }
.pill.unsent { display: inline-flex; align-items: center; gap: 5px; cursor: default; margin-top: 6px; }
.pill.unsent .ic { width: 14px; height: 14px; }
.topbar .pill.unsent { margin-top: 0; }
.pill { border: 0; background: #fff8db; color: var(--amber); font-weight: 700; font-size: 12.5px; border-radius: 999px; padding: 5px 10px; cursor: pointer; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-titles h1 { font-size: 27px; letter-spacing: -.01em; display: flex; align-items: center; gap: 12px; }
.page-sub { color: var(--muted); margin-top: 3px; font-size: 15px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { font-size: 17px; }
.card.error { color: var(--red); }
.card.flush { padding: 6px 0; }
.card.flush .card-head { padding: 12px 20px 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  background: #fff; color: var(--text); border: 1px solid var(--border2); border-radius: var(--r-sm);
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn .ic { width: 18px; height: 18px; }
.btn:hover:not(:disabled) { background: var(--hover); border-color: #8f99a7; }
.btn.primary { background: var(--g700); color: #fff; border-color: var(--g700); }
.btn.primary:hover:not(:disabled) { background: var(--g800); }
.btn.soft { background: var(--g100); color: var(--g800); border-color: var(--g100); }
.btn.soft:hover:not(:disabled) { background: var(--g200); border-color: var(--g200); }
.btn.danger { color: var(--red); border-color: #efc2bd; }
.btn.danger:hover:not(:disabled) { background: var(--red-bg); border-color: var(--red); }
.dialog .btn.danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.tone { background: var(--tb); color: var(--tc); border-color: transparent; }
.btn.tone:hover:not(:disabled) { background: var(--tb); border-color: var(--tc); }
.btn.small { height: 32px; padding: 0 11px; font-size: 13.5px; }
.btn.big { height: 50px; padding: 0 22px; font-size: 16.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.light { color: #e6eedf; }
.icon-btn.light:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.link { background: none; border: 0; color: var(--g700); text-decoration: underline; cursor: pointer; padding: 2px 0; font-size: inherit; font-weight: 600; }
.btn:focus-visible, .icon-btn:focus-visible, .sw-arrow:focus-visible, .side-link:focus-visible, .tab:focus-visible, .row.click:focus-visible, .stat:focus-visible, .seg:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- fields ---------- */
.inp { height: 42px; border: 1px solid var(--border2); border-radius: var(--r-sm); padding: 0 12px; background: #fff; color: var(--text); width: 100%; min-width: 0; font-size: 15.5px; }
textarea.inp { height: auto; padding: 10px 12px; resize: vertical; }
.inp:focus { outline: none; border-color: var(--g500); box-shadow: 0 0 0 3px rgba(91, 138, 60, .22); }
.inp:disabled { background: #f3f4f1; color: var(--muted); }
.inp.num { text-align: right; }
.inp.small { height: 34px; font-size: 13.5px; padding: 0 8px; }
select.inp { padding: 0 10px; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--g700); }
.form { display: grid; gap: 14px; }
.form.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field-label { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.field-hint { font-size: 12.5px; color: var(--faint); }
.amount-line { display: flex; justify-content: space-between; align-items: center; background: var(--g50); border: 1px solid var(--g100); border-radius: var(--r-sm); padding: 12px 14px; font-weight: 600; }
.amount-line b { font-size: 22px; color: var(--g800); }
.amount-line.wide { grid-column: 1 / -1; }
.sh-body .segs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.sh-body .seg { justify-content: center; text-align: center; }
.segs { display: inline-flex; background: #eceee8; border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 600; cursor: pointer; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.seg.on { background: #fff; color: var(--g800); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.seg .ic { width: 18px; height: 18px; }
.seg.on[class*="t-"] { background: var(--tc); color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.seg[class*="t-"]:not(.on) .ic { color: var(--tc); }

/* on/off switch */
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track { width: 44px; height: 26px; border-radius: 999px; background: #cfd5c9; position: relative; transition: background .15s; flex: none; }
.knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left .15s; }
.switch input:checked + .track { background: var(--g600); }
.switch input:checked + .track .knob { left: 21px; }
.switch input:focus-visible + .track { outline: 3px solid #f2b705; outline-offset: 2px; }
.switch.off { opacity: .55; cursor: not-allowed; }
.switch-label { font-weight: 600; font-size: 14.5px; }

/* ---------- month / year switcher ---------- */
.switcher { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; margin-bottom: 18px; box-shadow: var(--shadow); user-select: none; }
.sw-arrow { display: inline-flex; align-items: center; gap: 6px; height: 46px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); background: #f4f6f9; color: var(--text); font-weight: 700; font-size: 15px; cursor: pointer; }
.sw-arrow:hover:not(:disabled) { background: #e8ecf1; border-color: var(--border2); }
.sw-arrow:disabled { opacity: .35; cursor: not-allowed; }
.sw-arrow .ic { width: 20px; height: 20px; stroke-width: 2.4; }
.sw-mid { text-align: center; cursor: default; min-width: 0; }
.sw-big { font-size: 26px; font-weight: 750; color: var(--text); letter-spacing: -.01em; line-height: 1.15; }
.sw-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* ---------- customer search ---------- */
.picker { position: relative; width: 100%; }
.picker-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; width: 19px; height: 19px; }
.picker .picker-input { padding-left: 40px; }
.picker.big .picker-input { height: 50px; font-size: 18px; font-weight: 650; }
.picker-menu { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .16); max-height: 300px; overflow: auto; z-index: 40; padding: 4px; }
.picker-menu.open { display: block; }
.picker-item { padding: 10px 12px; cursor: pointer; border-radius: 8px; display: flex; align-items: center; gap: 8px; }
.picker-item:hover { background: var(--hover); }
.picker-item.hi { background: var(--charge-bg); color: var(--charge); font-weight: 600; }
.picker-item.hi .pi-right { color: var(--charge); }
.picker-item.new { color: var(--g700); font-weight: 650; }
.picker-item .ic { width: 18px; height: 18px; }
.picker-empty { padding: 10px 12px; color: var(--muted); }
.custbar { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.custbar .picker { flex: 1; }

/* ---------- banners and notes ---------- */
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 14.5px; }
.banner .ic { flex: none; }
.banner.error { background: var(--red-bg); color: var(--red); margin: 12px 32px 0; }
.banner.warn { background: var(--wait-bg); color: var(--wait); box-shadow: inset 4px 0 0 var(--wait-tile); }
.banner.lock { background: #eef0eb; color: var(--text); }
.banner.ok { background: var(--g50); color: var(--g800); }
.banner .grow { flex: 1; }
.hint { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; }

/* ---------- lists (rows) ---------- */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-top: 1px solid var(--border); min-height: 64px; }
.row:first-child { border-top: 0; }
.row.click { cursor: pointer; border-radius: 10px; }
.row.click:hover { background: var(--hover); }
.row.pending { background: #fff8f0; border-radius: 10px; padding-left: 10px; padding-right: 10px; margin: 2px 0; border-top-color: transparent; box-shadow: inset 4px 0 0 var(--wait-tile); }
.row.rejected { background: #fff5f4; border-radius: 10px; padding-left: 10px; padding-right: 10px; margin: 2px 0; border-top-color: transparent; box-shadow: inset 4px 0 0 var(--red); }
.row-ic { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.row-ic.charge { background: var(--charge-bg); color: var(--charge); }
.row-ic.pasture { background: var(--past-bg); color: var(--past); }
.row-ic.payment { background: var(--pay-bg); color: var(--pay); }
.row-ic.person { background: var(--cust-bg); color: var(--cust); font-weight: 700; font-size: 14px; }
.row-ic.tag, .row-ic.cal { background: var(--admin-bg); color: var(--admin); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 650; font-size: 15.5px; }
.row-detail { color: var(--text); font-size: 14.5px; }
.row-meta { color: var(--muted); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 2px; }
@media (min-width: 561px) { .row-meta > span:not(.chip) + span:not(.chip)::before { content: '\00B7'; margin-right: 8px; color: var(--faint); } }
.waive-cell .switch-label { font-size: 13px; font-weight: 500; color: var(--muted); max-width: 120px; line-height: 1.2; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.mini-stats .stat { padding: 12px 14px; }
.row-amt { font-weight: 700; font-size: 16px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-amt.pay { color: var(--pay); }
.row-amt .sub { display: block; font-weight: 500; font-size: 12.5px; color: var(--muted); }
.row-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row .chev { color: var(--faint); }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 650; border-radius: 999px; padding: 2px 10px; background: #eceee8; color: #4a5245; white-space: nowrap; }
.chip.pending { background: var(--wait-bg); color: var(--wait); }
.chip.rejected { background: var(--red-bg); color: var(--red); white-space: normal; }
.chip.ok { background: var(--g100); color: var(--g800); }
.chip.new { background: var(--cust-bg); color: var(--cust); }
.chip.st1 { background: var(--red-bg); color: var(--red); }
.chip.st2 { background: var(--amber-bg); color: var(--amber); }
.chip.st3 { background: var(--blue-bg); color: var(--blue); }
.chip.st4 { background: var(--g100); color: var(--g800); }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.add-row .btn { height: 46px; }

/* ---------- empty states ---------- */
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty-ic { width: 54px; height: 54px; border-radius: 50%; background: #eef1f5; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.empty-ic .ic { width: 26px; height: 26px; }
.empty-title { font-weight: 650; color: var(--text); font-size: 16px; }
.empty-text { margin: 4px auto 12px; max-width: 420px; }

/* ---------- tables (year totals etc.) ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.tbl th { text-align: left; font-size: 12.5px; font-weight: 650; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border2); white-space: nowrap; }
table.tbl td { padding: 10px; border-bottom: 1px solid var(--border); }
table.tbl .num, table.tbl th.num { text-align: right; }
table.tbl tr.click { cursor: pointer; }
table.tbl tr.click:hover td { background: var(--hover); }
table.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--g600); border-bottom: 0; }
table.tbl.small { font-size: 13.5px; }

/* ---------- home ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.step { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; background: #fff; }
.step.now { border-color: var(--g500); box-shadow: 0 0 0 3px rgba(91, 138, 60, .16); }
.step.done { background: var(--g50); }
.step-top { display: flex; align-items: center; gap: 10px; }
.step-n { width: 30px; height: 30px; border-radius: 50%; background: var(--g100); color: var(--g800); font-weight: 750; display: flex; align-items: center; justify-content: center; flex: none; }
.step.done .step-n { background: var(--g600); color: #fff; }
.step.done .step-n .ic { width: 17px; height: 17px; stroke-width: 2.6; }
.step-title { font-weight: 650; }
.step-status { color: var(--muted); font-size: 14px; flex: 1; }
.step-status.warn { color: var(--amber); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { text-align: left; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.stat:hover { border-color: var(--border2); }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 650; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.stat-value { font-size: 23px; font-weight: 750; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 13px; color: var(--muted); }
.stat.on { border-color: var(--g600); box-shadow: 0 0 0 3px rgba(91, 138, 60, .18); }
.stat.s1 .dot { background: var(--red); } .stat.s1 .stat-value { color: var(--red); }
.stat.s2 .dot { background: #d18b00; }
.stat.s3 .dot { background: var(--blue); } .stat.s3 .stat-value { color: var(--blue); }
.stat.s4 .dot { background: var(--g500); }
.stats .stat.s1 { border-left: 4px solid var(--red); }
.stats .stat.s2 { border-left: 4px solid #d18b00; }
.stats .stat.s3 { border-left: 4px solid var(--blue); }
.stats .stat.s4 { border-left: 4px solid var(--g500); }
.stat.plain { cursor: default; }
.notice { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; margin-bottom: 12px; box-shadow: var(--shadow); }
.notice.warn { background: #fffaf0; border-color: #f1dcae; }
.notice .row-ic { background: var(--wait-bg); color: var(--wait); }
.notice.warn { box-shadow: inset 4px 0 0 var(--wait-tile), var(--shadow); }
.notice-main { flex: 1; }
.notice-title { font-weight: 650; }
.notice-text { color: var(--muted); font-size: 14px; }
.hero { display: flex; align-items: center; gap: 18px; background: var(--g700); color: #fff; border-radius: var(--radius); padding: 22px; margin-bottom: 18px; flex-wrap: wrap; }
.hero h2 { font-size: 21px; }
.hero p { margin: 4px 0 0; opacity: .85; }
.hero .btn { background: #fff; color: var(--g800); border-color: #fff; }
.hero-main { flex: 1; min-width: 220px; }
.search { position: relative; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 19px; height: 19px; }
.search .inp { padding-left: 40px; }

/* ---------- enter screen ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.sum { position: sticky; top: 20px; }
.sum-line { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 15px; border-bottom: 1px solid var(--border); }
.sum-line.bold { font-weight: 650; }
.sum-total { display: flex; justify-content: space-between; align-items: center; background: var(--g700); color: #fff; border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.sum-total span { font-weight: 600; font-size: 14px; }
.sum-total b { font-size: 22px; font-variant-numeric: tabular-nums; }
.sum-total .neg { color: #d9e9ff; }
.sum-sec { font-weight: 650; font-size: 14px; margin: 16px 0 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.sum-info { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.sum-wait { display: flex; gap: 8px; align-items: center; background: var(--amber-bg); color: var(--amber); font-size: 13.5px; padding: 8px 10px; border-radius: 10px; margin-bottom: 10px; font-weight: 600; }
.sum-wait .ic { width: 17px; height: 17px; }
details.sum-details > summary { list-style: none; cursor: pointer; }
details.sum-details > summary::-webkit-details-marker { display: none; }
.month-total { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: 14px; padding: 12px 4px 0; border-top: 1px solid var(--border); margin-top: 4px; }
.month-total b { color: var(--text); font-size: 16px; }

/* ---------- approvals ---------- */
.acard { display: flex; gap: 14px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.acard:first-child { border-top: 0; }
.acard .row-main { min-width: 220px; }
.acard-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.warn-text { color: var(--red); font-size: 13.5px; font-weight: 600; margin-top: 3px; }

/* ---------- customer page ---------- */
.cust-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.cust-big { width: 58px; height: 58px; border-radius: 16px; background: var(--cust-bg); color: var(--cust); font-weight: 750; font-size: 20px; display: flex; align-items: center; justify-content: center; flex: none; }
.cust-info { flex: 1; min-width: 220px; }
.cust-info h2 { font-size: 22px; }
.cust-lines { color: var(--muted); margin-top: 4px; font-size: 14.5px; }
.cust-owes { text-align: right; }
.cust-owes .label { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.cust-owes .value { font-size: 28px; font-weight: 750; font-variant-numeric: tabular-nums; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 8px; margin-top: 16px; }
.action-grid .btn { justify-content: flex-start; height: 46px; padding: 0 14px; }
.btn[class*="t-"]:not(.tone):not(.primary) .ic { color: var(--tc); }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 600; margin-bottom: 10px; cursor: pointer; background: none; border: 0; padding: 0; font-size: 14.5px; }
.back-link:hover { color: var(--cust); }

/* customer page tabs */
.cust-card { margin-bottom: 12px; }
.ctabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; margin-bottom: 18px; box-shadow: var(--shadow); }
.ctab { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 6px 10px; border: 0; background: transparent; border-radius: 10px; font-weight: 650; font-size: 15.5px; color: var(--muted); cursor: pointer; text-align: center; }
.ctab .ic { color: var(--tc); width: 20px; height: 20px; }
.ctab:hover { background: var(--hover); color: var(--text); }
.ctab.on { background: var(--tc); color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.ctab.on .ic { color: #fff; }
.ctab:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
.ctab-short { display: none; }

/* Print & mail */
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.pcard { background: var(--surface); border: 1px solid var(--border); border-top: 5px solid var(--tt); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.pcard-head { display: flex; align-items: center; gap: 12px; }
.pcard-n { width: 30px; height: 30px; border-radius: 50%; background: var(--tc); color: #fff; font-weight: 750; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pcard-title { font-weight: 700; font-size: 18px; }
.pcard-sub { color: var(--muted); font-size: 14px; }
.pcard-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.pcard .hint { margin: 0; }
.big-select { height: 48px; font-size: 16px; font-weight: 600; }
.pc-amount-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--stmt-bg); color: var(--stmt); border-radius: 10px; padding: 12px 14px; font-weight: 600; }
.pc-amount-line > span { display: flex; flex-direction: column; }
.pc-mailed { font-weight: 500; font-size: 13px; color: var(--muted); }
.pc-amount-line b { font-size: 22px; color: var(--text); font-variant-numeric: tabular-nums; }
.pc-amount-line b.neg { color: var(--blue); }
.env-mini { position: relative; aspect-ratio: 9.5 / 4.125; border: 1px solid var(--border2); border-radius: 6px; background: #fffdf8; box-shadow: inset 0 0 0 6px #fff, 0 2px 6px rgba(16, 24, 40, .08); font-family: Arial, Helvetica, sans-serif; color: #222; overflow: hidden; }
.env-from { position: absolute; left: 5%; top: 9%; font-size: 11.5px; line-height: 1.35; color: #444; }
.env-to { position: absolute; left: 40%; top: 46%; font-size: 14px; line-height: 1.4; font-weight: 600; }
.env-missing { color: var(--red); font-weight: 600; font-style: italic; }

/* details */
.dl { display: grid; }
.dl-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px; padding: 11px 2px; border-top: 1px solid var(--border); }
.dl-row:first-child { border-top: 0; }
.dl-label { color: var(--muted); font-weight: 600; font-size: 14.5px; }
.dl-value { font-size: 15.5px; }

/* ---------- year ---------- */
.glance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.glance .stat { cursor: default; box-shadow: none; background: var(--g50); border-color: var(--g100); }
.glance .stat.big { background: var(--g700); border-color: var(--g700); color: #fff; }
.glance .stat.big .stat-label { color: #d6e6c9; }

/* ---------- people ---------- */
.person-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.person-row:first-child { border-top: 0; }
.person-row .row-main { min-width: 160px; }
.person-row select { width: auto; min-width: 230px; }

/* ---------- sign in ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, var(--g800), var(--g600)); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 30px 26px 24px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.auth-logo { width: 96px; height: 96px; }
.auth-card h1 { font-size: 23px; margin: 10px 0 2px; color: var(--g800); }
.auth-card .form { text-align: left; margin: 18px 0 16px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.auth-links .link:only-child { margin: 0 auto; }

/* people */
.auth-note { font-size: 13.5px; color: var(--muted); margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--border); text-align: left; }
.person-fixed { font-size: 13.5px; padding: 6px 12px; }
.role-choices { display: grid; gap: 10px; }
.role-choice { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 2px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.role-choice:hover { border-color: var(--border2); }
.role-choice.on { border-color: var(--tc); background: var(--tb); }
.role-choice:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
.rc-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.rc-title { font-weight: 700; font-size: 16px; }
.rc-sub { color: var(--muted); font-size: 13.5px; }
.rc-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border2); flex: none; background: #fff; }
.role-choice.on .rc-dot { border: 7px solid var(--tc); }

/* ---------- dialogs (questions) ---------- */
.dialog-back { position: fixed; inset: 0; background: rgba(15, 25, 10, .45); z-index: 120; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog { background: #fff; border-radius: 16px; max-width: 470px; width: 100%; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); max-height: calc(100vh - 32px); overflow: auto; }
.dialog-title { font-weight: 700; padding: 18px 20px 0; font-size: 18px; }
.dialog-body { padding: 8px 20px 4px; font-size: 15px; color: #2c3327; }
.dialog-body .field { margin-top: 10px; }
.dialog-body .picker { margin-top: 8px; }
.dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; flex-wrap: wrap; }

/* ---------- forms that slide up ---------- */
.sh-back { position: fixed; inset: 0; background: rgba(15, 25, 10, 0); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; transition: background .16s; }
.sh-back.open { background: rgba(15, 25, 10, .45); }
.sh-panel { background: #fff; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); border-radius: 18px; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); transform: translateY(14px); opacity: 0; transition: transform .16s, opacity .16s; }
.sh-panel.wide { max-width: 760px; }
.sh-back.open .sh-panel { transform: none; opacity: 1; }
.sh-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px 22px; border-bottom: 1px solid var(--border); }
.sh-title { font-weight: 700; font-size: 18px; }
.sh-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.sh-foot { display: flex; justify-content: space-between; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.sh-foot .left, .sh-foot .right { display: flex; gap: 8px; flex-wrap: wrap; }
.sh-error { display: none; align-items: center; gap: 8px; background: var(--red-bg); color: var(--red); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-weight: 600; font-size: 14.5px; }
.sh-error.show { display: flex; }
.more-list { display: grid; gap: 4px; }
.more-link { display: flex; align-items: center; gap: 14px; padding: 14px 8px; color: var(--text); text-decoration: none; font-size: 16.5px; border-bottom: 1px solid var(--border); }
.more-link .chev { margin-left: auto; color: var(--faint); }
.more-user { display: flex; align-items: center; gap: 12px; padding: 16px 8px 10px; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(30px); background: #23291f; color: #fff; padding: 12px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 200; max-width: calc(100vw - 32px); font-size: 15px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); display: flex; gap: 10px; align-items: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.ok { background: var(--g700); }
#toast.error { background: var(--red); }
#toast.warn { background: #8a5300; }

/* ---------- print preview (on screen) ---------- */
#print-root { display: none; }
body.previewing #print-root { display: block; position: fixed; inset: 0; overflow: auto; background: #5d6359; z-index: 150; }
body.previewing { overflow: hidden; }
.print-bar { position: sticky; top: 0; z-index: 2; background: var(--g800); color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.print-title { font-weight: 700; font-size: 16px; }
.print-count { font-weight: 400; opacity: .85; }
.print-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.print-actions .btn:disabled { opacity: .75; }
@media (max-width: 640px) { .print-actions { margin-left: 0; width: 100%; } .print-actions .btn.primary { flex: 1; } }
.print-tip { width: 100%; font-size: 13px; opacity: .9; }
.sheets { padding: 18px 16px 40px; }
.sheet { background: #fff; position: relative; overflow: hidden; margin: 0 auto 18px; box-shadow: 0 4px 18px rgba(0, 0, 0, .35); color: #262626; }
.sheet.letter { width: 8.5in; height: 10.9in; }
.sheet.letter .sheet-body { position: absolute; left: 0.5in; top: 0.45in; width: 7.5in; height: 9.4in; padding: 0; overflow: visible; }
.sheet.envelope { width: 9.5in; height: 4.08in; }
.sheet.envelope .sheet-body { position: absolute; left: 0.3in; top: 0.3in; width: 7.9in; height: 3.4in; padding: 0; overflow: visible; }
.pt { position: absolute; white-space: nowrap; overflow: hidden; font-family: Arial, Helvetica, sans-serif; font-kerning: none; }
.pl { position: absolute; height: 0; }
.pr { position: absolute; }
.pi { position: absolute; object-fit: contain; }

/* ---------- printing ---------- */
@media print {
  body { background: #fff !important; overflow: visible !important; }
  #app, .print-bar, #toast, .dialog-back, .sh-back { display: none !important; }
  /* nothing a host or browser add-on puts on the page (like a "Powered by Netlify" badge) gets printed */
  body > *:not(#print-root) { display: none !important; }
  body.previewing #print-root { display: block !important; position: static !important; overflow: visible !important; background: none !important; }
  .sheets { zoom: 1 !important; padding: 0 !important; }
  .sheet { margin: 0 !important; box-shadow: none !important; break-after: page; page-break-after: always; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
  /* a little shorter than the paper, so a phone's own print margins can't push a statement onto a 2nd page */
  .sheet.letter { height: 9.9in !important; }
  .sheet.envelope { height: 3.8in !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}


/* ---------- home shortcuts ---------- */
.qa-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.qa { display: flex; align-items: center; gap: 12px; text-align: left; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow); min-height: 74px; transition: border-color .12s, transform .06s; }
.qa { border-top: 4px solid var(--tt, var(--g500)); }
.qa:hover { border-color: var(--tt, var(--g500)); box-shadow: 0 4px 14px rgba(16, 24, 40, .1); }
.qa:active { transform: translateY(1px); }
.qa-ic { position: relative; width: 44px; height: 44px; border-radius: 12px; background: var(--tb, var(--g100)); color: var(--tc, var(--g700)); display: flex; align-items: center; justify-content: center; flex: none; }
.qa-ic .ic { width: 22px; height: 22px; }
.qa-ic .badge { position: absolute; top: -6px; right: -6px; }
.qa-text { display: flex; flex-direction: column; min-width: 0; }
.qa-title { font-weight: 700; font-size: 16px; }
.qa-sub { color: var(--muted); font-size: 13.5px; }
.qa:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }

/* ---------- fast entry ---------- */
.entry-card { border: 1px solid var(--border); border-top: 5px solid var(--tt); }
.qhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.qgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; align-items: end; }
.qgrid > * { grid-column: span 3; min-width: 0; }
.k-charge .f-cust, .k-charge .f-item { grid-column: span 4; }
.k-charge .f-num { grid-column: span 2; }
.k-charge .f-date { grid-column: span 3; }
.k-charge .f-note { grid-column: span 6; }
.k-payment .f-cust { grid-column: span 5; }
.k-payment .f-num { grid-column: span 3; }
.k-payment .f-date { grid-column: span 4; }
.k-payment .f-note { grid-column: span 9; }
.k-pasture .f-cust { grid-column: span 4; }
.k-pasture .f-num { grid-column: span 2; }
.k-pasture .f-date { grid-column: span 2; }
.k-pasture .f-note { grid-column: span 9; }
.qgrid .f-add { grid-column: span 3; }
.qgrid .f-add .btn { width: 100%; height: 42px; }
.qgrid .field-hint { display: none; }
.qmsg { margin-top: 12px; color: var(--muted); font-size: 14.5px; min-height: 21px; }
.qmsg.err { color: var(--red); font-weight: 650; }
.qmsg.warn { color: var(--amber); font-weight: 650; }
.qdone { display: none; align-items: center; gap: 8px; margin-top: 8px; background: var(--pay-bg); color: var(--pay); border: 1px solid #c5e6cf; border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: 14.5px; }
.qdone.show { display: flex; }
.qdone .link { margin-left: auto; }
.qdone .ic { width: 18px; height: 18px; stroke-width: 2.4; }
.segs.small .seg { padding: 5px 10px; font-size: 13.5px; }

.seg-short { display: none; }

/* ---------- type-to-find lists ---------- */
.pi-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-right { color: var(--faint); font-size: 13px; white-space: nowrap; }
.picker-item.dim { opacity: .6; }
.side-find { padding: 2px 12px 10px; }
.side-find .inp { height: 38px; background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); color: #fff; font-size: 14.5px; }
.side-find .inp::placeholder { color: rgba(255, 255, 255, .65); }
.side-find .inp:focus { background: #fff; color: var(--text); border-color: #fff; box-shadow: none; }
.side-find .picker-icon { color: rgba(255, 255, 255, .7); }
.side-find .picker:focus-within .picker-icon { color: var(--faint); }
.side-find .picker-menu { color: var(--text); }

/* ---------- fold-out ---------- */
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
details.fold > summary::-webkit-details-marker { display: none; }
.fold-title { font-weight: 650; font-size: 17px; }
.fold-ic { margin-left: auto; color: var(--faint); transition: transform .15s; }
details.fold[open] .fold-ic { transform: rotate(180deg); }

/* ---------- in between ---------- */
@media (max-width: 1260px) {
  .split { grid-template-columns: minmax(0, 1fr) 310px; }
}
@media (max-width: 1100px) {
  .qa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .sum { position: static; }
  .steps { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- phones and small tablets ---------- */
@media (max-width: 999px) {
  .side { display: none; }
  .main { margin-left: 0; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; background: var(--g800); color: #fff; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); }
  .top-logo { width: 32px; height: 32px; cursor: pointer; }
  .top-title { flex: 1; font-weight: 650; font-size: 16.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: #fff; border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 12px rgba(0, 0, 0, .06);
  }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 62px; color: var(--faint); text-decoration: none; font-size: 11.5px; font-weight: 600; border: 0; background: none; cursor: pointer; }
  .tab .ic { width: 24px; height: 24px; }
  .tab.on { color: var(--text); }
  .tab-ic { position: relative; display: flex; color: var(--tc, currentColor); padding: 3px 14px; border-radius: 999px; }
  .tab.on .tab-ic { background: var(--tb, #eef1f5); }
  .tab-ic.t-home { --tc: var(--g600); }
  .tab-ic .badge { position: absolute; top: -6px; right: -12px; min-width: 18px; height: 18px; font-size: 11px; }
  .content { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }
  .banner.error { margin: 10px 14px 0; }
  #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 14px; }
  .page-titles h1 { font-size: 22px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 14px; border-radius: 14px; }
  .card.flush .card-head { padding: 10px 14px 0; }
  .form.cols { grid-template-columns: minmax(0, 1fr); }
  .switcher { padding: 8px; }
  .sw-arrow { height: 44px; padding: 0 12px; }
  .sw-big { font-size: 21px; }
  .sw-sub { font-size: 12.5px; }
  .add-row .btn { flex: 1; }
  /* forms take the whole screen */
  .sh-back { padding: 0; align-items: flex-end; }
  .sh-panel, .sh-panel.wide { max-width: none; max-height: 94vh; height: 94vh; border-radius: 18px 18px 0 0; transform: translateY(40px); }
  .sh-body { padding: 16px; }
  .sh-foot { padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); }
  .sh-foot .right { flex: 1; }
  .sh-foot .right .btn { flex: 1; height: 50px; font-size: 16px; }
  .sh-foot .left .btn { height: 50px; }
  .inp { height: 48px; font-size: 16.5px; }
  .picker.big .picker-input { height: 52px; }
  .qgrid > *, .qgrid .f-note, .qgrid .f-cust, .qgrid .f-item, .qgrid .f-add { grid-column: span 12 !important; }
  .qgrid .f-num, .qgrid .f-date { grid-column: span 6 !important; }
  .qgrid .f-photo { order: 0; }
  .qgrid .f-add .btn { height: 52px; }
  .qgrid .f-add .field-label { display: none; }
  .qtip { display: none; }
  .page-ic { display: none; }
  .page-head { position: relative; padding-right: 92px; }
  .page-head .help-btn { position: absolute; top: 2px; right: 0; height: 34px; padding: 0 11px; font-size: 13.5px; }
  .cust-card { padding: 14px 16px; }
  .cust-head { gap: 12px; }
  .cust-big { width: 44px; height: 44px; border-radius: 12px; font-size: 16px; }
  .cust-info { min-width: 0; flex: 1 1 200px; }
  .cust-info h2 { font-size: 19px; }
  .cust-lines { font-size: 13.5px; }
  .cust-owes { width: 100%; text-align: left; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; }
  .cust-owes .value { font-size: 24px; }
  .ctabs { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; }
  .ctab { flex-direction: column; gap: 3px; min-height: 58px; font-size: 13px; padding: 6px 2px; }
  .ctab-long { display: none; }
  .ctab-short { display: inline; }
  .pgrid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pcard-btns .btn { flex: 1 1 100%; }
  .dl-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .env-to { left: 30%; font-size: 12px; }
  .env-from { font-size: 9.5px; }
  .qgrid.k-charge .f-date, .qgrid.k-charge .f-note { grid-column: span 6 !important; }
  .qhead .segs { width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .qhead .seg { justify-content: center; }
  .seg-long { display: none; }
  .seg-short { display: inline; }
  .qa { min-height: 64px; padding: 12px; }
}
@media (max-width: 560px) {
  .sw-name { display: none; }
  .sw-arrow { width: 48px; justify-content: center; padding: 0; }
  .row { gap: 10px; }
  .row-ic { width: 38px; height: 38px; }
  .row { flex-wrap: wrap; }
  .row > .chev { display: none; }
  .row-meta { gap: 2px 10px; }
  .card .btn-row > .btn.big { flex: 1 1 100%; }
  .row-main { flex: 1 1 150px; }
  .row-acts { width: 100%; justify-content: flex-start; padding-left: 48px; }
  .row-acts .btn { flex: 1; }
  .waive-cell { padding-left: 48px; }
  .mini-stats { gap: 6px; }
  .mini-stats .stat { padding: 10px; }
  .mini-stats .stat-value { font-size: 16px; }
  .mini-stats .stat-sub { font-size: 12px; }
  .acard-acts { width: 100%; }
  .acard-acts .btn { flex: 1; }
  .cust-owes { text-align: left; width: 100%; }
  .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-grid .btn { white-space: normal; height: auto; min-height: 48px; padding: 8px 12px; text-align: left; line-height: 1.2; }
  .person-row select { min-width: 0; width: 100%; }
  .stat-value { font-size: 19px; }
  .hero { padding: 18px; }
  .hero .btn { width: 100%; }
}

/* ---------- can't start ---------- */
.center-card { max-width: 520px; margin: 12vh auto 0; background: #fff; border: 1px solid var(--border); border-top: 5px solid var(--red); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow); }
.center-card h1 { font-size: 22px; margin-bottom: 6px; }
.center-card p { color: var(--muted); margin-bottom: 16px; }
@media (max-width: 560px) { .center-card { margin: 24px 16px 0; } }

/* ---------- built-in help ---------- */
.help-btn { height: 38px; padding: 0 14px; border-radius: 999px; font-size: 14.5px; }
.help-btn .ic { color: var(--charge); }
.page-actions { align-items: center; }
.page-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.page-top .back-link { margin-bottom: 0; }
.help-intro { margin: 0 0 14px; font-size: 15.5px; color: var(--text); }
.help-qs { display: grid; gap: 8px; }
.help-q { border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.help-q > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 13px 14px; font-weight: 650; font-size: 15.5px; }
.help-q > summary::-webkit-details-marker { display: none; }
.help-q > summary:hover { background: var(--hover); border-radius: 12px; }
.help-q[open] > summary { color: var(--charge); }
.help-q-text { flex: 1; }
.help-q .fold-ic { margin-left: 0; }
.help-q[open] .fold-ic { transform: rotate(180deg); }
.help-steps, .help-list { margin: 0; padding: 0 16px 6px 40px; display: grid; gap: 8px; font-size: 15px; }
.help-steps li::marker { color: var(--charge); font-weight: 750; }
.help-tip { display: flex; gap: 8px; align-items: flex-start; margin: 6px 14px 14px; padding: 10px 12px; border-radius: 10px; background: var(--charge-bg); color: #24406b; font-size: 14px; }
.help-tip .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--charge); }
.help-q:not([open]) .help-steps { display: none; }
.help-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }

/* the tour */
.tour-block { position: fixed; inset: 0; z-index: 300; }
.tour-hole { position: fixed; z-index: 301; border-radius: 14px; box-shadow: 0 0 0 4px #f2b705, 0 0 0 9999px rgba(12, 20, 10, .58); pointer-events: none; transition: left .2s, top .2s, width .2s, height .2s; }
.tour-tip { position: fixed; z-index: 302; background: #fff; border-radius: 14px; padding: 16px 18px 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.tour-count { font-size: 12.5px; font-weight: 700; color: var(--charge); text-transform: uppercase; letter-spacing: .04em; }
.tour-title { font-weight: 750; font-size: 18px; margin: 2px 0 4px; }
.tour-text { color: var(--muted); font-size: 15px; }
.tour-btns { display: flex; align-items: center; gap: 8px; margin-top: 14px; }

/* getting started */
.gs-card { border-top: 5px solid var(--charge-tile); }
.gs-item { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.gs-item:first-of-type { border-top: 0; }
.gs-n { width: 30px; height: 30px; border-radius: 50%; background: var(--charge-bg); color: var(--charge); font-weight: 750; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.gs-item.done .gs-n { background: var(--pay-tile); color: #fff; }
.gs-n .ic { width: 17px; height: 17px; stroke-width: 2.6; }
.gs-text { flex: 1; min-width: 200px; }
.gs-title { font-weight: 650; }
.gs-item.done .gs-title { color: var(--muted); text-decoration: line-through; }
.gs-sub { color: var(--muted); font-size: 14px; }
.load-detail { background: #f4f6f9; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; display: grid; gap: 4px; word-break: break-word; margin-top: 10px; }

/* ---------- photos ---------- */
.lbl-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.lbl-btn { display: inline-flex; align-items: center; gap: 3px; border: 0; background: var(--charge-bg); color: var(--charge); font-weight: 700; font-size: 12px; border-radius: 999px; padding: 2px 8px 2px 6px; cursor: pointer; }
.lbl-btn .ic { width: 14px; height: 14px; }
.lbl-btn:hover { background: #d7e5f8; }
.qgrid .f-photo { grid-column: 1 / -1; order: 99; }
.pfield { display: block; }
.pfile { display: none; }
.pstrip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pitem { position: relative; display: inline-flex; }
.pthumb { width: 64px; height: 64px; border-radius: 10px; border: 1px solid var(--border2); background: #f4f6f9; overflow: hidden; padding: 0; cursor: zoom-in; display: inline-flex; align-items: center; justify-content: center; color: var(--faint); }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pthumb.card { width: 96px; height: 72px; }
.pthumb-wait .ic { width: 22px; height: 22px; }
.pdel { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #2b2f36; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.pdel .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.photo-add { border-style: dashed; color: var(--charge); border-color: #9db8e0; }
.photo-add .ic { color: var(--charge); }
.photo-chip { cursor: pointer; border: 0; background: var(--charge-bg); color: var(--charge); }
.photo-chip .ic { width: 14px; height: 14px; }
.acard-photos { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.sh-photos { margin-top: 14px; }

/* the photo viewer */
.pv-back { position: fixed; inset: 0; z-index: 210; background: rgba(10, 12, 16, .92); display: flex; flex-direction: column; }
.pv-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: #fff; }
.pv-count { font-weight: 650; }
.pv-stage { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 8px 16px; min-height: 0; }
.pv-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); background: #fff; }
.pv-wait { color: #cfd5de; }
.pv-nav { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

/* the weight calculator */
.wc-head, .wc-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 14px minmax(0, 1fr) 14px minmax(0, 1fr) 36px; gap: 6px; align-items: center; }
.wc-head { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.wc-head span:nth-child(2), .wc-head span:nth-child(4), .wc-head span:nth-child(6) { text-align: right; padding-right: 12px; }
.wc-loads { display: grid; gap: 8px; margin-bottom: 10px; }
.wc-n { color: var(--faint); font-weight: 700; font-size: 13px; text-align: center; }
.wc-op { color: var(--faint); text-align: center; font-weight: 700; }
.wc-bu { margin-top: 12px; max-width: 220px; }
.wc-totals { margin-top: 14px; background: var(--charge-bg); border-radius: 12px; padding: 12px 14px; }
.wc-big { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 650; color: var(--charge); }
.wc-big b { font-size: 22px; color: var(--text); font-variant-numeric: tabular-nums; }
.wc-conv { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; color: var(--muted); font-size: 14.5px; }
.wc-conv b { color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .wc-head, .wc-row { grid-template-columns: 18px minmax(0, 1fr) 10px minmax(0, 1fr) 10px minmax(0, 1fr) 30px; gap: 4px; }
  .wc-row .inp { padding: 0 6px; }
}
@media (max-width: 999px) { .qgrid .f-photo { order: 0; } }

/* ---------- customer names you can click ---------- */
.cust-link { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; font-weight: 650; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: rgba(31, 95, 168, .35); text-underline-offset: 3px; }
.cust-link:hover { color: var(--cust); text-decoration-color: currentColor; }
.cust-link:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; border-radius: 4px; }
.cust-link.strong { font-weight: 750; }
.row-ic.as-link { border: 0; cursor: pointer; font: inherit; }
.row-ic.as-link:hover { filter: brightness(.95); }
.row-meta .who { color: var(--faint); }
.record-line { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--muted); background: #f5f6f3; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.record-line .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--faint); }

/* ---------- people: who has joined, invites ---------- */
.seen { display: inline-flex; align-items: center; gap: 4px; }
.seen .ic { width: 14px; height: 14px; }
.seen.ok { color: var(--g600); }
.seen.no { color: var(--amber); font-weight: 600; }
.person-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; }
.person-links .link { font-size: 13.5px; display: inline-flex; align-items: center; gap: 4px; }
.person-links .link .ic { width: 14px; height: 14px; }
.link.danger { color: var(--red); }
.people-sub { font-size: 12.5px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 16px 0 2px; }
.person-row.invited .row-ic.person { background: var(--wait-bg); color: var(--wait); }
.invite-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 4px 0 14px; }
.invite-way { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border: 2px solid var(--border); border-radius: 12px; background: #fff; color: var(--text); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.invite-way:hover { border-color: var(--tc); background: var(--tb); }
.invite-way:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
.invite-msg { width: 100%; font-size: 14px; line-height: 1.45; resize: vertical; background: #fafbf8; }
.invite-code { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; font-size: 15px; }
.invite-code b { font-size: 20px; letter-spacing: .08em; font-family: ui-monospace, Menlo, Consolas, monospace; }
.invite-intro { background: var(--g50); color: var(--g800); border-radius: 10px; padding: 10px 12px; margin-top: 0; }
.join-code { text-align: left; margin: 18px 0 14px; }
.join-code-row { display: flex; gap: 8px; margin-top: 6px; }
.join-code-row .inp { flex: 1; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- photos: banner across the top of Home, and behind the sign-in box ---------- */
.page.tone-home > .page-head { position: relative; background: linear-gradient(90deg, rgba(0,0,0,.42) 0%, rgba(0,0,0,.18) 45%, rgba(0,0,0,0) 70%), #4d7a35 url(../img/home-banner.jpg) center 58% / cover; color: #fff; border-radius: var(--radius); padding: 34px 28px; min-height: 190px; align-items: flex-end; margin-bottom: 18px; box-shadow: var(--shadow); }
.page.tone-home > .page-head h1 { color: #fff; font-size: 32px; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.page.tone-home > .page-head .page-sub { color: rgba(255,255,255,.92); font-size: 16px; text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.page.tone-home > .page-head .help-btn { background: rgba(255,255,255,.92); }
@media (max-width: 760px) {
  .page.tone-home > .page-head { min-height: 150px; padding: 56px 18px 18px; background: linear-gradient(0deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.2) 55%, rgba(0,0,0,0) 80%), #4d7a35 url(../img/home-banner.jpg) 30% 58% / cover; }
  .page.tone-home > .page-head .page-actions { position: absolute; top: 10px; right: 10px; }
  .page.tone-home > .page-head h1 { font-size: 25px; }
}
.auth-wrap { background: linear-gradient(rgba(20,25,15,.10), rgba(20,25,15,.30)), var(--g700) url(../img/signin-background.jpg) center 38% / cover; }

/* ---------- date boxes on phones: never wider than their space ---------- */
.form > *, .qgrid > *, .field { min-width: 0; }
input[type="date"].inp { display: block; max-width: 100%; min-width: 0; }
/* iPhones and iPads give date boxes their own minimum width and ignore the page's sizing */
@supports (-webkit-touch-callout: none) {
  input[type="date"].inp { -webkit-appearance: none; appearance: none; height: 42px; line-height: 40px; text-align: left; overflow: hidden; }
  input[type="date"].inp::-webkit-date-and-time-value { text-align: left; margin: 0; }
  input[type="date"].inp::-webkit-datetime-edit { padding: 0; }
}
