:root { color-scheme:dark;
  --bg:#0b0f17; --card:#121826; --card2:#182033; --hover:#1c2538; --text:#e8edf5; --muted:#8a94a7; --line:#232c3d;
  --input:#0b0f17; --input-line:#2f3a50; --primary:#4f7cff; --primary-hover:#3d6af0;
  --ok:#3fb950; --bad:#f85149; --warn:#d29922; --side-w:236px; --side-folded-w:68px; --radius:14px; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; font:14px/1.5 "Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; background:var(--bg); color:var(--text);
  -webkit-font-smoothing:antialiased; }
a { color:#7aa2ff; text-decoration:none; } a:hover { text-decoration:underline; }
h1 { font-size:22px; margin:0 0 12px; display:flex; gap:10px; align-items:center; flex-wrap:wrap; letter-spacing:-.01em; }
h2 { font-size:15px; margin:0 0 12px; display:flex; gap:8px; align-items:center; } h3 { font-size:14px; margin:0 0 6px; }
.ico { flex:none; }

/* ---------- TEST instance banner ---------- */
.test-banner { position:sticky; top:0; z-index:60; height:34px; line-height:20px; padding:7px 12px; text-align:center;
  font-weight:800; letter-spacing:.06em;
  color:#3d2c00; background:repeating-linear-gradient(45deg,#ffd33d,#ffd33d 14px,#f0b400 14px,#f0b400 28px); }
.test-banner ~ .side { top:34px; }                  /* side menu and sticky top bar start below the banner */
.test-banner ~ .shell .topbar { top:34px; }

/* ---------- app shell: side menu + top bar ---------- */
body.app { display:flex; min-height:100vh; flex-direction:column; }
.side { position:fixed; inset:0 auto 0 0; width:var(--side-w); background:#0e1422; border-right:1px solid var(--line);
  display:flex; flex-direction:column; padding:16px 12px; z-index:30; overflow-y:auto; transition:transform .2s; }
.brand { display:flex; align-items:center; gap:10px; padding:6px 8px 18px; color:var(--text) !important; text-decoration:none !important; }
.logo { display:grid; place-items:center; width:36px; height:36px; border-radius:10px; color:#fff;
  background:linear-gradient(135deg,#4f7cff,#8b5cf6); box-shadow:0 6px 18px rgba(79,124,255,.35); }
.brand-text { display:flex; flex-direction:column; line-height:1.15; } .brand-text small { color:var(--muted); font-size:12px; }
.nav { display:flex; flex-direction:column; gap:2px; }
.nav-group { font-size:11px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:#5d687d; padding:14px 10px 6px; }
.nav-item { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:9px; color:#b5bfd0; font-weight:500; }
.nav-item:hover { background:var(--hover); color:var(--text); text-decoration:none; }
.nav-item.active { background:rgba(79,124,255,.14); color:#fff; box-shadow:inset 3px 0 0 var(--primary); }
.nav-item.active .ico { color:#8fb0ff; }
.shell { flex:1; margin-left:var(--side-w); min-width:0; display:flex; flex-direction:column; min-height:100vh; }
.topbar { position:sticky; top:0; z-index:20; height:58px; display:flex; align-items:center; gap:12px; padding:0 24px;
  background:rgba(11,15,23,.82); backdrop-filter:blur(10px); border-bottom:1px solid var(--line); }
.topbar-title { flex:1; font-weight:600; }
.icon-btn { background:none; border:0; color:var(--text); padding:6px; border-radius:8px; cursor:pointer; }
.icon-btn:hover { background:var(--hover); }
.menu-btn { display:inline-flex; }
.usermenu { position:relative; }
.usermenu summary { list-style:none; display:flex; align-items:center; gap:10px; cursor:pointer; padding:5px 8px; border-radius:10px; }
.usermenu summary::-webkit-details-marker { display:none; }
.usermenu summary:hover, .usermenu[open] summary { background:var(--hover); }
.avatar { display:grid; place-items:center; width:32px; height:32px; border-radius:50%; font-weight:700; color:#fff;
  background:linear-gradient(135deg,#4f7cff,#8b5cf6); }
.avatar.big { width:52px; height:52px; font-size:20px; }
.who { display:flex; flex-direction:column; line-height:1.15; } .who small { color:var(--muted); font-size:12px; }
.usermenu .menu { position:absolute; right:0; top:calc(100% + 8px); min-width:230px; background:var(--card2); border:1px solid var(--line);
  border-radius:12px; padding:6px; box-shadow:0 18px 40px rgba(0,0,0,.45); }
.usermenu .menu a, .menu-row { display:flex; align-items:center; gap:10px; width:100%; padding:9px 10px; border-radius:8px; color:var(--text);
  background:none; border:0; font:inherit; cursor:pointer; text-align:left; }
.usermenu .menu a:hover, .menu-row:hover { background:var(--hover); text-decoration:none; }
.shell main { width:100%; max-width:1360px; margin:0 auto; padding:24px; flex:1; }
.foot { display:flex; justify-content:space-between; gap:12px; padding:14px 24px; border-top:1px solid var(--line); color:#5d687d; font-size:12px; }
.scrim { display:none; }
@media (max-width:900px) {
  .side { transform:translateX(-100%); box-shadow:0 0 40px rgba(0,0,0,.6); }
  body.side-open .side { transform:none; }
  body.side-open .scrim { display:block; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:25; }
  .shell { margin-left:0; } .menu-btn { display:inline-flex; }
  .topbar { padding:0 12px; } .shell main { padding:16px 12px; } .who { display:none; }
}

/* ---------- plain pages (sign in) ---------- */
body.plain { min-height:100vh; background:radial-gradient(1200px 600px at 50% -10%, rgba(79,124,255,.18), transparent 60%), var(--bg); }
.plain-main { max-width:560px; margin:0 auto; padding:9vh 16px 40px; }
.login-card { max-width:400px; margin:0 auto; padding:28px; }
.login-brand { display:flex; align-items:center; gap:12px; margin-bottom:22px; }
.login-card h1 { font-size:20px; margin-bottom:14px; }
.login-foot { text-align:center; margin-top:18px; }
button.wide, .button.wide { width:100%; padding:10px; margin-top:4px; }
.narrow { max-width:380px; margin:80px auto; }

/* ---------- page pieces ---------- */
.page-head { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; flex-wrap:wrap; margin-bottom:18px; }
.page-head h1 { margin:0; } .page-head p { margin:2px 0 0; }
.page-head .head-actions { display:flex; gap:8px; align-items:flex-end; flex-wrap:wrap; }
.section-title { margin:6px 0 10px; color:var(--muted); font-size:13px; text-transform:uppercase; letter-spacing:.06em; }
.tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; margin-bottom:18px; }
.tile { padding:16px 18px; background:var(--card); border:1px solid var(--line); border-radius:var(--radius); color:var(--text);
  transition:border-color .15s, transform .15s; }
.tile:hover { border-color:#3a4766; }
.tile-num { font-size:26px; font-weight:700; line-height:1.1; font-variant-numeric:tabular-nums; min-height:29px; }
.tile-label { color:#c2cad8; font-weight:500; } .tile-sub { color:var(--muted); font-size:12px; margin-top:4px; }
.tile.soon { border-style:dashed; }
.tile.sensitive { border-color:rgba(210,153,34,.4); }
.grid.dash-grid { grid-template-columns:repeat(auto-fit,minmax(360px,1fr)); align-items:start; }
.card-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; } .card-head h2 { margin:0; }
.mini-list { list-style:none; margin:0; padding:0; }
.mini-list li { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:center; padding:9px 0;
  border-bottom:1px solid var(--line); }
.mini-list li:last-child { border-bottom:0; }
.mini-list li > :first-child { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mini-right { text-align:right; white-space:nowrap; }
.card { background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:18px; margin-bottom:16px; }
.table-wrap { overflow-x:auto; border-radius:var(--radius); border:1px solid var(--line); }
.table-wrap > table.list { border:0; border-radius:0; }
.pill, button, .button { white-space:nowrap; }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; }
.grid .card { margin-bottom:0; } .grid + .card { margin-top:16px; }
.profile { display:flex; gap:14px; align-items:center; margin-bottom:14px; }
.grid.account-grid { grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); align-items:start; }
.filters { padding:14px 18px; }
.filter-row { display:flex; gap:14px; align-items:flex-end; flex-wrap:wrap; }
.filter-row > label { margin:0; min-width:140px; } .filter-row > label:last-of-type { flex:1; min-width:180px; }
/* shared cash period picker (_period.html) */
.period-tabs { display:flex; gap:6px; flex-wrap:wrap; }
.period-custom { flex:1; }
.period-custom label { min-width:130px; }
.period-custom label:last-of-type { flex:none; min-width:130px; }
.period-label { margin:8px 0 0; }
.totals-row td { border-top:2px solid var(--line, #333); }
label { display:block; margin-bottom:12px; font-weight:500; }
input, select, textarea { display:block; width:100%; margin-top:4px; padding:8px 10px; border:1px solid var(--input-line); border-radius:6px;
  font:inherit; background:var(--input); color:var(--text); }
input[type="checkbox"] { width:20px; height:20px; padding:0; margin:0; accent-color:var(--primary);
  cursor:pointer; vertical-align:middle; flex:none; }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(59,130,246,.25); }
input::placeholder { color:#6e7681; }
button, .button { display:inline-block; padding:8px 14px; border:1px solid var(--input-line); border-radius:6px; background:var(--card2);
  font:inherit; cursor:pointer; color:var(--text); }
button:hover, .button:hover { background:var(--hover); border-color:#4a5363; text-decoration:none; }
.primary { background:var(--primary); border-color:var(--primary); color:#fff !important; }
.primary:hover { background:var(--primary-hover); border-color:var(--primary-hover); }
.danger { border-color:var(--bad); color:var(--bad) !important; background:transparent; }
.danger:hover { background:var(--bad); color:#fff !important; }
table.list { width:100%; border-collapse:collapse; background:var(--card); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
table.list th, table.list td { text-align:left; padding:8px 10px; border-bottom:1px solid var(--line); vertical-align:top; }
table.list tr:last-child td { border-bottom:0; }
table.list th { background:var(--card2); font-weight:600; font-size:12px; text-transform:uppercase; color:var(--muted); }
table.compact th, table.compact td { padding:5px 8px; }
td.detail { max-width:420px; word-break:break-word; color:var(--muted); }
.pager { display:flex; gap:8px; margin-top:12px; }
dl { display:grid; grid-template-columns:130px 1fr; gap:6px 10px; margin:0; } dt { color:var(--muted); } dd { margin:0; word-break:break-word; }
.pill { display:inline-block; padding:1px 8px; border-radius:999px; font-size:12px; font-weight:600; border:1px solid transparent; }
.pill.on { background:rgba(63,185,80,.15); color:#56d364; border-color:rgba(63,185,80,.4); }
.pill.off { background:rgba(139,148,158,.12); color:#9ea7b3; border-color:rgba(139,148,158,.3); }
.pill.bad { background:rgba(248,81,73,.15); color:#ff7b72; border-color:rgba(248,81,73,.4); }
.pill.lvl1 { background:rgba(139,148,158,.12); color:#9ea7b3; border-color:rgba(139,148,158,.3); }
.pill.lvl2 { background:rgba(79,124,255,.15); color:#8fb0ff; border-color:rgba(79,124,255,.4); }
.pill.lvl3 { background:rgba(248,81,73,.15); color:#ff7b72; border-color:rgba(248,81,73,.4); }
.muted { color:var(--muted); } .small { font-size:12px; } .nowrap { white-space:nowrap; }
.flash { padding:10px 14px; border-radius:8px; margin-bottom:14px; border:1px solid transparent; }
.flash.ok { background:rgba(63,185,80,.12); color:#7ee787; border-color:rgba(63,185,80,.4); }
.flash.err { background:rgba(248,81,73,.12); color:#ffa198; border-color:rgba(248,81,73,.4); }
.flash.warn { background:rgba(210,153,34,.15); color:#e3b341; border-color:rgba(210,153,34,.4); }

/* ---------- idle sign-out warning ---------- */
#idle-banner { position:fixed; left:50%; bottom:18px; transform:translateX(-50%); z-index:80; padding:12px 20px;
  border-radius:12px; background:rgba(210,153,34,.97); color:#241a00; font-weight:700; box-shadow:0 12px 32px rgba(0,0,0,.5); }

::-webkit-scrollbar { width:10px; height:10px; } ::-webkit-scrollbar-track { background:var(--bg); }
::-webkit-scrollbar-thumb { background:#30363d; border-radius:5px; } ::-webkit-scrollbar-thumb:hover { background:#484f58; }

/* ---------- setup: users ---------- */
form.inline { display:inline-block; margin:0; }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:#30363d; margin-right:8px; vertical-align:middle; }
.dot.on { background:#56d364; box-shadow:0 0 6px rgba(86,211,100,.6); }
label.check { display:flex; align-items:center; gap:8px; }
label.check input { margin:0; }
.pw-row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin:6px 0 14px; }
.pw { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:26px; letter-spacing:.06em;
  background:var(--card2); border:1px solid var(--line); border-radius:8px; padding:10px 16px;
  white-space:nowrap; overflow-x:auto; max-width:100%; }
.pw span + span { margin-left:.45em; }  /* visual groups of 4 only: copying gives the password without spaces */
.forgot-link { text-align:center; margin:12px 0 0; }

/* ---------- setup: stations / collectors ---------- */
.qr-card { max-width:420px; text-align:center; }
.qr svg { width:260px; height:260px; }
.collect-msg { font-size:19px; line-height:1.5; text-align:center; padding:12px 0; }

/* customers */
.acct { font-weight:700; letter-spacing:.03em; }
.cust-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; margin-bottom:8px; }
.cust-name { font-size:22px; font-weight:700; }
.cust-name-ar { font-size:17px; color:var(--muted); margin-top:2px; }
.flags { margin-top:8px; display:flex; gap:6px; flex-wrap:wrap; }
.grid2 { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px 16px; }
.filter-row .grow { flex:1; min-width:200px; }
.nav-badge { margin-left:auto; min-width:20px; text-align:center; padding:1px 7px; border-radius:999px;
  font-size:11px; font-weight:700; background:var(--primary); color:#fff; }
.pager { display:flex; gap:14px; align-items:center; justify-content:center; margin:14px 0; }
.dup-list { margin:8px 0 4px; padding-left:18px; }
.dup-list a { font-weight:700; }
.check-row { display:flex; align-items:center; gap:8px; font-size:14px; }
.check-row input { margin:0; }
.inline { display:inline-block; }
.inline-edit { display:inline-block; }
.inline-edit summary { display:inline-block; }
.mt { margin-top:10px; }
.edit-box summary { cursor:pointer; }
.item-list li.item-block { display:block; }
.item-row { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.item-main { display:flex; align-items:center; gap:10px; flex-wrap:wrap; min-width:0; }
.item-main .small-btn { padding:3px 10px; font-size:12px; }
.item-actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.item-actions button, .item-actions .button { padding:4px 12px; font-size:13px; }
.row-form { margin-top:10px; padding:12px; border:1px solid var(--line); border-radius:var(--radius); }
.card-head { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.card-head h2 { margin:0; }
.hist li { display:block; padding:4px 0; font-size:14px; }
.add-box > summary { cursor:pointer; }
.add-box[open] > summary { margin-bottom:10px; }
.addr-list { list-style:none; margin:0; padding:0; }
.addr-list > li { padding:10px 0; border-bottom:1px solid var(--line); }
.addr-list > li:last-child { border-bottom:0; }
.addr-head { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.subhead { font-size:14px; color:var(--muted); margin:16px 0 6px; }
@media (max-width:640px) {
  .hsm { display:none; }
  .cust-name { font-size:19px; }
}

/* UPSILON suggestions + links */
.ups-panel { margin:8px 0; padding:10px; border:1px dashed var(--input-line); border-radius:8px; }
.ups-title { font-size:12px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin-bottom:6px; }
.ups-card { padding:8px 0; border-bottom:1px solid var(--line); }
.ups-card:last-child { border-bottom:0; }
.ups-card.linked { opacity:.55; }
.ups-card.picked { opacity:.7; }
.ups-head { display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; }
.ups-card a.small, .ups-card [data-fill] { margin-left:8px; }
.ups-card button { margin-top:6px; }
.ups-chips { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:6px; }
.ups-chips:empty { display:none; }
.chip { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border:1px solid var(--input-line);
        border-radius:999px; background:var(--card2); font-size:13px; }
.chip button { padding:0 4px; border:0; background:none; color:var(--muted); font-size:13px; }
.chip button:hover { color:var(--text); background:none; border:0; }
.ups-block { padding:10px 0; border-bottom:1px solid var(--line); }
.ups-block:last-of-type { border-bottom:0; }
.small-table { font-size:13px; }

/* codes page: ignored row's controls stay submitted but look/feel off */
.ign-ctl { display:contents; }
.ign-ctl.ign label, .ign-ctl.ign .pill, .ign-ctl.ign form,
.ign-ctl.ign .ups-chips, .ign-ctl.ign select, .ign-ctl.ign input { opacity:.4; pointer-events:none; }

/* /upsilon/services: one compact edit line per package row */
.map-edit { align-items:center; gap:10px; margin-top:8px; }
.map-edit .ups-chips { margin-bottom:0; }
.map-edit .map-add { width:auto; max-width:220px; min-width:0; margin-top:0; }
.map-edit .map-note { flex:1 1 120px; min-width:120px; max-width:200px; margin-top:0; }
.map-edit label.check { flex:none; min-width:0; }  /* .filter-row's last-label flex:1 would eat the line */

/* totals row on setup lists */
.total-row td { border-top:2px solid var(--line); border-bottom:0; }

/* ---- sortable tables ---- */
table.sortable th[data-ci] { cursor: pointer; user-select: none; }
table.sortable th[data-ci]:hover, th a.sortlink:hover { color: var(--ink); text-decoration: underline; }
th a.sortlink { color: inherit; text-decoration: none; display: block; }
th a.sortlink:focus-visible { outline: 2px solid var(--brand, #06c); outline-offset: -2px; }
table.sortable th[data-ci]:focus-visible { outline: 2px solid var(--brand, #06c); outline-offset: -2px; }

/* ---- bulk bar + balance column ---- */
.bulkbar { position:fixed; left:50%; transform:translateX(-50%); bottom:14px; z-index:60;
  display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:10px 16px;
  background:var(--card2); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:0 8px 24px rgba(0,0,0,.5); }
.bulkbar[hidden] { display:none; }
body.has-bulkbar main { padding-bottom:140px; }
.bulkbar select { max-width:170px; }
.pick-col { width:1%; }
.bal-owe { color:var(--bad); }
.bal-credit { color:var(--ok); }
@media (max-width:640px) { .bulkbar { left:8px; right:8px; transform:none; } }

/* ---- starting balance ---- */
.fix-hl { outline:2px solid var(--warn, #d97706); outline-offset:4px; border-radius:var(--radius); }
.item-row > .pick { flex:0 0 auto; align-self:flex-start; margin:1px 8px 0 0; }
.item-row > .pick + .item-main { flex:1 1 auto; }  /* info sits right next to its tick */
.bal-pick .pick-slot { flex:0 0 auto; width:28px; }
.bal-pick .item-main { flex:1 1 0; white-space:normal; }
.bal-pick .item-actions { margin-left:auto; }
.svc-off { opacity:.55; }
.svc-addons { display:inline-flex; gap:12px; flex-wrap:wrap; align-items:center; }
.svc-panel { margin-top:4px; padding-top:6px; border-top:1px dashed var(--input-line); }
.svc-panel > form + form, .svc-panel > .filter-row + form { margin-top:6px; }

/* ---------- foldable side menu on computers (rail of icons; phones keep the drawer) ---------- */
@media (min-width:901px) {
  body.side-folded .side { width:var(--side-folded-w); padding:16px 10px; overflow:visible; }
  body.side-folded .shell { margin-left:var(--side-folded-w); }
  body.side-folded .brand { justify-content:center; padding:6px 0 18px; }
  body.side-folded .brand-text, body.side-folded .nav-item > span:not(.nav-badge) { position:absolute; width:1px; height:1px;
    margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }  /* hidden visually, still read; badges stay */
  body.side-folded .nav-item { justify-content:center; padding:9px 0; position:relative; }
  body.side-folded .nav-badge { position:absolute; top:2px; right:8px; min-width:16px; height:16px;
    padding:0 4px; font-size:10px; line-height:16px; margin:0; }  /* count becomes a bubble on the icon */
  body.side-folded .nav-group { font-size:0; height:1px; padding:0; margin:8px 10px; background:var(--line); }
  body.side-folded .nav-item:hover::after, body.side-folded .nav-item:focus-visible::after {
    content:attr(data-label); position:absolute; left:calc(100% + 12px); top:50%; transform:translateY(-50%);
    background:var(--card2); border:1px solid var(--line); color:var(--text); padding:6px 10px; border-radius:8px;
    font-size:13px; font-weight:500; white-space:nowrap; box-shadow:0 8px 24px rgba(0,0,0,.4);
    pointer-events:none; z-index:40; }
}
@media (min-width:901px) and (max-height:620px) {  /* short windows: scrolling beats the tooltip */
  body.side-folded .side { overflow-y:auto; }
}

/* ---------- compact customer rows: office phones get them via the media query,
   the collector app (.collect-app) always does ---------- */
.m-list, .sort-fields, .phone-only { display:none; }
.m-list { background:var(--card); border:1px solid var(--line); border-radius:14px; }
.m-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center;
  padding:10px 12px; min-height:44px; color:var(--text); border-bottom:1px solid var(--line); }
.m-row:last-child { border-bottom:0; }
.m-row:hover { text-decoration:none; }
.m-row:active { background:var(--hover); }
.m-main { display:flex; flex-direction:column; gap:1px; min-width:0; }
.m-name { font-weight:600; overflow-wrap:anywhere; }
.m-name-ar { unicode-bidi:plaintext; text-align:left; overflow-wrap:anywhere;
  font-family:"Noto Sans Arabic","Noto Kufi Arabic",Tahoma,sans-serif; }
.m-sub { color:var(--muted); font-size:12.5px; }
.m-acct { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
.m-side { white-space:nowrap; text-align:right; }
@media (max-width:640px) {
  .results-table { display:none; }
  .m-list { display:block; }
  .phone-only { display:inline; }
  .sort-fields { display:flex; gap:8px; width:100%; }
  .sort-fields select { flex:1; width:auto; min-width:0; min-height:44px; margin-top:0; }
  .filter-row input[name="q"] { font-size:16px; min-height:44px; }  /* 16px stops iOS zoom-on-focus */
  .filter-row button.primary { min-height:44px; }
  .pager .button { display:inline-flex; align-items:center; min-height:44px; }
}

/* ---------- collect (collector phone pages) ---------- */
.collect-app .m-list { display:block; }
.plain-main.collect-main { padding-top:12px; }   /* phone pages start right under the banner */
.collect-figure .figure-top { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:8px;
  font-size:12px; line-height:18px; }   /* label | name centred in the box | empty */
.collect-figure .figure-who { color:var(--muted); font-weight:600; text-align:center; overflow-wrap:anywhere; }
.collect-figure .figure-num { font-size:30px; font-weight:700; }
.collect-bal { text-align:center; }
.collect-bal .money-big { font-size:26px; }
.collect-app a.m-row { color:var(--text); }
.collect-app .m-row.muted { opacity:.55; }

/* the home's All / Unpaid / Paid picker — three small square on/off buttons on one line */
.f-chips { flex:1 1 100%; display:flex; gap:6px; }
.f-chips .f-chip { display:inline-flex; margin:0; cursor:pointer; }
.f-chips .f-chip input { position:absolute; opacity:0; width:1px; height:1px; margin:0; }
.f-chips .f-chip span { display:inline-flex; align-items:center; height:32px; padding:0 14px; border-radius:4px;
  border:1px solid var(--input-line); color:var(--muted); font-size:13px; font-weight:500; }
.f-chips .f-chip input:checked + span { background:var(--primary); border-color:var(--primary); color:#fff; }
.f-chips .f-chip input:focus-visible + span { box-shadow:0 0 0 3px rgba(79,124,255,.35); }

/* the settings page's plain-text receipt preview */
.receipt-text { max-width:300px; margin:0 auto; padding:12px; background:#fff; color:#111;
  border-radius:8px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12px;
  white-space:pre-wrap; overflow-wrap:anywhere; }

/* ---------- money: balances, tables, receipt, print ---------- */
.money-big { font-size:19px; }
table.list th.num, table.list td.num { text-align:right; font-variant-numeric:tabular-nums; }
.mini-right { justify-self:end; text-align:right; }
/* money "Latest" rows never truncate: the what wraps, the date sits small+muted under it */
.mini-list li.mline > .ml-what { overflow:visible; text-overflow:clip; white-space:normal;
  overflow-wrap:break-word; display:flex; flex-direction:column; gap:1px; }

/* receipt — a narrow slip (~72 mm) inside the normal page */
.receipt { max-width:300px; margin:0 auto; padding:18px 16px; background:#fff; color:#111;
  border-radius:10px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:13px; line-height:1.5; }
.receipt a { color:#111; }
.receipt-head { display:flex; flex-direction:column; align-items:center; text-align:center;
  border-bottom:1px dashed #999; padding-bottom:8px; margin-bottom:8px; }
.receipt-head strong { font-size:15px; }
.receipt-copy { text-align:center; font-weight:700; letter-spacing:.2em; border:1px solid #111;
  margin:6px 0; padding:2px 0; }
.receipt-cancelled { text-align:center; font-weight:700; color:#b00020; border:1px solid #b00020;
  margin:6px 0; padding:2px 4px; }
.receipt-row { display:block; margin:2px 0; }
.receipt-paid { text-align:center; font-size:17px; font-weight:700; margin:10px 0; }
.receipt-for { font-weight:700; margin-top:8px; }
.receipt-line { display:flex; justify-content:space-between; gap:10px; }
.receipt-line > :first-child { min-width:0; }
.muted-line { color:#444; font-size:12px; }
.receipt-thanks { text-align:center; margin-top:12px; border-top:1px dashed #999; padding-top:8px; }

@media print {
  body.app { background:#fff; }
  .side, .topbar, .foot, .test-banner, .scrim, #idle-banner, .flash, .no-print { display:none !important; }
  .shell { display:block; }
  main { padding:0 !important; }
  .print-page > *:not(.print-area) { display:none !important; }
  .print-area { border:0 !important; padding:0 !important; background:#fff !important; color:#111; }
  .print-area table.list { color:#111; background:#fff; border-color:#999; }
  .print-area table.list th, .print-area table.list td { border-color:#bbb; }
  .print-area a { color:#111; text-decoration:none; }
  .print-area .muted { color:#555; }
  .print-area .bal-owe, .print-area .bal-credit { color:#111; }
  .receipt.print-area { max-width:72mm; }
  .table-wrap { overflow:visible; border:0; }
}
