/* PVA Office — dark workspace with a single lime accent.
   Layout: top pill nav on desktop, bottom tab bar on phones; list/detail split for documents. */
:root {
  --bg: #0a0b0d;
  --bg-2: #0f1013;
  --card: #15171b;
  --card-2: #1b1e23;
  --card-3: #23272d;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --ink: #f3f4f6;
  --ink-2: #c8cbd1;
  --muted: #8b9099;
  --dim: #5f646d;
  --lime: #c5f04a;
  --lime-2: #d4f773;
  --lime-ink: #10140a;
  --lime-soft: rgba(197, 240, 74, .13);
  --paper: #f4f4f1;
  --paper-2: #e9e9e4;
  --paper-ink: #121418;
  --paper-muted: #6c7078;
  --paper-line: rgba(18, 20, 24, .08);
  --red: #ff7d6b;
  --red-soft: rgba(255, 125, 107, .14);
  --amber: #f1c35c;
  --amber-soft: rgba(241, 195, 92, .15);
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --f-ui: "Geist", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --tabbar-h: 0px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
[hidden] { display: none !important; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--f-ui); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; font-feature-settings: "ss01", "cv11";
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 calc(40px + var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -.015em; text-wrap: balance; }
.wrap { max-width: 1320px; margin: 0 auto; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 14px;
  max-width: 1320px; margin: 0 auto; padding-block: 14px;
  background: linear-gradient(var(--bg) 70%, rgba(10, 11, 13, 0));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 21; background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand svg { width: 52px; height: auto; display: block; }
.brand span { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.pillnav {
  display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: var(--paper);
  margin-inline: auto; box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}
.pillnav a {
  text-decoration: none; color: var(--paper-ink); font-size: 13px; font-weight: 500; padding: 8px 15px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s; white-space: nowrap;
}
.pillnav a:hover { background: var(--paper-2); }
.pillnav a[aria-current="page"] { background: var(--lime); color: var(--lime-ink); }
.pillnav .lead { width: 34px; height: 34px; padding: 0; justify-content: center; border: 1px solid var(--paper-line); }
.top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2);
  display: inline-grid; place-items: center; transition: background .15s, color .15s, transform .15s; position: relative; flex-shrink: 0;
}
.iconbtn:hover { background: var(--card-3); color: var(--ink); }
.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 17px; height: 17px; }
.iconbtn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600;
  background: var(--card-3); color: var(--ink); border: 2px solid var(--bg); flex-shrink: 0; letter-spacing: .02em; text-transform: uppercase;
}
.avatar.lg { width: 42px; height: 42px; font-size: 14px; }
.avatar.lime { background: var(--lime); color: var(--lime-ink); }
.avatar.onpaper { background: var(--paper-2); color: var(--paper-ink); border-color: var(--paper); }
.avatars { display: flex; }
.avatars .avatar { margin-left: -9px; width: 30px; height: 30px; font-size: 11px; }
.avatars .avatar:first-child { margin-left: 0; }
.kbd { font-size: 11px; color: var(--dim); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; }
.searchbtn { width: auto; padding: 0 12px 0 11px; border-radius: 999px; gap: 8px; display: inline-flex; align-items: center; color: var(--muted); font-size: 13px; }

/* ---------- page head ---------- */
.pagehead { display: flex; align-items: center; gap: 14px; margin: 18px 0 22px; flex-wrap: wrap; }
.pagehead h1 { font-size: clamp(34px, 5vw, 54px); font-weight: 300; letter-spacing: -.035em; line-height: 1; }
.pagehead .grow { flex: 1; }
.pagehead .sub { color: var(--muted); font-size: 13px; width: 100%; margin-top: -8px; }
.backbtn { width: 40px; height: 40px; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line-2); background: var(--card-2); color: var(--ink); padding: 9px 16px; border-radius: 999px; font-weight: 500;
  font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; text-decoration: none;
  transition: background .15s, transform .12s, border-color .15s, color .15s; min-height: 38px;
}
.btn:hover { background: var(--card-3); }
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn.lime { background: var(--lime); color: var(--lime-ink); border-color: transparent; font-weight: 600; }
.btn.lime:hover { background: var(--lime-2); }
.btn.light { background: var(--paper); color: var(--paper-ink); border-color: transparent; }
.btn.light:hover { background: #fff; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--card-2); }
.btn.danger { color: var(--red); }
.btn.danger.armed { background: var(--red); color: #1a0703; border-color: transparent; }
.btn.small { padding: 5px 12px; min-height: 30px; font-size: 12.5px; }
.btn.big { padding: 13px 22px; font-size: 15px; min-height: 48px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }
.btn .count { background: rgba(0, 0, 0, .25); border-radius: 999px; padding: 0 7px; font-size: 11px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 22px; min-width: 0; }
.card.tight { padding: 16px 18px; border-radius: var(--r-lg); }
.card h2 { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .hint { font-size: 12px; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.grid.halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.label { font-size: 12.5px; color: var(--muted); }
.big-num { font-size: clamp(26px, 3vw, 34px); font-weight: 400; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; }
.big-num .cur { font-size: .5em; color: var(--muted); vertical-align: .55em; margin-right: 3px; font-weight: 400; }
.big-num .unit { font-size: .5em; color: var(--muted); margin-left: 4px; }
.metric { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.metrics > .metric { padding: 0 22px; border-left: 1px solid var(--line); }
.metrics > .metric:first-child { padding-left: 0; border-left: 0; }
.track { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; display: flex; }
.track > i { display: block; height: 100%; background: var(--lime); border-radius: 999px; transition: width .8s var(--ease); }
.track > i.red { background: var(--red); }
.track > i.amber { background: var(--amber); }
.track > i.grey { background: var(--dim); }
.metric-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; min-height: 30px; }
.metric-foot .label { font-size: 11.5px; }

/* mode tiles (collected card) */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; margin-top: 18px; }
.tile { border-radius: 16px; padding: 12px; background: var(--card-2); border: 1px solid var(--line); min-height: 86px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.tile b { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile span { font-size: 11px; color: var(--muted); }
.tile.hot { background: var(--lime); color: var(--lime-ink); min-height: 112px; border-color: transparent; }
.tile.hot span { color: rgba(16, 20, 10, .65); }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; padding: 3px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--line-2); color: var(--ink-2); }
.pill.paid, .pill.accepted { background: var(--lime); color: var(--lime-ink); border-color: transparent; }
.pill.overdue, .pill.declined { background: var(--red-soft); color: var(--red); border-color: transparent; }
.pill.partial, .pill.pending { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.pill.draft, .pill.expired { background: rgba(255, 255, 255, .06); color: var(--muted); border-color: transparent; }
.pill.cancelled { color: var(--dim); text-decoration: line-through; }
.pill.converted { color: var(--muted); }
.rows .pill { border-color: var(--paper-line); color: var(--paper-ink); }
.rows .pill.draft, .rows .pill.expired { background: var(--paper-2); color: var(--paper-muted); }
.rows .pill.overdue, .rows .pill.declined { background: #ffe3dd; color: #b23a26; }
.rows .pill.partial, .rows .pill.pending { background: #fbefcf; color: #8a5f00; }
.rows .pill.cancelled { color: var(--paper-muted); }

/* ---------- segmented ---------- */
.seg { display: inline-flex; gap: 3px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 500; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; transition: background .2s, color .2s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--lime); color: var(--lime-ink); }
.seg button .n { font-size: 10.5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center; background: rgba(255, 255, 255, .1); }
.seg button[aria-pressed="true"] .n { background: var(--lime-ink); color: var(--lime); }
.kindtabs { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; padding-bottom: 2px; }
.kindtabs::-webkit-scrollbar { display: none; }
.kindtabs a { text-decoration: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; transition: background .2s; }
.kindtabs a:hover { background: var(--card-2); }
.kindtabs a[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: transparent; }
.kindtabs a .n { font-size: 11px; color: var(--muted); }
.kindtabs a[aria-current="page"] .n { color: var(--dim); }

/* ---------- filters ---------- */
.filters { display: flex; align-items: center; gap: 8px; margin: 18px 0 14px; flex-wrap: wrap; }
.filters .flabel { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; margin-right: 8px; }
.filters .flabel b { width: 22px; height: 22px; border-radius: 50%; background: var(--paper); color: var(--paper-ink); font-size: 11px; display: inline-grid; place-items: center; font-weight: 600; }
.control, .filters select, .filters input {
  background: var(--card); border: 1px solid var(--line-2); border-radius: 999px; padding: 9px 14px; min-height: 40px; font-size: 13px; color: var(--ink-2);
  min-width: 0;
}
.filters select { padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b9099' stroke-width='2.2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.filters .search { flex: 1; min-width: 180px; }
.filters .ftoggle { display: none; }
.filters input[type="date"] { color-scheme: dark; }

/* ---------- list/detail ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.paper { background: var(--paper); color: var(--paper-ink); border-radius: var(--r-xl); position: relative; }
.split.has-detail .paper { display: grid; grid-template-columns: minmax(300px, 410px) minmax(0, 1fr); gap: 14px; padding: 14px; }
.listpane { padding: 8px 6px; min-width: 0; }
.listpane .phead { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 8px; gap: 10px; }
.listpane .phead h2 { font-size: 15px; font-weight: 500; }
.listpane .phead .meta { font-size: 12px; color: var(--paper-muted); }
.rows { display: flex; flex-direction: column; gap: 2px; }
.row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 999px;
  text-decoration: none; color: inherit; transition: background .15s, color .15s; cursor: pointer; border: 0; background: transparent; text-align: left; width: 100%;
}
.row:hover { background: var(--paper-2); }
.row[aria-current="true"] { background: #16181c; color: var(--ink); }
.row[aria-current="true"] .avatar.onpaper { background: var(--card-3); color: var(--ink); border-color: #16181c; }
.row[aria-current="true"] .pill { background: var(--paper); color: var(--paper-ink); border-color: transparent; }
.row[aria-current="true"] .sub { color: var(--muted); }
.row .t { min-width: 0; }
.row .t b { display: block; font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { display: block; font-size: 11.5px; color: var(--paper-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .amt { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 400; letter-spacing: -.02em; text-align: right; white-space: nowrap; }
.row .amt .cur { font-size: 10px; color: var(--paper-muted); margin-right: 2px; vertical-align: .45em; }
.row[aria-current="true"] .amt .cur { color: var(--muted); }
.list-empty { padding: 40px 18px; text-align: center; color: var(--paper-muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.list-empty h3 { color: var(--paper-ink); font-size: 18px; font-weight: 500; }
.list-empty .btn { background: var(--paper-ink); color: var(--paper); border-color: transparent; }
.floating-seg { position: absolute; top: -21px; left: 50%; transform: translateX(-50%); z-index: 2; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); max-width: calc(100% - 24px); }
.has-floating-seg { margin-top: 32px; }

/* detail pane */
.detail { background: #16181c; color: var(--ink); border-radius: var(--r-lg); padding: 22px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.detail-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.detail-top .label { margin-bottom: 8px; display: block; }
.docno { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.docno .hash { font-size: 15px; color: var(--muted); }
.docno b { font-size: clamp(24px, 2.6vw, 32px); font-weight: 400; letter-spacing: -.03em; }
.party-name { font-size: 18px; font-weight: 500; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; }
.party-line { display: flex; gap: 10px; align-items: center; }
.party-line .t { min-width: 0; }
.party-line b { display: block; font-weight: 500; font-size: 13.5px; }
.party-line small { color: var(--muted); font-size: 11.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datesline { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.datesline b { color: var(--ink); font-weight: 500; }
.itemcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.itemcard { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-width: 0; position: relative; }
.itemcard .amt { font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.itemcard .amt .cur { font-size: 10px; color: var(--muted); vertical-align: .5em; margin-right: 2px; }
.itemcard .nm { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.itemcard .q { font-size: 11px; color: var(--muted); }
.itemcard .go { position: absolute; top: 12px; right: 12px; color: var(--muted); width: 14px; height: 14px; }
.itemcard.add { align-items: center; justify-content: center; border-style: dashed; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, .025) 6px 12px); color: var(--muted); text-decoration: none; }
.itemcard.add span { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; }
.sumbar { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 12px 12px 18px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.sumbar .s { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sumbar .s small { font-size: 11px; color: var(--muted); }
.sumbar .s b { font-size: 18px; font-weight: 400; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sumbar .s b .cur { font-size: 10px; color: var(--muted); vertical-align: .5em; margin-right: 2px; }
.sumbar .grow { flex: 1; }
.sumbar .acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sec-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; }
.plist { display: flex; flex-direction: column; }
.plist .pr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.plist .pr:first-child { border-top: 0; }
.plist .pr small { display: block; color: var(--muted); font-size: 11.5px; }
.plist .pr .num { font-size: 14px; }
.links { display: flex; gap: 8px; flex-wrap: wrap; }
.links a { text-decoration: none; }
.notice { border-radius: var(--r-md); padding: 12px 14px; background: var(--card-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.notice.warn { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.notice.err { background: var(--red-soft); border-color: transparent; color: var(--red); }

/* menus */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; bottom: calc(100% + 8px); min-width: 230px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 6px; box-shadow: var(--shadow); z-index: 30; display: flex; flex-direction: column; }
.menu.down { bottom: auto; top: calc(100% + 8px); }
.menu button, .menu a { border: 0; background: transparent; text-align: left; padding: 9px 12px; border-radius: 10px; font-size: 13px; color: var(--ink); display: flex; gap: 10px; align-items: center; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--card-3); }
.menu svg { width: 16px; height: 16px; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.menu .danger { color: var(--red); }

/* ---------- overview ---------- */
.ov-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); gap: 16px; }
.ov-grid .wide { grid-column: 1 / -1; }
.recv .metric .big-num { font-size: clamp(26px, 2.8vw, 34px); }
.recv { display: flex; flex-direction: column; gap: 22px; }
.aging { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.aging .ab { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.aging .ab b { font-weight: 400; font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.aging .ab .track { height: 4px; }
.bars-chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.bars-chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars-chart .stack { width: 100%; max-width: 36px; display: flex; align-items: flex-end; gap: 3px; height: 100%; }
.bars-chart .stack i { flex: 1; border-radius: 8px 8px 3px 3px; background: #3b4048; min-height: 3px; transition: height .8s var(--ease); }
.bars-chart .stack i.l { background: var(--lime); }
.bars-chart .col span { font-size: 11px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: #3b4048; }
.legend i.l { background: var(--lime); }
.legend i.r { background: var(--red); }
.legend i.a { background: var(--amber); }
.feed { display: flex; flex-direction: column; }
.feed .fi { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.feed .fi:first-child { border-top: 0; }
.feed .fi b { font-weight: 500; }
.feed .fi small { display: block; color: var(--muted); font-size: 11.5px; }
.feed .fi .t { min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.feed .fi .when { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.statrow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.statrow:first-of-type { border-top: 0; }
.statrow b { font-weight: 400; font-variant-numeric: tabular-nums; font-size: 15px; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 12px; }
.fgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fgrid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label, .field > .flabel2 { font-size: 12px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea, .input {
  background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; min-height: 42px; width: 100%; min-width: 0;
  color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s; font-size: 14px;
}
.field textarea { min-height: 76px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.field input[type="date"], .field input[type="time"] { color-scheme: dark; -webkit-appearance: none; appearance: none; display: block; text-align: left; }
.field select, select.input { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b9099' stroke-width='2.2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field select option { background: var(--card-2); }
.field .help { font-size: 11.5px; color: var(--muted); }
.field .err { font-size: 11.5px; color: var(--red); }
.field.invalid input { border-color: var(--red); }
.form-error { color: var(--red); font-size: 13px; min-height: 0; }
.form-error:not(:empty) { padding: 10px 12px; background: var(--red-soft); border-radius: 12px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; cursor: pointer; }
.toggle:first-child { border-top: 0; }
.toggle small { display: block; color: var(--muted); font-size: 11.5px; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; vertical-align: middle; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--card-3); transition: background .2s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-2); transition: transform .2s var(--ease), background .2s; }
.switch input:checked + i { background: var(--lime); }
.switch input:checked + i::after { transform: translateX(18px); background: var(--lime-ink); }
.switch input:focus-visible + i { outline: 2px solid var(--lime); outline-offset: 2px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 5px 11px; font-size: 12px; color: var(--ink-2); white-space: nowrap; flex-shrink: 0; text-decoration: none; }
.chip:hover { background: var(--card-2); }
.chip[aria-pressed="true"] { background: var(--lime); color: var(--lime-ink); border-color: transparent; }

/* ---------- editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.editor .side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; }
.editor .card h2 { margin-bottom: 14px; color: var(--ink); font-size: 16px; }
.lines { display: flex; flex-direction: column; gap: 10px; }
.line { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) 84px 120px 76px 92px 110px 36px; align-items: start; animation: rise .25s var(--ease); }
.line .field > label { font-size: 11px; }
.line .field input, .line .field select { min-height: 38px; padding: 8px 10px; font-size: 13.5px; }
.line .desc { grid-column: 1 / -2; }
.line .desc textarea { min-height: 38px; font-size: 13px; padding: 8px 10px; }
.line .lamt { text-align: right; font-variant-numeric: tabular-nums; padding-top: 30px; font-size: 14px; }
.line .lamt small { display: block; font-size: 11px; color: var(--muted); }
.line .rm { margin-top: 24px; width: 36px; height: 36px; }
.line .meta-row { grid-column: 1 / -2; display: flex; gap: 10px; }
.line .meta-row .field { max-width: 150px; min-width: 104px; }
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--card-2); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 6px; box-shadow: var(--shadow); z-index: 25; max-height: 280px; overflow-y: auto; }
.combo-list button { display: flex; width: 100%; text-align: left; gap: 10px; align-items: center; border: 0; background: transparent; padding: 9px 10px; border-radius: 10px; font-size: 13px; color: var(--ink); }
.combo-list button:hover, .combo-list button.active { background: var(--card-3); }
.combo-list small { color: var(--muted); font-size: 11.5px; display: block; }
.combo-list .t { min-width: 0; flex: 1; }
.combo-list .r { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.partycard { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.partycard .t b { display: block; font-weight: 500; }
.partycard .t small { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
.totals { display: flex; flex-direction: column; }
.totals .tr { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.totals .tr.grand { border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 12px; color: var(--ink); align-items: baseline; }
.totals .tr.grand b { font-size: 28px; font-weight: 400; letter-spacing: -.03em; }
.totals .words { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.addline { border: 1px dashed var(--line-2); background: transparent; border-radius: var(--r-md); padding: 12px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 13px; }
.addline:hover { background: var(--card-2); color: var(--ink); }
.addline svg { width: 16px; height: 16px; }
.savebar { display: none; }

/* ---------- sheets / modals ---------- */
.layer { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; background: rgba(0, 0, 0, .55); animation: fade .2s ease; }
.layer.center { justify-content: center; align-items: flex-start; padding-top: 10vh; }
.sheet {
  width: min(560px, 100%); height: 100%; background: var(--bg-2); border-left: 1px solid var(--line-2); overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; animation: slidein .32s var(--ease);
}
.layer.center .sheet { height: auto; max-height: 80vh; border-radius: var(--r-lg); border: 1px solid var(--line-2); width: min(640px, calc(100% - 32px)); animation: pop .22s var(--ease); }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: calc(16px + env(safe-area-inset-top, 0px)) 22px 14px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.layer.center .sheet-head { padding-top: 16px; }
.sheet-head h2 { font-size: 20px; font-weight: 400; flex: 1; letter-spacing: -.02em; }
.sheet-body { padding: 18px 22px; flex: 1; }
.sheet-foot { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 12px 22px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bg-2); border-top: 1px solid var(--line); flex-wrap: wrap; }
.sheet-foot .grow { flex: 1; }
.grabber { display: none; }
.palette-input { width: 100%; background: transparent; border: 0; font-size: 17px; padding: 6px 0; color: var(--ink); }
.palette-input:focus { outline: none; }
.palette-list { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.palette-list a, .palette-list button { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; text-decoration: none; color: var(--ink); border: 0; background: transparent; text-align: left; font-size: 13.5px; width: 100%; }
.palette-list a.active, .palette-list a:hover, .palette-list button:hover, .palette-list button.active { background: var(--card-2); }
.palette-list svg { width: 16px; height: 16px; color: var(--muted); }
.palette-list small { color: var(--muted); font-size: 12px; }
.palette-group { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); padding: 10px 10px 4px; }
.create-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.create-grid a { text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 18px; min-height: 104px; transition: background .15s, transform .15s; }
.create-grid a:hover { background: var(--card-2); transform: translateY(-2px); }
.create-grid a svg { width: 22px; height: 22px; color: var(--lime); }
.create-grid a b { font-weight: 500; font-size: 13.5px; }
.create-grid a small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.create-grid a.primary { background: var(--lime); color: var(--lime-ink); }
.create-grid a.primary svg { color: var(--lime-ink); }
.create-grid a.primary small { color: rgba(16, 20, 10, .65); }

/* ---------- tables (expenses ledger etc.) ---------- */
.tablewrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--card); }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 860px; }
table.t th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background .15s; }
table.t tbody tr:hover { background: var(--card-2); }
table.t .r { text-align: right; }
table.t .amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tfoot td { background: var(--card-2); font-weight: 500; }
table.t small { display: block; color: var(--muted); font-size: 11.5px; }
.owner-line { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.lock { display: inline-block; width: 10px; height: 11px; vertical-align: -1px; margin-right: 4px; }
.rowacts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.pos { color: var(--lime); }
.neg { color: var(--red); }
.bar-list { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13px; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bar-row .amt { font-variant-numeric: tabular-nums; font-size: 12.5px; text-align: right; white-space: nowrap; }
.bar-row .pct { color: var(--muted); font-size: 11px; margin-left: 5px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart svg text { fill: var(--muted); font-size: 11px; font-family: var(--f-ui); }
.empty-mini { color: var(--muted); font-size: 13px; padding: 6px 0; }
.chipsrow { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chipsrow::-webkit-scrollbar { display: none; }

/* ---------- activity ---------- */
.log-day { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); margin: 16px 4px 8px; }
.log-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); margin-bottom: 8px; align-items: start; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--dim); }
.log-dot.created, .log-dot.issued, .log-dot.payment_added { background: var(--lime); }
.log-dot.deleted, .log-dot.cancelled, .log-dot.payment_removed, .log-dot.archived { background: var(--red); }
.log-line { font-size: 14px; overflow-wrap: anywhere; }
.log-line b { font-weight: 500; }
.log-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.log-changes { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.log-changes li { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 8px; }
.log-changes .f { color: var(--muted); }
.log-changes .v { overflow-wrap: anywhere; }
.log-changes s { color: var(--dim); }
.log-changes .arrow { color: var(--dim); margin: 0 5px; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { text-decoration: none; padding: 9px 14px; border-radius: 999px; color: var(--ink-2); font-size: 13.5px; }
.settings-nav a:hover { background: var(--card); }
.settings-sections { display: flex; flex-direction: column; gap: 16px; }
.settings-sections .card { scroll-margin-top: 84px; }
.logo-preview { background: var(--paper); border-radius: var(--r-md); padding: 18px; display: grid; place-items: center; min-height: 100px; color: var(--paper-ink); }
.logo-preview svg, .logo-preview img { max-height: 64px; width: auto; max-width: 220px; }
.numrow { display: grid; grid-template-columns: minmax(0, 1.2fr) 90px 90px 110px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.numrow:first-child { border-top: 0; }
.numrow input:not([type="checkbox"]) { background: var(--card-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; min-height: 38px; width: 100%; color: var(--ink); }
.numrow .prev { font-variant-numeric: tabular-nums; color: var(--lime); font-size: 13px; text-align: right; }
.teamrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 38px; gap: 8px; margin-bottom: 8px; }

/* ---------- toast + gate ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); z-index: 80;
  background: var(--paper); color: var(--paper-ink); padding: 11px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow); max-width: calc(100% - 32px); animation: rise .25s var(--ease);
}
.gate { min-height: 100vh; display: grid; place-items: center; padding-block: 40px; }
.gate-card { width: min(440px, 100%); display: flex; flex-direction: column; gap: 18px; }
.gate-card .logo svg { width: 92px; height: auto; color: var(--ink); }
.gate-card h1 { font-size: 44px; font-weight: 300; letter-spacing: -.035em; line-height: 1.02; }
.gate-card p { margin: 0; color: var(--muted); }
.gate-card .err { color: var(--red); font-size: 13.5px; }
.gate-card .err:empty { display: none; }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.checklist code { font-size: 12px; background: var(--card-2); padding: 1px 6px; border-radius: 6px; }
.skeleton { background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-xl); min-height: 160px; }

/* ---------- phone tab bar ---------- */
.tabbar { display: none; }

@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }
.view-enter { animation: rise .3s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .pillnav a { padding: 8px 11px; }
  .pillnav a .lbl-long { display: none; }
  .split.has-detail .paper { grid-template-columns: minmax(270px, 340px) minmax(0, 1fr); }
  .detail-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .detail-top > :first-child { grid-column: 1 / -1; }
  .editor { grid-template-columns: minmax(0, 1fr) 320px; }
  .line { grid-template-columns: minmax(0, 1fr) 76px 110px 70px 86px; }
  .line .lamt { grid-column: 1 / 2; text-align: left; padding-top: 0; }
  .line .rm { grid-column: 5; grid-row: 1; justify-self: end; }
}
@media (max-width: 960px) {
  .plist .pr { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; }
  .plist .pr [data-act="reimb"] { justify-self: start; }
  :root { --tabbar-h: 74px; }
  .pillnav, .top-actions .hide-phone { display: none; }
  .topbar { justify-content: space-between; padding-block: 10px; }
  .pagehead { margin: 10px 0 16px; }
  .ov-grid, .grid.two, .grid.halves, .grid.thirds { grid-template-columns: minmax(0, 1fr); }
  .recv .metrics { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .recv .metrics > .metric { padding: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 16px; }
  .recv .metrics > .metric:first-child { border-top: 0; padding-top: 0; }
  .aging { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
  .split.has-detail .paper { grid-template-columns: minmax(0, 1fr); padding: 8px; }
  .split.has-detail .detail-wrap { display: none; }
  .paper { border-radius: var(--r-lg); }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor .side { position: static; }
  .editor .side .savebtns { display: none; }
  .savebar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; gap: 10px; align-items: center;
    padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    background: rgba(15, 16, 19, .92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--line);
  }
  .savebar .tot { flex: 1; min-width: 0; }
  .savebar .tot small { display: block; color: var(--muted); font-size: 11px; }
  .savebar .tot b { font-size: 20px; font-weight: 400; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
  body.editing { --tabbar-h: 76px; }
  body.editing .tabbar { display: none; }
  .line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .partycard { grid-template-columns: auto minmax(0, 1fr); }
  .partycard > div:last-child { grid-column: 1 / -1; justify-content: flex-start !important; }
  .line > .field:first-child { grid-column: 1 / -1; }
  .line .desc, .line .meta-row { grid-column: 1 / -1; }
  .line .lamt { grid-column: 1 / 2; padding-top: 4px; }
  .line .rm { grid-column: 2; grid-row: auto; justify-self: end; margin-top: 0; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .numrow { grid-template-columns: minmax(0, 1fr) 80px 80px; }
  .numrow .prev { grid-column: 1 / -1; text-align: left; }
  .numrow .fyc { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; position: fixed; z-index: 40;
    left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    height: 62px; border-radius: 999px; background: rgba(27, 30, 35, .86); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--line-2); box-shadow: 0 12px 40px rgba(0, 0, 0, .5); padding: 0 6px;
  }
  .tabbar a, .tabbar button { border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; text-decoration: none; padding: 6px 0; }
  .tabbar a svg, .tabbar button svg { width: 21px; height: 21px; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a[aria-current="page"] svg { color: var(--lime); }
  .tabbar .fab { justify-self: center; width: 52px; height: 52px; border-radius: 50%; background: var(--lime); color: var(--lime-ink); display: grid; place-items: center; padding: 0; box-shadow: 0 6px 20px rgba(197, 240, 74, .3); }
  .tabbar .fab svg { width: 24px; height: 24px; }
  .layer { align-items: flex-end; }
  .layer .sheet, .layer.center .sheet {
    width: 100%; height: auto; max-height: calc(100% - 40px - env(safe-area-inset-top, 0px)); border-radius: 26px 26px 0 0; border: 0; border-top: 1px solid var(--line-2);
    animation: slideup .34s var(--ease);
  }
  .layer.full .sheet { height: 100%; max-height: none; border-radius: 0; }
  .layer.center { padding-top: 0; }
  .sheet-head { padding-top: 10px; }
  .layer.full .sheet-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .grabber { display: block; width: 40px; height: 5px; border-radius: 999px; background: var(--line-2); margin: 8px auto 0; flex-shrink: 0; }
  .layer.full .grabber { display: none; }
  .create-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail { border-radius: 0; padding: 18px 16px 24px; background: transparent; }
  .detail-top { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .itemcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sumbar { padding: 14px; }
  .sumbar .acts { width: 100%; }
  .sumbar .acts .btn.lime { flex: 1; }
  .floating-seg { position: static; transform: none; margin: 0 0 10px; box-shadow: none; max-width: 100%; }
  .has-floating-seg { margin-top: 0; }
  .filters .flabel { display: none; }
  .filters .ftoggle { display: inline-flex; }
  .filters:not(.open) .fx { display: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; row-gap: 16px; }
  .metrics > .metric { padding: 0 0 0 16px; }
  .metrics > .metric:nth-child(odd) { padding-left: 0; border-left: 0; }
  .metrics > .metric:nth-child(3):last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 14px; }
  .big-num { font-size: 26px; }
  .row { grid-template-columns: auto minmax(0, 1fr) auto; border-radius: 18px; row-gap: 3px; padding: 10px; }
  .row > .avatar { grid-row: span 2; }
  .row .t { grid-column: 2; grid-row: 1; }
  .row .pill { grid-column: 2; grid-row: 2; justify-self: start; font-size: 10.5px; padding: 1px 8px; }
  .row .amt { grid-column: 3; grid-row: 1 / span 2; }
  .filters .search { min-width: 100%; order: -1; }
  .filters select, .filters input[type="date"] { flex: 1 1 calc(50% - 4px); }
  .fgrid.three, .fgrid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .hide-phone { display: none !important; }
  input, select, textarea { font-size: 16px !important; }
  table.t { min-width: 0; }
  table.t thead { display: none; }
  table.t, table.t tbody, table.t tfoot { display: block; }
  table.t tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.t td { display: block; padding: 0; border: 0; min-width: 0; }
  table.t td[data-span] { grid-column: 1 / -1; }
  table.t td.amt { grid-column: 2; grid-row: 1; }
}
@media (min-width: 961px) { .phone-only { display: none !important; } }
@media (max-width: 520px) {
  .fgrid, .fgrid.three, .fgrid.four { grid-template-columns: minmax(0, 1fr); }
  .fgrid .field.half-phone { grid-column: auto; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bar-row { grid-template-columns: minmax(0, 6.5em) minmax(0, 1fr) auto; gap: 8px; }
  .log-changes li { grid-template-columns: 7em minmax(0, 1fr); }
  .log-item { grid-template-columns: auto minmax(0, 1fr); }
  .log-item > .btn { grid-column: 2; justify-self: start; }
}
@keyframes slideup { from { transform: translateY(40px); opacity: .4; } }

/* ---------- bill upload ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 34px 20px; border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--lime); background: var(--lime-soft); }
.dropzone b { font-weight: 500; font-size: 15px; }
.dropzone .muted { font-size: 12.5px; }
.dz-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; color: var(--lime); }
.dz-icon svg { width: 20px; height: 20px; }
.reading { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--r-md); background: var(--card-2); border: 1px solid var(--line); }
.reading b { display: block; font-weight: 500; }
.reading .muted { font-size: 12.5px; }
.scan { width: 44px; height: 56px; border-radius: 6px; background: var(--paper); position: relative; overflow: hidden; flex-shrink: 0; }
.scan::before { content: ""; position: absolute; inset: 10px 8px auto; height: 30px; background: repeating-linear-gradient(var(--paper-2) 0 3px, transparent 3px 7px); }
.scan i { position: absolute; left: 0; right: 0; height: 3px; background: var(--lime); box-shadow: 0 0 10px var(--lime); animation: scan 1.4s ease-in-out infinite alternate; }
@keyframes scan { from { top: 4px; } to { top: calc(100% - 7px); } }
.fillnote { display: flex; flex-direction: column; gap: 8px; }
.fillnote ul { margin: 0; padding-left: 18px; font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; }
