/* =====================================================================
   FLIP OS V5 — components: cards, stats, chips, tables, board,
   workspace, punch, chat, modal, snack.
   ===================================================================== */

/* ---- cards ---- */
.card { background: var(--card); border-radius: var(--rc); box-shadow: var(--lift); border: 1px solid var(--hair2); }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 22px 14px; }
.card-h h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.card-h .csub { font-size: 13px; color: var(--mut); margin-top: 2px; }
.card-pad { padding: 22px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--hair2); }

/* ---- stats band ---- */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
/* phone-size: tighter stat tiles, two-up */
@media (max-width: 620px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 11px; }
  .stat { padding: 14px 15px 13px; }
  .stat .s-v { font-size: 23px; margin-top: 7px; }
  .stat .s-s { font-size: 12px; }
  .ptitle h2 { font-size: 20px; }
}
.stat { background: var(--card); border-radius: var(--rc); box-shadow: var(--lift); border: 1px solid var(--hair2); padding: 18px 20px 17px; min-width: 0; }
.stat .s-v { font-size: 31px; font-weight: 750; letter-spacing: -.03em; line-height: 1.08; margin-top: 9px; font-variant-numeric: tabular-nums; }
.stat .s-v.ok { color: var(--ok); }
.stat .s-s { font-size: 12.5px; color: var(--mut); margin-top: 6px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.stat .s-bar { height: 5px; border-radius: 99px; background: var(--paper); margin-top: 12px; overflow: hidden; }
.stat .s-bar i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }

.meter { height: 6px; border-radius: 99px; background: var(--paper); overflow: hidden; }
:root[data-night="on"] .meter, :root[data-night="on"] .stat .s-bar { background: rgba(255,255,255,.08); }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }

/* ---- chips ---- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650;
  padding: 3.5px 11px; border-radius: 99px; background: var(--paper); color: var(--ink2); white-space: nowrap; }
:root[data-night="on"] .chip { background: rgba(255,255,255,.07); }
.chip .i { width: 13px; height: 13px; }
.chip i.dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.chip.ok { color: var(--ok); background: var(--ok-soft); }
.chip.warn { color: var(--warn); background: var(--warn-soft); }
.chip.bad { color: var(--bad); background: var(--bad-soft); }
.chip.info { color: var(--info); background: var(--info-soft); }
.chip.brand { color: var(--brand-ink); background: var(--brand-soft); }
button.chip { cursor: pointer; border: 0; }
button.chip:hover { filter: brightness(.96); }

.scorep { width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center;
  font: 700 13.5px/1 var(--f-ui); background: var(--brand-soft); color: var(--brand-ink); }

/* ---- list rows ---- */
.lrows { display: flex; flex-direction: column; }
.lrow { display: flex; align-items: center; gap: 14px; padding: 13px 22px; border-top: 1px solid var(--hair2);
  text-align: left; width: 100%; transition: background .13s; }
.lrow:first-child { border-top: 0; }
button.lrow:hover { background: var(--paper); }
:root[data-night="on"] button.lrow:hover { background: rgba(255,255,255,.04); }
.lrow .lr-m { flex: 1; min-width: 0; }
.lrow .lr-t { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .lr-s { font-size: 12.5px; color: var(--mut); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .lr-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lrow .lr-amt.ok { color: var(--ok); }
.lrow .lr-amt small { display: block; font-weight: 500; color: var(--mut); font-size: 11.5px; text-align: right; }
.lrow > .i.chev { color: var(--mut2); width: 17px; height: 17px; }
.lthumb { border-radius: 10px; object-fit: cover; flex: none; background: var(--paper); }
.lthumb-lg { width: 74px; height: 54px; }
.lthumb-md { width: 62px; height: 47px; }
.lr-x { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.lr-side { display: flex; flex-direction: column; gap: 7px; align-items: flex-end; }

@media (max-width: 740px) {
  .lrow { padding: 13px 16px; gap: 11px; flex-wrap: wrap; }
  .lrow .lr-t, .lrow .lr-s { white-space: normal; overflow: visible; text-overflow: clip; }
  .lrow > .i.chev { display: none; }
  .lthumb-lg { width: 60px; height: 46px; }
  .lthumb-md { width: 54px; height: 42px; }
  .lrow .lr-side { flex-direction: row; align-items: center; flex-basis: 100%; justify-content: space-between; }
}

.nada { text-align: center; padding: 44px 20px; color: var(--mut); }
.nada .n-ic { width: 48px; height: 48px; border-radius: 15px; background: var(--paper); color: var(--mut2);
  display: grid; place-items: center; margin: 0 auto 13px; }
:root[data-night="on"] .nada .n-ic { background: rgba(255,255,255,.06); }
.nada h4 { font-size: 15px; color: var(--ink); }
.nada p { font-size: 13px; max-width: 330px; margin: 5px auto 14px; }

/* ---- tables (shared column grid: 20 / 30 / 18 / 32) ---- */
.tblwrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; padding: 12px 22px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.tbl th .lab { color: var(--mut); }
.tbl td { padding: 13px 22px; border-bottom: 1px solid var(--hair2); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; transition: background .12s; }
.tbl tbody tr:hover { background: var(--paper); }
:root[data-night="on"] .tbl tbody tr:hover { background: rgba(255,255,255,.04); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .sub { font-size: 12px; color: var(--mut); margin-top: 1px; }
.tbl .act { width: 54px; text-align: right; }
.tbl td .chip { white-space: nowrap; }
.tbl th:nth-child(1), .tbl td:nth-child(1) { width: 20%; min-width: 130px; }
.tbl th:nth-child(2), .tbl td:nth-child(2) { width: 30%; min-width: 160px; }
.tbl th:nth-child(3), .tbl td:nth-child(3) { width: 18%; min-width: 150px; white-space: nowrap; }
.tbl th:nth-child(4), .tbl td:nth-child(4) { width: 32%; }
.tbl.amt4 th:nth-child(4), .tbl.amt4 td:nth-child(4) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl.exp th:nth-child(2), .tbl.exp td:nth-child(2) { width: 12%; white-space: nowrap; }
.tbl.exp th:nth-child(3), .tbl.exp td:nth-child(3) { width: 12%; white-space: nowrap; }
.tbl.exp th:nth-child(4), .tbl.exp td:nth-child(4) { width: 16%; white-space: nowrap; }
.tbl.exp th:nth-child(5), .tbl.exp td:nth-child(5) { width: 14%; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.tbl .neg { color: var(--bad); }

/* P&L table: 8 numeric columns, right-aligned, with a totals row */
.pl-tbl th:nth-child(n), .pl-tbl td:nth-child(n) { width: auto; min-width: 0; }
.pl-tbl th:first-child, .pl-tbl td:first-child { text-align: left; min-width: 150px; }
.pl-tbl th:not(:first-child), .pl-tbl td:not(:first-child) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-tbl .pl-total td { border-top: 2px solid var(--hair); border-bottom: 0; background: var(--paper); font-weight: 700; cursor: default; }
:root[data-night="on"] .pl-tbl .pl-total td { background: rgba(255,255,255,.04); }
.pl-tbl .pl-total td .sub, .pl-tbl td .sub { font-size: 11.5px; }

@media (max-width: 740px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody { display: block; width: 100% !important; }
  .tbl td { display: block; width: auto !important; min-width: 0 !important; white-space: normal !important;
    border: 0; padding: 0; text-align: left !important; }
  /* each row becomes a compact 2-col grid: text left, money/status right */
  .tbl tbody tr { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px 12px;
    padding: 12px 18px 13px; border-bottom: 1px solid var(--hair2); }
  .tbl tbody tr:last-child { border-bottom: 0; }
  /* delete lives in the edit sheet on phones */
  .tbl .act { display: none; }
  /* vendors & materials: title + status chip on line 1, details below */
  .tbl td:nth-child(1) { grid-area: 1 / 1; font-size: 14.5px; }
  .tbl td:nth-child(2) { grid-area: 2 / 1 / 2 / -1; }
  .tbl td:nth-child(3) { grid-area: 1 / 2; justify-self: end; }
  .tbl td:nth-child(4) { grid-area: 3 / 1 / 3 / -1; }
  /* pricing: amount top-right, status chip below */
  .tbl.amt4 td:nth-child(3) { grid-area: 3 / 1 / 3 / -1; justify-self: start; }
  .tbl.amt4 td:nth-child(4) { grid-area: 1 / 2; justify-self: end; }
  /* expenses: amount top-right, date beside category, receipt last */
  .tbl.exp td:nth-child(2) { grid-area: 2 / 1; }
  .tbl.exp td:nth-child(3) { grid-area: 2 / 2; justify-self: end; }
  .tbl.exp td:nth-child(4) { grid-area: 3 / 1 / 3 / -1; }
  .tbl.exp td:nth-child(5) { grid-area: 1 / 2; justify-self: end; }
  /* money + dates never wrap */
  .tbl.exp td:nth-child(3), .tbl.exp td:nth-child(5), .tbl.amt4 td:nth-child(4) { white-space: nowrap !important; }
  /* P&L stays a real table on mobile (horizontal scroll) — too many columns to stack */
  .pl-tbl, .pl-tbl thead, .pl-tbl tbody { display: revert !important; }
  .pl-tbl thead { display: table-header-group !important; }
  .pl-tbl tbody tr { display: table-row !important; padding: 0 !important; }
  .pl-tbl td { display: table-cell !important; width: auto !important; padding: 12px 14px !important; border-bottom: 1px solid var(--hair2) !important; }
  .pl-tbl td:not(:first-child) { text-align: right !important; }
}

/* ---- deal detail hero ---- */
.deal-hero { display: grid; grid-template-columns: 1.05fr 1fr; }
@media (max-width: 880px) {
  .deal-hero { grid-template-columns: 1fr; }
  .deal-hero > div:first-child { min-height: 200px; aspect-ratio: 16/9; }
  .deal-hero > div:last-child { padding: 18px 16px 20px !important; }
}

/* ---- calculator property row ---- */
@media (max-width: 620px) {
  .calcrow { flex-wrap: wrap; }
  .calcrow > div { flex: 1 1 100% !important; order: 1; }
  .calcrow .scorep { margin-left: auto; }
}

/* ---- two-column splits ---- */
.duo { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1220px) { .duo { grid-template-columns: 1fr; } }

/* ---- deal board (kanban) ---- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 10px; }
/* mobile: segmented stage switcher + single clean list */
.board-seg { width: 100%; }
.board-seg button { flex: 1; padding: 8px 4px; font-size: 12.5px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.board-seg .bs-n { font: 600 10.5px/1 var(--f-mono); background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink2); border-radius: 99px; padding: 3px 6px; }
:root[data-night="on"] .board-seg .bs-n { background: rgba(255,255,255,.12); }
.board-seg button[aria-pressed="true"] .bs-n { background: var(--brand-soft); color: var(--brand-ink); }
/* icon-only segmented toggles (view switchers) */
.seg-ic button { padding: 6px 11px; display: grid; place-items: center; }
.seg-ic .i { width: 15.5px; height: 15.5px; }
/* properties card grid */
.pgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.bcol { background: color-mix(in srgb, var(--ink) 4%, transparent); border: 1px solid var(--hair2); border-radius: var(--rc); padding: 13px; min-height: 240px; }
:root[data-night="on"] .bcol { background: rgba(255, 255, 255, .035); }
.bcol-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 12px; }
.bcol-h b { font-size: 13.5px; white-space: nowrap; }
.deal { background: var(--card); border-radius: 15px; box-shadow: var(--lift); border: 1px solid var(--hair2);
  margin-bottom: 11px; overflow: hidden; cursor: pointer; width: 100%; text-align: left; display: block;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.deal:hover { transform: translateY(-2px); box-shadow: var(--lift-lg); }
.deal img { width: 100%; aspect-ratio: 16/8.4; object-fit: cover; display: block; }
.deal .d-b { padding: 12px 14px 13px; }
.deal .d-a { font-size: 14px; font-weight: 650; }
.deal .d-s { font-size: 12px; color: var(--mut); margin: 1px 0 10px; }
.deal .d-f { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pgrid .deal { margin-bottom: 0; }
.deal .chip.ov { position: absolute; top: 10px; left: 10px; background: rgba(255, 255, 255, .93); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.deal .chip.ov.warn { background: rgba(255, 244, 232, .94); }
.deal .chip.ov.info { background: rgba(238, 244, 255, .94); }
@media (max-width: 740px) {
  .board { display: block; overflow: visible; padding-bottom: 0; }
  .board .bcol { display: none; background: none; border: 0; padding: 0; min-height: 0; }
  .board .bcol.cur { display: block; }
  .board .bcol-h { display: none; }
  .board .deal { margin-bottom: 12px; }
  /* two-up compact cards */
  .pgrid { grid-template-columns: 1fr 1fr; gap: 11px; }
  .board.cols2 .bcol.cur { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; align-items: start; }
  .board.cols2 .deal { margin-bottom: 0; }
  .board.cols2 .nada { grid-column: 1 / -1; }
  .deal-sm .deal img { aspect-ratio: 16/10; }
  .deal-sm .deal .d-b { padding: 10px 12px 12px; }
  .deal-sm .deal .d-a { font-size: 13px; }
  .deal-sm .deal .d-s { font-size: 11px; margin: 1px 0 8px; }
  .deal-sm .deal .scorep { width: 30px; height: 30px; font-size: 12px; border-radius: 9px; }
  .deal-sm .deal .d-f b { font-size: 12.5px !important; }
  .deal-sm .deal .d-f .lab { font-size: 9px; }
  .deal-sm .deal .chip.ov { top: 7px; left: 7px; font-size: 10.5px; padding: 3px 9px; }
}

/* ---- flips grid ---- */
.flips { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.flip-card { background: var(--card); border-radius: var(--rc); box-shadow: var(--lift); border: 1px solid var(--hair2);
  overflow: hidden; cursor: pointer; text-align: left; display: block; width: 100%;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease); }
.flip-card:hover { transform: translateY(-3px); box-shadow: var(--lift-lg); }
.flip-card .fc-ph { position: relative; aspect-ratio: 16/8.6; background: var(--paper); }
.flip-card .fc-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flip-card .fc-ph .chip { position: absolute; top: 12px; left: 12px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.flip-card .fc-ph .chip.warn { background: rgba(255, 244, 232, .94); }
.flip-card .fc-ph .chip.info { background: rgba(238, 244, 255, .94); }
.flip-card .fc-b { padding: 16px 20px 18px; }
.flip-card .fc-a { font-size: 16.5px; font-weight: 700; letter-spacing: -.015em; }
.flip-card .fc-l { font-size: 12.5px; color: var(--mut); margin-top: 1px; }
.flip-card .fc-m { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 16px; margin: 15px 0; }
.flip-card .fc-m .v { font-size: 15.5px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.flip-card .fc-m .v.ok { color: var(--ok); }

/* ---- workspace hero ---- */
.ws { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 20px 22px; }
.ws .ws-ph { width: 168px; height: 112px; border-radius: 14px; overflow: hidden; flex: none; background: var(--paper); }
.ws .ws-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ws .ws-m { flex: 1; min-width: 230px; }
.ws .ws-m h2 { font-size: 23px; font-weight: 750; letter-spacing: -.025em; }
.ws .ws-loc { font-size: 13.5px; color: var(--mut); margin-top: 2px; }
.ws .ws-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ws .ws-act { display: flex; flex-direction: column; gap: 9px; }
@media (max-width: 880px) { .ws .ws-ph { width: 100%; height: 170px; } .ws .ws-act { flex-direction: row; width: 100%; } }

/* ---- files: empty photo tiles + typed doc icons ---- */
.sh-ph.empty { display: grid; place-items: center; border: 1.5px dashed var(--hair); background: var(--paper); color: var(--mut2); }
.sh-ph.empty .i { width: 26px; height: 26px; }
.doc-ic { width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--paper); color: var(--ink2); }
.doc-ic .i { width: 18px; height: 18px; }
.doc-ic.info { background: var(--info-soft); color: var(--info); }
.doc-ic.warn { background: var(--warn-soft); color: var(--warn); }
.doc-ic.ok { background: var(--ok-soft); color: var(--ok); }
.doc-ic.brand { background: var(--brand-soft); color: var(--brand-ink); }

/* ---- vendors + materials as cards ---- */
.wsgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.vcard, .mcard { background: var(--card); border: 1px solid var(--hair2); border-radius: var(--rc);
  padding: 16px 17px; box-shadow: var(--lift); cursor: pointer; display: flex; flex-direction: column; gap: 11px;
  transition: border-color .14s, box-shadow .14s; min-height: 120px; }
.vcard:hover, .mcard:hover { border-color: var(--brand-ring); box-shadow: var(--lift-lg); }
.vcard-top { display: flex; align-items: center; gap: 12px; }
.vc-ic { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink); }
.vc-ic .i { width: 20px; height: 20px; }
.vc-id { flex: 1; min-width: 0; }
.vc-id b { display: block; font-size: 15px; font-weight: 650; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-id span { display: block; font-size: 12.5px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink2); }
.vc-line .i { width: 15px; height: 15px; color: var(--mut); flex: none; }
.vc-notes { font-size: 12.5px; color: var(--mut); line-height: 1.5; }
.vc-acts { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 3px; }
.vc-acts a { text-decoration: none; }
.vc-acts a .i { width: 15px; height: 15px; }
.vc-nophone { font-size: 12.5px; color: var(--mut2); white-space: nowrap; }
.mcard b.mc-name { font-size: 15px; font-weight: 650; letter-spacing: -.01em; line-height: 1.3; }
.mc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.mc-foot .mut { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; min-width: 0; }
.mc-foot .mut .i { width: 14px; height: 14px; flex: none; }

/* ---- overview: health flags + deal math ---- */
.flagrow { display: flex; flex-wrap: wrap; gap: 8px; }
.dealmath { display: flex; flex-direction: column; }
.dealmath .dm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; font-size: 14px; border-bottom: 1px solid var(--hair2); }
.dealmath .dm-row:last-child { border-bottom: 0; }
.dealmath .dm-row span { color: var(--ink2); white-space: nowrap; }
.dealmath .dm-row b { font-weight: 700; white-space: nowrap; }
.dealmath .dm-sum span { color: var(--ink); font-weight: 650; }
.dealmath .dm-profit { border-top: 1.5px solid var(--hair); margin-top: 4px; padding-top: 13px; }
.dealmath .dm-profit b.pos { color: var(--ok); font-size: 16px; }
.dealmath .dm-profit i { font-style: normal; font-weight: 600; font-size: 12.5px; opacity: .85; }

/* ---- budget (merged money tab) ---- */
.budgsum-figs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.bfig { min-width: 0; }
.bfig .lab { color: var(--mut); }
.bfig b { display: block; font-size: 22px; font-weight: 750; letter-spacing: -.02em; margin-top: 5px; line-height: 1.1; }
.bfig b.pos { color: var(--ok); }
.bfig b.neg { color: var(--bad); }
.bfig span { display: block; font-size: 12px; color: var(--mut); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tnum.pos { color: var(--ok); }
.bnote { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--warn);
  background: var(--warn-soft); border-radius: 12px; padding: 11px 14px; }
.bnote .i { width: 17px; height: 17px; flex: none; }
@media (max-width: 720px) { .budgsum-figs { grid-template-columns: 1fr 1fr; } }

/* ---- workspace console (slim header + persistent KPI ribbon) ---- */
.wsh { padding: 16px 18px; }
.wsh-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.wsh-id { display: flex; align-items: center; gap: 13px; min-width: 0; flex: 1; }
.wsh-ph { width: 54px; height: 54px; border-radius: 13px; overflow: hidden; flex: none; background: var(--paper); }
.wsh-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wsh-chips { display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; }
.wsh-act { display: flex; gap: 8px; flex: none; }
.kpibar { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 16px;
  border: 1px solid var(--hair2); border-radius: 15px; overflow: hidden; background: var(--paper); }
.kpi { padding: 13px 16px; border-right: 1px solid var(--hair2); min-width: 0; }
.kpi:last-child { border-right: none; }
.kpi .k-l { font: 600 9.5px/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mut);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-v { font-size: 19px; font-weight: 750; letter-spacing: -.02em; margin-top: 5px; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.ok .k-v { color: var(--ok); }
.kpi.warn .k-v { color: var(--warn); }
.kpi.bad .k-v { color: var(--bad); }
.kpi .k-s { font-size: 11.5px; color: var(--mut); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-bar { height: 5px; border-radius: 99px; background: var(--hair); margin-top: 9px; overflow: hidden; }
.kpi .k-bar i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
@media (max-width: 1040px) {
  .kpibar { grid-template-columns: repeat(3, 1fr); }
  .kpi:nth-child(3) { border-right: none; }
  .kpi:nth-child(n+4) { border-top: 1px solid var(--hair2); }
}
@media (max-width: 600px) {
  .kpibar { grid-template-columns: repeat(2, 1fr); }
  .kpi { border-right: none; }
  .kpi:nth-child(odd) { border-right: 1px solid var(--hair2); }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--hair2); }
  .wsh-act { width: 100%; }
  .wsh-act .b { flex: 1; justify-content: center; }
}

/* ---- underline tabs ---- */
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; padding: 0 4px; }
.tabbar::-webkit-scrollbar { display: none; }
.tabu { display: flex; align-items: center; gap: 8px; padding: 12px 13px; margin-bottom: -1px;
  font-size: 14px; font-weight: 600; color: var(--mut); white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color .14s; }
.tabu .i { width: 16.5px; height: 16.5px; }
.tabu:hover { color: var(--ink); }
.tabu.on { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tabu .tn { font: 600 10.5px/1 var(--f-mono); background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink2);
  border-radius: 99px; padding: 4px 7px; min-width: 14px; text-align: center; }
:root[data-night="on"] .tabu .tn { background: rgba(255, 255, 255, .12); color: var(--ink2); }
/* active tab: badge turns brand purple */
.tabu.on .tn { background: var(--brand-soft); color: var(--brand-ink); }

/* tabs collapse to icons ONLY when the bar itself runs out of room —
   measured on the tab bar's own width, not the viewport. Desktop only:
   on mobile the full labeled tabs stay and the bar swipes horizontally. */
.tabbar { container-type: inline-size; -webkit-overflow-scrolling: touch; }
@media (min-width: 881px) {
  @container (max-width: 1010px) {
    .tabu .tl { display: none; }
    .tabu.on .tl { display: inline; }
    .tabu { padding: 12px 12px; }
    .tabu .i { width: 18.5px; height: 18.5px; }
  }
}
@media (max-width: 880px) {
  .tabu { scroll-snap-align: start; }
  .tabbar { scroll-snap-type: x proximity; padding-bottom: 1px; }
}

/* ---- milestones ---- */
.mline { display: flex; margin: 6px 0 2px; }
.mst { flex: 1; position: relative; text-align: center; min-width: 84px; }
.mst::before { content: ""; position: absolute; top: 8px; left: -50%; width: 100%; height: 2.5px; background: var(--hair); }
.mst:first-child::before { display: none; }
.mst .md { width: 17px; height: 17px; border-radius: 99px; margin: 0 auto 9px; position: relative; z-index: 2;
  background: var(--card); border: 2.5px solid var(--hair); }
.mst.done .md { background: var(--brand); border-color: var(--brand); }
.mst.done::before { background: var(--brand); }
.mst.now .md { border-color: var(--brand); box-shadow: 0 0 0 5px var(--brand-ring); }
.mst.now::before { background: var(--brand); }
.mst b { display: block; font-size: 12px; font-weight: 650; }
.mst span { display: block; font-size: 11px; color: var(--mut); margin-top: 1px; }

/* ---- task cards (Tasks card view) ---- */
.tgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); }
.tcard { padding: 14px 15px 13px; display: flex; flex-direction: column; gap: 11px; border-radius: 15px; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.tcard:hover { transform: translateY(-2px); box-shadow: var(--lift-lg); }
.tcard .tc-t { font-size: 14px; font-weight: 600; line-height: 1.45; }
.tcard.fin .tc-t { color: var(--mut); text-decoration: line-through; }
.tcard.fin .tick { background: var(--brand); border-color: var(--brand); color: #fff; }
.tcard .tc-f { margin-top: auto; }

/* ---- vendor cards + clickable vendor rows ---- */
.vgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.vcard { padding: 16px 17px 15px; display: flex; flex-direction: column; gap: 13px; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.vcard:hover { transform: translateY(-2px); box-shadow: var(--lift-lg); }
div.lrow.vrow { cursor: pointer; }
div.lrow.vrow:hover { background: var(--paper); }
:root[data-night="on"] div.lrow.vrow:hover { background: rgba(255,255,255,.04); }

/* ---- home: balanced masonry so cards pack with no voids ---- */
.homegrid { column-count: 2; column-gap: 18px; }
.homegrid > .homecol { display: contents; }
.homegrid .card { break-inside: avoid; margin-bottom: 18px; display: block; width: 100%; }
@media (max-width: 1100px) { .homegrid { column-count: 1; } }
.shots-mini { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shots-mini .sh-ph { aspect-ratio: 1 / 1; border-radius: 11px; }
.shots-mini figcaption { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; white-space: normal !important; text-overflow: clip; }

@media (max-width: 740px) {
  .tgrid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tcard .tc-t { font-size: 13px; }
  .vgrid { grid-template-columns: 1fr; }
}

/* ---- punch list ---- */
.punch-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tick { width: 23px; height: 23px; border-radius: 99px; border: 2px solid var(--hair); flex: none; background: var(--card);
  display: grid; place-items: center; color: transparent; transition: all .14s; }
.tick .i { width: 13px; height: 13px; stroke-width: 2.6; }
.tick:hover { border-color: var(--brand); }
.task-row.fin .tick { background: var(--brand); border-color: var(--brand); color: #fff; }
.task-row { display: flex; align-items: center; gap: 13px; padding: 11.5px 22px; border-top: 1px solid var(--hair2); cursor: pointer; }
.task-row:first-child { border-top: 0; }
.task-row:hover { background: var(--paper); }
:root[data-night="on"] .task-row:hover { background: rgba(255,255,255,.04); }
.task-row .tk-t { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 500; }
.task-row.fin .tk-t { color: var(--mut); text-decoration: line-through; }
.task-row .tk-note { font-size: 12.5px; color: var(--mut); margin-top: 3px; display: flex; gap: 6px; align-items: flex-start; }
.task-row .tk-note .i { width: 13px; height: 13px; margin-top: 2px; }
.task-row .tk-meta { display: flex; align-items: center; gap: 8px; }
.phn { width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center;
  font: 700 12px/1 var(--f-mono); background: var(--brand-soft); color: var(--brand-ink); }

/* ---- chat ---- */
.chat-scroll { display: flex; flex-direction: column; gap: 15px; padding: 22px; max-height: min(56vh, 540px); overflow-y: auto; }
.bub { display: flex; gap: 11px; max-width: 100%; }
.bub .bb { background: var(--paper); border-radius: 5px 16px 16px 16px; padding: 10px 14px; max-width: 76%; }
:root[data-night="on"] .bub .bb { background: rgba(255,255,255,.07); }
.bub .bn { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.bub .bn span { font-weight: 500; color: var(--mut); margin-left: 7px; font-size: 11px; }
.bub .bt { font-size: 14px; }
.bub.me { flex-direction: row-reverse; }
.bub.me .bb { background: var(--brand); color: #fff; border-radius: 16px 5px 16px 16px; }
.bub.me .bn { opacity: .85; }
.chat-type { display: flex; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--hair2); align-items: flex-end; }
.chat-type textarea { min-height: 46px; max-height: 130px; border-radius: 14px; }

/* ---- photos / files ---- */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
@media (max-width: 620px) { .shots { grid-template-columns: 1fr 1fr; } }
.shot { margin: 0; }
.shot .sh-ph { aspect-ratio: 4/3; border-radius: 13px; overflow: hidden; background: var(--paper); border: 1px solid var(--hair2);
  display: grid; place-items: center; color: var(--mut2); font: 600 11px/1 var(--f-mono);
  background-image: repeating-linear-gradient(135deg, transparent 0 14px, var(--hair2) 14px 28px); }
.shot .sh-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot figcaption { font-size: 12px; color: var(--mut); margin-top: 6px; }

/* ---- modal / snack ---- */
.dim { position: fixed; inset: 0; z-index: 120; background: rgba(13, 10, 25, .52);
  opacity: 0; pointer-events: none; transition: opacity .18s; }
.dim.up { opacity: 1; pointer-events: auto; }
.modal { position: fixed; z-index: 130; top: 42%; left: 50%;
  width: min(490px, calc(100vw - 28px)); max-height: min(78vh, 740px); max-height: min(78dvh, 740px);
  background: var(--card); border-radius: var(--rm); box-shadow: var(--lift-lg);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate(-50%, -47%) scale(.97);
  transition: opacity .19s var(--ease), transform .19s var(--ease), visibility .19s; }
.modal.up { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, -50%) scale(1);
  /* no visibility in the opening transition — it must flip instantly so fields can be focused immediately */
  transition: opacity .19s var(--ease), transform .19s var(--ease); }
:is(.modal, .pop) .m-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 24px 14px; }
:is(.modal, .pop) .m-h h3 { font-size: 17.5px; font-weight: 700; letter-spacing: -.015em; }
:is(.modal, .pop) .m-x { width: 34px; height: 34px; border-radius: 99px; display: grid; place-items: center; background: var(--paper); color: var(--mut); }
:root[data-night="on"] :is(.modal, .pop) .m-x { background: rgba(255,255,255,.08); }
:is(.modal, .pop) .m-x:hover { color: var(--ink); }
:is(.modal, .pop) .m-b { padding: 6px 24px 22px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 15px; }
:is(.modal, .pop) .m-f { display: flex; gap: 10px; padding: 15px 24px 22px; border-top: 1px solid var(--hair2); }

.snacks { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (max-width: 880px) { .snacks { bottom: calc(96px + env(safe-area-inset-bottom)); } }
.snack { display: flex; align-items: center; gap: 10px; background: #1d1929; color: #fff;
  padding: 12px 19px; border-radius: 99px; font-size: 13.5px; font-weight: 550; box-shadow: var(--lift-lg);
  animation: snackin .3s var(--ease); }
.snack .i { width: 16px; height: 16px; color: #6fdcA8; }
@keyframes snackin { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---- segmented mini control ---- */
.segm { display: inline-flex; background: var(--paper); border-radius: 99px; padding: 3.5px; gap: 3px; border: 1px solid var(--hair2); }
:root[data-night="on"] .segm { background: rgba(255,255,255,.06); }
.segm button { border-radius: 99px; padding: 6px 14px; font-size: 12.5px; font-weight: 600; color: var(--mut);
  transition: background .13s, color .13s; }
.segm button:not([aria-pressed="true"]):hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
:root[data-night="on"] .segm button:not([aria-pressed="true"]):hover { background: rgba(255, 255, 255, .07); }
.segm button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--lift); }
/* round month-nav buttons (calendar header) */
.cnav { width: 30px; height: 30px; border-radius: 99px; display: grid; place-items: center; flex: none;
  background: var(--card); border: 1px solid var(--hair); box-shadow: var(--lift); color: var(--ink2);
  transition: color .13s, border-color .13s, background .13s; }
.cnav:hover { color: var(--brand-ink); border-color: var(--brand); }
:root[data-night="on"] .cnav { background: rgba(255,255,255,.07); }
.cnav .i { width: 15px; height: 15px; }

/* month dropdown (calendar header) — compact control, same scale as .b.sm */
.msel { -webkit-appearance: none; appearance: none; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 650; letter-spacing: -.01em; color: var(--ink);
  min-height: 33px; padding: 0 32px 0 13px; border: 1px solid var(--hair); border-radius: 9px;
  background-color: var(--card); transition: border-color .13s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6580' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
.msel:hover { border-color: var(--brand); }
:root[data-night="on"] .msel { background-color: rgba(255,255,255,.05);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239b94b3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E"); }

/* ---- modal v2 ---- */
:is(.modal, .pop) .m-sub { font-size: 12.5px; color: var(--mut); margin-top: 2px; }
.m-hero { display: flex; gap: 13px; align-items: center; background: var(--paper); border-radius: 14px; padding: 11px 12px; }
:root[data-night="on"] .m-hero { background: rgba(255,255,255,.06); }
.m-hero img { width: 66px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; }
.m-hero .mh-t { min-width: 0; flex: 1; }
.m-hero .mh-t b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-hero .mh-t span { display: block; font-size: 12px; color: var(--mut); margin-top: 1px; }

.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 99px;
  border: 1.5px solid var(--hair); background: var(--card); font-size: 13px; font-weight: 600; color: var(--ink2);
  transition: all .13s var(--ease); }
:root[data-night="on"] .pick button { background: rgba(255,255,255,.04); }
.pick button:hover { border-color: var(--mut2); }
.pick button.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.pick.people button { padding: 6px 14px 6px 7px; }

.amtbox { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--hair); background: var(--card);
  border-radius: 14px; padding: 12px 18px; transition: border-color .15s, box-shadow .15s; }
:root[data-night="on"] .amtbox { background: rgba(255,255,255,.05); }
.amtbox:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3.5px var(--brand-ring); }
.amtbox b { font-size: 23px; font-weight: 650; color: var(--mut2); }
.amtbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink);
  font-size: 25px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.amtbox input:focus, .amtbox input:focus-visible { outline: 0; box-shadow: none; }

.swrow { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1.5px solid var(--hair); border-radius: 14px; padding: 12px 15px; cursor: pointer; }
.swrow .sw-t b { display: block; font-size: 14px; }
.swrow .sw-t span { display: block; font-size: 12px; color: var(--mut); margin-top: 1px; }
.swrow input { position: absolute; opacity: 0; pointer-events: none; }
.swrow .tog { width: 46px; height: 27px; border-radius: 99px; background: var(--hair); position: relative; flex: none; transition: background .18s var(--ease); }
.swrow .tog::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 99px;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s var(--ease); }
.swrow input:checked + .tog { background: var(--brand); }
.swrow input:checked + .tog::after { transform: translateX(19px); }

/* ---- undo snack ---- */
.snack .snack-act { margin-left: 4px; padding: 5px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 700;
  background: rgba(255, 255, 255, .16); color: #fff; flex: none; }
.snack .snack-act:hover { background: rgba(255, 255, 255, .26); }

/* ---- keyboard-selected search row ---- */
.fp-row.sel { background: var(--paper); }
:root[data-night="on"] .fp-row.sel { background: rgba(255, 255, 255, .07); }

/* ---- mobile swipe actions ---- */
@media (max-width: 880px) {
  .task-row, .tbl.exp tbody tr { touch-action: pan-y; }
}
.swx { transition: none !important; }
.task-row, .tbl.exp tbody tr { transition: transform .2s var(--ease), background .15s; }
.swx-ok { background: var(--ok-soft) !important; }
.swx-del { background: var(--bad-soft, rgba(214, 69, 69, .14)) !important; }

/* ---- calendar (month grid) ---- */
.cg-w { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 16px 16px 8px; }
.cg-w .lab { text-align: center; color: var(--ink2); }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 0 16px 16px; }
.cg-d { min-height: 0; border: 1px solid var(--hair2); border-radius: 12px; padding: 7px 7px 6px; min-width: 0;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 4px; align-items: stretch; cursor: pointer; background: var(--card);
  transition: background .12s, border-color .12s, box-shadow .12s; }
.cg-d:hover { background: var(--paper); }
:root[data-night="on"] .cg-d:hover { background: rgba(255, 255, 255, .04); }
.cg-d.off { background: transparent; border-color: transparent; cursor: default; pointer-events: none; }
.cg-d.dropping { border-color: var(--brand); box-shadow: 0 0 0 2.5px var(--brand-ring); }
.cg-n { font: 600 11.5px/1 var(--f-mono); color: var(--ink2); background: var(--paper); border: 1px solid var(--hair2);
  border-radius: 99px; width: 21px; height: 21px; display: grid; place-items: center; padding: 0; align-self: flex-end; }
:root[data-night="on"] .cg-n { background: rgba(255,255,255,.06); }
.cg-d.today .cg-n { color: #fff; background: var(--brand); border-color: transparent; border-radius: 99px; width: 21px; height: 21px; display: grid; place-items: center; padding: 0; }
.cg-i { display: flex; align-items: center; gap: 5px; min-width: 0; width: 100%; text-align: left;
  font-size: 11.5px; font-weight: 600; padding: 3.5px 6px; border-radius: 7px; color: var(--ink); cursor: grab;
  background: color-mix(in srgb, var(--pc) 12%, transparent); }
.cg-i:active { cursor: grabbing; }
.cg-i .i { width: 12px; height: 12px; color: var(--pc); flex: none; }
.cg-i .cg-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.cg-i .cg-tm { font: 600 9.5px/1 var(--f-mono); color: var(--mut); flex: none; }
.cg-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--pc, var(--mut)); flex: none; display: inline-block; }
.cg-i.fin { opacity: .5; }
.cg-i.fin .cg-t { text-decoration: line-through; }
.cg-i.late .cg-t { color: var(--bad); }
.cg-more { font-size: 11px; font-weight: 700; color: var(--mut); text-align: left; padding: 1px 6px; }
.cg-more:hover { color: var(--ink); }

/* month view fits the viewport exactly (no page scroll): the grid is locked to
   the available height and the week rows shrink to fit on any screen size */
.main:has(.calgrid) { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.page:has(.calgrid) { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.page:has(.calgrid) > .vstack { flex: 1; min-height: 0; }
.vstack:has(.calgrid) .card:has(.calgrid) { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.calgrid { flex: 1; min-height: 0; grid-auto-rows: minmax(0, 1fr); }

/* ---- agenda view ---- */
.ag-day { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; padding: 14px 22px 9px; border-top: 1px solid var(--hair2); }
.ag-day:first-child { border-top: 0; }
.ag-num { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--paper);
  font: 700 15px/1 var(--f-mono); color: var(--ink2); flex: none; }
:root[data-night="on"] .ag-num { background: rgba(255,255,255,.07); }
.ag-num.today { background: var(--brand); color: #fff; }
.ag-t { flex: 1; min-width: 0; }
.ag-t b { display: block; font-size: 14.5px; line-height: 1.25; }
.ag-t span { display: block; font-size: 12px; color: var(--mut); }
.ag-add { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 99px; color: var(--mut); background: var(--paper); flex: none; }
:root[data-night="on"] .ag-add { background: rgba(255,255,255,.07); }
.ag-add .i { width: 15px; height: 15px; }
.ag-day:hover .ag-add { color: var(--brand-ink); }
.ag-row { border-top: 0; padding: 9px 22px 9px 73px; }
.ag-row .chip .i { width: 14px; height: 14px; }
.ag-row.fin .lr-t { text-decoration: line-through; opacity: .55; }
.ag-none { padding: 2px 22px 10px 73px; font-size: 12.5px; color: var(--mut); }
.ag-cap { display: flex; align-items: center; gap: 8px; padding: 14px 22px 6px; font: 600 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; }
.ag-cap.bad { color: var(--bad); }
.ag-cap .i { width: 15px; height: 15px; }

/* calendar property dropdown: custom chevron with breathing room */
select[data-cal-prop-sel] { -webkit-appearance: none; appearance: none; cursor: pointer; transition: border-color .13s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6580' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 14px;
  padding-right: 34px !important; }
select[data-cal-prop-sel]:hover { border-color: var(--brand); }
:root[data-night="on"] select[data-cal-prop-sel] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239b94b3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E"); }

/* ---- anchored popover (Apple Calendar-style) ---- */
.pop { position: fixed; z-index: 140; background: var(--card); border: 1px solid var(--hair2); border-radius: 18px;
  box-shadow: var(--lift-lg); display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; pointer-events: none; transform: scale(.96);
  transition: opacity .16s var(--ease), transform .16s var(--ease), visibility .16s; }
.pop.up { opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  /* visibility must flip instantly on open so fields can be focused immediately */
  transition: opacity .16s var(--ease), transform .16s var(--ease); }
.pop[data-side="right"] { transform-origin: left center; }
.pop[data-side="left"] { transform-origin: right center; }
.pop[data-side="bottom"] { transform-origin: center top; }
.pop[data-side="top"] { transform-origin: center bottom; }
.pop .m-h { padding: 16px 18px 10px; }
.pop .m-b { padding: 4px 18px 16px; }
.pop .m-f { padding: 12px 18px 16px; }
.pop-ar { position: absolute; width: 13px; height: 13px; background: var(--card); transform: rotate(45deg); }
.pop[data-side="right"] .pop-ar { border-left: 1px solid var(--hair2); border-bottom: 1px solid var(--hair2); }
.pop[data-side="left"] .pop-ar { border-right: 1px solid var(--hair2); border-top: 1px solid var(--hair2); }
.pop[data-side="bottom"] .pop-ar { border-left: 1px solid var(--hair2); border-top: 1px solid var(--hair2); }
.pop[data-side="top"] .pop-ar { border-right: 1px solid var(--hair2); border-bottom: 1px solid var(--hair2); }

/* ---- time field with inline AM/PM segmented toggle ---- */
.timebox { display: flex; align-items: center; gap: 8px; border: 1px solid var(--hair); background: var(--card);
  border-radius: var(--rs); padding: 3.5px 4px 3.5px 13px; }
:root[data-night="on"] .timebox { background: rgba(255,255,255,.05); }
.timebox:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3.5px var(--brand-ring); }
.fld .timebox input, .timebox input { border: 0; background: transparent; flex: 1; min-width: 0; width: auto;
  padding: 6.5px 0; font-size: 14.5px; outline: 0; font-variant-numeric: tabular-nums; }
.fld .timebox input:focus, .timebox input:focus { border: 0; box-shadow: none; }
.ampm { display: inline-flex; background: var(--paper); border-radius: 8px; padding: 2.5px; gap: 2px; flex: none; }
:root[data-night="on"] .ampm { background: rgba(255,255,255,.07); }
.ampm button { border-radius: 6px; padding: 4.5px 9px; font-size: 11.5px; font-weight: 700; color: var(--mut);
  transition: background .12s, color .12s; }
.ampm button.on { background: var(--card); color: var(--ink); box-shadow: var(--lift); }
:root[data-night="on"] .ampm button.on { background: rgba(255,255,255,.13); }

/* ---- compact date row (expands the mini calendar on demand) ---- */
.dateline { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  border: 1px solid var(--hair); background: var(--card); border-radius: var(--rs);
  padding: 10px 13px; font-size: 14.5px; }
:root[data-night="on"] .dateline { background: rgba(255,255,255,.05); }
.dateline:hover { border-color: var(--brand); }
.dateline .i { width: 16px; height: 16px; color: var(--mut); flex: none; }
.dateline b { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dateline .dl-hint { font-size: 12px; font-weight: 600; color: var(--brand-ink, var(--brand)); flex: none; }
@media (max-width: 700px) {
  .cg-w, .calgrid { gap: 3px; padding-left: 8px; padding-right: 8px; }
  .cg-d { min-height: 66px; padding: 4px; gap: 3px; flex-direction: row; flex-wrap: wrap; align-content: flex-start; }
  .cg-n { width: 100%; }
  .cg-i { width: auto; padding: 3px 4px; border-radius: 99px; }
  .cg-i .cg-t, .cg-i .cg-tm { display: none; }
  .cg-more { width: 100%; padding: 0 2px; font-size: 10px; }
}

/* ---- list/card view toggle switch ---- */
.vswitch { display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px; border-radius: 99px;
  background: var(--paper); border: 1px solid var(--hair2); }
:root[data-night="on"] .vswitch { background: rgba(255,255,255,.06); }
.vswitch .vs-ic { display: grid; place-items: center; color: var(--mut); transition: color .15s var(--ease); }
.vswitch .vs-ic .i { width: 16px; height: 16px; }
.vswitch .vs-ic.on { color: var(--ink); }
.vswitch .tog { width: 38px; height: 22px; border-radius: 99px; background: var(--brand); position: relative; flex: none;
  transition: background .18s var(--ease); }
.vswitch .tog::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 99px;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s var(--ease); }
.vswitch[aria-checked="true"] .tog::after { transform: translateX(16px); }

.m-f { align-items: center; }
.m-f .push { margin-left: auto; }

@media (max-width: 620px) {
  .modal { top: auto; bottom: 0; left: 0; width: 100vw; max-height: 90vh; max-height: 90dvh;
    border-radius: 24px 24px 0 0; transform: translateY(8%); }
  .modal.up { transform: none; }
  .modal .m-f { padding-bottom: calc(22px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal .m-f .b.pri { flex: 1 1 auto; }
}

/* ---- sign-in gate ---- */
.gate { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center;
  background: radial-gradient(1200px 700px at 30% 20%, #241c4a, #15111f 70%);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s var(--ease), visibility .25s; }
.gate.up { opacity: 1; visibility: visible; pointer-events: auto; }
.gate-card { width: min(380px, calc(100vw - 36px)); background: var(--card); border-radius: 24px;
  box-shadow: var(--lift-lg); padding: 34px 32px 28px; text-align: center; transform: translateY(-6vh); }
.gate-card .mark { width: 56px; height: 56px; border-radius: 17px; display: inline-grid; place-items: center;
  background: linear-gradient(145deg, #6a5cf0, #4d41dd); color: #fff; }
.gate-card .mark svg { width: 34px; height: 34px; fill: currentColor; }
.gate-card h2 { font-size: 23px; font-weight: 750; letter-spacing: -.025em; margin-top: 6px; }
.gate-card .gate-user { display: flex; align-items: center; gap: 12px; justify-content: flex-start;
  background: var(--paper); border-radius: 14px; padding: 12px 14px; margin: 18px 0 14px; }
:root[data-night="on"] .gate-card .gate-user { background: rgba(255,255,255,.06); }
.gate-card .gate-user b { font-size: 15px; }
.gate-card p { font-size: 12.5px; color: var(--mut); margin-top: 14px; }

/* ---- uploads ---- */
.upbox { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%;
  border: 1.8px dashed var(--hair); border-radius: 16px; padding: 22px 16px; color: var(--mut);
  background: var(--paper); transition: border-color .15s, background .15s; cursor: pointer; }
:root[data-night="on"] .upbox { background: rgba(255,255,255,.04); }
.upbox:hover { border-color: var(--brand); color: var(--brand-ink); }
.upbox .i { width: 22px; height: 22px; margin-bottom: 3px; }
.upbox b { font-size: 14px; color: var(--ink); }
.upbox:hover b { color: var(--brand-ink); }
.upbox span { font-size: 12px; }
.updone { display: flex; align-items: center; gap: 14px; border: 1.5px solid var(--hair); border-radius: 16px; padding: 12px; flex-wrap: wrap; }
.scan-cta { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  border: 1.5px solid var(--brand-ring, var(--hair)); border-radius: 16px; padding: 14px 16px; margin-bottom: 14px;
  background: var(--brand-soft, var(--paper)); color: var(--brand-ink); transition: border-color .15s, transform .1s; }
.scan-cta:hover { border-color: var(--brand); }
.scan-cta:active { transform: scale(.99); }
.scan-cta > .i { width: 26px; height: 26px; flex: none; }
.scan-cta .scan-tx { flex: 1; min-width: 0; }
.scan-cta .scan-tx b { display: block; font-size: 14.5px; color: var(--ink); }
.scan-cta .scan-tx span { font-size: 12.5px; color: var(--mut); }
.scan-cta > .i:last-child { width: 18px; height: 18px; color: var(--mut2); }
.updone img { width: 86px; height: 64px; border-radius: 10px; object-fit: cover; }
.uplist { display: flex; flex-direction: column; gap: 8px; }
.uprow { display: flex; align-items: center; gap: 12px; border: 1px solid var(--hair2); border-radius: 13px; padding: 8px 10px; }
.uprow img { width: 46px; height: 36px; border-radius: 8px; object-fit: cover; flex: none; }
.uprow .gl { width: 40px; height: 40px; border-radius: 10px; background: var(--paper); display: grid; place-items: center; color: var(--mut); flex: none; }
:root[data-night="on"] .uprow .gl { background: rgba(255,255,255,.06); }
.uprow .upr-t { flex: 1; min-width: 0; }
.uprow .upr-t b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uprow .upr-t span { display: block; font-size: 11.5px; color: var(--mut); }
.rcpt-th { width: 46px; height: 34px; border-radius: 7px; object-fit: cover; display: block; border: 1px solid var(--hair); }

/* ---- calendar ---- */
.cal { border: 1.5px solid var(--hair); border-radius: 16px; padding: 14px; background: var(--card); }
:root[data-night="on"] .cal { background: rgba(255,255,255,.04); }
.cal-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal-h b { font-size: 14.5px; letter-spacing: -.01em; }
.cal-nav { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--mut); }
.cal-nav:hover { background: var(--paper); color: var(--ink); }
:root[data-night="on"] .cal-nav:hover { background: rgba(255,255,255,.08); }
.cal-nav .i { width: 16px; height: 16px; }
.cal-w { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.cal-w .lab { text-align: center; font-size: 9.5px; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-d { height: 36px; border-radius: 10px; display: grid; place-items: center;
  font-size: 13.5px; font-weight: 550; color: var(--ink2); transition: background .12s; }
.cal-d:hover { background: var(--paper); }
:root[data-night="on"] .cal-d:hover { background: rgba(255,255,255,.08); }
.cal-d.today { box-shadow: inset 0 0 0 1.5px var(--hair); font-weight: 700; }
.cal-d.on { background: var(--brand); color: #fff; font-weight: 700; box-shadow: none; }

/* ---- settings / integrations ---- */
.set-count { background: linear-gradient(145deg, #6a5cf0, #4d41dd); color: #fff; border-radius: 18px;
  padding: 16px 18px 15px; display: flex; flex-direction: column; gap: 5px; min-width: 116px; flex: none; }
.set-count b { font-size: 34px; font-weight: 750; letter-spacing: -.03em; line-height: 1; }
.igrid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }
.itile { border: 1.5px solid var(--hair); border-radius: 16px; padding: 15px 16px 14px;
  display: flex; flex-direction: column; gap: 10px; }
:root[data-night="on"] .itile { background: rgba(255,255,255,.03); }
.itile .it-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.itile .it-h b { font-size: 14px; line-height: 1.35; }
.itile .it-h .chip { flex: none; }
.itile p { font-size: 12.5px; color: var(--ink2); line-height: 1.55; }
.itile .it-where { font-size: 11.5px; color: var(--mut); line-height: 1.55; }
.itile .it-where .lab { display: inline; font-size: 9px; margin-right: 3px; }
.itile .it-act { margin-top: auto; align-self: flex-start; }
.ai-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); }
.ai-cell { border: 1.5px solid var(--hair); border-radius: 13px; padding: 11px 12px 10px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0; }
:root[data-night="on"] .ai-cell { background: rgba(255,255,255,.03); }
.ai-cell .ai-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.ai-cell select.tin { padding: 7px 10px; font-size: 12.5px; }
.ai-cell .ai-model { font: 500 10px/1.4 var(--f-mono); color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 740px) {
  .igrid { grid-template-columns: 1fr; }
  .ai-grid { grid-template-columns: 1fr 1fr; }
  .ai-cell select.tin { font-size: 16px; }
  .set-count { flex-direction: row; align-items: center; gap: 12px; padding: 13px 16px; }
  .set-count b { font-size: 27px; }
  .set-count .lab br { display: none; }
}

/* ---- stat deltas (trend / pacing pills) + hover ---- */
.stat { transition: box-shadow .15s var(--ease), transform .15s var(--ease); }
.stat:hover { box-shadow: var(--lift-lg); }
.s-s .delta { font-weight: 700; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 5px; }
.s-s .delta::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; flex: none; }
.s-s .delta.up { color: var(--ok); }
.s-s .delta.down { color: var(--bad); }
.s-s .delta.warn { color: var(--warn); }
.s-s .delta.flat { color: var(--mut); }

/* ---- home action queue ---- */
.lrow .chip.q-ic { width: 36px; height: 36px; justify-content: center; border-radius: 10px; flex: none; padding: 0; }
.lrow .chip.q-ic .i { width: 16px; height: 16px; }
button.lrow:active { transform: translateY(.5px); }

/* ---- offer-calculator verdict ---- */
.verdict { padding: 22px; }
.verdict .vd-word { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; margin-top: 12px; }
.verdict .vd-word.go { color: var(--ok); }
.verdict .vd-word.thin { color: var(--warn); }
.verdict .vd-word.pass { color: var(--bad); }
.verdict .vd-note { font-size: 13px; color: var(--mut); margin-top: 9px; line-height: 1.5; max-width: 42ch; }
.verdict .vd-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.verdict .vd-num { font-size: 21px; font-weight: 750; margin-top: 4px; font-variant-numeric: tabular-nums; }
.verdict .vd-mao { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hair2); }
.verdict .vd-mao b { display: block; font-size: 20px; margin-top: 4px; letter-spacing: -.02em; }

/* ---- misc ---- */
.mut { color: var(--mut); }
.tnum { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }
.rowflex { display: flex; align-items: center; gap: 10px; }
.spread { justify-content: space-between; }
.wgap { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 36px; height: 36px; border-radius: 99px; border: 2.5px solid transparent; cursor: pointer; }
.sw.on { box-shadow: 0 0 0 2.5px var(--brand); border-color: var(--card); }

/* ---- appearance: accent swatch picker (Settings) ---- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 12px; }
.swatch { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 13px;
  border: 1.5px solid var(--hair); background: var(--card); text-align: left; transition: border-color .14s, box-shadow .14s, background .14s; }
.swatch:hover { border-color: var(--mut2); }
.swatch.on { border-color: var(--sw, var(--brand)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.swatch .sw-dot { width: 26px; height: 26px; border-radius: 99px; flex: none; background: var(--sw);
  display: grid; place-items: center; color: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.swatch .sw-dot .i { width: 15px; height: 15px; opacity: 0; transform: scale(.6); transition: opacity .14s, transform .14s; stroke-width: 2.6; }
.swatch.on .sw-dot .i { opacity: 1; transform: none; }
.swatch .sw-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swatch.on .sw-name { color: var(--brand-ink); }

/* drag-reorder: Your flips in the rail */
.r-flip[draggable="true"] { cursor: grab; user-select: none; -webkit-user-select: none; }
.r-flip.drag-src { opacity: .4; }
.r-flip.drop-before { box-shadow: inset 0 2px 0 var(--brand); }
.r-flip.drop-after { box-shadow: inset 0 -2px 0 var(--brand); }

/* ============================ vendor directory ============================ */
.vdir { display: flex; flex-direction: column; gap: 18px; }
/* stat tiles */
.vdir-tiles { display: grid; gap: 14px; grid-template-columns: repeat(6, 1fr); }
.vdir-tiles.t4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1180px) { .vdir-tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 980px) { .vdir-tiles.t4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .vdir-tiles { grid-template-columns: repeat(2, 1fr); gap: 11px; } }
.vtile { background: var(--card); border: 1px solid var(--hair2); border-radius: var(--rc);
  box-shadow: var(--lift); padding: 16px 17px 15px; min-width: 0; }
.vt-h { display: flex; align-items: center; gap: 9px; }
.vt-ic { width: 28px; height: 28px; flex: none; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink); }
.vt-ic .i { width: 16px; height: 16px; }
.vt-l { font: 600 10px/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mut);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-v { font-size: 27px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; margin-top: 11px;
  font-variant-numeric: tabular-nums; }
.vt-v.warn { color: var(--warn); }
.vt-ic.warn { background: var(--warn-soft); color: var(--warn); }
.vt-s { font-size: 12px; color: var(--mut); margin-top: 4px; }

/* filter / toolbar */
.vdir-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vdir-search { flex: 1 1 240px; min-width: 190px; display: flex; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--hair); border-radius: var(--rs); padding: 9px 13px;
  color: var(--mut); box-shadow: var(--lift); transition: border-color .15s, box-shadow .15s; }
.vdir-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3.5px var(--brand-ring); }
.vdir-search .i { width: 16px; height: 16px; flex: none; }
.vdir-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font-size: 14px; }
.vdir-search input::placeholder { color: var(--mut2); }
.vdir-seg { display: inline-flex; gap: 8px; }
.fchip { display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; min-height: 38px;
  border-radius: var(--rs); font-size: 13.5px; font-weight: 600; color: var(--ink2);
  background: var(--card); border: 1px solid var(--hair); box-shadow: var(--lift); cursor: pointer; white-space: nowrap; }
.fchip .i { width: 15px; height: 15px; color: var(--mut); }
.fchip:hover { border-color: var(--mut2); }
.fchip.on { background: var(--ink); color: var(--paper); border-color: transparent; box-shadow: none; }
.fchip.on .i { color: currentColor; }
.vdir-sel { position: relative; display: inline-flex; align-items: center; }
.vdir-trades, .ge-cat, .ge-range, .ge-method { appearance: none; -webkit-appearance: none; min-height: 38px; padding: 0 34px 0 14px;
  border-radius: var(--rs); font-size: 13.5px; font-weight: 600; color: var(--ink2);
  background: var(--card); border: 1px solid var(--hair); box-shadow: var(--lift); cursor: pointer; }
.vdir-trades:hover, .ge-cat:hover, .ge-range:hover, .ge-method:hover { border-color: var(--mut2); }
.vdir-trades:focus, .ge-cat:focus, .ge-range:focus, .ge-method:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3.5px var(--brand-ring); }
.vsel-ch { position: absolute; right: 11px; width: 15px; height: 15px; color: var(--mut); pointer-events: none; transform: rotate(90deg); }
.vdir-spread { flex: 1 1 0; min-width: 0; }

/* card grid */
.vdir-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
@media (max-width: 760px) { .vdir-grid { grid-template-columns: 1fr; } }
.vdcard { background: var(--card); border: 1px solid var(--hair2); border-radius: var(--rc); box-shadow: var(--lift);
  padding: 19px 20px; display: flex; flex-direction: column; gap: 15px; transition: border-color .14s, box-shadow .14s; }
.vdcard:hover { border-color: var(--brand-ring); box-shadow: var(--lift-lg); }
.vd-head { display: flex; align-items: flex-start; gap: 13px; }
.vd-head .ava { width: 46px; height: 46px; border-radius: 13px; flex: none; font-size: 15px; font-weight: 700; }
.vd-id { flex: 1; min-width: 0; }
.vd-name { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-id .chip { margin-top: 7px; }
.vd-act { display: flex; align-items: center; gap: 6px; flex: none; }
.vd-act .b.sm { box-shadow: none; }
.vd-act .chip.ok .i { width: 13px; height: 13px; }
.vd-kebab { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--mut2); }
.vd-kebab:hover { background: var(--paper); color: var(--ink); }
.vd-kebab .i { width: 18px; height: 18px; }

.vd-contact { display: flex; flex-direction: column; gap: 9px; }
.vd-contact .cline { display: flex; align-items: center; gap: 11px; font-size: 13.5px; color: var(--ink2);
  min-width: 0; }
.vd-contact .cline .i { width: 16px; height: 16px; flex: none; color: var(--mut2); }
.vd-contact .cline span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-nocontact { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--warn); }
.vd-nocontact .i { width: 16px; height: 16px; flex: none; }

.vd-stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--hair2);
  border-radius: 14px; overflow: hidden; background: color-mix(in srgb, var(--paper) 45%, transparent); }
:root[data-night="on"] .vd-stats { background: rgba(255,255,255,.025); }
.vd-stats .st { padding: 12px 13px; border-left: 1px solid var(--hair2); min-width: 0; }
.vd-stats .st:first-child { border-left: 0; }
.vd-stats .st .l { font: 600 9px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mut);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-stats .st .v { font-size: 16px; font-weight: 700; margin-top: 8px; font-variant-numeric: tabular-nums; }
.vd-stats .st .v.owed { color: var(--warn); }

.vd-meta { display: flex; gap: 30px; }
.vd-meta .m { display: flex; align-items: center; gap: 10px; }
.vd-meta .m .i { width: 17px; height: 17px; flex: none; color: var(--mut2); }
.vd-meta .ml { font: 600 9px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.vd-meta .mv { font-size: 13px; font-weight: 600; margin-top: 3px; }

.vd-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--hair2); padding-top: 15px; }
.vd-foot .acts { display: flex; gap: 9px; flex-wrap: wrap; }
.vd-foot .b.sm { box-shadow: none; }
.vd-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 650;
  color: var(--brand-ink); white-space: nowrap; }
.vd-link .i { width: 16px; height: 16px; }
.vd-link:hover { text-decoration: underline; }

/* untracked payees footer */
.vdir-untracked { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--hair2); border-radius: var(--rc); box-shadow: var(--lift);
  padding: 15px 20px; transition: border-color .14s, box-shadow .14s; }
.vdir-untracked:hover { border-color: var(--brand-ring); box-shadow: var(--lift-lg); }
.vdir-untracked .ut-ic { width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink); }
.vdir-untracked .ut-ic .i { width: 18px; height: 18px; }
.vdir-untracked .ut-t { display: inline-flex; align-items: center; gap: 9px; flex: none; }
.vdir-untracked .ut-t b { font-size: 14.5px; font-weight: 700; }
.vdir-untracked .ut-s { color: var(--mut); font-size: 13px; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vdir-untracked .ut-ch { width: 18px; height: 18px; color: var(--mut2); flex: none; }
@media (max-width: 620px) { .vdir-untracked .ut-s { display: none; } }

/* ============================ Financials shell ============================ */
.fin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hair); margin-bottom: 2px; overflow-x: auto; scrollbar-width: none; }
.fin-tabs::-webkit-scrollbar { display: none; }
.fin-tab { display: inline-flex; align-items: center; gap: 8px; padding: 11px 4px; margin: 0 14px 0 2px; font-size: 14.5px; font-weight: 600;
  color: var(--mut); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .14s; }
.fin-tab .i { width: 17px; height: 17px; }
.fin-tab:hover { color: var(--ink2); }
.fin-tab.on { color: var(--ink); border-bottom-color: var(--brand); }
.fin-soon { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 64px 28px; gap: 6px; }
.fin-soon .fs-ic { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); margin-bottom: 8px; }
.fin-soon .fs-ic .i { width: 26px; height: 26px; }
.fin-soon h3 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.fin-soon p { font-size: 14px; color: var(--mut); max-width: 440px; line-height: 1.55; }
.fin-soon .chip { margin-top: 10px; background: var(--brand-soft); color: var(--brand-ink); }

/* ---- redesigned vendor card (clean, financial) ---- */
.vcard2 { background: var(--card); border: 1px solid var(--hair2); border-radius: var(--rc); box-shadow: var(--lift);
  padding: 20px 21px; display: flex; flex-direction: column; gap: 16px; cursor: pointer;
  transition: border-color .14s, box-shadow .14s, transform .14s; }
.vcard2:hover { border-color: var(--brand-ring); box-shadow: var(--lift-lg); transform: translateY(-2px); }
.vc-head { display: flex; align-items: flex-start; gap: 13px; }
.vc-head .ava { width: 46px; height: 46px; border-radius: 13px; flex: none; font-size: 15px; font-weight: 700; }
.vc-id { flex: 1; min-width: 0; }
.vc-name { font-size: 16px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-tags { display: flex; align-items: center; gap: 9px; margin-top: 7px; flex-wrap: wrap; }
.vc-jobs { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--mut); font-weight: 600; }
.vc-jobs .i { width: 13px; height: 13px; }
.vc-act { display: flex; align-items: center; gap: 6px; flex: none; }
.vc-act .b.sm { box-shadow: none; }
.vc-act .chip.ok .i { width: 13px; height: 13px; }
.vc-contact { display: flex; flex-direction: column; gap: 8px; }
.vc-contact .cl { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink2); min-width: 0; }
.vc-contact .cl .i { width: 16px; height: 16px; flex: none; color: var(--mut2); }
.vc-contact .cl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-nocontact { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--warn); }
.vc-nocontact .i { width: 16px; height: 16px; flex: none; }
.vc-fin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 15px 0; border-top: 1px solid var(--hair2); border-bottom: 1px solid var(--hair2); }
.vcm { min-width: 0; }
.vcm + .vcm { padding-left: 16px; border-left: 1px solid var(--hair2); }
.vcm-l { font: 600 9.5px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.vcm-v { font-size: 19px; font-weight: 750; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.vcm-v.warn { color: var(--warn); }
.vc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.vc-foot .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.vc-foot .b.sm { box-shadow: none; }
.vc-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 650; color: var(--brand-ink); white-space: nowrap; }
.vc-link .i { width: 16px; height: 16px; transition: transform .14s; }
.vcard2:hover .vc-link .i { transform: translateX(2px); }

/* ============================ vendor workspace ============================ */
.vw-back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 13.5px; font-weight: 600;
  color: var(--mut); padding: 5px 10px 5px 6px; border-radius: 9px; transition: background .13s, color .13s; }
.vw-back:hover { background: var(--paper); color: var(--ink); }
.vw-back .i { width: 17px; height: 17px; }
.vw-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 22px 24px; }
.vw-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.vw-id .ava { width: 58px; height: 58px; border-radius: 16px; flex: none; font-size: 19px; font-weight: 700; }
.vw-idm { min-width: 0; }
.vw-name { display: flex; align-items: center; gap: 11px; font-size: 22px; font-weight: 750; letter-spacing: -.02em; flex-wrap: wrap; }
.vw-name .chip.ok .i { width: 13px; height: 13px; }
.vw-tags { display: flex; align-items: center; gap: 8px 16px; margin-top: 9px; flex-wrap: wrap; }
.vw-sub { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--mut); }
.vw-sub .i { width: 15px; height: 15px; color: var(--mut2); }
.vw-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.vw-kpis { display: grid; gap: 14px; grid-template-columns: repeat(5, 1fr); }
@media (max-width: 980px) { .vw-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .vw-kpis { grid-template-columns: repeat(2, 1fr); } }
.vw-kpi { background: var(--card); border: 1px solid var(--hair2); border-radius: var(--rc); box-shadow: var(--lift); padding: 16px 18px; min-width: 0; }
.vw-kpi .kl { font: 600 9.5px/1.2 var(--f-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--mut); }
.vw-kpi .kv { font-size: 23px; font-weight: 750; letter-spacing: -.025em; margin-top: 9px; font-variant-numeric: tabular-nums; }
.vw-kpi .kv.warn { color: var(--warn); }
.vw-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; }
.vw-tabs::-webkit-scrollbar { display: none; }
.vw-tab { padding: 11px 4px; margin: 0 16px 0 2px; font-size: 14.5px; font-weight: 600; color: var(--mut);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .14s; }
.vw-tab:hover { color: var(--ink2); }
.vw-tab.on { color: var(--ink); border-bottom-color: var(--brand); }
.vw-h3 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 16px; }
.vw-grid2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.vw-grid2 > * { min-width: 0; }
@media (max-width: 980px) { .vw-grid2 { grid-template-columns: 1fr; } }

.snap-bar { height: 12px; border-radius: 99px; background: var(--warn-soft); overflow: hidden; }
.snap-bar.sm { height: 8px; margin-top: 4px; background: var(--paper); }
:root[data-night="on"] .snap-bar.sm { background: rgba(255,255,255,.08); }
.snap-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.snap-bar.sm i { background: var(--brand); }
.snap-legend { display: flex; gap: 20px; margin-top: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink2); font-weight: 600; }
.snap-legend span { display: inline-flex; align-items: center; gap: 7px; }
.snap-legend .d { width: 9px; height: 9px; border-radius: 99px; }
.snap-legend .d.ok { background: var(--ok); }
.snap-legend .d.warn { background: var(--warn); }
.snap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 14px; margin-top: 20px; }
.snap-grid .sl, .vj-fin .sl { font: 600 9.5px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.snap-grid .sv, .vj-fin .sv { font-size: 18px; font-weight: 700; margin-top: 7px; font-variant-numeric: tabular-nums; }
.snap-grid .sv.warn, .vj-fin .sv.warn { color: var(--warn); }

.vw-timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; align-items: center; gap: 13px; padding: 11px 0; border-top: 1px solid var(--hair2); }
.tl-item:first-child { border-top: 0; padding-top: 0; }
.tl-dot { width: 9px; height: 9px; border-radius: 99px; flex: none; }
.tl-dot.ok { background: var(--ok); }
.tl-dot.warn { background: var(--warn); }
.tl-b { flex: 1; min-width: 0; }
.tl-t { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-s { font-size: 12px; color: var(--mut); margin-top: 2px; }
.tl-a { text-align: right; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-a small { display: block; font-weight: 500; color: var(--mut); font-size: 11.5px; }

.vw-tblwrap { overflow-x: auto; }
.vw-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.vw-tbl th { text-align: left; padding: 11px 22px; border-bottom: 1px solid var(--hair); white-space: nowrap;
  font: 600 10px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.vw-tbl td { padding: 13px 22px; border-bottom: 1px solid var(--hair2); vertical-align: middle; white-space: nowrap; }
.vw-tbl tbody tr:last-child td { border-bottom: 0; }
.vw-tbl tbody tr { transition: background .12s; }
.vw-tbl tbody tr:hover { background: var(--paper); }
:root[data-night="on"] .vw-tbl tbody tr:hover { background: rgba(255,255,255,.04); }
.vw-tbl .r { text-align: right; }
.vw-tbl .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.vw-rcpt { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-ink); }
.vw-rcpt .i { width: 15px; height: 15px; }
@media (max-width: 740px) {
  .vw-tbl thead { display: none; }
  .vw-tbl, .vw-tbl tbody { display: block; }
  .vw-tbl tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 13px 18px; border-bottom: 1px solid var(--hair2); }
  .vw-tbl td { display: block; padding: 0; border: 0; white-space: normal; }
  .vw-tbl td::before { content: attr(data-l) " · "; color: var(--mut); font-size: 11px; font-weight: 600; }
  .vw-tbl td.r { text-align: left; }
  .vw-tbl td[data-l="Amount"] { grid-column: 2; grid-row: 1; text-align: right; }
  .vw-tbl td[data-l="Amount"]::before { display: none; }
}

.vw-jobs { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
@media (max-width: 740px) { .vw-jobs { grid-template-columns: 1fr; } }
.vw-job { gap: 0; }
.vj-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.vj-name { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.vj-city { font-size: 12.5px; color: var(--mut); margin-top: 2px; }
.vj-fin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 14px; }

.vw-docs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.vw-doc { display: flex; align-items: center; gap: 13px; background: var(--card); border: 1px solid var(--hair2); border-radius: var(--rc); box-shadow: var(--lift); padding: 15px 17px; }
.vw-doc .doc-ic { width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center; }
.vw-doc .doc-ic.ok { background: var(--ok-soft); color: var(--ok); }
.vw-doc .doc-ic.miss { background: var(--paper); color: var(--mut2); }
:root[data-night="on"] .vw-doc .doc-ic.miss { background: rgba(255,255,255,.06); }
.vw-doc .doc-ic .i { width: 19px; height: 19px; }
.vw-doc .doc-m { flex: 1; min-width: 0; }
.vw-doc .doc-n { font-size: 14px; font-weight: 650; }
.vw-doc .doc-s { font-size: 12px; color: var(--mut); margin-top: 2px; }
.vw-doc .b.sm { box-shadow: none; flex: none; }

/* ---- Financials: section heads + payments + owners + reporting ---- */
.fin-h { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 13px; }
.pay-vend { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; }
.pay-tbl th:nth-child(2), .pay-tbl td:nth-child(2) { min-width: 170px; }

.bill-list { display: flex; flex-direction: column; }
.bill-row { display: flex; align-items: center; gap: 13px; padding: 13px 22px; border-top: 1px solid var(--hair2); }
.bill-row:first-child { border-top: 0; }
.bill-m { flex: 1; min-width: 0; }
.bill-t { font-size: 14px; font-weight: 650; }
.bill-s { font-size: 12.5px; color: var(--mut); margin-top: 2px; }
.bill-a { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--warn); white-space: nowrap; }
.bill-row .b.sm { box-shadow: none; flex: none; }

.own-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.own-card { gap: 0; cursor: pointer; transition: border-color .14s, box-shadow .14s, transform .14s; }
.own-card:hover { border-color: var(--brand-ink); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.own-card .vc-link { margin-left: auto; }
.own-card:hover .vc-link .i { transform: translateX(2px); }
.ow-mixlist { display: flex; flex-direction: column; gap: 14px; }
.ow-fp-row { cursor: pointer; transition: background .12s; }
.ow-fp-row:hover { background: var(--hover, rgba(0,0,0,.035)); }
.pay-clk { cursor: pointer; transition: background .12s; }
.pay-clk:hover { background: var(--hover, rgba(0,0,0,.035)); }
.tl-clk { cursor: pointer; border-radius: 10px; transition: background .12s; }
.tl-clk:hover { background: var(--hover, rgba(0,0,0,.04)); }
.tel-link { color: inherit; text-decoration: none; }
.tel-link:hover { text-decoration: underline; }
.menu-pop { position: fixed; z-index: 1000; min-width: 184px; background: var(--card); border: 1px solid var(--hair2); border-radius: 13px; box-shadow: 0 12px 34px rgba(0,0,0,.18); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.menu-pop button, .menu-pop a { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; cursor: pointer; padding: 9px 11px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink); text-decoration: none; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--hover, rgba(0,0,0,.05)); }
.menu-pop .i { width: 16px; height: 16px; color: var(--mut2); flex: none; }
.menu-pop .danger { color: var(--bad); }
.menu-pop .danger .i { color: var(--bad); }
.ava-edit { position: relative; padding: 0; border: 0; background: none; cursor: pointer; display: inline-flex; flex: none; }
.ava-cam { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 1px solid var(--hair2); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.ava-cam .i { width: 12px; height: 12px; color: var(--ink2); }
.ow-mix { display: flex; align-items: center; gap: 12px; }
.ow-mix-l { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; min-width: 108px; }
.ow-mix-l .i { width: 15px; height: 15px; }
.ow-mix-v { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.own-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.own-n { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.own-r { font-size: 12.5px; color: var(--mut); margin-top: 2px; }
.own-fin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.own-fin .sl { font: 600 9px/1.2 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mut); }
.own-fin .sv { font-size: 16px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.own-fin .sv.warn { color: var(--warn); }
.own-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 12.5px; }
.own-foot .b.sm { box-shadow: none; }

.dist-list { display: flex; flex-direction: column; gap: 16px; }
.dist-row { display: flex; align-items: center; gap: 12px; }
.dist-m { width: 120px; flex: none; }
.dist-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--paper); overflow: hidden; }
:root[data-night="on"] .dist-bar { background: rgba(255,255,255,.08); }
.dist-bar i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.dist-row .bill-a { color: var(--ink); }

.rbars { display: flex; flex-direction: column; gap: 14px; }
.rbar { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 14px; }
.rb-l { font-size: 13px; font-weight: 600; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-track { height: 10px; border-radius: 99px; background: var(--paper); overflow: hidden; }
:root[data-night="on"] .rb-track { background: rgba(255,255,255,.07); }
.rb-track i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.rb-v { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.cflow { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 14px; align-items: end; height: 190px; padding-top: 18px; }
.cf-col { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.cf-amt { font: 600 11px/1 var(--f-mono); color: var(--mut); }
.cf-bar { width: 100%; max-width: 52px; flex: 1; display: flex; align-items: flex-end; background: var(--paper); border-radius: 9px 9px 0 0; overflow: hidden; }
:root[data-night="on"] .cf-bar { background: rgba(255,255,255,.05); }
.cf-bar i { width: 100%; border-radius: 9px 9px 0 0; background: linear-gradient(180deg, var(--brand), var(--brand-deep)); transition: height .4s var(--ease); }
.cf-m { font: 600 11px/1 var(--f-mono); color: var(--mut); text-transform: uppercase; letter-spacing: .06em; }

/* ============================ Financials — responsive / mobile-app ============================ */
/* tablet & small laptop */
@media (max-width: 980px) {
  .vw-hero { padding: 20px; }
  .vw-name { font-size: 20px; }
}
@media (max-width: 880px) {
  .vdir-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .vw-jobs { grid-template-columns: 1fr; }
}

/* phones — app-like single column, big tap targets */
@media (max-width: 620px) {
  /* KPI tiles: 2-up, tighter numbers so currency never clips */
  .vt-v { font-size: 22px; margin-top: 9px; }
  .vt-s { font-size: 11.5px; }

  /* directory toolbar → stacked: full-width search, scrollable filter row */
  .vdir-bar { gap: 10px; }
  .vdir-search { flex: 1 1 100%; min-height: 44px; }
  .vdir-seg { flex: 1 1 100%; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .vdir-seg::-webkit-scrollbar { display: none; }
  .vdir-seg .fchip { flex: 1 0 auto; justify-content: center; min-height: 42px; }
  .vdir-sel { flex: 1 1 46%; }
  .vdir-trades { width: 100%; min-height: 44px; }
  .vdir-w9 { flex: 1 1 46%; justify-content: center; min-height: 44px; }
  .vdir-spread { display: none; }
  .vdir-bar .vswitch { flex: 0 0 auto; }
  .vdir-bar .b.pri { flex: 1 1 auto; justify-content: center; min-height: 44px; }

  /* vendor card */
  .vcard2 { padding: 17px; }
  .vc-fin { gap: 0; }
  .vcm + .vcm { padding-left: 12px; }
  .vcm-v { font-size: 17px; }
  .vc-foot .acts { flex: 1 1 100%; }
  .vc-foot .acts .b.sm { flex: 1 1 auto; justify-content: center; min-height: 40px; }
  .vc-link { flex: 1 1 100%; justify-content: flex-end; margin-top: 2px; }

  /* payments: bills + ledger toolbar */
  .pay-controls { flex-wrap: wrap; }
  .fin-pay .card-h .rowflex { width: 100%; }
  .fin-pay .card-h .vdir-search { flex: 1 1 100% !important; min-height: 44px; }
  .fin-pay .card-h .vdir-seg { flex: 1 1 100%; }
  .fin-pay .card-h .b.sm { flex: 1 1 auto; justify-content: center; min-height: 42px; }
  .bill-row { flex-wrap: wrap; padding: 14px 16px; min-height: 56px; }
  .bill-row .bill-a { margin-left: auto; }
  .bill-row .b.sm { flex: 1 1 100%; justify-content: center; min-height: 42px; order: 3; }

  /* owners */
  .own-grid { grid-template-columns: 1fr; }
  .own-fin .sv { font-size: 15px; }
  .dist-m { width: 96px; }

  /* reporting */
  .rbar { grid-template-columns: 76px 1fr auto; gap: 10px; }
  .rb-l { font-size: 12px; }
  .rb-v { font-size: 12.5px; }
  .cflow { gap: 7px; height: 168px; }
  .cf-amt { font-size: 9.5px; }
  .cf-m { font-size: 10px; letter-spacing: .03em; }
  .cf-bar { border-radius: 7px 7px 0 0; }

  /* workspace hero + actions go full-width and tappable */
  .vw-hero { padding: 18px; gap: 16px; }
  .vw-id { gap: 13px; }
  .vw-id .ava { width: 50px; height: 50px; border-radius: 14px; font-size: 17px; }
  .vw-name { font-size: 19px; }
  .vw-actions { width: 100%; }
  .vw-actions .b.sm { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  .vw-actions .vd-kebab { flex: 0 0 auto; }
  .vw-kpi { padding: 14px 15px; }
  .vw-kpi .kv { font-size: 20px; }
  .vw-tab, .fin-tab { font-size: 14px; }

  /* card section paddings tighten a touch */
  .card-pad { padding: 18px; }
}

/* very small phones */
@media (max-width: 380px) {
  .vdir-tiles { gap: 9px; }
  .vt-v { font-size: 20px; }
  .vw-kpis { gap: 10px; }
}

/* ============================ owner ledger / IOUs ============================ */
.b.xs { min-height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; box-shadow: none; }
.own-add { width: 30px; height: 30px; padding: 0; flex: none; box-shadow: none; }
.own-add .i { width: 16px; height: 16px; }
.own-head { position: relative; }
.own-head > div:not(.own-add):nth-child(2) { flex: 1; min-width: 0; }
.own-break { font-size: 12px; color: var(--mut); margin-top: 10px; }
.own-card .own-foot { margin-top: 12px; }

/* type chips in the ledger */
.ol-type { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 650; white-space: nowrap; }
.ol-type .i { width: 13px; height: 13px; }
.ol-type.t-cash { color: var(--brand-ink); background: var(--brand-soft); }
.ol-type.t-materials { color: var(--info); background: var(--info-soft); }
.ol-type.t-labor { color: var(--ok); background: var(--ok-soft); }
.ol-type.t-adjustment { color: var(--warn); background: var(--warn-soft); }

.ol-desc { font-size: 13.5px; font-weight: 550; }
.ol-prop { font-size: 12px; color: var(--mut); margin-top: 3px; }
.ol-tbl td { vertical-align: middle; }
.ol-tbl th:nth-child(4), .ol-tbl td:nth-child(4) { white-space: normal; min-width: 220px; }
.ol-acts { display: inline-flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.ol-act-cell { white-space: normal; }
.ol-filter { flex-wrap: wrap; }

/* how-it-works helper card */
.how-card .how-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.how-card .how-list li { position: relative; padding-left: 24px; font-size: 13px; line-height: 1.5; color: var(--ink2); }
.how-card .how-list li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 8px; height: 8px; border-radius: 99px; background: var(--brand); }
.how-card .how-list b { color: var(--ink); font-weight: 650; }

@media (max-width: 740px) {
  .ol-tbl td.ol-act-cell::before { display: none; }
  .ol-tbl td.ol-act-cell { text-align: left; }
  .ol-acts { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .ol-tbl th:nth-child(4), .ol-tbl td:nth-child(4) { min-width: 0; }
  .ol-acts { justify-content: flex-start; }
  .ol-acts .b.xs { flex: 1 1 auto; justify-content: center; min-height: 38px; }
  .ol-tbl td.ol-act-cell { text-align: left; }
  .ol-tbl td.ol-act-cell::before { display: none; }
}

/* ============================ General (overhead) expenses ============================ */
/* filter bar — mirrors .vdir-bar */
.ge-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 22px 16px; }
.ge-search { flex: 1 1 200px; min-width: 160px; }
.ge-cat, .ge-range, .ge-method { max-width: 100%; }

/* category chip */
.ge-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 650; white-space: nowrap; }
.ge-chip i { width: 7px; height: 7px; border-radius: 99px; flex: none; }

.ge-payee { font-size: 13.5px; font-weight: 600; }
.ge-more { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 14px; border-top: 1px solid var(--hair2); font-size: 13.5px; font-weight: 650; color: var(--brand-ink);
  transition: background .13s; }
.ge-more:hover { background: var(--paper); }
:root[data-night="on"] .ge-more:hover { background: rgba(255,255,255,.04); }
.ge-more .i { width: 16px; height: 16px; }
.ge-note { font-size: 12px; color: var(--mut); margin-top: 2px; }
.ge-yr { font-size: 11px; color: var(--mut2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.ge-recur { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--brand-ink); }
.ge-recur .i { width: 13px; height: 13px; }
.ge-owner { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; font-size: 11.5px; font-weight: 650;
  color: var(--warn); background: var(--warn-soft); padding: 2px 8px; border-radius: 99px; cursor: pointer; }
.ge-owner .i { width: 12px; height: 12px; }
.ge-tbl tbody tr { cursor: pointer; }
.ge-tbl th:nth-child(2), .ge-tbl td:nth-child(2) { min-width: 180px; white-space: normal; }

/* recurring commitments */
.ge-commits { display: flex; flex-direction: column; }
.ge-commits-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
@media (max-width: 720px) { .ge-commits-grid { grid-template-columns: 1fr; column-gap: 0; } }
.ge-commits-grid .ge-commit:nth-child(2) { border-top: 0; padding-top: 0; }
.ge-commit { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--hair2); }
.ge-commit:first-child { border-top: 0; padding-top: 0; }
.ge-dot { width: 9px; height: 9px; border-radius: 99px; flex: none; }
.ge-commit-m { flex: 1; min-width: 0; }
.ge-commit-t { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ge-commit-s { font-size: 12px; color: var(--mut); margin-top: 2px; }
.ge-commit-a { text-align: right; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ge-commit-a small { display: block; font-weight: 500; color: var(--mut); font-size: 11.5px; }

/* reporting block */
.ge-period { flex-wrap: wrap; }
.ge-rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 860px) { .ge-rep-grid { grid-template-columns: 1fr; gap: 24px; } }
.ge-rep-col { min-width: 0; }
.ge-cflow { height: 150px; }
.ge-split { margin-top: 20px; }
.ge-split-bar { height: 10px; border-radius: 99px; overflow: hidden; background: var(--mut2); display: flex; }
.ge-split-bar i { display: block; height: 100%; background: var(--brand); }
.ge-split-leg { display: flex; gap: 20px; margin-top: 11px; flex-wrap: wrap; font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.ge-split-leg span { display: inline-flex; align-items: center; gap: 7px; }
.ge-split-leg .d { width: 9px; height: 9px; border-radius: 99px; }

@media (max-width: 620px) {
  .ge-bar { padding: 0 16px 14px; }
  .ge-search { flex: 1 1 100%; min-height: 44px; }
  .ge-seg { flex: 1 1 100%; }
  .ge-bar .vdir-sel { flex: 1 1 46%; }
  .ge-bar .vdir-sel select { width: 100%; min-height: 44px; }
  .ge-bar .vdir-spread { display: none; }
  .ge-bar .b.sm { display: none; }
  .ge-tbl th:nth-child(2), .ge-tbl td:nth-child(2) { min-width: 0; }
}
