/* ARVDesk: plain, readable, no build step. Copyright (c) 2026 CLA/RE Inc. All rights reserved.
   ARVDesk palette (navy + slate). Icons: Heroicons (MIT), see static/vendor/heroicons/LICENSE. */
:root {
  --ink:#1f2933; --muted:#616e7c; --line:#e1e7ef; --line-strong:#cbd4e0; --bg:#f4f6f9; --panel:#fff;
  --brand:#1d4e89; --brand-dark:#163b68; --brand-soft:#e8eff8; --accent:#c9842b;
  --arv-mark:#1F6B45; --arv-mark-hover:#17573A; --arv-mark-ink:#fff;
  --ok:#1f7a3a; --warn:#a86500; --bad:#b42318;
  --radius:10px; --shadow:0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --topbar-h:60px;
}
* { box-sizing: border-box; }
body { margin:0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color:var(--ink); background:var(--bg); }
a { color: var(--brand); }
h1 { font-size:1.6rem; font-weight:500; margin:.2rem 0; letter-spacing:-.01em; }
h2 { font-size:1.1rem; font-weight:600; margin:.1rem 0 .6rem; }
h3 { font-size:.95rem; font-weight:600; }
.icon { width:20px; height:20px; flex:none; vertical-align:middle; }
.icon.sm { width:16px; height:16px; } .icon.lg { width:24px; height:24px; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* --- Top bar ------------------------------------------------------------------------------ */
header.topbar { position:sticky; top:0; z-index:50; background:var(--tl-ffffff); border-bottom:1px solid var(--line); height:var(--topbar-h);
  display:flex; align-items:center; gap:.9rem; padding:0 1.25rem; }
.wordmark { display:flex; align-items:center; gap:.5rem; color:var(--ink); text-decoration:none; font-size:1.2rem; letter-spacing:.01em; flex:none; }
.wordmark svg { width:30px; height:30px; }
.wordmark b { font-weight:800; color:var(--arv-mark); } .wordmark span { font-weight:500; }
.arv-mark { color: var(--arv-mark); }
.arv-mark-line { fill: none; stroke: var(--arv-mark-ink); }
.arv-mark-door { fill: var(--arv-mark-ink); }
a.wordmark:hover .arv-mark,
.support-launch:hover .arv-mark,
.auth-brand:hover .arv-mark { color: var(--arv-mark-hover); }
.support-launch .arv-mark { width: 20px; height: 20px; }
.sd-head .arv-mark { width: 28px; height: 28px; }
.auth-brand .arv-mark { width: 44px; height: 44px; }
.search { flex:1 1 auto; max-width:460px; margin:0 auto; position:relative; }
.search input { width:100%; border:1px solid var(--line-strong); border-radius:999px; padding:.45rem .9rem .45rem 2.2rem; background:var(--tl-ffffff); font-size:.92rem; }
.search input:focus { outline:2px solid var(--brand-soft); border-color:var(--brand); }
.search > .icon { position:absolute; left:.7rem; top:50%; transform:translateY(-50%); color:var(--muted); width:18px; height:18px; }
.search-results { position:absolute; top:calc(100% + 6px); left:0; right:0; background:var(--tl-ffffff); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:0 8px 24px rgba(16,24,40,.14); max-height:70vh; overflow:auto; z-index:60; }
.search-results:empty { display:none; }
.search-results h4 { margin:0; padding:.5rem .8rem .2rem; font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.search-results a { display:flex; gap:.6rem; align-items:center; padding:.45rem .8rem; color:var(--ink); text-decoration:none; }
.search-results a:hover, .search-results a:focus { background:var(--brand-soft); }
.search-results img { width:44px; height:28px; object-fit:cover; border-radius:4px; background:var(--bg); }
.search-results .none { padding:.7rem .8rem; color:var(--muted); }
.top-icons { display:flex; align-items:center; gap:.15rem; margin-left:auto; flex:none; }
.theme-toggle { display:inline-flex; margin:0; }
.icon-btn { display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px; border-radius:999px; color:var(--td-475467);
  background:none; border:0; padding:0; cursor:pointer; text-decoration:none; }
.icon-btn:hover, details[open] > summary.icon-btn { background:var(--bg); color:var(--ink); }
.avatar { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; flex:none; border-radius:999px; background:var(--brand-fill);
  color:#fff; font-weight:700; font-size:.85rem; }

/* Dropdowns: <details class="dd"><summary>…</summary><div class="dd-panel">…</div></details> */
details.dd { position:relative; }
details.dd > summary { list-style:none; cursor:pointer; }
details.dd > summary::-webkit-details-marker { display:none; }
.dd-panel { position:absolute; top:calc(100% + 6px); left:0; min-width:220px; background:var(--tl-ffffff); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:0 8px 24px rgba(16,24,40,.14); padding:.35rem; z-index:70; }
.dd-panel.right { left:auto; right:0; }
.dd-panel a, .dd-panel button.link { display:flex; align-items:center; gap:.55rem; width:100%; padding:.45rem .6rem; border-radius:6px; color:var(--ink);
  text-decoration:none; font-size:.92rem; background:none; border:0; cursor:pointer; text-align:left; font:inherit; }
.dd-panel a:hover, .dd-panel button.link:hover { background:var(--brand-soft); }
.dd-panel a.current { background:var(--brand-soft); color:var(--brand); font-weight:600; }
.dd-panel .icon { color:var(--muted); width:18px; height:18px; }
.dd-panel h4 { margin:.45rem .6rem .15rem; font-size:.7rem; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); }
.dd-panel hr { border:0; border-top:1px solid var(--line); margin:.35rem 0; }
.dd-panel .who { padding:.45rem .6rem; font-size:.85rem; color:var(--muted); }
.dd-panel .who strong { display:block; color:var(--ink); }
.dd-panel form { margin:0; }

/* --- Page --------------------------------------------------------------------------------- */
main { max-width:1200px; margin:0 auto; padding:1.1rem 1.25rem 0; }
main.wide { max-width:1240px; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; flex-wrap:wrap; margin-bottom:.8rem; }
.page-head .sub { color:var(--muted); font-size:.92rem; margin:.15rem 0 0; display:flex; gap:.9rem; flex-wrap:wrap; align-items:center; }
.help-link { display:inline-flex; align-items:center; gap:.3rem; font-size:.88rem; text-decoration:none; }
.help-link:hover { text-decoration:underline; }
.tabs { display:flex; gap:.2rem; border-bottom:1px solid var(--line); margin:0 0 1.1rem; overflow-x:auto; scrollbar-width:none; }
.tabs a { padding:.65rem .9rem; color:var(--muted); text-decoration:none; font-weight:600; font-size:.92rem; border-bottom:2px solid transparent; white-space:nowrap; margin-bottom:-1px; }
.tabs a:hover { color:var(--ink); }
.tabs a.active { color:var(--brand); border-bottom-color:var(--brand); }
.tabs .count { display:inline-block; min-width:1.4rem; padding:0 .4rem; margin-left:.3rem; border-radius:999px; background:var(--bg); color:var(--muted); font-size:.78rem; text-align:center; }
.tabs a.active .count { background:var(--brand-soft); color:var(--brand); }

.stats { display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:1rem; margin-bottom:1.4rem; }
.stat { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:.9rem 1.1rem; box-shadow:var(--shadow);
  text-decoration:none; color:var(--ink); display:block; }
a.stat:hover { border-color:var(--brand); }
.stat .label { display:flex; align-items:center; gap:.4rem; color:var(--muted); font-size:.88rem; font-weight:600; }
.stat .label .icon { color:var(--brand); width:18px; height:18px; }
.stat .value { font-size:1.75rem; font-weight:600; margin-top:.15rem; font-variant-numeric:tabular-nums; }
.stat .hint { color:var(--muted); font-size:.8rem; }

.section-title { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:.4rem 0 .6rem; }
.section-title h2 { margin:0; font-size:1.05rem; }
.cards { display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:1rem; margin-bottom:1.6rem; }
.pcard { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); overflow:visible; display:flex; flex-direction:column; }
.pcard .cover { position:relative; aspect-ratio:16/10; background:var(--bg); border-radius:var(--radius) var(--radius) 0 0; overflow:hidden; display:block; }
.pcard .cover img { width:100%; height:100%; object-fit:cover; display:block; }
.badge { display:inline-block; background:rgba(255,255,255,.94); color:var(--ink); font-size:.68rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase;
  padding:.15rem .45rem; border-radius:4px; border:1px solid var(--line); }
.pcard .badge { position:absolute; top:.55rem; left:.55rem; }
.badge.t-brrrr { color:var(--brand); } .badge.t-flip { color:var(--td-8a4b0f); } .badge.t-hold { color:var(--ok); } .badge.t-new_build { color:var(--td-5b3c99); }
.pcard .body { padding:.7rem .85rem .4rem; flex:1; }
.pcard .title { font-weight:600; color:var(--brand); text-decoration:none; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pcard .title:hover { text-decoration:underline; }
.pcard .addr { color:var(--muted); font-size:.82rem; margin-top:.1rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pcard .foot { display:flex; align-items:center; justify-content:space-between; padding:.35rem .5rem .5rem .85rem; gap:.5rem; }
.chip { display:inline-flex; align-items:center; gap:.3rem; font-size:.78rem; color:var(--muted); background:var(--bg); border-radius:999px; padding:.1rem .55rem; white-space:nowrap; }
.chip.ok { background:var(--tl-e3f4e8); color:var(--ok); } .chip.warn { background:var(--tl-fff1d6); color:var(--warn); } .chip.info { background:var(--brand-soft); color:var(--brand); }
.chip.muted { background:var(--tl-eef0f3); }
.progress { height:6px; background:var(--bg); border-radius:999px; overflow:hidden; margin-top:.45rem; }
.progress > span { display:block; height:100%; background:var(--brand-fill); border-radius:999px; }
.progress.over > span { background:var(--bad); }

.panel { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); margin-bottom:1.2rem; }
.panel-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.8rem 1rem; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.panel-head h2 { margin:0; font-size:1.05rem; }
.panel-body { padding:1rem; }
.filters { display:flex; gap:.5rem; flex-wrap:wrap; align-items:center; padding:.7rem 1rem; border-bottom:1px solid var(--line); background:var(--tl-fbfcfd); }
.filters input[type=search] { flex:1 1 200px; border-radius:8px; }
.filters select { border-radius:8px; }

/* Expense filters (Account / Company / Category / Class) */
.filters.ff-expense-filters {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .65rem;
  flex-wrap: nowrap;
  padding: .75rem 1rem .85rem;
  background: var(--tl-f5f7fa);
  border-bottom: 1px solid var(--line);
}
.ff-expense-filters .ff-filter-row {
  display: flex;
  gap: .65rem;
  align-items: flex-end;
  flex-wrap: wrap;
  width: 100%;
}
.ff-expense-filters .ff-filter-primary {
  flex-wrap: nowrap;
}
.ff-expense-filters .ff-filter-field {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  min-width: 0;
}
.ff-expense-filters .ff-filter-primary .ff-filter-field {
  flex: 1 1 0;
}
.ff-expense-filters .ff-filter-field label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--td-475467);
  margin: 0;
  line-height: 1.2;
}
.ff-expense-filters .ff-filter-field select,
.ff-expense-filters .ff-filter-field input[type=date] {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: .38rem .5rem;
  background: var(--tl-ffffff);
  font-size: .9rem;
  min-height: 2.05rem;
}
.ff-expense-filters .ff-filter-secondary .ff-filter-field {
  flex: 0 1 180px;
}
.ff-expense-filters .ff-filter-secondary .ff-filter-property {
  flex: 1 1 220px;
  max-width: 320px;
}
.ff-expense-filters .ff-filter-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding-bottom: .05rem;
  flex: none;
}
.ff-expense-filters .ff-filter-actions .secondary {
  padding: .38rem .8rem;
  font-size: .88rem;
}
@media (max-width: 860px) {
  .ff-expense-filters .ff-filter-primary {
    flex-wrap: wrap;
  }
  .ff-expense-filters .ff-filter-primary .ff-filter-field {
    flex: 1 1 calc(50% - .35rem);
  }
}
@media (max-width: 480px) {
  .ff-expense-filters .ff-filter-primary .ff-filter-field {
    flex: 1 1 100%;
  }
}

.view-toggle { display:inline-flex; border:1px solid var(--line-strong); border-radius:8px; overflow:hidden; }
.view-toggle a { display:inline-flex; align-items:center; gap:.3rem; padding:.3rem .7rem; font-size:.85rem; color:var(--ink); text-decoration:none; }
.view-toggle a + a { border-left:1px solid var(--line-strong); }
.view-toggle a:hover { background:var(--brand-soft); }
.view-toggle a.on { background:var(--brand-fill); color:#fff; }
/* Map view (Leaflet). Pin colors by stage, ARVDesk palette. */
.map-view { padding:0 1rem 1rem; }
.map-box { height:520px; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; position:relative; background:var(--tl-e9edf2); z-index:0; }
.map-box.small { height:260px; }
.map-legend { display:flex; flex-wrap:wrap; gap:.4rem 1rem; align-items:center; font-size:.82rem; padding:.2rem 0 .6rem; }
.map-legend span { display:inline-flex; align-items:center; gap:.35rem; }
.pin-dot { width:12px; height:12px; border-radius:50%; display:inline-block; border:2px solid var(--tl-ffffff); box-shadow:0 0 0 1px rgba(0,0,0,.25); }
.pin { background:transparent; border:0; }
.pin span { display:flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:50% 50% 50% 0;
  transform:rotate(-45deg); border:2px solid var(--tl-ffffff); box-shadow:0 1px 4px rgba(0,0,0,.35); color:#fff; font:700 12px/1 system-ui, sans-serif; }
.pin span > b { transform:rotate(45deg); font-weight:700; }
.stage-deal, .pin.stage-deal span { background:var(--brand-fill); }
.stage-rehab, .pin.stage-rehab span { background:var(--accent); }
.stage-rental, .pin.stage-rental span { background:var(--ok); }
.stage-listed, .pin.stage-listed span { background:#5b3c99; }
.stage-sold, .pin.stage-sold span { background:#667085; }
.stage-archived, .pin.stage-archived span { background:#98a2b3; }
.map-popup { font:inherit; width:220px; }
.map-popup-thumb { width:100%; height:120px; object-fit:cover; border-radius:6px; display:block; margin-bottom:.4rem; background:var(--bg); }
.map-popup-addr { font-weight:600; color:var(--brand); }
.map-popup-meta { display:flex; gap:.4rem; align-items:center; margin-top:.35rem; }
.map-popup-money { margin-top:.35rem; font-size:.85rem; }
.map-offline { position:absolute; inset:auto .6rem .6rem .6rem; z-index:500; background:var(--tl-fff8e6); color:var(--td-6b4500); border:1px solid var(--tl-f0d49b); border-radius:8px; padding:.4rem .6rem; font-size:.82rem; }
.map-missing { margin-top:.9rem; }
.map-missing h3 { font-size:.95rem; display:flex; align-items:center; gap:.35rem; margin:0 0 .2rem; }
.map-missing ul { margin:.4rem 0 0; padding-left:1.1rem; }
.map-missing li { margin:.2rem 0; }
.map-foot { font-size:.82rem; margin:.6rem 0 0; }
.leaflet-container { font:inherit; }
.leaflet-popup-content { margin:10px 12px; }

table.list { border:0; }
table.list th { background:var(--tl-fbfcfd); font-size:.78rem; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); font-weight:700; border-bottom:1px solid var(--line); white-space:nowrap; padding:.55rem .6rem; }
table.list th a { color:inherit; text-decoration:none; display:inline-flex; align-items:center; gap:.15rem; }
table.list th a:hover { color:var(--ink); }
table.list th.sorted a { color:var(--brand); }
table.list tr.list-group th { background:transparent; text-transform:none; letter-spacing:0; font-size:.78rem; font-weight:700; color:var(--muted); border-bottom:0; padding:.65rem .6rem .15rem; }
table.list td { padding:.55rem .6rem; vertical-align:middle; border-bottom:1px solid var(--line); }
table.list tr:last-child td { border-bottom:0; }
table.list tbody tr:hover td { background:var(--tl-fafbfd); }
table.list .thumb { width:64px; height:40px; object-fit:cover; border-radius:6px; display:block; background:var(--bg); }
table.list .addr-cell a { font-weight:600; text-decoration:none; } table.list .addr-cell a:hover { text-decoration:underline; }
table.list .addr-cell .muted { font-size:.82rem; }
.kebab summary { width:32px; height:32px; }
.row-actions { width:40px; text-align:right; }
.empty { text-align:center; color:var(--muted); padding:2rem 1rem; }
.empty .icon { width:40px; height:40px; color:var(--line-strong); display:block; margin:0 auto .4rem; }

.banner { display:flex; align-items:center; gap:.9rem; background:var(--brand-soft); border:1px solid var(--tl-cfdcee); border-radius:var(--radius); padding:.7rem 1rem; margin-bottom:1.1rem; flex-wrap:wrap; }
.banner .grow { flex:1 1 280px; }
.banner .progress { background:var(--tl-ffffff); max-width:260px; }

/* Property / project hero */
.hero { display:grid; grid-template-columns: 360px 1fr; gap:1.2rem; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:1rem; margin-bottom:1.2rem; }
.hero .cover { aspect-ratio:16/10; border-radius:8px; overflow:hidden; background:var(--bg); position:relative; }
.hero .cover img { width:100%; height:100%; object-fit:cover; display:block; }
.hero .cover .badge { position:absolute; top:.6rem; left:.6rem; }
.hero h1 { margin-top:0; }
.hero .meta { color:var(--muted); margin:.1rem 0 .7rem; }
.hero .actions { display:flex; gap:.5rem; flex-wrap:wrap; align-items:center; margin-top:.6rem; }
.mini-stats { display:grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap:.6rem; margin-top:.4rem; }
.mini-stats div { background:var(--bg); border-radius:8px; padding:.5rem .7rem; }
.mini-stats .label { font-size:.78rem; color:var(--muted); font-weight:600; }
.mini-stats .value { font-size:1.15rem; font-weight:600; font-variant-numeric:tabular-nums; }
.photo-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap:.8rem; }
.photo-grid figure { margin:0; background:var(--bg); border-radius:8px; overflow:hidden; border:1px solid var(--line); position:relative; }
.photo-grid img { width:100%; height:auto; aspect-ratio:16/10; object-fit:cover; display:block; }
.photo-grid figcaption { padding:.35rem .5rem; font-size:.8rem; display:flex; justify-content:space-between; align-items:center; gap:.3rem; }
.photo-grid figcaption > span:last-child { display:flex; gap:.25rem; flex:none; }
.photo-grid .badge { position:absolute; top:.4rem; left:.4rem; }
.photo-grid form { display:inline; margin:0; }

/* --- Existing components (kept) ----------------------------------------------------------- */
.card { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:1rem; margin-bottom:1rem; box-shadow:var(--shadow); }
.grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap:1rem; }
table { border-collapse:collapse; width:100%; background:var(--tl-ffffff); }
th, td { border-bottom:1px solid var(--line); padding:.4rem .5rem; text-align:left; vertical-align:top; }
th { background:var(--tl-f6f8fb); font-weight:600; }
td.num, th.num { text-align:right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight:700; border-top:2px solid var(--ink); }
tr.section td { font-weight:600; background:var(--bg); }
.opening { background:var(--tl-fff8e1); }
.tag { display:inline-block; padding:0 .4rem; border-radius:3px; font-size:.8rem; font-weight:600; }
.tag.ok { background:var(--tl-e3f4e8); color:var(--ok); } .tag.warn { background:var(--tl-fff1d6); color:var(--warn); }
.tag.bad { background:var(--tl-fde7e5); color:var(--bad); } .tag.info { background:var(--tl-e6eef8); color:var(--brand); }
.tag.opening-label { background:var(--tl-ffe8a3); color:var(--td-5c4400); }
.msg { padding:.6rem .85rem; border-radius:8px; margin-bottom:.6rem; border:1px solid transparent; }
.msg.success { background:var(--tl-e3f4e8); border-color:var(--tl-c3e6cd); } .msg.error { background:var(--tl-fde7e5); border-color:var(--tl-f6c9c4); }
.msg.warning { background:var(--tl-fff1d6); border-color:var(--tl-f3dca9); } .msg.info { background:var(--tl-e6eef8); border-color:var(--tl-cfdcee); }
form p, form div.field { margin:.4rem 0; }
label { font-weight:600; display:block; }
input, select, textarea { font:inherit; padding:.38rem .5rem; border:1px solid var(--line-strong); border-radius:6px; max-width:100%; background:var(--tl-ffffff); color:var(--ink); }
input[type=checkbox] { width:auto; }
.helptext { color:var(--muted); font-size:.85rem; display:block; }
.errorlist { color:var(--bad); margin:.2rem 0; padding-left:1rem; }
button, .button { background:var(--brand-fill); color:#fff; border:1px solid var(--brand); border-radius:8px; padding:.45rem .95rem; font:inherit; font-weight:600; cursor:pointer;
  text-decoration:none; display:inline-flex; align-items:center; gap:.35rem; font-size:.92rem; }
button:hover, .button:hover { background:var(--brand-fill-hover); }
button.secondary, .button.secondary { background:var(--tl-ffffff); color:var(--brand); border:1px solid var(--line-strong); }
button.secondary:hover, .button.secondary:hover { border-color:var(--brand); background:var(--tl-ffffff); }
button.danger { background:var(--tl-ffffff); color:var(--bad); border-color:#f0c2bd; }
.muted { color:var(--muted); }
.formrow { display:flex; gap:.5rem; flex-wrap:wrap; align-items:flex-end; }
.formrow > div { flex: 1 1 140px; }
.form-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:.2rem 1.2rem; }
.form-grid > div { margin:.3rem 0; } .form-grid input:not([type=checkbox]), .form-grid select, .form-grid textarea { width:100%; }
.form-grid .wide { grid-column: 1 / -1; }
/* Entry forms: equal columns, labels on one row so the controls line up. */
.form-grid.aligned { gap:.85rem 1.25rem; align-items: start; }
.form-grid.aligned > .field { display:flex; flex-direction:column; min-width:0; margin:0; }
.form-grid.aligned > .field.wide { grid-column: 1 / -1; }
.form-grid.aligned > .field.is-latent, .form-grid.aligned > input[type="hidden"] { display:none; }
.field-label { display:flex; align-items:flex-start; gap:.3rem; min-height:2.6em; margin-bottom:.2rem; }
.field-label label { margin:0; line-height:1.3; }
.form-grid.aligned > .field.check .field-label { min-height:0; align-items:center; }
.form-grid.aligned > .field.check input[type=checkbox] { width:auto; margin-right:.35rem; }
.form-section { margin:0 0 1.15rem; }
.form-section > h2 { font-size:.78rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); margin:0 0 .55rem; }
.form-actions { margin-top:.4rem; }
.tip { position:relative; display:inline-flex; flex:none; }
button.tip-btn { width:1.15rem; height:1.15rem; min-width:1.15rem; padding:0; border-radius:50%; background:var(--bg); color:var(--muted);
  border:1px solid var(--line-strong); font-size:.72rem; font-weight:700; line-height:1; display:inline-flex; align-items:center; justify-content:center; }
button.tip-btn:hover, button.tip-btn:focus, .tip.is-open button.tip-btn { background:var(--brand-soft); color:var(--brand); border-color:var(--brand); }
.tip-bubble { display:none; position:absolute; z-index:30; top:1.4rem; left:0; width:min(280px, 70vw); background:var(--ink); color:#fff;
  font-size:.78rem; font-weight:500; line-height:1.35; padding:.45rem .6rem; border-radius:6px; box-shadow:var(--shadow); }
.tip.is-open .tip-bubble, button.tip-btn:hover + .tip-bubble, button.tip-btn:focus + .tip-bubble { display:block; }
.form-grid.aligned > .field:nth-child(2n) .tip-bubble { left:auto; right:0; }
.fake-banner { background:var(--tl-fff1d6); border:1px dashed var(--warn); padding:.3rem .6rem; font-size:.85rem; }
footer { color:var(--muted); font-size:.8rem; text-align:center; margin:2rem 0; }
table.inner { background:transparent; } table.inner td { border:0; padding:0 .4rem 0 0; font-size:.85rem; }
.bad { color: var(--bad); }
.table-wrap { overflow-x:auto; }
.help-doc { max-width:820px; } .help-doc h2 { margin-top:1.4rem; } .help-doc li { margin:.25rem 0; }

/* --- Responsive ----------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  header.topbar { height:auto; flex-wrap:wrap; padding:.5rem .75rem; gap:.4rem .5rem; }
  .search { display:none; } .icon-btn.show-sm { display:inline-flex; }
  .top-icons { gap:0; } .icon-btn { width:34px; height:34px; }
  .wordmark { font-size:1.05rem; } .wordmark img { width:26px; height:26px; }
  .topbar .top-icons, .topbar .wordmark { flex:none; }
  main { padding:.9rem .75rem 0; }
  h1 { font-size:1.35rem; }
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); gap:.6rem; }
  .stat { padding:.7rem .8rem; } .stat .value { font-size:1.4rem; }
  .cards { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; gap:.75rem; padding-bottom:.4rem; margin-right:-.75rem; }
  .cards .pcard { flex:0 0 78%; scroll-snap-align:start; }
  .form-grid, .form-grid.aligned { grid-template-columns: 1fr; }
  .field-label { min-height:0; }
  .form-grid.aligned > .field:nth-child(2n) .tip-bubble { left:0; right:auto; }
  .section-title .muted { display:none; }
  .map-view { padding:0 .5rem .75rem; } .map-box { height:420px; }
  /* Table becomes a stacked list on phones */
  table.list.stack thead { display:none; }
  table.list.stack tr { display:grid; grid-template-columns: 72px 1fr auto; gap:.1rem .6rem; padding:.6rem .5rem; border-bottom:1px solid var(--line); }
  table.list.stack td { border:0; padding:0; }
  table.list.stack td.c-thumb { grid-row: span 3; }
  table.list.stack td.c-addr { grid-column:2; }
  table.list.stack td.row-actions { grid-column:3; grid-row:1; }
  table.list.stack td.c-opt { display:none; }
  table.list.stack td.c-mobile { grid-column:2; font-size:.82rem; }
  table.list.stack tr.list-group { display:block; padding:.5rem .5rem .05rem; border-bottom:0; }
  table.list.stack tr.list-group th { display:block; padding:0; }
}
@media (max-width: 359px) {
  /* Very narrow phones: logo mark only, tighter gaps, so the buttons and icons stay on one row above the search. */
  header.topbar { gap:.4rem .3rem; padding:.5rem .5rem; }
  .wordmark > span { display:none; }
}
.location-edit { margin-top:1.2rem; border-top:1px solid var(--line); padding-top:1rem; scroll-margin-top:calc(var(--topbar-h) + 1rem); }
.location-edit h2 { font-size:1.05rem; display:flex; align-items:center; gap:.35rem; margin:0 0 .3rem; }
.map-box[data-map-picker] { cursor:crosshair; }
#location { scroll-margin-top:calc(var(--topbar-h) + 1rem); }

/* --- Sign-in and other account pages (templates/auth/layout.html) ----------------------------- */
.auth-body { min-height:100vh; margin:0; background:linear-gradient(180deg, var(--brand-soft) 0, var(--bg) 340px); }
.auth-main { min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:2rem 1rem; box-sizing:border-box; }
.auth-card { width:100%; max-width:420px; box-sizing:border-box; background:var(--panel); border:1px solid var(--line); border-radius:14px;
  box-shadow:0 10px 30px rgba(16,24,40,.08), var(--shadow); padding:2rem 2rem 1.5rem; }
.auth-card.auth-wide { max-width:480px; }
.auth-brand { display:flex; align-items:center; justify-content:center; gap:.55rem; margin-bottom:1.25rem; }
.auth-wordmark { font-size:1.55rem; color:var(--ink); letter-spacing:-.01em; }
.auth-wordmark b { color:var(--arv-mark); font-weight:800; }
.auth-title, .auth-generic h1 { font-size:1.3rem; text-align:center; margin:0 0 .4rem; }
.auth-generic h2 { font-size:1.05rem; }
.auth-sub { color:var(--muted); font-size:.92rem; margin:.25rem 0 1rem; line-height:1.45; }
.auth-title + .auth-form { margin-top:1.1rem; }
.auth-form { display:flex; flex-direction:column; gap:.9rem; margin:0 0 .9rem; }
.auth-field label { font-size:.88rem; margin-bottom:.3rem; }
.auth-label-row { display:flex; justify-content:space-between; align-items:baseline; gap:.5rem; }
.auth-label-row a { font-size:.85rem; font-weight:500; }
.auth-card input:not([type=checkbox]):not([type=hidden]), .auth-generic input:not([type=checkbox]) { width:100%; box-sizing:border-box; padding:.6rem .7rem; font-size:1rem; border-radius:8px; }
.auth-card input:focus { outline:2px solid var(--brand); outline-offset:1px; border-color:var(--brand); }
.auth-field .helptext { margin-top:.3rem; }
.auth-field .helptext ul { margin:.2rem 0 0; padding-left:1.1rem; }
.auth-error { color:var(--bad); font-size:.85rem; margin-top:.3rem; }
.auth-submit, .auth-generic form button[type=submit] { width:100%; padding:.65rem 1rem; font-size:1rem; justify-content:center; text-align:center; box-sizing:border-box; }
a.auth-submit { display:block; text-decoration:none; }
.auth-links { text-align:center; font-size:.9rem; margin:.4rem 0 0; }
.auth-links button.link, .auth-card button.link { background:none; border:0; color:var(--brand); padding:0; font-weight:500; text-decoration:underline; cursor:pointer; }
.auth-note { margin:1.25rem -2rem -1.5rem; padding:.85rem 2rem; background:var(--bg); border-top:1px solid var(--line); border-radius:0 0 14px 14px;
  color:var(--muted); font-size:.85rem; text-align:center; }
.auth-legal { color:var(--muted); font-size:.78rem; margin:1.2rem 0 0; text-align:center; }
.auth-qr { display:flex; justify-content:center; margin:.2rem 0; }
.auth-qr img { width:180px; height:180px; border:1px solid var(--line); border-radius:8px; padding:6px; background:var(--tl-ffffff); }
.auth-secret summary { cursor:pointer; color:var(--brand); font-size:.9rem; }
.auth-secret input { margin-top:.4rem; font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:.9rem !important; }
.auth-generic form p { margin:0 0 .8rem; }
@media (max-width: 480px) {
  .auth-main { justify-content:flex-start; padding:1.25rem .75rem; }
  .auth-card { padding:1.5rem 1.15rem 1.1rem; border-radius:12px; }
  .auth-note { margin:1.1rem -1.15rem -1.1rem; padding:.8rem 1.15rem; border-radius:0 0 12px 12px; }
}

/* --- Project tabs, Documents tab, Notes tab -------------------------- */
.crumbs { margin:.1rem 0 .6rem; font-size:.88rem; }
.project-head h1 { margin:0; font-size:1.75rem; }
.project-head .meta { margin:.1rem 0 .8rem; }
.project-tabs { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius) var(--radius) 0 0; padding:0 .6rem; }
.project-tabs a { padding:.75rem 1.1rem; }
.icon-btn { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; padding:0; border-radius:999px;
  background:var(--tl-ffffff); border:1px solid var(--line-strong); color:var(--ink); cursor:pointer; list-style:none; }
.icon-btn:hover { border-color:var(--brand); color:var(--brand); background:var(--tl-ffffff); }
.icon-btn.danger { color:var(--bad); border-color:#f0c2bd; }
.icon-btn.danger:hover { border-color:var(--bad); color:var(--bad); }
.icon-btn.disabled { opacity:.35; cursor:not-allowed; }
.icon-btn .icon.sm { width:14px; height:14px; }
.pill-btn { display:inline-flex; align-items:center; gap:.25rem; border:1px solid var(--brand); color:var(--brand); border-radius:999px;
  padding:.25rem .7rem; font-size:.88rem; font-weight:500; background:var(--tl-ffffff); cursor:pointer; white-space:nowrap; }
.pill-btn:hover { background:var(--brand-soft); }
.button.pill { border-radius:999px; padding:.5rem 1.15rem; display:inline-flex; align-items:center; gap:.35rem; font-size:1rem; }
.mini-form { display:flex; flex-direction:column; gap:.4rem; padding:.3rem; min-width:240px; }
.mini-form label { font-size:.8rem; color:var(--muted); font-weight:600; }
.dd-panel button.link.danger-text { color:var(--bad); }
.dd-panel button.link { background:none; border:0; font:inherit; font-weight:400; text-align:left; cursor:pointer; }

.docs-layout { display:grid; grid-template-columns: 280px 1fr; gap:1.5rem; align-items:start; margin-top:1.2rem; }
.folders-pane { background:transparent; }
.folders-head { display:flex; align-items:center; justify-content:space-between; margin:0 0 .55rem; }
.folders-head h2 { margin:0; font-size:.8rem; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); font-weight:600; }
.folder-list { list-style:none; margin:0; padding:0; background:var(--panel); border:1px solid var(--line); border-radius:4px; box-shadow:var(--shadow); }
.folder-list li { display:flex; align-items:center; gap:.4rem; padding:0 .55rem 0 0; border-top:1px solid var(--line); min-height:42px; }
.folder-list li:first-child { border-top:0; }
.folder-list li > a { flex:1; min-width:0; padding:.65rem .85rem; color:var(--ink); text-decoration:none; font-size:.92rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.folder-list li:hover { background:var(--tl-f8fafc); }
.folder-list li.active { background:var(--tl-dcebf3); }
.folder-list li.active > a { font-weight:500; }
.folder-actions { display:inline-flex; gap:.3rem; flex:none; }
.folder-actions form { margin:0; }
.count-badge { display:inline-block; min-width:1.2rem; padding:0 .35rem; border-radius:3px; background:var(--tl-e4e7eb); color:var(--ink); font-size:.75rem; text-align:center; margin-right:auto; }
.folder-list li > a + .count-badge { margin-left:-.5rem; flex:none; }
.help-tip { position:relative; display:inline-flex; color:var(--td-3e4c59); cursor:help; flex:none; }
.help-tip .tip { display:none; position:absolute; right:-.4rem; top:calc(100% + 6px); z-index:20; width:230px; background:#1f2933; color:#fff;
  font-size:.8rem; line-height:1.35; padding:.5rem .6rem; border-radius:6px; box-shadow:var(--shadow); }
.help-tip:hover .tip, .help-tip:focus .tip, .help-tip:focus-within .tip { display:block; }

.files-toolbar { display:flex; align-items:center; gap:.8rem; flex-wrap:wrap; margin-bottom:1.1rem; }
.doc-search { position:relative; flex:0 1 200px; display:flex; align-items:center; }
.doc-search .icon { position:absolute; left:.6rem; color:var(--muted); }
.doc-search input { width:100%; padding:.5rem .6rem .5rem 2rem; border-radius:4px; }
.upload-form { display:flex; align-items:center; gap:.6rem; margin:0; flex-wrap:wrap; }
.upload-btn { cursor:pointer; }
.upload-btn:focus-within { outline:2px solid var(--brand-soft); outline-offset:2px; }
.upload-hint { font-size:.8rem; }
.search-note { font-size:.88rem; margin:-.4rem 0 .8rem; }
.folder-group { margin-bottom:1.6rem; }
.folder-heading { display:flex; align-items:center; gap:.5rem; font-size:1.5rem; font-weight:400; color:var(--td-3e4c59); border-bottom:1px solid var(--line-strong);
  padding-bottom:.45rem; margin:0 0 1rem; }
.folder-heading .icon { width:26px; height:26px; color:#cbd2d9; fill:#e4e7eb; }
.doc-name { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; font-size:.84rem; line-height:1.3; color:var(--brand); text-decoration:none; overflow:hidden; overflow-wrap:anywhere; }
.doc-name:hover { text-decoration:underline; }
.doc-note { font-size:.74rem; color:var(--muted); margin-top:.2rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* Documents tab (docs-thumbs 2026-10-19): small thumbnails or a list, and a side preview panel. */
.files-pane[data-view="grid"] .doc-list-wrap, .files-pane[data-view="list"] .thumb-grid { display:none; }
.thumb-grid { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(112px, 1fr)); gap:.75rem; }
.doc-tile { display:flex; flex-direction:column; gap:.35rem; text-decoration:none; color:var(--ink); border-radius:6px; padding:.3rem; min-width:0; }
.doc-tile:hover, .doc-tile:focus-visible { background:var(--brand-soft); }
.doc-tile.is-active { background:var(--brand-soft); outline:2px solid var(--brand); }
.tile-thumb { position:relative; display:flex; align-items:center; justify-content:center; aspect-ratio:4/3; background:var(--tl-f0f2f5);
  border:1px solid var(--line); border-radius:4px; overflow:hidden; }
.tile-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.tile-thumb.is-icon img { width:44%; height:auto; object-fit:contain; }
.tile-ext { display:none; position:absolute; bottom:.25rem; right:.3rem; font-size:.62rem; font-weight:700; letter-spacing:.05em; color:#616e7c; }
.tile-thumb.is-icon .tile-ext { display:block; }
.tile-name { font-size:.76rem; line-height:1.25; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
.doc-tile .entry-label { display:block; min-width:0; max-width:100%; overflow-wrap:anywhere; }
.doc-tile .entry-num { white-space:nowrap; }
.thumb-grid > li:has(> .doc-tile) { min-width:0; }
.doc-list { width:100%; border-collapse:collapse; font-size:.88rem; }
.doc-list th { font-size:.74rem; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); font-weight:700; white-space:nowrap; }
.doc-list td { vertical-align:middle; }
.doc-list td:not(:first-child) { white-space:nowrap; color:var(--muted); }
.doc-tile.as-row { flex-direction:row; align-items:center; gap:.6rem; padding:.15rem .3rem; }
.doc-tile.as-row .tile-thumb { flex:none; width:40px; aspect-ratio:4/3; }
.doc-tile.as-row .tile-ext { display:none !important; }
.doc-tile.as-row .tile-name { font-size:.88rem; -webkit-line-clamp:1; color:var(--brand); }
.files-toolbar .view-toggle { margin-left:auto; order:3; }
.doc-panel-host:empty { display:none; }
.dp-sheet { position:fixed; top:var(--topbar-h); right:0; bottom:0; width:min(440px, 100vw); z-index:920; background:var(--panel);
  border-left:1px solid var(--line); box-shadow:-8px 0 24px rgba(31,41,51,.12); display:flex; flex-direction:column; overflow-y:auto; }
.dp-sheet:focus { outline:none; }
.dp-head { display:flex; align-items:flex-start; gap:.6rem; padding:.8rem 1rem; border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--panel); z-index:1; }
.dp-head h2 { flex:1; margin:0; font-size:1rem; line-height:1.35; overflow-wrap:anywhere; }
.dp-preview { background:var(--tl-eef1f5); display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:220px; padding:.6rem; }
.dp-preview > img { max-width:100%; max-height:42vh; object-fit:contain; background:var(--tl-ffffff); box-shadow:var(--shadow); }
.dp-frame { width:100%; height:42vh; border:1px solid var(--line); background:var(--tl-ffffff); }
.dp-pdf-page { display:none; }
.dp-pdf-page img { max-width:100%; max-height:50vh; background:var(--tl-ffffff); box-shadow:var(--shadow); display:block; margin:0 auto .4rem; }
.dp-none { text-align:center; padding:1.5rem; }
.dp-details { margin:0; padding:.8rem 1rem; display:grid; gap:.55rem; font-size:.88rem; }
.dp-details > div { display:grid; grid-template-columns:96px 1fr; gap:.6rem; }
.dp-details dt { color:var(--muted); font-size:.78rem; text-transform:uppercase; letter-spacing:.03em; padding-top:.1rem; }
.dp-details dd { margin:0; overflow-wrap:anywhere; }
.dp-link + .dp-link { margin-top:.25rem; }
.dp-actions { display:flex; flex-wrap:wrap; gap:.5rem; padding:.2rem 1rem 1.2rem; align-items:flex-start; }
.dp-actions .button, .dp-actions summary.button { display:inline-flex; align-items:center; gap:.35rem; }
.dp-act > summary { list-style:none; cursor:pointer; }
.dp-act > summary::-webkit-details-marker { display:none; }
.dp-act[open] { flex-basis:100%; order:5; background:var(--tl-fbfcfd); border:1px solid var(--line); border-radius:6px; padding:.6rem; }
.dp-act .mini-form { display:grid; gap:.4rem; margin-top:.6rem; }
.dp-delete { margin:0 0 0 auto; }
@media (min-width: 1101px) {
  .docs-layout:has(.dp-sheet) .files-pane { margin-right:440px; }
}
@media (max-width: 700px) {
  .thumb-grid { grid-template-columns:repeat(auto-fill, minmax(96px, 1fr)); gap:.5rem; }
  .dp-sheet { top:0; width:100vw; z-index:960; border-left:0; box-shadow:none; }
  .dp-head { padding:.7rem .8rem; }
  .dp-close { width:40px; height:40px; }
  .dp-pdf { display:none; }
  .dp-pdf-page { display:block; text-align:center; }
  .dp-frame.dp-html { height:60vh; }
  .dp-actions .button, .dp-actions summary.button { min-height:42px; }
  .doc-list th:nth-child(3), .doc-list td:nth-child(3) { display:none; }
  body:has(.dp-sheet) { overflow:hidden; }
}
.empty.small { padding:.8rem 0; text-align:left; font-size:.9rem; }

.notes-wrap { max-width:860px; margin-top:1.2rem; }
.note-form textarea { width:100%; min-height:5rem; resize:vertical; }
.note-form-actions { display:flex; justify-content:space-between; align-items:center; gap:.8rem; margin-top:.5rem; }
.note { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:.8rem 1rem; margin-bottom:.8rem; }
.note.pinned { background:var(--tl-fffbea); border-color:var(--tl-f3e3a6); }
.note-head { display:flex; align-items:center; gap:.45rem; flex-wrap:wrap; font-size:.9rem; }
.note-actions { margin-left:auto; display:inline-flex; gap:.3rem; }
.note-actions form { margin:0; }
.note-body { margin-top:.45rem; white-space:normal; overflow-wrap:anywhere; }
.avatar.sm { width:26px; height:26px; font-size:.75rem; }
.muted.small, .small { font-size:.8rem; }
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; }
}

/* Rental Income (rentals/*.html, rehab/_mark_complete.html) */
.chip.bad { background:var(--tl-fde7e5); color:var(--bad); font-weight:600; }
.stats.stats-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.stat .value .value-sub { font-size:1rem; font-weight:600; }
.inline-form { display:flex; gap:.5rem; align-items:center; flex-wrap:wrap; }
.inline-form label { font-weight:600; font-size:.88rem; }
.panel-foot { padding:.6rem 1.1rem; margin:0; }
.plain-list { list-style:none; padding:0; margin:.3rem 0 .6rem; }
.plain-list li { padding:.2rem 0; border-bottom:1px solid var(--line); }
table.kv td:first-child { color:var(--muted); width:40%; }
.mark-complete { display:flex; gap:.5rem; align-items:center; flex-wrap:wrap; margin-top:.7rem; padding:.6rem .7rem; border:1px dashed var(--line); border-radius:8px; }
.mark-complete label { font-weight:600; font-size:.88rem; }
.mark-complete-done { margin-top:.6rem; }
@media (max-width: 1100px) { .stats.stats-5 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 700px) { .stats.stats-5 { grid-template-columns: 1fr 1fr; } }

/* Maintenance log (rental ops phase 1) */
.wo-files { display:flex; flex-wrap:wrap; gap:.6rem; margin-bottom:.8rem; }
.wo-file { display:flex; flex-direction:column; align-items:center; gap:.2rem; width:128px; font-size:.78rem; text-decoration:none; }
.wo-file img { width:120px; height:90px; object-fit:cover; border-radius:6px; border:1px solid var(--line); }
.wo-notes { white-space:pre-wrap; font-family:inherit; font-size:.9rem; background:var(--tl-fbfcfd); border:1px solid var(--line); border-radius:6px; padding:.6rem .8rem; margin:0; }
.wo-detail textarea { width:100%; max-width:100%; box-sizing:border-box; }
.wo-detail .formrow > div { flex: 1 1 140px; min-width:0; }
.nowrap { white-space:nowrap; }

/* Stripe rent (rentpay) */
ol.checklist { padding-left:1.2rem; } ol.checklist li { margin:.4rem 0; }
code.copy-me { user-select:all; word-break:break-all; font-size:.9rem; }
.pay-page { max-width:560px; margin:1.5rem auto; }
.pay-page button { background:var(--brand-fill, var(--brand)); } .pay-page button:hover { background:var(--brand-fill-hover, var(--brand-dark)); } /* tenant pay pages load ds.css only in Night: without it the Continue button had no fill (white on white) */
.pay-page table.pay-lines { width:100%; } .pay-page table.pay-lines td, .pay-page table.pay-lines th { padding:.45rem .2rem; }
.pay-page .pay-total th { border-top:2px solid var(--line); font-size:1.05rem; }
.pay-page .choice { display:block; border:1px solid var(--line); border-radius:8px; padding:.6rem .75rem; margin:.5rem 0; }
.pay-page .choice input { margin-right:.4rem; }
.stripe-card td code, .stripe-card td { overflow-wrap:anywhere; word-break:break-word; }
.stripe-card th { width:38%; }
.pay-page .choice .small { font-weight:400; }
.sim-banner { background:var(--tl-fff1d6); border:1px dashed var(--warn); padding:.5rem .8rem; border-radius:8px; margin-bottom:.8rem; }

/* --- Eviction tracker (docs/EVICTIONS.md) -------------------------------------------------- */
.ev-board { display:grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap:.6rem; overflow-x:auto; padding-bottom:.4rem; }
.ev-col { background:var(--tl-eef2f7); border-radius:var(--radius); padding:.5rem; min-height:120px; }
.ev-col h3 { margin:.1rem .2rem .5rem; font-size:.82rem; color:var(--muted); display:flex; justify-content:space-between; }
.ev-card { display:block; background:var(--tl-ffffff); border:1px solid var(--line); border-radius:8px; padding:.5rem .6rem; margin-bottom:.45rem;
  box-shadow:var(--shadow); color:var(--ink); text-decoration:none; font-size:.84rem; }
.ev-card:hover { border-color:var(--brand); }
.ev-card.overdue { border-left:4px solid var(--bad); } .ev-card.soon { border-left:4px solid var(--warn); }
.ev-card .addr { font-weight:600; } .ev-card .meta { color:var(--muted); font-size:.76rem; }
.ev-card .due { margin-top:.25rem; font-size:.78rem; }
.ev-timeline { display:flex; flex-wrap:wrap; gap:0; margin:.2rem 0 .4rem; padding:0; list-style:none; }
.ev-timeline li { position:relative; flex:1 1 0; min-width:84px; text-align:center; font-size:.74rem; color:var(--muted); padding-top:22px; }
.ev-timeline li::before { content:""; position:absolute; top:7px; left:0; right:0; height:3px; background:var(--line-strong); }
.ev-timeline li:first-child::before { left:50%; } .ev-timeline li:last-child::before { right:50%; }
.ev-timeline li .dot { position:absolute; top:1px; left:calc(50% - 8px); width:16px; height:16px; border-radius:50%; background:var(--tl-ffffff);
  border:3px solid var(--line-strong); z-index:1; }
.ev-timeline li.done .dot { background:var(--ok); border-color:var(--ok); } .ev-timeline li.done::before { background:var(--ok); }
.ev-timeline li.current .dot { background:var(--tl-ffffff); border-color:var(--brand); box-shadow:0 0 0 4px var(--brand-soft); }
.ev-timeline li.current { color:var(--ink); font-weight:600; }
.ev-timeline li.skipped { opacity:.45; }
.ev-timeline li .d { display:block; font-weight:400; color:var(--muted); }
.ev-actions { display:grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap:.7rem; }
.ev-action { border:1px solid var(--line); border-radius:8px; padding:.6rem .75rem; background:var(--tl-fbfcfe); }
.ev-action.approval { border-color:var(--tl-cfdcee); background:var(--tl-f4f8fd); }
.ev-action h3 { margin:0 0 .4rem; font-size:.9rem; display:flex; gap:.4rem; align-items:center; flex-wrap:wrap; }
.ev-action .fields { display:grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap:.4rem .6rem; }
.ev-action label { font-size:.76rem; color:var(--muted); display:block; }
.ev-action input:not([type=checkbox]), .ev-action select { width:100%; }
.ev-action .check { display:flex; gap:.35rem; align-items:center; font-size:.8rem; }
.ev-action.locked { opacity:.75; }
.ev-pending { display:inline-block; font-size:.72rem; font-weight:600; color:var(--td-8a5300); background:var(--tl-fff1d6); border:1px solid var(--tl-f3dca9);
  border-radius:999px; padding:0 .45rem; white-space:nowrap; }
.ev-confirmed { display:inline-block; font-size:.72rem; font-weight:600; color:var(--ok); background:var(--tl-e3f4e8); border-radius:999px; padding:0 .45rem; }
.ev-cite { font-size:.76rem; color:var(--muted); }
.ev-banner { border-radius:8px; padding:.55rem .8rem; margin:.4rem 0; font-size:.88rem; }
.ev-banner.bad { background:var(--tl-fde7e5); border:1px solid var(--tl-f6c9c4); } .ev-banner.warn { background:var(--tl-fff1d6); border:1px solid var(--tl-f3dca9); }
.ev-banner.info { background:var(--tl-e6eef8); border:1px solid var(--tl-cfdcee); }
.ev-unitcard { border:1px solid var(--tl-f6c9c4); background:var(--tl-fffafa); border-radius:8px; padding:.6rem .8rem; margin-top:.6rem; }
.ev-unitcard h3 { margin:0 0 .3rem; display:flex; gap:.5rem; align-items:center; flex-wrap:wrap; }
.ev-settings td, .ev-settings th { vertical-align:top; }
.ev-settings input[type=number] { width:5.5rem; }
.ev-next14 td { font-size:.86rem; }

/* Books reports (docs/BOOKS.md): CPA draft banner, tie-out checks, filter bar on the report page */
.report-hub h2 { margin-top:1.4rem; }
.report-hub ul.links { columns:2; margin:.3rem 0 0; padding-left:1.1rem; }

/* --- Main dashboard (home page, docs/DASHBOARD.md) ------------------------------------------ */
.dash-banner { display:flex; gap:.45rem; align-items:flex-start; border-radius:8px; margin:0 0 .8rem; }
.dash-banner .icon { flex:none; margin-top:.1rem; color:var(--warn); }
.dash-filters { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; margin:0 0 1rem; }
.dash-custom { display:inline-flex; }
.dash-custom summary { cursor:pointer; color:var(--brand); font-size:.9rem; padding:.3rem 0; }
.dash-custom[open] { display:flex; flex-wrap:wrap; gap:.4rem; align-items:center; flex-basis:100%; }
.dash-custom[open] summary { flex-basis:100%; }
.dash-stats .stat .hint { line-height:1.35; }
.stat.stat-warn { border-color:var(--tl-f3dca9); } .stat.stat-warn .value { color:var(--warn); }
.dash-up { color:var(--bad); font-weight:600; } .dash-down { color:var(--ok); font-weight:600; }
.dash-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:0 1.2rem; }
.dash-grid .panel { min-width:0; }
.dash-note { font-size:.8rem; }
.hrow { display:grid; grid-template-columns: minmax(0,1fr) auto; gap:.1rem .75rem; padding:.35rem 0; color:var(--ink); text-decoration:none; border-bottom:1px solid var(--line); }
.hrow:last-of-type { border-bottom:0; }
a.hrow:hover .hrow-label { color:var(--brand); text-decoration:underline; }
.hrow-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.9rem; }
.hrow-amt { font-variant-numeric:tabular-nums; font-weight:600; font-size:.9rem; text-align:right; white-space:nowrap; }
.hbar { grid-column: 1 / -1; height:6px; background:var(--bg); border-radius:999px; overflow:hidden; }
.hbar > span { display:block; height:100%; background:var(--brand-fill); border-radius:999px; }
.hbar.cat > span { background:var(--accent); } .hbar.vend > span { background:#4f7cac; }
.mbars { display:grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap:.35rem; align-items:end; height:170px; }
.mbar { display:flex; flex-direction:column; align-items:stretch; height:100%; text-decoration:none; color:var(--muted); }
.mbar-col { flex:1; display:flex; align-items:flex-end; background:var(--bg); border-radius:4px; overflow:hidden; }
.mbar-col > span { display:block; width:100%; background:#8fb0d6; border-radius:4px 4px 0 0; }
.mbar.current .mbar-col > span { background:var(--brand-fill); }
.mbar:hover .mbar-col > span { background:var(--brand-fill-hover); }
.mbar-lbl { font-size:.72rem; text-align:center; margin-top:.25rem; }
.dash-split { display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:.8rem 1.2rem; }
.dash-split > div { display:flex; flex-direction:column; gap:.15rem; font-size:.82rem; min-width:0; }
.hbar.split-rental > span { background:var(--ok); } .hbar.split-property > span { background:#8fb0d6; } .hbar.split-overhead > span { background:var(--muted); }
.dash-grid .span2 { grid-column: 1 / -1; }
.dash-table .show-sm { display:none; }
.dash-split strong { font-size:.98rem; font-variant-numeric:tabular-nums; }
.dash-table td, .dash-table th { font-size:.88rem; }
.dash-table a { color:var(--brand); }
.dash-sub { font-size:.78rem; }
.dash-chips { display:flex; gap:.4rem; flex-wrap:wrap; } .dash-chips a { text-decoration:none; }
@media (max-width: 1100px) { .dash-stats.stats-5 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .dash-stats.stats-5 { grid-template-columns: 1fr 1fr; }
  .dash-stats .stat .value { font-size:1.25rem; }
  .dash-split { grid-template-columns: 1fr 1fr; }
  .dash-table .hide-sm { display:none; }
  .dash-table .show-sm { display:block; margin-top:.15rem; }
  .dash-stats.stats-5 .stat:first-child { grid-column: 1 / -1; }
  .mbars { height:130px; gap:.2rem; }
  .mbar-lbl { font-size:.62rem; }
  .dash-filters select { flex:1 1 40%; }
}
.bookkeeping .inline-form { display:flex; gap:.5rem; align-items:center; flex-wrap:wrap; margin-bottom:1rem; }
.bookkeeping .card.featured { margin-bottom:1rem; }

/* Landlord Forms (docs/FORMS.md) */
.forms-notice { background:var(--tl-fff8e6); border:1px solid var(--tl-f3dca9); border-left:4px solid var(--warn); border-radius:8px; padding:.75rem 1rem; margin-bottom:1.1rem; }
.forms-notice p { margin:.2rem 0; }
.forms-cards { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:1rem; margin-bottom:1.4rem; }
.forms-card { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:.85rem 1rem; display:flex; flex-direction:column; gap:.35rem; }
.forms-card h3 { margin:0; font-size:1.05rem; } .forms-card h3 a { color:var(--brand); text-decoration:none; } .forms-card h3 a:hover { text-decoration:underline; }
.forms-card .chips { display:flex; flex-wrap:wrap; gap:.3rem; }
.forms-group { margin-bottom:1.2rem; }
.forms-table td.dl { white-space:nowrap; text-align:right; }
.forms-table .use-when { color:var(--muted); font-size:.85rem; }
.forms-table tr.attorney td { background:var(--tl-f2f7ee); }
.forms-ack { display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; margin-top:.5rem; }
.forms-ack label { display:inline-flex; align-items:center; gap:.4rem; font-weight:600; }
.forms-packs { display:flex; gap:.6rem; flex-wrap:wrap; align-items:center; }

/* ---- Help Center + ARVDesk Support (2026-10-16) ---------------------------------------- */
.nav-group > summary { display:flex; align-items:center; gap:8px; cursor:pointer; list-style:none; padding:6px 8px; border-radius:6px; font-weight:600; color:var(--ink); }
.nav-group > summary::-webkit-details-marker { display:none; }
.nav-group > summary .chev { margin-left:auto; transition:transform .15s; }
.nav-group[open] > summary .chev { transform:rotate(180deg); }
.nav-group > a { padding-left:22px; }
.help-center { max-width:860px; }
.hc-search { display:flex; align-items:center; gap:10px; padding:10px 14px; }
.hc-search input { flex:1; border:0; outline:0; font-size:1rem; background:transparent; }
.hc-search .icon { color:var(--muted); }
.hc-count { margin:4px 0 10px; }
.hc-list { display:grid; gap:10px; }
.hc-item { display:flex; align-items:center; gap:14px; text-decoration:none; color:var(--ink); padding:14px 16px; }
.hc-item:hover { border-color:var(--brand); }
.hc-item > span:nth-child(2) { flex:1; display:flex; flex-direction:column; gap:2px; }
.hc-ico { display:inline-flex; width:36px; height:36px; align-items:center; justify-content:center; border-radius:8px; background:var(--brand-soft); color:var(--brand); }
.hc-article h2 { font-size:1.1rem; margin-top:1.2em; }
.hc-article h2:first-child { margin-top:0; }
.hc-more { margin-top:14px; display:flex; flex-direction:column; gap:6px; }
.hc-more a { display:flex; gap:6px; align-items:center; }
.crumbs { font-size:.9rem; color:var(--muted); margin:0 0 6px; }

.support-launch { position:fixed; right:20px; bottom:20px; z-index:900; display:inline-flex; align-items:center; gap:8px;
  padding:9px 16px 9px 12px; border-radius:12px; border:1px solid var(--brand-dark); background:var(--tl-ffffff); color:var(--brand);
  font-weight:700; letter-spacing:.01em; box-shadow:0 6px 18px rgba(16,24,40,.18); cursor:pointer; }
.support-launch:hover { background:var(--brand-soft); }
.support-launch span:not(.support-dot) { border-left:3px solid var(--accent); padding-left:8px; }
.support-dot { position:absolute; top:-5px; right:-5px; width:13px; height:13px; border-radius:50%; background:var(--accent); border:2px solid var(--tl-ffffff); }
.support-dot[hidden] { display:none; }
.support-drawer { position:fixed; top:0; right:0; bottom:0; width:min(400px, 100vw); z-index:950; background:var(--bg);
  border-left:4px solid var(--brand); box-shadow:-8px 0 24px rgba(16,24,40,.16); display:flex; flex-direction:column; }
.support-drawer[hidden] { display:none; }
/* Optional top offset (N2): a staging-only banner sets --arv-staging-banner-h on <html> while it is shown. Unset = 0px. */
.support-drawer { top:var(--arv-staging-banner-h, 0px); padding-top:env(safe-area-inset-top, 0px); }
body.support-open .support-launch { right:420px; }
@media (max-width:700px) { body.support-open .support-launch { display:none; } }
/* Phones (copy-fixes C11, 2026-10-19): the Support button sits at the end of the page, above the footer, instead of
   floating, so it never covers a form's Save / Cancel buttons. Same button, same drawer, same unread dot. */
@media (max-width:700px) {
  .support-launch { position:relative; right:auto; bottom:auto; z-index:auto; display:flex; width:max-content;
    margin:8px 16px 16px auto; box-shadow:none; }
}
/* Spent by category (2026-10-25): at 1280 the fixed button covers that box's right-hand Total.
   On every page that has the box, the button sits at the end of the page instead of floating.
   Phones already do this (the rule above); this is the wider layout, including 1280. */
@media (min-width:701px) {
  body:has(.spent-by-category) .support-launch { position:relative; right:auto; bottom:auto; z-index:auto;
    display:flex; width:max-content; margin:8px 16px 16px auto; box-shadow:none; }
}
.sd-head { display:flex; gap:12px; align-items:flex-start; padding:16px; background:var(--tl-ffffff); border-bottom:1px solid var(--line); }
.sd-head h2 { margin:0; font-size:1.15rem; color:var(--brand-dark); }
.sd-head p { margin:2px 0 0; color:var(--muted); font-size:.9rem; }
.sd-close { margin-left:auto; }
.sd-body { overflow:auto; padding:12px 14px 24px; display:flex; flex-direction:column; gap:12px; }
.sd-sec { background:var(--tl-ffffff); border:1px solid var(--line); border-radius:var(--radius); padding:12px 14px; }
.sd-sec h3 { display:flex; align-items:center; gap:6px; margin:0 0 8px; font-size:.95rem; text-transform:uppercase; letter-spacing:.04em; color:var(--brand); }
.sd-form { display:flex; flex-direction:column; gap:6px; }
.sd-form label { font-weight:600; font-size:.9rem; }
.sd-form input, .sd-form textarea { width:100%; box-sizing:border-box; }
.sd-form button { align-self:flex-start; display:inline-flex; gap:6px; align-items:center; }
.sd-hint { font-size:.82rem; margin:0; }
.sd-error { color:var(--bad); margin:0; }
.sd-thread, .sd-guide { display:flex; flex-direction:column; padding:8px 0; border-top:1px solid var(--line); text-decoration:none; color:var(--ink); }
.sd-thread:first-of-type, .sd-guide:first-of-type { border-top:0; }
.sd-thread.is-unread .sd-t-subj { font-weight:700; }
.sd-t-subj { display:flex; align-items:center; gap:6px; }
.sd-t-meta, .sd-guide .muted { font-size:.82rem; color:var(--muted); }
.sd-dot { width:9px; height:9px; border-radius:50%; background:var(--accent); display:inline-block; }
.sd-all { display:block; margin-top:6px; font-weight:600; }
.sd-back { align-self:flex-start; }
.sd-msgs { display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
.sd-msg { padding:8px 10px; border-radius:8px; background:var(--tl-ffffff); border:1px solid var(--line); }
.sd-msg.staff { border-left:4px solid var(--brand); }
.sd-msg.me { border-left:4px solid var(--accent); }
.sd-msg-who { font-size:.8rem; color:var(--muted); margin-bottom:3px; }

/* --- Section workspaces (2026-10-17, core/nav.py + includes/section_nav.html) ----------------------------------------
   Top bar: one pill per section (active = filled navy). Section pages: left menu with the section's add buttons on top.
   Phones: the pills take their own row under the logo, and the side menu becomes one strip: a compact add control,
   then the page tabs, so the tabs show without a swipe. */
.icon-btn.show-sm { display:none; }
.sec-pills { display:flex; gap:.35rem; flex:none; }
.sec-pill { display:inline-flex; align-items:center; gap:.35rem; padding:.36rem .8rem .36rem .65rem; border-radius:999px; border:1.5px solid var(--brand);
  color:var(--brand); background:var(--tl-ffffff); text-decoration:none; font-weight:600; font-size:.88rem; white-space:nowrap; }
.sec-pill:hover { background:var(--brand-soft); }
.sec-pill[aria-current="page"] { background:var(--brand-fill); color:#fff; }
.sec-pill:focus-visible, .sec-item:focus-visible, .sec-addbtn:focus-visible { outline:3px solid #9cc0ea; outline-offset:2px; }
.sec-pill .lbl-short { display:none; }

.sec-shell { display:grid; grid-template-columns:236px minmax(0, 1fr); align-items:start; min-height:calc(100vh - var(--topbar-h)); }
.sec-side { position:sticky; top:var(--topbar-h); max-height:calc(100vh - var(--topbar-h)); overflow-y:auto; background:var(--tl-ffffff);
  border-right:1px solid var(--line); padding:.9rem .7rem 1.4rem; align-self:stretch; }
.sec-shell > main { width:100%; }
.sec-title { margin:.1rem .45rem .6rem; font-size:.72rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--ink); }
.sec-addmenu { margin:0 0 .9rem; }
.sec-addbtn { display:flex; align-items:center; gap:.4rem; padding:.48rem .8rem; border-radius:8px; background:var(--brand-fill); color:#fff;
  font-weight:600; font-size:.92rem; cursor:pointer; list-style:none; white-space:nowrap; }
.sec-addbtn::-webkit-details-marker { display:none; }
.sec-addbtn:hover, details[open] > .sec-addbtn { background:var(--brand-fill-hover); }
.sec-addbtn .chev { margin-left:auto; }
.sec-addmenu .dd-panel { left:0; right:0; min-width:0; top:calc(100% + 4px); z-index:40; }
.sec-addmenu .dd-panel a { font-weight:600; color:var(--brand); }
.sec-addmenu .dd-panel a .icon { color:var(--brand); }
.sec-menu { display:flex; flex-direction:column; gap:1px; }
.sec-group { margin:.85rem .55rem .25rem; font-size:.68rem; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:var(--muted); }
.sec-item { display:flex; align-items:center; gap:.6rem; padding:.42rem .6rem; border-radius:8px; color:var(--ink); text-decoration:none; font-size:.92rem;
  border-left:3px solid transparent; }
.sec-item .icon { width:18px; height:18px; color:var(--muted); }
.sec-item:hover { background:var(--bg); }
.sec-item[aria-current="page"] { background:var(--brand-soft); color:var(--brand); font-weight:600; border-left-color:var(--brand); }
.sec-item[aria-current="page"] .icon { color:var(--brand); }
.sec-item.soon { color:#98a2b3; cursor:default; }
.sec-item.soon .icon { color:#c0c7d2; }
.sec-item small { margin-left:auto; font-size:.66rem; color:#98a2b3; white-space:nowrap; }

@media (max-width: 1240px) {
  .sec-pill .icon { display:none; }
  .sec-pill { padding:.34rem .7rem; }
}
@media (max-width: 1020px) {
  .sec-pill .lbl { display:none; } .sec-pill .lbl-short { display:inline; }
  .sec-shell { grid-template-columns:200px minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .sec-shell { display:block; min-height:0; }
  .sec-side { position:static; max-height:none; overflow:visible; display:flex; align-items:center; gap:.5rem; padding:.5rem .75rem;
    border-right:0; border-bottom:1px solid var(--line); }
  .sec-title, .sec-group, .sec-item .icon, .sec-item small, .sec-addbtn .chev { display:none; }
  .sec-addmenu { margin:0; flex:none; }
  .sec-addbtn { padding:.32rem .7rem; border-radius:999px; font-size:.86rem; gap:.25rem; }
  .sec-addmenu .dd-panel { right:auto; min-width:210px; }
  .sec-menu { flex-direction:row; gap:.3rem; overflow-x:auto; scrollbar-width:none; flex:1 1 auto; min-width:0; }
  .sec-menu::-webkit-scrollbar { display:none; }
  .sec-item { flex:none; padding:.32rem .7rem; border:1px solid var(--line-strong); border-radius:999px; font-size:.86rem; white-space:nowrap; }
  .sec-item[aria-current="page"] { border-color:var(--brand); background:var(--brand-soft); }
  .sec-item.soon { border-style:dashed; order:99; }
  .sec-side { position:relative; top:auto; }
  /* More tabs to the right: fade the edge and show an arrow (app.js sets .is-overflow / .at-end). */
  .sec-side.is-overflow:not(.at-end) .sec-more { display:flex; }
  .sec-more { position:absolute; top:1px; bottom:1px; right:0; width:56px; align-items:center; justify-content:flex-end;
    padding-right:.45rem; background:linear-gradient(to right, rgba(255,255,255,0), var(--tl-ffffff) 70%); color:var(--brand); cursor:pointer; }
  .sec-more .icon { width:18px; height:18px; }
  .sec-item.soon span::after { content:" · soon"; font-size:.75rem; }
}
@media (max-width: 640px) {
  .sec-pills { order:5; flex:1 1 100%; gap:.3rem; }
  .sec-pill { flex:1 1 0; justify-content:center; padding:.32rem .3rem; font-size:.84rem; min-width:0; }
}

/* New lease opens as its own panel. The page template supplies the overlay, so base.html
   stays untouched. The top bar is sticky at z-index 50; this layer sits above it. */
html:has(.lease-overlay) { overflow:hidden; }
.lease-overlay { position:fixed; inset:0; z-index:1100; display:flex; align-items:center; justify-content:center;
  padding:1.25rem; background:rgba(31, 41, 51, .55); }
/* Optional top offset (N1): see .support-drawer. The sheet starts below a staging banner and the notch. */
.lease-overlay { top:var(--arv-staging-banner-h, 0px); }
.lease-close { display:none; }
.lease-sheet { width:min(640px, 100%); max-height:100%; display:flex; }
.lease-card { width:100%; margin:0; padding:0; display:flex; flex-direction:column;
  max-height:min(760px, calc(100dvh - 2.5rem)); overflow:hidden; }
.lease-card-head { flex:none; padding:1.15rem 1.25rem 0; }
.lease-card-body { flex:1 1 auto; overflow:auto; padding:.85rem 1.25rem 1rem;
  scroll-padding-top:.75rem; scroll-padding-bottom:1rem; }
.lease-card h1 { margin:0 0 .25rem; }
.lease-lead { margin:0 0 .85rem; color:var(--muted); }
.lease-sheet .form-grid.aligned { grid-template-columns:1fr; gap:.85rem; }
.lease-sheet .field-label { min-height:0; margin-bottom:.3rem; }
.lease-sheet .field,
.lease-sheet input:not([type=checkbox]):not([type=hidden]),
.lease-sheet select,
.lease-sheet textarea { scroll-margin-top:calc(var(--topbar-h) + .75rem); scroll-margin-bottom:4.5rem; }
.lease-sheet input:not([type=checkbox]):not([type=hidden]),
.lease-sheet select { min-height:44px; padding:.5rem .75rem; width:100%; }
.lease-sheet .req { color:var(--bad); text-decoration:none; font-weight:700; }
.lease-sheet details.more-options { margin-top:.35rem; border-top:1px solid var(--line); }
.lease-sheet details.more-options > summary { cursor:pointer; list-style:none; display:flex; align-items:center; gap:.35rem;
  font-weight:600; color:var(--brand); padding:.85rem 0 .7rem; }
.lease-sheet details.more-options > summary::-webkit-details-marker { display:none; }
.lease-sheet details.more-options .more-chev { transition:transform .15s ease; }
.lease-sheet details.more-options[open] .more-chev { transform:rotate(180deg); }
.lease-note { margin:.15rem 0 .85rem; font-size:.9rem; }
.lease-card-foot { flex:none; display:flex; justify-content:flex-end; gap:.6rem; padding:.75rem 1.25rem;
  border-top:1px solid var(--line); background:var(--panel); }
.lease-card-foot .button, .lease-card-foot button { min-height:44px; padding:.55rem 1.05rem; }
@media (max-width: 640px) {
  .lease-overlay { padding:0; padding-top:env(safe-area-inset-top, 0px); align-items:stretch; }
  .lease-close { display:inline-flex; align-items:center; min-height:44px; margin:0 0 .25rem -.25rem; padding:0 .5rem;
    font-weight:700; color:var(--brand); text-decoration:none; }
  .lease-sheet { width:100%; max-width:none; height:100%; }
  .lease-card { max-height:none; height:100%; border-radius:0; border-left:0; border-right:0; }
  .lease-card-head { padding:1rem .9rem 0; }
  .lease-card-body { padding:.75rem .9rem .85rem; }
  .lease-card-foot { padding:.7rem .9rem; }
}

/* These pages fill the content column. No left offset, so a later sidebar can sit beside them. */
main.rent-block { max-width:none; width:100%; margin:0; }
.sec-more { display:none; }  /* phone strip overflow hint; shown in the <=700px block */
/* Transactions register (one register, 2026-10-17): type tags */
.tag.t-in { background:var(--tl-e7f6ec); color:var(--td-17643a); }
.tag.t-transfer { background:var(--tl-eef2ff); color:var(--td-3446a8); }
.view-toggle.txn-types { flex-wrap:wrap; }

/* Receipts on projects + receipt icon on transaction / expense lines (2026-10-17).
   Projects > Receipts list (2026-10-24): one line per file (thumb beside the facts). Under 900px the
   thumb stacks above the facts. Colors are theme tokens so the arv_theme cookie (night / regular) applies. */
.rcpt-icon { display:inline-flex; align-items:center; margin-left:.35rem; color:var(--accent, var(--brand)); vertical-align:middle; }
.rcpt-icon .icon { width:16px; height:16px; }
.rcpt-icon:hover, .rcpt-icon:focus-visible { color:var(--ink); }
td.txn-id { white-space:nowrap; }
.prj-receipt-chips { display:flex; flex-wrap:wrap; gap:.4rem; margin:0 0 .8rem; }
.prj-receipt-chips a { display:inline-flex; align-items:center; text-decoration:none; border:1px solid var(--line-strong); border-radius:999px; padding:.28rem .75rem; color:var(--muted); background:var(--panel); font-size:.85rem; font-weight:600; }
.prj-receipt-chips a:hover { border-color:var(--brand); color:var(--ink); }
.prj-receipt-chips a.on { background:var(--brand-fill); border-color:var(--brand-fill); color:var(--ds-side-active-text); }
.prj-receipt-filters { display:flex; flex-wrap:wrap; gap:.6rem 1rem; align-items:flex-end; margin:0 0 .8rem; padding:.7rem .8rem; border:1px solid var(--line); border-radius:8px; background:var(--panel); }
.prj-receipt-filters .ff-filter-field { display:flex; flex-direction:column; gap:.2rem; min-width:10rem; }
.prj-receipt-filters .ff-filter-field label { font-size:.8rem; font-weight:600; }
.prj-receipt-filters .ff-filter-actions { display:flex; gap:.6rem; align-items:center; }
/* Projects > Checks paid: read-only register grouped by vendor. Tokens only, so Night (arv_theme) and Regular both apply. */
.checks-head .crumbs { margin:0; }
.checks-head h1 { margin:0; }
.checks-head .muted { margin:.2rem 0 0; }
.checks-filters { align-items:flex-end; }
.checks-filters .ff-filter-field { display:flex; flex-direction:column; gap:.25rem; min-width:8rem; flex:1 1 9rem; }
.checks-filters .ff-filter-field label { font-size:.78rem; font-weight:600; }
.checks-filters .ff-filter-field select,
.checks-filters .ff-filter-field input[type=date],
.checks-filters .ff-filter-field input[type=search] { width:100%; box-sizing:border-box; }
.checks-filters .ff-filter-field input[type=search] { flex:0 0 auto; }
.checks-filters .ck-property { flex:1.6 1 14rem; min-width:12rem; }
.checks-filters .ck-vendor { flex:1.6 1 14rem; min-width:12rem; }
.checks-filters .ck-search { flex:1 1 9rem; max-width:12rem; }
.checks-filters .ck-dir { flex:0 1 8rem; min-width:7rem; }
.checks-filters .ff-filter-actions { display:flex; align-items:center; gap:.6rem; }
.checks-filters .ck-q-help { flex:1 0 100%; margin:0; }
.checks-filters .ck-q-help.is-bad { color:var(--bad); font-weight:600; }
.ck-summary { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem 1rem; margin:.75rem 0 .6rem; }
.ck-total { margin:0; font-size:1.05rem; }
.ck-total strong { font-variant-numeric:tabular-nums; }
.ck-nophoto-chip { text-decoration:none; color:var(--muted); border:1px solid var(--line); }
.ck-nophoto-chip .icon { width:14px; height:14px; }
.ck-nophoto-chip:hover, .ck-nophoto-chip.is-on { background:var(--tl-fff1d6); color:var(--td-7a4b00); }
.ck-bulk { margin-left:auto; font-size:.85rem; color:var(--muted); }
.ck-bulk .linklike { background:none; border:0; padding:0; color:var(--brand); cursor:pointer; font:inherit; text-decoration:underline; }
.ck-issues { margin:0 0 .8rem; border:1px solid var(--line); border-radius:var(--radius, 8px); background:var(--panel, var(--tl-ffffff)); }
.ck-issues > summary { display:flex; flex-wrap:wrap; align-items:baseline; gap:.2rem .8rem; padding:.45rem .8rem; cursor:pointer; font-size:.9rem; }
.ck-issues-title { font-weight:600; }
.ck-issues-counts { font-size:.82rem; }
.ck-issues-body { padding:.1rem .8rem .7rem; border-top:1px solid var(--line); font-size:.88rem; }
.ck-issue-bank h3 { margin:.6rem 0 .15rem; font-size:.9rem; }
.ck-issue-bank h3 .muted { font-weight:400; font-size:.82rem; margin-left:.4rem; }
.ck-issue-bank ul { margin:0; padding:0; list-style:none; }
.ck-issue-bank li { margin:.15rem 0; overflow-wrap:anywhere; }
.ck-k { display:inline-block; min-width:4.6rem; font-weight:600; color:var(--muted); }
.checks-paid td { vertical-align:middle; }
.checks-paid th a { color:inherit; text-decoration:none; white-space:nowrap; }
.checks-paid th a:hover { text-decoration:underline; }
.checks-paid th.ck-h-photo { text-align:center; }
.checks-paid td.num,
.checks-paid td.ck-num,
.checks-paid td.ck-date { white-space:nowrap; }
.checks-paid td.ck-num a { font-weight:600; font-variant-numeric:tabular-nums; }
.checks-paid td.ck-photo { text-align:center; }
.checks-paid .ck-photolink { display:inline-flex; align-items:center; justify-content:center; min-width:32px; min-height:32px; color:var(--brand); border-radius:6px; }
.checks-paid .ck-photolink:hover { background:var(--brand-soft); }
.checks-paid .ck-memo { max-width:16rem; overflow-wrap:anywhere; color:var(--muted); }
.checks-paid tr.ck-ghead > td { background:var(--ds-slate-50, var(--tl-f6f7f9)); font-weight:650; border-top:1px solid var(--line); }
.checks-paid .ck-gtoggle { display:inline-flex; align-items:center; gap:.45rem; max-width:100%; background:none; border:0; padding:.1rem 0; margin:0; color:inherit; font:inherit; cursor:pointer; text-align:left; }
.checks-paid .ck-gtoggle:focus-visible { outline:2px solid var(--brand); outline-offset:2px; border-radius:4px; }
.checks-paid .ck-chev { flex:none; transition:transform .15s; }
.checks-paid .ck-gcount { color:var(--muted); font-weight:400; font-size:.85rem; white-space:nowrap; }
.checks-paid tbody.is-collapsed .ck-chev { transform:rotate(-90deg); }
.checks-paid tbody.is-collapsed tr.ck-row { display:none; }
.ck-pager { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem 1rem; margin-top:.6rem; }
@media (max-width: 900px) {
  .checks-filters .ff-filter-field,
  .checks-filters .ck-property,
  .checks-filters .ck-vendor,
  .checks-filters .ck-search,
  .checks-filters .ck-dir { flex:1 1 calc(50% - .5rem); min-width:0; max-width:none; }
  .checks-filters .ck-vendor,
  .checks-filters .ck-property { flex:1 1 100%; }
  .ck-bulk { margin-left:0; }
  .checks-paid, .checks-paid tbody, .checks-paid.is-grouped tbody { display:block; }
  .checks-paid thead { display:none; }
  .checks-paid tr.ck-row { display:block; border:1px solid var(--line); border-radius:var(--radius, 8px); margin:0 0 .5rem; padding:.45rem .8rem; background:var(--panel, var(--tl-ffffff)); }
  .checks-paid tbody.is-collapsed tr.ck-row { display:none; }
  .checks-paid tr.ck-ghead { display:flex; align-items:center; justify-content:space-between; gap:.8rem; margin:.9rem 0 .4rem; background:var(--ds-slate-50, var(--tl-f6f7f9)); border-radius:var(--radius, 8px); padding:.15rem .6rem; }
  .checks-paid tr.ck-ghead > td { display:block; border:0; padding:.35rem 0; background:none; }
  .checks-paid tr.ck-ghead > td.ck-gname { flex:1 1 auto; min-width:0; }
  .checks-paid tr.ck-ghead > td.ck-gfill { display:none; }
  .checks-paid tr.ck-ghead > td.ck-gtotal { flex:none; font-variant-numeric:tabular-nums; }
  .checks-paid .ck-gtoggle { flex-wrap:wrap; row-gap:0; min-height:44px; }
  .checks-paid tr.ck-row > td { display:flex; justify-content:space-between; align-items:center; gap:1rem; border:0; padding:.18rem 0; text-align:right; }
  .checks-paid tr.ck-row > td[data-label]::before { content:attr(data-label); color:var(--muted); font-weight:600; text-align:left; flex:none; }
  .checks-paid tr.ck-row > td.ck-memo { max-width:none; }
  .checks-paid tr.ck-row > td.ck-photo { justify-content:space-between; text-align:right; }
  .checks-paid tr.ck-row > td.is-empty { display:none; }
  .checks-paid tr.ck-row > td.ck-vendorcell { display:none; }
  .checks-paid:not(.is-grouped) tr.ck-row > td.ck-vendorcell { display:flex; }
}
.rcpt-doc { display:inline-flex; align-items:center; justify-content:center; gap:.15rem; width:48px; height:48px; border:1px solid var(--line); border-radius:4px; font-size:.72rem; font-weight:600; background:var(--tl-f6f7f9); }
.prj-receipt-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:.55rem; }
.prj-receipt-row { display:flex; flex-direction:row; align-items:center; gap:.9rem; padding:.55rem .75rem; background:var(--panel); border:1px solid var(--line); border-radius:10px; }
.prj-receipt-thumbs { display:flex; flex-direction:row; flex-wrap:nowrap; gap:.4rem; flex:none; }
.prj-receipt-thumbs a { display:inline-flex; text-decoration:none; color:inherit; }
.prj-receipt-thumbs img, .prj-receipt-doc { width:96px; height:96px; object-fit:cover; border:1px solid var(--line); border-radius:8px; background:var(--tl-f6f7f9); }
.prj-receipt-doc { display:inline-flex; align-items:center; justify-content:center; gap:.2rem; font-size:.78rem; font-weight:700; color:var(--ink); }
.prj-receipt-meta { display:flex; flex-direction:row; flex-wrap:nowrap; align-items:center; gap:.75rem 1.1rem; min-width:0; flex:1; }
.prj-receipt-meta .date { flex:none; color:var(--muted); white-space:nowrap; }
.prj-receipt-meta .vendor, .prj-receipt-meta .addr { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.prj-receipt-meta .vendor { flex:1 1 auto; font-weight:600; }
.prj-receipt-meta .addr { flex:0 1 14rem; }
.prj-receipt-meta .amt { flex:none; font-variant-numeric:tabular-nums; white-space:nowrap; }
.prj-receipt-meta .posting { flex:none; margin-left:auto; white-space:nowrap; }
.prj-posting-posted { color:var(--ok); font-weight:650; }
.prj-posting-draft { color:var(--warn); font-weight:650; }
.prj-receipt-empty { padding:.8rem .2rem; }
.prj-receipt-total { margin:.7rem 0; font-weight:600; }
.tag.rs-to_assign { background:var(--tl-eef2ff); color:var(--td-3730a3); }
.tag.rs-needs_review { background:var(--tl-fff7e6); color:var(--td-92400e); }
.tag.rs-approved { background:var(--tl-e9f7ef); color:var(--td-166534); }
.tag.rs-rejected { background:var(--tl-fdecec); color:var(--td-991b1b); }
.entry-docs { margin:0 0 1rem; padding:.7rem .85rem; background:var(--panel); border:1px solid var(--line); border-radius:10px; }
.entry-docs h2 { margin:0 0 .4rem; font-size:1rem; }
.entry-doc-list { list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:.4rem .9rem; }
/* Row actions (2026-10-29): Post and Link to existing entry. The link form is a small panel under its button. */
.prj-receipt-actions { display:flex; flex-direction:row; flex-wrap:wrap; align-items:center; gap:.4rem; flex:none; position:relative; }
.prj-receipt-actions .button, .prj-receipt-actions button { padding:.32rem .7rem; font-size:.85rem; white-space:nowrap; }
.prj-receipt-actions form { margin:0; }
.prj-link-entry > summary { list-style:none; cursor:pointer; display:inline-flex; }
.prj-link-entry > summary::-webkit-details-marker { display:none; }
.prj-link-form { position:absolute; right:0; top:calc(100% + .35rem); z-index:5; width:min(19rem, 86vw); padding:.7rem .8rem; background:var(--panel); border:1px solid var(--line-strong); border-radius:10px; box-shadow:0 6px 22px rgba(0,0,0,.18); display:flex; flex-direction:column; gap:.35rem; }
.prj-link-form label { font-size:.8rem; font-weight:600; }
.prj-link-form p { margin:0; }
.prj-unlinked { font-size:.75rem; }
.expense-attach { margin:0 0 1rem; padding:.55rem .7rem; border:1px solid var(--line); border-radius:8px; background:var(--panel); font-size:.9rem; }
@media (max-width: 899px) {
  .prj-receipt-actions { flex-wrap:wrap; }
  .prj-link-form { position:static; width:auto; margin-top:.4rem; box-shadow:none; }
  .prj-link-entry { flex:1 1 100%; }
  .prj-receipt-row { flex-direction:column; align-items:stretch; }
  .prj-receipt-thumbs { flex-wrap:wrap; }
  .prj-receipt-meta { flex-wrap:wrap; }
  .prj-receipt-meta .posting { margin-left:0; }
}
@media (max-width: 640px) { .prj-receipt-filters .ff-filter-field { min-width:0; flex:1 1 40%; } }

/* Documents page (2026-10-17): one-line intro, filter row, aligned table, upload dialog from + Add > Upload */
.docs-filters { display:flex; flex-wrap:wrap; gap:.6rem 1rem; align-items:flex-end; margin:0 0 .8rem; }
.docs-filters .df-field { display:flex; flex-direction:column; gap:.2rem; width:13rem; }
.docs-filters .df-search { width:16rem; }
.docs-filters label { font-size:.8rem; font-weight:600; }
.docs-filters .df-clear { padding-bottom:.45rem; }
/* Documents "All documents" list v3 (2026-10-23): full width; 32px chevron | File (flex) | Type 110 | Property 160 | Date 110 | menu 40.
   File name one line + ellipsis + title; one muted 12px line (note · size); ~56px rows; whole row opens the file (app.js data-row-href). */
.ds-table-wrap.docs-wrap { width:100%; max-width:none; overflow:visible; }
table.docs-table { table-layout:fixed; width:100%; border-collapse:collapse; }
.ds-table-wrap.docs-wrap > table.ds-table.docs-table { display:table; width:100%; max-width:100%; min-width:0; } /* beats ds.css table.ds-table:not(.stack) {display:block} on phones */
table.docs-table col.c-x { width:32px; } table.docs-table col.c-file { width:auto; } table.docs-table col.c-type { width:110px; }
table.docs-table col.c-prop { width:160px; } table.docs-table col.c-date { width:110px; } table.docs-table col.c-menu { width:40px; }
table.docs-table > thead th { white-space:nowrap; }
table.docs-table > tbody > tr.doc-row > td { vertical-align:middle; padding:10px 8px; line-height:1.25; border-bottom:1px solid var(--ds-slate-200); overflow:hidden; }
table.docs-table > tbody > tr.doc-row { cursor:pointer; }
table.docs-table > tbody > tr.doc-row:hover > td { background:var(--ds-slate-50); }
table.docs-table.compact > tbody > tr > td.ds-x { width:32px; padding:0 0 0 4px; }
table.docs-table td.ds-x .ds-expand { width:24px; height:24px; min-width:24px; padding:0; border-color:transparent; background:transparent; }
table.docs-table td.doc-kind, table.docs-table td.doc-date { white-space:nowrap; text-overflow:ellipsis; font-size:.84rem; }
table.docs-table td[data-label="Property"] > a, table.docs-table .doc-folder { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:.84rem; }
table.docs-table .doc-folder { font-size:12px; color:var(--muted); }
table.docs-table > tbody > tr.doc-row > td.doc-menu { padding:0 6px 0 0; overflow:visible; text-align:right; }
table.docs-table td.doc-menu summary.ds-icon-btn { width:28px; height:28px; min-width:28px; padding:0; display:inline-flex; align-items:center; justify-content:center; }
table.docs-table td.doc-menu .ds-menu-panel form { margin:0; } table.docs-table .doc-menu-del { all:unset; display:flex; gap:.5rem; align-items:center; width:100%; cursor:pointer; padding:.45rem .75rem; color:var(--ds-late); box-sizing:border-box; }
.docs-table .doc-file { display:flex; gap:.6rem; align-items:center; min-width:0; }
.docs-table .doc-ico { flex:0 0 20px; width:20px; height:20px; border-radius:4px; }
.docs-table .doc-ico .icon { width:14px; height:14px; }
.doc-ico { flex:0 0 28px; height:28px; display:inline-flex; align-items:center; justify-content:center; border-radius:6px; background:var(--brand-soft, var(--tl-eef2ff)); color:var(--brand); }
.doc-ico-receipt { background:var(--tl-e9f7ef); color:var(--td-166534); }
.docs-table .doc-name { display:flex; flex-direction:column; flex:1 1 auto; min-width:0; overflow:hidden; -webkit-line-clamp:unset; }
.docs-table .doc-fn, .docs-table .doc-sub, .docs-table .doc-meta-sm { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; overflow-wrap:normal; word-break:normal; max-width:100%; }
.docs-table .doc-fn { font-size:.9rem; line-height:20px; font-weight:500; color:var(--brand); text-decoration:none; }
.docs-table .doc-fn:hover { text-decoration:underline; }
.docs-table .doc-sub, .docs-table .doc-meta-sm { font-size:12px; line-height:16px; color:var(--muted); margin-top:0; }
.docs-table .doc-meta-sm { display:none; }
/* Expanded row (2026-10-24): full-width label | value. Long values stay on one line (ellipsis, copy, title)
   so a number is never broken mid-digit. Tokens only, so Night (arv_theme) follows the same rules. */
.docs-table .doc-detail { display:grid; grid-template-columns:max-content minmax(0,1fr); column-gap:1.25rem; row-gap:.4rem; width:100%; margin:0; align-items:center; font-size:var(--ds-text-sm, .875rem); }
.docs-table .doc-detail dt { margin:0; color:var(--ds-slate-600); font-weight:600; }
.docs-table .doc-detail dd { margin:0; min-width:0; overflow:hidden; }
.docs-table .doc-detail dd.doc-plain { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; overflow-wrap:normal; word-break:normal; }
.docs-table .doc-val { display:flex; align-items:center; gap:.4rem; min-width:0; max-width:100%; }
.docs-table .doc-val-text { flex:1 1 auto; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; overflow-wrap:normal; word-break:normal; }
.docs-table .doc-copy { all:unset; flex:0 0 auto; cursor:pointer; font-size:12px; line-height:1; font-weight:600; color:var(--brand); border:1px solid var(--line); background:var(--panel); border-radius:6px; padding:.28rem .45rem; }
.docs-table .doc-copy:hover, .docs-table .doc-copy:focus-visible { background:var(--ds-slate-50); }
.docs-table .doc-copy:focus-visible { outline:2px solid var(--brand); outline-offset:1px; }
.docs-table .doc-detail-actions { display:flex; flex-wrap:wrap; gap:.5rem; margin:.75rem 0 0; }
.doc-copy-buf { position:fixed; left:-9999px; top:0; }
@media (max-width:899px) {
  /* phones/tablets: Type hidden; Property · Date stacked under the name; each row is a 32px | 1fr | 40px grid */
  .ds-table-wrap.docs-wrap > table.ds-table.docs-table, table.docs-table > tbody { display:block; width:100%; }
  table.docs-table colgroup, table.docs-table > thead, table.docs-table .doc-kind, table.docs-table .doc-prop, table.docs-table td[data-label="Property"], table.docs-table .doc-date { display:none; }
  table.docs-table > tbody > tr.doc-row { display:grid; grid-template-columns:32px minmax(0,1fr) 40px; align-items:center; border-bottom:1px solid var(--ds-slate-200); }
  table.docs-table > tbody > tr.doc-row > td { display:block; border:0; padding:12px 4px; min-width:0; }
  table.docs-table > tbody > tr.doc-row > td.doc-cell { padding-left:0; }
  table.docs-table > tbody > tr.doc-row > td.doc-kind, table.docs-table > tbody > tr.doc-row > td[data-label="Property"], table.docs-table > tbody > tr.doc-row > td.doc-date { display:none; }
  table.docs-table > tbody > tr.ds-detail:not([hidden]) { display:block; } table.docs-table > tbody > tr.ds-detail > td { display:block; }
  /* beat ds.css ".ds-table.stack" phone-card rules (padding, 4px left bar, 1fr auto grid, ::before labels) */
  table.ds-table.stack.docs-table > tbody > tr.ds-row.doc-row { grid-template-columns:32px minmax(0,1fr) 40px; gap:0; padding:0; border-left:0; }
  table.ds-table.stack.docs-table > tbody > tr.ds-row.doc-row > td { padding:12px 4px; width:auto; }
  table.ds-table.stack.docs-table > tbody > tr.ds-row.doc-row > td.doc-cell { padding-left:0; }
  table.ds-table.stack.docs-table > tbody > tr.ds-row.doc-row > td[data-label]::before { content:none; }
  table.ds-table.stack.compact.docs-table > tbody > tr.ds-row.doc-row:has(> td.ds-x) { grid-template-columns:32px minmax(0,1fr) 40px; }
  table.ds-table.stack.compact.docs-table > tbody > tr.ds-row.doc-row:has(> td.ds-x) > td.ds-x { grid-column:1; grid-row:1; width:auto; padding:12px 0; }
  table.ds-table.stack.compact.docs-table > tbody > tr.ds-row.doc-row:has(> td.ds-x) > td.doc-cell { grid-column:2; grid-row:1; }
  table.ds-table.stack.compact.docs-table > tbody > tr.ds-row.doc-row:has(> td.ds-x) > td.doc-menu { grid-column:3; grid-row:1; }
  table.ds-table.stack.docs-table > tbody > tr.ds-row.doc-row > td[data-label="Type"], table.ds-table.stack.docs-table > tbody > tr.ds-row.doc-row > td[data-label="Property"], table.ds-table.stack.docs-table > tbody > tr.ds-row.doc-row > td[data-label="Date"] { display:none; }
  .docs-table .doc-meta-sm { display:block; } .docs-table .doc-sub { display:none; }
  table.ds-table.stack.docs-table > tbody > tr.ds-row.doc-row > td { padding-top:8px; padding-bottom:8px; }
  .docs-table .doc-detail { grid-template-columns:1fr; row-gap:.15rem; align-items:start; }
  .docs-table .doc-detail dt { margin-top:.55rem; }
  .docs-table .doc-detail-actions { flex-direction:column; align-items:stretch; }
  .docs-table .doc-detail-actions .ds-btn { justify-content:center; }
}
/* Transactions list (2026-10-24): same row metrics as the Documents list. Full width, one line + ellipsis,
   12px grey sub-line, ~56px rows, chevron, edit in its own column. Tokens only (night follows arv_theme). */
.ds-table-wrap.txn-wrap { width:100%; max-width:none; }
.ds-table-wrap.txn-wrap > table.ds-table.txn-table,
.ds-table-wrap.txn-wrap > table.ds-table.txn-bycat { display:table; width:100%; max-width:100%; min-width:0; }
table.txn-table, table.txn-bycat { table-layout:fixed; width:100%; border-collapse:collapse; }
table.txn-table col.c-x { width:32px; } table.txn-table col.c-date { width:132px; } table.txn-table col.c-type { width:132px; }
table.txn-table col.c-vendor { width:auto; } table.txn-table col.c-prop { width:150px; } table.txn-table col.c-memo { width:auto; }
table.txn-table col.c-amt { width:108px; } table.txn-table col.c-cat { width:168px; } table.txn-table col.c-act { width:40px; }
table.txn-bycat col.c-id { width:64px; } table.txn-bycat col.c-date { width:118px; } table.txn-bycat col.c-ent { width:120px; }
table.txn-bycat col.c-vendor { width:auto; } table.txn-bycat col.c-memo { width:auto; }
table.txn-bycat col.c-paid { width:140px; } table.txn-bycat col.c-prop { width:160px; } table.txn-bycat col.c-amt { width:108px; }
table.txn-table > thead th, table.txn-bycat > thead th { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
table.ds-table.compact.txn-table > tbody > tr.txn-row > td,
table.txn-bycat > tbody > tr.ds-row > td { vertical-align:middle; padding:10px 8px; line-height:1.25; min-height:56px; overflow:hidden; border-bottom:1px solid var(--ds-slate-200); }
table.txn-table > tbody > tr.txn-row:hover > td,
table.txn-bycat > tbody > tr.ds-row:hover > td { background:var(--ds-slate-50); }
table.txn-table.compact > tbody > tr > td.ds-x { width:32px; padding:0 0 0 4px; }
table.txn-table td.ds-x .ds-expand { width:24px; height:24px; min-width:24px; padding:0; border-color:transparent; background:transparent; }
table.txn-table > tbody > tr.txn-row > td.txn-act { padding:0 6px 0 0; overflow:visible; text-align:center; }
table.txn-table td.txn-act .ds-edit-hover { margin:0; }
table.txn-table td.txn-date, table.txn-table td.txn-type, table.txn-table td.txn-prop { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:.84rem; }
table.txn-table td.txn-amt, table.txn-bycat > tbody > tr > td.num { white-space:nowrap; }
.txn-wrap .txn-stack, .txn-wrap .txn-cat-line, .txn-wrap .txn-memo-line { display:flex; min-width:0; max-width:100%; }
.txn-wrap .txn-stack { flex-direction:column; }
.txn-wrap .txn-cat-line, .txn-wrap .txn-memo-line { align-items:center; gap:.35rem; }
.txn-wrap .txn-one, .txn-wrap .txn-sub, .txn-wrap .txn-meta-sm { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; overflow-wrap:normal; word-break:normal; max-width:100%; }
.txn-wrap .txn-one { flex:1 1 auto; min-width:0; font-size:.9rem; line-height:20px; }
.txn-wrap .txn-sub, .txn-wrap .txn-meta-sm, .txn-wrap .txn-gl { font-size:12px; line-height:16px; color:var(--muted); }
.txn-wrap .txn-meta-sm { display:none; }
.txn-wrap .txn-gl { flex:none; font-variant-numeric:tabular-nums; }
.txn-wrap .txn-memo-line .rcpt-icon, .txn-wrap .txn-memo-line .ds-lines-badge { flex:none; }
.txn-memo-full { margin:0 0 .75rem; overflow-wrap:anywhere; white-space:pre-wrap; }
@media (max-width:899px) {
  .ds-table-wrap.txn-wrap > table.ds-table.txn-table,
  .ds-table-wrap.txn-wrap > table.ds-table.txn-bycat,
  table.txn-table > tbody, table.txn-bycat > tbody { display:block; width:100%; }
  table.txn-table colgroup, table.txn-table > thead, table.txn-bycat colgroup, table.txn-bycat > thead { display:none; }
  table.txn-table > tbody > tr.txn-row { display:grid; grid-template-columns:32px minmax(0,1fr) 40px; align-items:center; border-bottom:1px solid var(--ds-slate-200); }
  table.txn-table > tbody > tr.txn-row > td { display:block; border:0; min-height:0; min-width:0; padding:8px 4px; }
  table.txn-table > tbody > tr.txn-row > td.txn-date,
  table.txn-table > tbody > tr.txn-row > td.txn-type,
  table.txn-table > tbody > tr.txn-row > td.txn-prop,
  table.txn-table > tbody > tr.txn-row > td.txn-amt,
  table.txn-table > tbody > tr.txn-row > td.txn-cat { display:none; }
  table.txn-table > tbody > tr.ds-detail:not([hidden]) { display:block; }
  table.txn-table > tbody > tr.ds-detail > td { display:block; }
  table.txn-table > tbody > tr.ds-group,
  table.txn-table > tbody > tr.ds-total,
  table.txn-table > tbody > tr.ds-empty { display:flex; justify-content:space-between; gap:8px; padding:8px; border-bottom:1px solid var(--ds-slate-200); }
  table.txn-table > tbody > tr.ds-group > td,
  table.txn-table > tbody > tr.ds-total > td,
  table.txn-table > tbody > tr.ds-empty > td { display:block; width:auto; border:0; padding:0; min-height:0; }
  table.txn-table > tbody > tr.ds-group > td:empty,
  table.txn-table > tbody > tr.ds-total > td:empty { display:none; }
  table.ds-table.stack.txn-table > tbody > tr.ds-row.txn-row { grid-template-columns:32px minmax(0,1fr) 40px; gap:0; padding:0; border-left:0; }
  table.ds-table.stack.txn-table > tbody > tr.ds-row.txn-row > td { padding:8px 4px; width:auto; }
  table.ds-table.stack.txn-table > tbody > tr.ds-row.txn-row > td[data-label]::before { content:none; }
  table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row:has(> td.ds-x) { grid-template-columns:32px minmax(0,1fr) 40px; }
  table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row:has(> td.ds-x) > td { grid-column:auto; width:auto; }
  table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row:has(> td.ds-x) > td.ds-x { grid-column:1; grid-row:1 / span 2; width:auto; padding:8px 0; }
  table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row:has(> td.ds-x) > td.txn-vendor { grid-column:2; grid-row:1; }
  table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row:has(> td.ds-x) > td.txn-memo { grid-column:2; grid-row:2; padding-top:0; }
  table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row:has(> td.ds-x) > td.txn-act { grid-column:3; grid-row:1 / span 2; display:block; }
  table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row > td.txn-date,
  table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row > td.txn-type,
  table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row > td.txn-prop,
  table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row > td.txn-amt,
  table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row > td.txn-cat { display:none; }
  .txn-wrap .txn-meta-sm { display:block; }
  .txn-wrap .txn-sub { display:none; }
  /* 390px: one collapsed line, the label and the amount. Vendor and date are in the expand row.
     The chart number still does not shrink if the vendor sub-line is showing. */
  @media (max-width:390px) {
    table.txn-table > tbody > tr.txn-row,
    table.ds-table.stack.txn-table > tbody > tr.ds-row.txn-row,
    table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row:has(> td.ds-x) {
      grid-template-columns:32px minmax(0,1fr) auto 40px;
    }
    table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row:has(> td.ds-x) > td.ds-x {
      grid-column:1; grid-row:1;
    }
    table.txn-table > tbody > tr.txn-row > td.txn-vendor,
    table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row:has(> td.ds-x) > td.txn-vendor { display:none; }
    table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row:has(> td.ds-x) > td.txn-memo {
      grid-column:2; grid-row:1; padding-top:8px;
    }
    table.txn-table > tbody > tr.txn-row > td.txn-amt,
    table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row:has(> td.ds-x) > td.txn-amt {
      display:block; grid-column:3; grid-row:1; white-space:nowrap;
    }
    table.ds-table.stack.compact.txn-table > tbody > tr.ds-row.txn-row:has(> td.ds-x) > td.txn-act {
      grid-column:4; grid-row:1;
    }
    .txn-wrap .txn-meta-sm { display:flex; align-items:baseline; gap:.35rem; overflow:hidden; text-overflow:clip; }
    .txn-wrap .txn-meta-sm .txn-meta-text { min-width:0; flex:1 1 auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .txn-wrap .txn-meta-acct { flex:none; }
  }
  table.txn-bycat > tbody > tr.ds-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 12px; padding:12px 8px; border-bottom:1px solid var(--ds-slate-200); }
  table.txn-bycat > tbody > tr.ds-row > td { display:block; border:0; padding:0; min-height:0; min-width:0; }
  table.txn-bycat > tbody > tr.ds-row > td[data-label]::before { content:attr(data-label) " "; color:var(--muted); font-size:12px; font-weight:600; }
  table.txn-bycat > tbody > tr.ds-row > td.num { grid-column:2; grid-row:1; font-weight:700; }
  table.txn-bycat > tbody > tr.ds-row > td.num::before { content:none; }
  table.txn-bycat td.hide-sm { display:none; }
  table.txn-bycat > tbody > tr.ds-group,
  table.txn-bycat > tbody > tr.ds-total,
  table.txn-bycat > tbody > tr.ds-empty { display:flex; justify-content:space-between; gap:8px; padding:8px; }
  table.txn-bycat > tbody > tr.ds-group > td,
  table.txn-bycat > tbody > tr.ds-total > td { display:block; width:auto; border:0; padding:0; }
  table.ds-table.stack.txn-bycat > tbody > tr.ds-row { grid-template-columns:minmax(0,1fr) auto; gap:2px 12px; padding:12px 8px; border-left:0; }
  table.ds-table.stack.txn-bycat > tbody > tr.ds-row > td { width:auto; padding:0; }
  table.ds-table.stack.txn-bycat > tbody > tr.ds-row > td.num { grid-column:2; grid-row:1; }
  table.ds-table.stack.txn-bycat td.hide-sm { display:none; }
}
/* Shared expense row: the date stays on one line. The label is one line, ellipsis, min-width 0. */
table.txn-table td.txn-date,
table.txn-table td.txn-date .txn-date-text {
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.txn-wrap .txn-memo-line .txn-label {
  min-width:0; flex:1 1 auto; display:block; max-width:100%;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  overflow-wrap:normal; word-break:normal;
}
.doc-name { display:flex; flex-direction:column; min-width:0; }
.doc-note { font-size:.82rem; }
td.doc-act { text-align:right; }
.empty-state { text-align:center; padding:2.5rem 1rem; border:1px dashed var(--line-strong, var(--tl-cbd5e1)); border-radius:var(--radius, 8px); background:var(--panel, var(--tl-ffffff)); }
.empty-state > .icon { width:36px; height:36px; color:var(--muted); }
.empty-state p { margin:.4rem 0; }
.upload-dialog { display:none; position:fixed; inset:0; z-index:920; /* above the Support button (900) so it never covers the dialog buttons */ align-items:center; justify-content:center; padding:1rem; }
.upload-dialog:target { display:flex; }
.upload-backdrop { position:absolute; inset:0; background:rgba(15,23,42,.45); }
.upload-box { position:relative; background:var(--panel, var(--tl-ffffff)); border-radius:var(--radius, 8px); box-shadow:0 20px 50px rgba(0,0,0,.25); width:min(640px, 100%); max-height:calc(100vh - 2rem); overflow:auto; padding:1.1rem 1.2rem; }
.upload-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:.8rem; }
.upload-top h2 { margin:0; font-size:1.15rem; }
.upload-close { color:var(--muted); }
.upload-grid { display:grid; grid-template-columns:1fr 1fr; gap:.8rem 1rem; }
.upload-grid .ug-field { display:flex; flex-direction:column; gap:.25rem; min-width:0; }
.upload-grid .ug-field label { font-size:.85rem; font-weight:600; }
.upload-grid .ug-field input, .upload-grid .ug-field select { width:100%; box-sizing:border-box; }
.upload-grid .ug-file, .upload-grid .ug-note { grid-column:1 / -1; }
.upload-grid .helptext { font-size:.8rem; color:var(--muted); }
.upload-grid .ug-actions { grid-column:1 / -1; display:flex; justify-content:flex-end; gap:.6rem; margin-top:.2rem; }
@media (max-width: 640px) {
  .docs-filters .df-field, .docs-filters .df-search { width:100%; }
  .upload-grid { grid-template-columns:1fr; } /* Documents upload dialog and Imports upload form */
}
/* Imports "Upload a file" (2026-10-24): same 2-column upload-grid, 12px muted help, and theme tokens as the Documents list.
   Groups stack with a larger gap. Phone (the query above) is one column. is-off is display only; noscript shows every field. */
form.imp-upload { display:flex; flex-direction:column; gap:1.25rem; }
form.imp-upload .upload-grid { align-items:start; margin:0; }
form.imp-upload .ug-field.is-off { display:none; }
form.imp-upload .imp-group:not(:has(.ug-field:not(.is-off))) { display:none; }
form.imp-upload .helptext { font-size:12px; line-height:16px; color:var(--muted); margin:0; }
form.imp-upload > .ug-actions { display:flex; justify-content:flex-end; align-items:center; gap:.75rem; margin:0; }
form.imp-upload .imp-need { margin:0; font-size:12px; line-height:16px; color:var(--muted); text-align:right; }
form.imp-upload .imp-drop-error { margin:0; font-size:12px; line-height:16px; color:var(--bad); text-align:left; }
form.imp-upload .imp-need[hidden], form.imp-upload .imp-drop-error[hidden] { display:none; }
form.imp-upload .ds-btn:disabled, form.imp-upload .ds-btn:disabled:hover { opacity:.45; cursor:not-allowed; }
form.imp-upload .errorlist { margin:.1rem 0; }
.imp-drop { display:flex; flex-direction:column; align-items:stretch; gap:.55rem; min-height:7.25rem; padding:1rem;
  border:1.5px dashed var(--line-strong); border-radius:var(--ds-r-md, 10px); background:var(--ds-slate-50); text-align:center; }
.imp-drop.is-over { border-color:var(--brand); background:var(--brand-soft); }
.imp-dropzone { display:flex; flex-direction:column; align-items:center; gap:.35rem; cursor:pointer; }
.imp-drop-prompt, .imp-drop-name { margin:0; }
.imp-drop-prompt { color:var(--muted); font-size:12px; line-height:16px; }
.imp-drop-name { color:var(--ink); font-weight:600; font-size:.9rem; overflow-wrap:anywhere; }
.imp-drop-prompt[hidden], .imp-drop-name[hidden] { display:none; }
.imp-drop input[type=file] { width:100%; box-sizing:border-box; cursor:pointer; }
/* Upload receipt dialog (2026-10-17), shares the Documents dialog look */
.upload-grid .ug-wide, .upload-grid .ug-hint { grid-column:1 / -1; }
.upload-grid .ug-hint { margin:0; }
/* Upload lease dialog (2026-10-17): basics first, required marks, buttons pinned at the bottom */
.lease-upload .lu-box { display:flex; flex-direction:column; padding:0; max-height:calc(100vh - 2rem); overflow:hidden; }
.lease-upload .upload-top { padding:1rem 1.2rem .4rem; margin:0; }
.lease-upload .lu-form { display:flex; flex-direction:column; min-height:0; flex:1; }
.lease-upload .lu-body { overflow:auto; padding:0 1.2rem 1rem; }
.lease-upload .lu-lead { margin:0 0 .8rem; }
.lease-upload .req { color:var(--bad, var(--td-b91c1c)); font-weight:700; }
.lease-upload fieldset.lu-new { border:1px solid var(--line); border-radius:var(--radius, 8px); margin:.9rem 0 0; padding:.6rem .8rem .8rem; }
.lease-upload fieldset.lu-new legend { font-weight:600; font-size:.9rem; padding:0 .3rem; }
.lease-upload .lu-more { margin-top:.8rem; }
.lease-upload .lu-more summary { cursor:pointer; font-weight:600; color:var(--brand, var(--td-1e3a8a)); padding:.3rem 0; }
.lease-upload .lu-more .upload-grid { margin-top:.5rem; }
.lease-upload .lu-actions { display:flex; justify-content:flex-end; gap:.6rem; padding:.75rem 1.2rem; border-top:1px solid var(--line); background:var(--panel, var(--tl-ffffff)); position:sticky; bottom:0; }
/* The New lease record basics only show while "No lease record yet" is picked (CSS only, no script). */
.lease-upload .lu-form:not(:has(#lu-lease option[value="new"]:checked)) fieldset.lu-new { display:none; }
/* Projects > Schedule / tasks and Photos (2026-10-18) */
.tag.tk-todo { background:var(--tl-eef2f6); color:var(--td-344054); } .tag.tk-doing { background:var(--tl-e6eef8); color:var(--brand); }
.tag.tk-done { background:var(--tl-e3f4e8); color:var(--ok); } .tag.tk-overdue { background:var(--tl-fde7e5); color:var(--bad); }
.prj-tasks .tk-done td:first-child a, .prj-tasks .tk-done td:first-child { color:var(--muted); text-decoration:line-through; }
.prj-tasks .tk-act form { margin:0; } .prj-tasks .tk-act { white-space:nowrap; text-align:right; }
.prj-tasks .small-btn { padding:.25rem .6rem; font-size:.82rem; min-height:0; }
.prj-tasks .tk-notes { margin-top:.15rem; }
.prj-task-filters .check label { display:flex; align-items:center; gap:.35rem; font-weight:500; white-space:nowrap; padding-top:1.3rem; }
.prj-photo-filters .ff-label { display:block; font-size:.8rem; font-weight:600; margin-bottom:.25rem; }
.badge.ph-before { background:var(--tl-fff1d6); color:var(--td-7a4b00); } .badge.ph-during { background:var(--tl-e6eef8); color:var(--brand); }
.badge.ph-after { background:var(--tl-e3f4e8); color:var(--ok); }
.task-form textarea { width:100%; box-sizing:border-box; }
@media (max-width: 640px) {
  .prj-tasks, .prj-tasks tbody { display:block; }
  .prj-tasks tr.tk-head { display:none; }
  .prj-tasks tr { display:block; border:1px solid var(--line); border-radius:var(--radius); margin:0 0 .65rem; padding:.6rem .8rem; background:var(--panel); }
  .prj-tasks tr.tk-empty { border:0; padding:0; background:transparent; }
  .prj-tasks td { display:flex; justify-content:space-between; gap:1rem; border:0; padding:.15rem 0; text-align:right; }
  .prj-tasks td[data-label]::before { content:attr(data-label); color:var(--muted); font-weight:600; text-align:left; }
  .prj-tasks td.tk-title { display:block; text-align:left; font-weight:600; padding-bottom:.3rem; }
  .prj-tasks td.tk-act { justify-content:flex-end; padding-top:.4rem; }
  .prj-tasks .tk-act { text-align:left; }
  .prj-task-filters .check label { padding-top:0; }
}

/* Receipt edit page (2026-10-18): one form, errors next to fields, phone = one column. */
.banner-warn { background:var(--tl-fff8e1); border-left:4px solid var(--warn, #b7791f); }
.receipt-edit-form .form-errors .errorlist { padding:.5rem .8rem; background:var(--tl-fdecea); border-radius:6px; list-style:none; margin:0; }
.receipt-edit-form .ug-field .errorlist { list-style:none; padding-left:0; font-size:.85rem; }
.receipt-edit-form .check-row label { display:flex; gap:.5rem; align-items:center; font-weight:600; }
.receipt-edit-form .check-row p { margin:.2rem 0; }
.receipt-edit-form .actions { display:flex; gap:.6rem; flex-wrap:wrap; }
@media (max-width:700px) {
  .receipt-edit-form.upload-grid { grid-template-columns:1fr; }
  .receipt-edit-form .actions button, .receipt-edit-form .actions .button { flex:1 1 auto; text-align:center; }
}
.doc-list { table-layout:fixed; }
.doc-list th:nth-child(2) { width:130px; } .doc-list th:nth-child(3) { width:120px; } .doc-list th:nth-child(4) { width:90px; }
.dp-delete button { color:var(--danger, var(--td-b42318)); }

/* Rehab projects list (2026-10-24): one line per project, ~56px rows, full width.
   Phones under 900px stack. No .stack class: that kit stacks at 700px and would fight these rules.
   Tokens only, so Night and Regular follow the theme cookie. */
.pj-stats { display:flex; flex-wrap:wrap; gap:.35rem 1.25rem; margin:0 0 1rem; font-size:.9rem; color:var(--muted); }
.pj-stats b { color:var(--ink); font-weight:700; margin-right:.2rem; }
/* width:auto, not 100%: the flush wrap has negative side margins, and 100% shifted it left of the card on every screen. */
.ds-table-wrap.pj-wrap { width:auto; max-width:none; }
/* Phones: ds.css only matches the plain wrap at <=700px, so the flush wrap kept its -20px margin against the 16px card padding and the expanded detail spilled past the card edge. */
@media (max-width:700px) {
  .ds-section .ds-table-wrap.flush.pj-wrap { margin-left:calc(-1 * var(--ds-4)); margin-right:calc(-1 * var(--ds-4)); margin-bottom:calc(-1 * var(--ds-4)); }
}
table.ds-table.pj-table { table-layout:fixed; width:100%; border-collapse:collapse; }
table.pj-table col.c-x { width:32px; }
table.pj-table col.c-status { width:110px; }
table.pj-table col.c-money { width:120px; }
table.pj-table col.c-pct { width:140px; }
table.pj-table col.c-act { width:130px; }
table.ds-table.pj-table.compact > tbody > tr.ds-row > td { height:56px; padding:0 8px; vertical-align:middle; box-sizing:border-box; border-bottom:1px solid var(--ds-slate-200); overflow:hidden; }
table.ds-table.pj-table.compact > tbody > tr > td.ds-x { width:32px; padding:0 0 0 4px; }
table.ds-table.pj-table td.ds-x .ds-expand { width:24px; height:24px; min-width:24px; padding:0; }
.pj-line { display:flex; align-items:baseline; gap:.45rem; min-width:0; }
.pj-line a { flex:1 1 auto; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:500; }
.pj-sub { flex:0 1 auto; max-width:46%; color:var(--muted); font-size:12px; line-height:16px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pj-empty { color:var(--muted); }
.pj-pct { display:block; font-variant-numeric:tabular-nums; line-height:1.1; }
.pj-bar { display:block; height:4px; margin-top:4px; border-radius:var(--ds-r-pill); background:var(--ds-slate-200); overflow:hidden; }
.pj-bar i { display:block; height:100%; background:var(--ds-paid-bar); }
.pj-bar i.over { background:var(--ds-severe-bar); }
table.ds-table.pj-table.compact > tbody > tr.ds-detail > td { height:auto; padding:12px 16px 16px; }
.pj-expand { display:flex; align-items:flex-start; gap:1rem; }
.pj-facts { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:.4rem 1rem; margin:0; flex:1 1 auto; min-width:0; }
.pj-facts dt { color:var(--muted); font-size:12px; font-weight:600; }
.pj-facts dd { margin:0; color:var(--ink); }
.pj-actions { margin-left:auto; display:flex; flex-wrap:wrap; gap:.5rem; justify-content:flex-end; }
/* The fixed Support button covers Last activity on a long list. On this page it sits at the end instead (phones already do). */
@media (min-width:701px) {
  body:has(.pj-table) .support-launch { position:relative; right:auto; bottom:auto; z-index:auto;
    display:flex; width:max-content; margin:8px 16px 16px auto; box-shadow:none; }
}
@media (max-width:899px) {
  .ds-table-wrap.pj-wrap { overflow:visible; }
  table.ds-table.pj-table:not(.stack),
  .ds-table-wrap.pj-wrap > table.ds-table.pj-table,
  table.ds-table.pj-table > tbody { display:block; width:100%; max-width:100%; overflow:visible; }
  table.ds-table.pj-table > thead, table.ds-table.pj-table colgroup { display:none; }
  table.ds-table.pj-table > tbody > tr.ds-row { display:grid; grid-template-columns:32px minmax(0, 1fr); align-items:center; border-bottom:1px solid var(--ds-slate-200); }
  table.ds-table.pj-table.compact > tbody > tr.ds-row > td { display:block; height:auto; border:0; padding:8px; min-width:0; }
  table.ds-table.pj-table > tbody > tr.ds-row > td.ds-x { grid-column:1; grid-row:1; }
  table.ds-table.pj-table > tbody > tr.ds-row > td.pj-name { grid-column:2; grid-row:1; }
  table.ds-table.pj-table > tbody > tr.ds-row > td.pj-meta { grid-column:1 / -1; }
  table.ds-table.pj-table > tbody > tr.ds-row > td.pj-meta::before { content:attr(data-label); display:block; font-size:var(--ds-text-xs); color:var(--muted); font-weight:600; }
  table.ds-table.pj-table > tbody > tr.ds-detail:not([hidden]) { display:block; }
  table.ds-table.pj-table > tbody > tr.ds-detail[hidden] { display:none; }
  table.ds-table.pj-table > tbody > tr.ds-detail > td, table.ds-table.pj-table > tbody > tr.ds-empty > td { display:block; height:auto; }
  .pj-facts { grid-template-columns:1fr 1fr; }
  .pj-expand { flex-direction:column; align-items:stretch; }
  .pj-actions { margin-left:0; width:100%; }
}
/* E-signature landlord pages (docs/ESIGN.md); theme tokens only */
.esign-status{display:inline-block;padding:.15rem .55rem;border-radius:999px;font-size:.85rem;background:var(--ds-muted-bg);color:var(--ds-muted)}
.esign-status.esign-sent{background:var(--ds-info-bg);color:var(--ds-info)}
.esign-status.esign-completed{background:var(--ds-paid-bg);color:var(--ds-paid)}
.esign-status.esign-voided{background:var(--ds-late-bg);color:var(--ds-late)}
.esign-ok{color:var(--ds-paid);font-weight:600}
.esign-bad{color:var(--ds-late);font-weight:700}
.esign-pre{white-space:pre-wrap;font-size:.78rem;max-width:44rem;margin:0}
.esign-ua{max-width:18rem}
/* Tenants list (2026-10-24): full content width; one line + ellipsis; ~56px rows.
   Deposit column hides through 1359px and stays in the expand row.
   From 900px through 1279px the table is fixed to the content column. Lease start
   and Unit join that expand row. The tenant name is at least 10rem, and the name
   and address clamp to two lines, so Rent and Balance stay on screen. 1280px and
   up keeps Lease start and Unit as columns.
   Under 900px the row stacks (labels), including on phones wider than the 700px kit. Tokens only, so Night follows arv_theme. */
main.tn-page,
.sec-shell > main.tn-page,
.sec-shell.is-rail > main.tn-page { max-width:none; width:100%; }
.ds-table-wrap.tn-wrap { width:100%; max-width:none; }
.tn-expand { margin:0; }
.tn-expand > div { min-width:0; }
.tn-expand dd { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media (min-width:900px) {
  table.ds-table.tn-table { table-layout:auto; width:100%; border-collapse:collapse; }
  table.tn-table col.c-x { width:36px; }
  table.tn-table col.c-end { width:auto; min-width:11rem; }
  table.tn-table thead th { padding-left:.5rem; padding-right:.5rem; }
  table.ds-table.compact.tn-table > tbody > tr.ds-row > td {
    height:56px; padding:0 .5rem; vertical-align:middle;
    overflow:hidden; white-space:nowrap; text-overflow:ellipsis; line-height:20px;
  }
  table.ds-table.compact.tn-table > tbody > tr.ds-row > td.ds-x { width:36px; padding-left:4px; overflow:visible; }
  /* Names and addresses keep a readable width and wrap. Rent, deposit, and balance stay as wide as their text. */
  table.ds-table.compact.tn-table > tbody > tr.ds-row > td.tn-name,
  table.ds-table.compact.tn-table > tbody > tr.ds-row > td[data-label="Property"] {
    height:auto; min-height:56px; min-width:8rem;
    overflow:visible; white-space:normal; text-overflow:clip;
  }
  table.ds-table.compact.tn-table > tbody > tr.ds-row > td.tn-name { min-width:13rem; }
  table.ds-table.compact.tn-table > tbody > tr.ds-row > td[data-label="Property"] { min-width:8.5rem; }
  table.tn-table .tn-ellipsis { display:block; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  table.tn-table td.tn-name > .tn-cell, table.tn-table td.tn-end > .tn-cell { display:flex; align-items:center; gap:6px; }
  table.tn-table td.tn-name .tn-ellipsis { flex:1 1 8rem; white-space:normal; overflow:visible; text-overflow:clip; }
  table.tn-table td[data-label="Property"] .tn-ellipsis { white-space:normal; overflow:visible; text-overflow:clip; }
  table.tn-table td.tn-name .ds-edit-hover { flex:0 0 auto; }
  /* Date plus the 60-day flag stay fully visible. The date ellipsizes only after the flag has its space. */
  table.tn-table td.tn-end .tn-ellipsis { flex:1 1 6.5rem; min-width:6.5rem; }
  table.tn-table td.tn-end .tn-flag { flex:0 0 auto; }
  table.tn-table td.tn-date { overflow:hidden; text-overflow:ellipsis; }
  table.tn-table td.num { width:1%; }
}
@media (max-width:1359px) and (min-width:900px) {
  table.tn-table col.c-dep { width:0; }
  table.tn-table .tn-deposit { display:none; }
  /* Two lines, then an ellipsis. The full string stays in the element for assistive tech, and title is the tooltip. */
  table.tn-table td.tn-name .tn-ellipsis,
  table.tn-table td.tn-prop .tn-ellipsis {
    display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2;
    overflow:hidden; white-space:normal; overflow-wrap:break-word;
  }
}
/* 900–1279px: the content column is about 658px at a 900px viewport. Fix the table
   to that wrap. Unit joins Lease start and Deposit held in the expand row so the
   tenant name can be at least 10rem. Address stays, clamped to two lines. Rent and
   Balance keep a fixed width. */
@media (max-width:1279px) and (min-width:900px) {
  table.ds-table.tn-table { table-layout:fixed; width:100%; }
  table.tn-table col.c-x { width:44px; }
  table.tn-table col.c-prop { width:5.5rem; }
  table.tn-table col.c-unit,
  table.tn-table col.c-start,
  table.tn-table col.c-dep { width:0; }
  table.tn-table col.c-end { width:7rem; min-width:0; }
  table.tn-table col.c-rent { width:6rem; }
  table.tn-table col.c-bal { width:9.5rem; }
  table.ds-table.compact.tn-table > tbody > tr.ds-row > td.tn-start,
  table.ds-table.compact.tn-table > tbody > tr.ds-row > td.tn-deposit,
  table.ds-table.compact.tn-table > tbody > tr.ds-row > td.tn-unit,
  table.tn-table thead th.tn-start,
  table.tn-table thead th.tn-deposit,
  table.tn-table thead th.tn-unit {
    display:table-cell; width:0; max-width:0; min-width:0; padding:0; border-width:0;
    overflow:hidden; visibility:hidden;
  }
  /* The unit cell is collapsed, so its clipped label is what assistive tech reads. */
  table.tn-table td.tn-unit > .sr-only { visibility:visible; }
  table.ds-table.compact.tn-table > tbody > tr.ds-row > td.tn-name { min-width:10rem; overflow:hidden; }
  table.ds-table.compact.tn-table > tbody > tr.ds-row > td.tn-prop { min-width:0; overflow:hidden; }
  table.tn-table td.tn-name { position:relative; }
  table.tn-table td.tn-name .ds-edit-hover { position:absolute; right:2px; top:4px; }
  table.tn-table td.tn-end .tn-ellipsis {
    min-width:0; flex:1 1 auto; white-space:normal; overflow:visible; text-overflow:clip;
  }
  table.tn-table td.tn-end > .tn-cell { flex-wrap:wrap; }
  table.tn-table thead th { white-space:normal; line-height:1.15; }
}
@media (min-width:1280px) {
  table.tn-table td.tn-unit > .sr-only { display:none; }
}
@media (max-width:899px) {
  table.tn-table td.tn-unit > .sr-only { display:none; }
  .ds-table-wrap.tn-wrap { overflow:visible; }
  table.ds-table.stack.tn-table > thead { display:none; }
  table.ds-table.stack.tn-table, table.ds-table.stack.tn-table > tbody { display:block; width:100%; }
  table.ds-table.stack.tn-table > tbody > tr.ds-row {
    display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 12px;
    padding:12px 16px; height:auto; border-bottom:1px solid var(--ds-slate-200); border-left:4px solid transparent;
  }
  table.ds-table.stack.tn-table > tbody > tr.tone-due { border-left-color:var(--ds-due-bar); }
  table.ds-table.stack.compact.tn-table > tbody > tr.ds-row > td {
    display:block; height:auto; max-height:none; padding:0; border:0; width:auto;
    white-space:normal; overflow:visible; text-overflow:clip; line-height:1.35;
  }
  table.ds-table.stack.compact.tn-table > tbody > tr.ds-row > td[data-label]::before {
    content:attr(data-label) " "; font-size:var(--ds-text-xs); color:var(--ds-slate-600); font-weight:600;
  }
  table.ds-table.stack.compact.tn-table > tbody > tr.ds-row > td.full { grid-column:1 / -1; }
  table.ds-table.stack.compact.tn-table > tbody > tr.ds-row:has(> td.ds-x) { grid-template-columns:minmax(0,1fr) auto; }
  table.ds-table.stack.compact.tn-table > tbody > tr.ds-row:has(> td.ds-x) > td { grid-column:1 / -1; }
  table.ds-table.stack.compact.tn-table > tbody > tr.ds-row:has(> td.ds-x) > td.ds-x {
    grid-column:2; grid-row:1; width:auto; padding:0;
  }
  table.ds-table.stack.tn-table > tbody > tr.ds-row > td.tn-name,
  table.ds-table.stack.tn-table > tbody > tr.ds-row > td.tn-end { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
  table.tn-table .tn-ellipsis { display:inline; white-space:normal; overflow:visible; text-overflow:clip; }
  table.ds-table.stack.tn-table > tbody > tr.ds-detail[hidden] { display:none; }
  table.ds-table.stack.tn-table > tbody > tr.ds-detail:not([hidden]) { display:block; }
  table.ds-table.stack.tn-table > tbody > tr.ds-detail > td { display:block; height:auto; white-space:normal; overflow:visible; }
  table.tn-table .tn-deposit { display:block; }
  /* Dates and badges stay one line. Later than the stacked-cell white-space:normal above, and more specific than
     the phone .ds-badge { white-space:normal } in ds.css (app.css loads first). */
  table.ds-table.stack.compact.tn-table > tbody > tr.ds-row > td.num,
  table.ds-table.stack.compact.tn-table > tbody > tr.ds-row > td.tn-date,
  table.tn-table td.tn-end .tn-ellipsis,
  table.tn-table .ds-badge { white-space:nowrap; }
}

/* Phone filter toolbar (2026-10-24). Tenants only. Other sticky bars stay as ds.css wrote them. */
@media (max-width:640px) {
  main.tn-page .ds-sticky-bar { min-width:0; max-width:100%; }
  main.tn-page .ds-sticky-bar .ds-filters {
    flex-wrap:wrap; overflow:visible; min-width:0; max-width:100%; width:100%;
  }
  main.tn-page .ds-sticky-bar .ds-filters label { flex:1 1 100%; min-width:0; max-width:100%; }
  main.tn-page .ds-sticky-bar .ds-filters select,
  main.tn-page .ds-sticky-bar .ds-filters input:not([type=checkbox]) { min-width:0; max-width:100%; width:100%; }
  main.tn-page .ds-sticky-bar .ds-filters .ds-filter-actions {
    margin-left:0; flex:1 1 100%; width:100%; max-width:100%; min-width:0;
  }
  main.tn-page .ds-sticky-bar .ds-filters .ds-filter-actions .ds-btn { flex:1 1 auto; justify-content:center; }
  main.tn-page .ds-sticky-bar .ds-filters label.ds-check {
    flex-direction:row; align-items:center; flex:0 0 auto; width:auto; min-width:0; max-width:none; white-space:nowrap;
  }
  main.tn-page .ds-sticky-bar .ds-filters label.ds-check input {
    width:auto; min-width:0; max-width:none; min-height:0;
  }
}

/* Phone (mobile-roles-1103): the Project dropdown on Projects > Photos / Schedule must not push the page wider than the screen. */
.prj-task-filters .ff-filter-field, .prj-photo-filters .ff-filter-field { min-width: 0; max-width: 100%; }
.prj-task-filters select, .prj-photo-filters select { max-width: 100%; box-sizing: border-box; }

/* Expenses filters on phones (staging rerun 2026-11-09, R1): one full-width filter per row. Without the wrap, the
   sticky bar's single scrolling row (ds.css) squeezes every filter to 0px at 390px. */
@media (max-width:640px) {
  form.ds-filters.txn-filters { flex-wrap:wrap; overflow-x:visible; }
  form.ds-filters.txn-filters label { flex:1 1 100%; min-width:0; max-width:100%; }
  form.ds-filters.txn-filters select,
  form.ds-filters.txn-filters input:not([type=checkbox]):not([type=hidden]) { min-width:0; max-width:100%; width:100%; }

/* Full email address with a Copy button (tenant list expand row, tenant page, lease page). 2026-10-26, reworked 2026-10-27.
   The address sits on its own full-width line, with the Copy button right after it on the last line (stacked label on the
   tenant page, a row spanning both columns on the lease page, the whole expand-row width on the tenant list). It breaks only where templates/leasing/_email_copy.html puts a
   <wbr> (after "@" and after dots), never mid-word. No break-all and no overflow-wrap:anywhere; break-word is only the
   last resort for one unbroken piece that is wider than the card. The full address is also the hover title. */
.email-full { display:block; max-width:100%; min-width:0; }
.email-full-text { min-width:0; white-space:normal; overflow-wrap:break-word; word-break:normal; hyphens:none; }
.email-copy { all:unset; display:inline-block; vertical-align:middle; margin-left:.4rem; cursor:pointer; font-size:12px; line-height:1; font-weight:600; color:var(--brand);
  white-space:nowrap; border:1px solid var(--line); background:var(--panel); border-radius:6px; padding:.28rem .45rem; }
.email-copy:hover, .email-copy:focus-visible { background:var(--brand-soft); }
.email-copy:focus-visible { outline:2px solid var(--brand); outline-offset:1px; }
.tn-expand dd:has(.email-full), .tn-expand .tn-email dd { overflow:visible; white-space:normal; text-overflow:clip; }
.tn-expand .tn-email { grid-column:1 / -1; }
.ds-kv td.kv-email { overflow-wrap:normal; word-break:normal; }
.ds-kv .kv-email-label th { padding-bottom:0; }
.ds-kv .kv-email-row > td { border-top:0; padding-top:.25rem; }

/* Tenant page */
.tp-name { overflow-wrap:anywhere; }
.tp-meta { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; }
.tp-where { overflow-wrap:anywhere; }
.tp-grid { align-items:start; }
.tp-kv th { white-space:nowrap; vertical-align:top; }
.tp-kv td, .tp-wrap { overflow-wrap:anywhere; min-width:0; }
.tp-scroll { max-height:28rem; overflow:auto; }
.tenant-link { color:inherit; text-decoration:underline; text-decoration-color:var(--line-strong); text-underline-offset:2px; }
.tenant-link:hover { color:var(--brand); text-decoration-color:currentColor; }
@media (max-width:600px) {
  .tp-kv th { white-space:normal; width:38%; }
  .tp-tabs a { flex:1 0 auto; text-align:center; }
}

/* Tenant page: Invite tenant (tenant-portal-1027) */
.tp-invite{margin:-4px 0 14px;padding:10px 12px;border:1px solid var(--ds-slate-200);border-radius:10px;background:var(--ds-surface)}
.tp-invite-state{margin:0;font-size:.9rem;color:var(--ds-slate-600)}
.tp-invite-result{margin-top:8px}
.tp-invite-msg{margin:0 0 6px}
.tp-invite-link{display:flex;gap:8px;align-items:center}
.tp-invite-link input{flex:1 1 auto;min-width:0;font:inherit;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.85rem;padding:8px 10px;border:1px solid var(--ds-slate-200);border-radius:8px;background:var(--ds-bg);color:var(--ds-slate-900,inherit)}
.tp-invite-note{margin:6px 0 0;font-size:.85rem}
.tp-invite-err{margin:6px 0 0;color:var(--ds-late);font-weight:600}
.tp-invite-form{display:inline}
@media (max-width:640px){.tp-invite-link{flex-wrap:wrap}.tp-invite-link input{flex-basis:100%}}
/* Edit a Receipts row (2026-10-29): the edit form, the confirm preview and the edit history. */
.rowedit-table { width:100%; border-collapse:collapse; margin:.4rem 0 .8rem; }
.rowedit-table th, .rowedit-table td { text-align:left; padding:.4rem .55rem; border-bottom:1px solid var(--line); font-size:.9rem; vertical-align:top; }
.rowedit-table thead th { font-size:.78rem; text-transform:uppercase; letter-spacing:.03em; color:var(--muted); }
.rowedit-table tr.on-entry td strong { color:var(--ink); }
.rowedit-effects { margin:.2rem 0 .9rem; padding-left:1.2rem; display:flex; flex-direction:column; gap:.3rem; font-size:.92rem; }
.rowedit-preview { border:1px solid var(--warn); border-radius:10px; padding:.8rem 1rem; background:var(--panel); }
.rowedit-history { margin-top:1.4rem; }
.rowedit-confirm .check-row { margin:.4rem 0 .7rem; }
@media (max-width: 640px) {
  .rowedit-table, .rowedit-table tbody, .rowedit-table tr, .rowedit-table th, .rowedit-table td { display:block; width:100%; box-sizing:border-box; }
  .rowedit-table thead { position:absolute; left:-9999px; }
  .rowedit-table tr { border:1px solid var(--line); border-radius:8px; margin:.45rem 0; padding:.25rem .15rem; }
  .rowedit-table th, .rowedit-table td { border:0; padding:.2rem .5rem; font-size:.88rem; }
  .rowedit-table td[data-label]::before { content:attr(data-label) ": "; color:var(--muted); font-size:.78rem; }
  .rowedit-table td:empty, .rowedit-table td.blank { display:none; }
  .rowedit-table th[scope=row] { font-weight:700; }
}

/* New project, one flow (roadmap item 1, 2026-11-20): four numbered parts; the Rehab part shows only for Owned / Rehab. */
.np-form fieldset.np-part { border:1px solid var(--line); border-radius:var(--radius, 8px); margin:0 0 .9rem; padding:.6rem .9rem .9rem; min-width:0; }
.np-form fieldset.np-part legend { font-weight:600; font-size:.95rem; padding:0 .35rem; display:inline-flex; align-items:center; gap:.4rem; }
.np-n { display:inline-grid; place-items:center; width:1.4rem; height:1.4rem; border-radius:50%; background:var(--accent); color:var(--panel); font-size:.78rem; }
.np-form:has(select[name="current_phase"] option[value="owned_rehab"]:not(:checked)) fieldset.np-rehab { display:none; }
.np-note { margin:.1rem 0 .6rem; }
.np-dup { margin:0 0 1rem; padding:.8rem 1rem; }
.np-dup h2 { font-size:1rem; margin:0 0 .5rem; display:flex; gap:.4rem; align-items:center; }
.np-dup-list { list-style:none; margin:0 0 .5rem; padding:0; display:grid; gap:.5rem; }
.np-dup-list li { display:flex; flex-wrap:wrap; gap:.3rem .6rem; align-items:center; }
.np-dup-acts { display:inline-flex; gap:.4rem; flex-wrap:wrap; margin-left:auto; }
.pj-waiting { margin:0 0 1rem; padding:.8rem 1rem; }
.pj-waiting h2 { font-size:1rem; margin:0; }
.pj-waiting-note { margin:.2rem 0 0; }
.pj-waiting ul { margin:.4rem 0 0; padding:0; list-style:none; display:grid; gap:.4rem; }
.pj-waiting li { display:flex; flex-wrap:wrap; gap:.3rem .6rem; align-items:center; }
