/* HomeslamPM — Revision 4 stylesheet. ONE look: "Site" (dark professional,
   field-use) — the direction Jason approved. Structure on a 4/8px spacing
   grid, strict 4-size type scale (--t-xs/sm/md/lg), 48px touch targets for
   gloves-and-sunlight, age green/yellow/red as the only operational color
   (3px left bar + colored day numeral), stage as typographic labels. */

:root {
  --bg: #14171a;              /* true dark neutral, no purple tint */
  --surface: #1d2126;
  --ink: #e8ebee; --ink-2: #aab3bc; --ink-3: #737e88;
  --line: #2c3339;
  --accent: #6b9bc3;          /* steel blue */
  --on-accent: #10141a;
  --age-green-c: #55a374;     /* desaturated for dark */
  --age-yellow-c: #c9a23e;
  --age-red-c: #c9605a;
  --t-xs: 12px; --t-sm: 13.5px; --t-md: 16px; --t-lg: 19px;
  --font: -apple-system, "Segoe UI", Roboto, "Inter", sans-serif;
  --mono: ui-monospace, Consolas, monospace;
  --radius: 8px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset;
  --tap: 48px;
  --header-bg: #101317; --header-ink: #e8ebee;
  --toast-bg: #262c33; --toast-ink: #e8ebee;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.45;
  background: var(--bg); color: var(--ink);
  padding-bottom: 72px;
}
button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; }

/* numerals that must align: counts, day clocks, money */
.agetag, .days, .bignum, .sheet-days, .sheet-date, .costline b,
.money-owner b { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
header {
  position: sticky; top: 0; z-index: 30;
  background: var(--header-bg); color: var(--header-ink);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
/* Rev 7 desktop fix: header rows and tab links share main's centered
   max-width column, so chrome and content form ONE column at any width —
   no full-bleed brand/tabs floating away from a centered body. */
.hrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: 760px; margin-inline: auto; }
.hrow.sub { margin-top: 4px; min-height: 24px; }
.brand { font-weight: 700; font-size: var(--t-md); letter-spacing: .02em; }
/* Rev 18-icons: sign mark on a white tile (PNG is on white; CSS just rounds it),
   reads like a browser-tab icon on the navy header. No border, no layout shift
   (explicit 26x26 in the markup reserves the space before the asset loads). */
.header-logo { width: 26px; height: 26px; border-radius: 5px; flex-shrink: 0; display: block; }
.proto {
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .08em;
  border: 1px solid var(--line); color: var(--ink-2);
  border-radius: 4px; padding: 1px 6px; text-transform: uppercase;
}
.spacer { flex: 1; }
header select {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 8px; font-size: var(--t-sm); min-height: 36px;
}
.syncstatus { font-size: var(--t-xs); color: var(--ink-3); letter-spacing: .02em; }
.syncstatus.off { color: var(--age-yellow-c); }

/* ---------- tabs ---------- */
nav.tabs {
  position: sticky; top: var(--header-h, 84px); z-index: 25;
  display: flex; justify-content: center;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
nav.tabs a {
  /* v3.25.7: equal-width tabs on every screen. flex-basis 0 + min-width 0 makes
     each tab exactly (row / N) wide regardless of label length — was 1 1 190px
     with default min-width:auto, so wider labels ("Handyman"/"Calendar") claimed
     their text width and rendered crunched/unequal at 390px. */
  flex: 1 1 0; min-width: 0; max-width: 190px; text-align: center; padding: 13px 0; min-height: var(--tap);
  color: var(--ink-2); text-decoration: none;
  font-weight: 600; font-size: var(--t-sm);
  border-bottom: 2px solid transparent; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
nav.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

main { padding: 12px; max-width: 760px; margin: 0 auto; }

/* ---------- primitives ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px;
  box-shadow: var(--shadow);
}
a.cardlink { text-decoration: none; color: inherit; display: block; }
a.cardlink:active .card, a.cardlink:active .tB-card,
a.cardlink:active .sheet-ghead { filter: brightness(.97); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--ink-2); font-size: var(--t-sm); }
.addr { font-weight: 650; font-size: var(--t-md); }
.section-title {
  font-weight: 650; font-size: var(--t-xs); margin: 20px 2px 8px;
  text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3);
}

/* stage: typographically restrained — uppercase label, no pill fill */
.stage {
  font-size: var(--t-xs); font-weight: 650; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-2); white-space: nowrap;
}
.chip {
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-3); white-space: nowrap;
}
.days { font-size: var(--t-xs); color: var(--ink-3); font-weight: 500; }

/* ---------- age system (the only operational color) ---------- */
.age-green  { --age-c: var(--age-green-c); }
.age-yellow { --age-c: var(--age-yellow-c); }
.age-red    { --age-c: var(--age-red-c); }
.tB-card[class*="age-"], .card[class*="age-"] { border-left: 3px solid var(--age-c); }
.agetag { font-weight: 700; font-size: var(--t-md); white-space: nowrap; }
.agetag.green  { color: var(--age-green-c); }
.agetag.yellow { color: var(--age-yellow-c); }
.agetag.red    { color: var(--age-red-c); }

/* v3.23.6: Trello due-date signal chip (card, only when overdue/soon) + the
   plain due line (detail) + label chips (neutral chip + Trello-color dot) */
.duechip {
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .04em; white-space: nowrap;
  padding: 1px 7px; border-radius: 999px; margin-right: 6px;
}
.duechip.red { color: var(--age-red-c); border: 1px solid var(--age-red-c); }
.duechip.yellow { color: var(--age-yellow-c); border: 1px solid var(--age-yellow-c); }
.duechip.done { color: var(--ink-3); border: 1px solid var(--line); } /* v3.25.0: completed due — muted, never red */
.dueline { font-size: var(--t-sm); margin-top: 4px; }

/* v3.25.0: Calendar Rev 2 — the agenda. Reuses the app's dark theme vars. */
.calhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 2px 10px; }
.caltitle { font-size: var(--t-lg); font-weight: 700; color: var(--ink); }
.calmeta { display: flex; align-items: center; gap: 10px; }
.calday { font-size: var(--t-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3); margin: 14px 2px 6px; }
.calday.overdue { color: var(--age-red-c); }
.calrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: var(--tap);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 6px; cursor: pointer; }
.calrow:active { background: var(--header-bg); }
.caltime { flex: 0 0 auto; min-width: 68px; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); }
.calbody { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.calempty { text-align: center; padding: 32px 12px; }
.labelchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.labelchip {
  display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-xs); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; background: var(--surface);
}
.labeldot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ---------- stub labels ---------- */
.stub {
  display: inline-block; font-size: var(--t-xs); font-weight: 500;
  border: 1px dashed var(--line); color: var(--ink-3);
  border-radius: 4px; padding: 3px 8px; margin: 2px 0;
  letter-spacing: .02em;
}

/* ---------- Work Order screenshot panel ---------- */
.wo-card { font-size: var(--t-sm); }
.wo-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 0; border-top: 1px solid var(--line); min-height: 32px;
}
.wo-row:first-child { border-top: 0; }
.wo-label { flex: 0 0 40%; max-width: 160px; color: var(--ink-3); font-weight: 500; }
.wo-val { flex: 1 1 auto; white-space: pre-wrap; word-break: break-word; }
.wo-row input { flex: 1 1 auto; min-width: 0; }
.wo-edit {
  flex: 0 0 auto; background: none; border: 0; cursor: pointer;
  color: var(--ink-3); font-size: var(--t-sm); padding: 0 4px; min-height: 28px;
}
.wo-corrected {
  display: inline-block; font-size: var(--t-xs); color: var(--accent);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-left: 4px;
}
.wo-inline { font-size: var(--t-xs); margin-left: 6px; }
.wo-issues { margin: 6px 0 0; padding-left: 18px; color: var(--age-yellow-c); font-size: var(--t-xs); }
.wo-foot { margin-top: 8px; font-size: var(--t-xs); }
.wo-fail { color: var(--age-red-c); }
.wo-fail b { color: var(--age-red-c); }
.wo-errclass { font-family: ui-monospace, monospace; font-size: var(--t-xs); color: var(--ink-3); }

/* ---------- Rev F: quote → compact scope ---------- */
.quote-err { color: var(--age-red-c); font-size: var(--t-xs); }
.quote-detail { margin-top: 4px; }
.quote-detail summary { cursor: pointer; color: var(--ink-3); }
.quote-detail .quote-pre { color: var(--ink-2); max-height: 160px; }
.quote-preview { margin-top: 8px; border-left: 3px solid var(--accent); }
.quote-pre {
  white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, "Cascadia Code", Menlo, monospace;
  font-size: var(--t-xs); line-height: 1.5; margin: 8px 0 0; max-height: 320px; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px;
}
/* Rev Z: cosmetic-warning flags on the quote preview (warn = the age-yellow
   token; the rgba values are #c9a23e at low alpha — a CSS var can't carry it) */
.quote-warnbanner {
  margin: 8px 0 0; padding: 6px 10px; font-size: var(--t-xs); color: var(--age-yellow-c);
  border: 1px solid var(--age-yellow-c); border-radius: 6px; background: rgba(201, 162, 62, .08);
}
.quote-line-flag {
  display: inline-block; width: 100%; background: rgba(201, 162, 62, .16);
  box-shadow: inset 2px 0 0 var(--age-yellow-c); border-radius: 3px;
}

/* ---------- Rev G: PM → Profit sync status (owner-only) ---------- */
.profit-sync { margin-top: 6px; font-size: var(--t-xs); }
.profit-sync.ps-ok { color: var(--age-green-c); }
.profit-sync.ps-fail { color: var(--age-red-c); }
.profit-sync .ps-warn { color: var(--age-yellow-c); }

/* ---------- money ---------- */
.money-owner {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 6px; padding: 8px 12px; margin-top: 8px; font-size: var(--t-sm);
  background: var(--surface);
}
.money-owner b { color: var(--ink); font-weight: 700; }
.costline { font-size: var(--t-sm); color: var(--ink-2); }
.costline b { color: var(--ink); }
.blackout {
  border: 1px dashed var(--line); border-radius: 6px;
  padding: 8px 12px; margin-top: 8px; font-size: var(--t-sm); color: var(--ink-3);
}

/* ---------- search ---------- */
.search {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; margin-bottom: 12px; background: var(--surface);
  color: var(--ink); min-height: var(--tap); font-size: var(--t-md);
}
.search::placeholder { color: var(--ink-3); }

/* ---------- job list: grouped cards (formerly View B — the keeper) ---------- */
.stagehead {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: var(--tap);
  background: none; border: none; padding: 10px 4px 6px; text-align: left;
}
.stagehead .stage { color: var(--ink); }
.stagehead .muted { font-size: var(--t-xs); }
.tB-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 6px;
  box-shadow: var(--shadow);
}

/* ---------- sub call sheet — Rev 9 hierarchy: band → tight children → gap --
   Each job is its own card. The header is a banded, sticky, one-step-larger
   address strip; sub rows are regular-weight, slightly smaller, indented
   children with tight spacing. The gap BETWEEN groups is clearly larger than
   the gap WITHIN one. Screenshot-first, always. */
.sheet-group {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px; /* between-jobs gap ≫ within-job spacing */
  padding-bottom: 4px;
}
/* Rev T (owner ruling, post-Rev-S walkthrough): the group headers are NOT
   sticky — normal document flow, scrolling with the list. The Rev 9 pinned-
   header idiom read as "choppy" on short one-row groups (headers spent half
   of each group's scroll in the push-off slide), so stickiness was removed
   deliberately. top/z-index went with position: sticky — a z-index left on
   a static element silently re-activates under flex/grid/positioning. */
a.gheadlink {
  border-radius: 7px 7px 0 0;
}
.sheet-ghead {
  display: flex; align-items: baseline; gap: 8px; min-height: var(--tap);
  padding: 11px 12px; margin-bottom: 2px;
  background: #262c34; /* elevated band — tone shift, not a colored bar */
  border-bottom: 1px solid var(--line);
  border-radius: 7px 7px 0 0;
  white-space: nowrap; overflow: hidden;
}
.sheet-ghead b { font-size: var(--t-lg); font-weight: 700; color: #ffffff; }
.sheet-ghead .muted { font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; }
.sheet-sub {
  display: grid; grid-template-columns: 1fr 108px 50px 42px;
  align-items: center; gap: 8px; width: 100%; min-height: 44px;
  padding: 0 12px 0 24px; /* children indent from the header's left edge */
  background: none; border: none; text-align: left;
}
.sheet-trade {
  font-size: var(--t-md); font-weight: 400; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.sheet-date { font-size: var(--t-xs); color: var(--ink-3); text-align: right; white-space: nowrap; }
.sheet-days { font-weight: 700; font-size: var(--t-md); text-align: right; white-space: nowrap; }
.sheet-days.green { color: var(--age-green-c); }
.sheet-days.yellow { color: var(--age-yellow-c); }
.sheet-days.red { color: var(--age-red-c); }
/* Rev U: the FULL sub note, shown only in the expanded row state (the
   collapsed row keeps its one-line ellipsis). Wraps freely; indented to
   the children's inset so it reads as part of the opened row. */
.subnote-full {
  padding: 2px 12px 6px 24px;
  font-size: var(--t-xs); color: var(--ink-3);
  white-space: normal; overflow-wrap: anywhere;
}
/* Rev V: the one-tap copy control on the expanded row — same indent as the
   note block; renders on EVERY expanded sub (owner ruling), noted or not. */
.subcopy { padding: 0 12px 4px 24px; }
/* Rev W: the DELIBERATE second tap — visually distinct from the plain Copy
   so a lockbox code never leaves by reflex. Renders only when a code exists. */
.subcopy .subcopy-code { margin-left: 18px; color: var(--age-yellow-c); }

/* Rev 8: explicit status controls — reveal, confirm, linger, undo */
.subwrap { overflow: hidden; }
.sheet-sub.active, .subchip.active { background: rgba(107, 155, 195, .08); }
.subctl {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 4px 12px 10px 24px; animation: pop .15s ease-out;
}
.card .subctl { padding: 4px 4px 10px; }
.confirm-q { font-size: var(--t-sm); font-weight: 600; color: var(--ink); }
.sheet-sub.lingerdone { grid-template-columns: 1fr 108px 100px; }
.struck { text-decoration: line-through; color: var(--ink-3) !important; }
.sheet-sub .undo { min-height: 40px; justify-self: end; }
.subwrap.leaving, .sheet-sub.leaving {
  transition: opacity .35s ease, max-height .35s ease, padding .35s ease;
  opacity: 0; max-height: 0 !important; padding-top: 0; padding-bottom: 0;
}
.subwrap { max-height: 200px; transition: max-height .35s ease; }

.sheet-filters { display: flex; gap: 8px; }
.flab {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
  font-size: var(--t-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-3);
}
.flab select {
  border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 8px; font-size: var(--t-sm); background: var(--surface);
  color: var(--ink); min-height: var(--tap); width: 100%;
}

/* sub status: small dot + uppercase label, age palette only.
   NEEDED reads stronger than SCHEDULED — needed items are the action items. */
.st {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--t-xs); font-weight: 650; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-2); white-space: nowrap;
}
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.st.needed { color: var(--ink); }
.st.scheduled { color: var(--ink-3); }
.st.needed::before { background: var(--age-red-c); }
.st.scheduled::before { background: var(--age-yellow-c); }
.st.done::before { background: var(--age-green-c); }

/* sub tracker rows */
.subchip {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: var(--tap);
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); padding: 10px 12px; margin-bottom: 4px; text-align: left;
  cursor: pointer; /* Rev 17: it's a div now — inputs can live inside it */
}
.subchip b { font-size: var(--t-md); font-weight: 650; }
.subchip .st { margin-left: auto; }

/* ---------- materials door row on job detail (Rev 5) ---------- */
.doorrow { display: flex; align-items: center; gap: 8px; min-height: var(--tap); }
.doorrow b { font-size: var(--t-md); }
.doorrow .chev { color: var(--ink-3); font-size: var(--t-lg); line-height: 1; }

/* ---------- full-screen materials page (Rev 5; pinning fixed Rev 6) ----------
   The page header + jump strip form ONE sticky block at top:0. On this route
   the app header un-sticks (scrolls away) and the tabs hide, so no measured
   offsets exist to go stale — the strip cannot land mid-list. */
body.matpage-open header { position: static; }
body.matpage-open nav.tabs { display: none; }

.matpin {
  position: sticky; top: 0; z-index: 25;
  background: var(--bg);
  margin: -12px -12px 0; padding: 8px 12px 0; /* bleed to main's edges so content can't peek behind */
  border-bottom: 1px solid var(--line);
}
.matpage-head { display: flex; align-items: center; gap: 10px; padding: 2px 0 6px; }
.matpage-head .back { margin: 0; font-size: 24px; min-width: 40px; min-height: 40px; justify-content: center; }
.matpage-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.matpage-title b { font-size: var(--t-lg); }
.syncstatus.mini { font-size: var(--t-xs); color: var(--ink-3); text-align: right; }
.syncstatus.mini.off { color: var(--age-yellow-c); }

.jumpstrip {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px;
  scrollbar-width: none;
}
.jumpstrip::-webkit-scrollbar { display: none; }
.jumpstrip button {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 8px 14px; font-size: var(--t-xs); font-weight: 600;
  white-space: nowrap; min-height: 44px; flex-shrink: 0;
}

/* flat notes-page sections: no card nesting, hairline rules between */
.matcat.flat {
  border-bottom: 1px solid var(--line);
  padding: 8px 0 12px; margin-bottom: 4px;
  scroll-margin-top: calc(var(--matpin-h, 116px) + 8px);
}
.matcat.flat:last-child { border-bottom: none; }
.matcat.flat h4 { min-height: 32px; display: flex; align-items: center; }
.catedit {
  flex: 1; min-width: 0; border: none; border-bottom: 1px solid var(--accent);
  outline: none; background: transparent; color: var(--ink);
  font-size: var(--t-md); font-weight: 700; padding: 4px 0;
}

.matfooter {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--header-bg); border-top: 1px solid var(--line);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
}
.matfooter .btn { display: block; width: 100%; max-width: 736px; margin: 0 auto; }
body.matpage-open { padding-bottom: 140px; } /* clear the fixed footer */
body.matpage-open #toasts { bottom: 84px; } /* toasts above the footer */

/* ---------- materials (notes-app parity) ---------- */
.matcat { margin-bottom: 16px; }
.matcat h4 { font-size: var(--t-md); font-weight: 700; margin-bottom: 2px; }
/* Rev 12 line anatomy: box toggles, text edits, swipe deletes. */
.swiperow { position: relative; overflow: hidden; }
.matitem {
  display: flex; align-items: center; gap: 12px; min-height: var(--tap);
  padding: 8px 4px; border-bottom: 1px solid var(--line);
  background: var(--surface); position: relative; z-index: 1;
  transition: transform .15s ease;
}
.swiperow.open .matitem { transform: translateX(-96px); }
.boxwrap { padding: 8px; margin: -8px; flex-shrink: 0; } /* generous but bounded box target */
.matitem input[type=checkbox] { width: 22px; height: 22px; display: block; accent-color: var(--accent); }
.matitem .ittext { flex: 1; font-size: var(--t-md); }
.matitem .ittext { padding: 8px 0; margin: -8px 0; min-width: 0; word-break: break-word; }
.matitem.done .ittext { text-decoration: line-through; color: var(--ink-3); }
.matitem.noBox { padding-left: 8px; }
.itemedit {
  flex: 1; min-width: 0; border: none; border-bottom: 1px solid var(--accent);
  outline: none; background: transparent; color: var(--ink);
  font-size: var(--t-md); padding: 8px 0;
}
.swipedel {
  position: absolute; top: 0; right: 0; bottom: 1px; width: 96px; z-index: 0;
  border: none; background: var(--age-red-c); color: #fff; font-weight: 700;
}
.hoverdel {
  display: none; border: none; background: none; color: var(--ink-3);
  font-size: 16px; padding: 8px; min-height: 40px; flex-shrink: 0;
}
@media (hover: hover) {
  .matitem:hover .hoverdel { display: block; }
  .hoverdel:hover { color: var(--age-red-c); }
}
.matitem.delstrip {
  color: var(--ink-3); font-size: var(--t-sm); background: var(--bg);
}
.trellodesc { white-space: pre-wrap; font-size: var(--t-sm); color: var(--ink-2); word-break: break-word; }
.attthumb {
  width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); display: block;
}
.newitem { display: flex; align-items: center; gap: 12px; padding: 6px 4px; min-height: var(--tap); }
.newitem .ghostbox { width: 22px; height: 22px; flex-shrink: 0; border: 1.5px dashed #3a434c; border-radius: 4px; }
.newitem input {
  flex: 1; border: none; outline: none; background: transparent;
  padding: 8px 0; font-size: var(--t-md); color: var(--ink);
}
.newitem input::placeholder { color: var(--ink-3); }

.notdropped {
  border: 1px solid var(--line); border-left: 3px solid var(--age-red-c);
  border-radius: var(--radius); background: var(--surface);
  padding: 12px 16px; margin-bottom: 8px;
}
.notdropped b { color: var(--age-red-c); font-size: var(--t-sm); text-transform: uppercase; letter-spacing: .07em; }
.notdropped ul { margin: 6px 0 0 18px; font-size: var(--t-sm); }
/* v3.23.5: not-dropped collapse header (Stage-aging chevron idiom) */
.ndhead {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: var(--tap);
  background: none; border: none; padding: 0; text-align: left; cursor: pointer;
}
.ndhead .muted { font-size: var(--t-xs); }

/* v3.23.5: Key Word scope search — second search below the address search */
.scopesearch .search { margin-bottom: 8px; }
.scopeopts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.scopeseg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.segbtn {
  background: var(--surface); border: none; color: var(--ink-2);
  padding: 8px 12px; font-size: var(--t-xs); cursor: pointer;
}
.segbtn + .segbtn { border-left: 1px solid var(--line); }
.segbtn.on { background: var(--accent); color: #fff; }
.scopesnip { margin-top: 6px; font-size: var(--t-sm); color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
mark.scopehl { background: rgba(201, 162, 62, .28); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ---------- attestation + dirty completions ---------- */
.attest-need {
  border: 1px solid var(--line); border-left: 3px solid var(--age-yellow-c);
  border-radius: var(--radius); background: var(--surface);
  padding: 12px 16px; margin-bottom: 8px;
}
.attest-need b { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.attest-done { color: var(--age-green-c); font-size: var(--t-sm); font-weight: 600; }
.dirty {
  border: 1px solid var(--line); border-left: 3px solid var(--age-red-c);
  border-radius: var(--radius); background: var(--surface);
  padding: 12px 16px; margin-bottom: 8px;
}
.dirty ul { margin: 6px 0 0 18px; font-size: var(--t-sm); }
.section-title.alert { color: var(--age-red-c); }

/* ---------- forms & buttons ---------- */
.inline-form { display: flex; gap: 6px; margin-top: 8px; }
.inline-form input, .inline-form select {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 12px; background: var(--surface); color: var(--ink);
  min-height: var(--tap); font-size: var(--t-sm);
}
.btn {
  border: 1px solid var(--accent); border-radius: 6px; padding: 10px 16px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 600; font-size: var(--t-sm); min-height: var(--tap);
}
.btn.ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn.green { background: var(--surface); color: var(--age-green-c); border-color: var(--age-green-c); }
.btn.small { padding: 8px 12px; }
.btn:disabled { opacity: .5; }
.btn-block { width: 100%; margin-top: 8px; }

/* ---------- change orders / expenses ---------- */
.coline { display: flex; gap: 6px; margin-bottom: 6px; }
.coline input.desc { flex: 1; min-width: 0; }
.coline input.amt { width: 96px; }
.coline input {
  border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px;
  background: var(--surface); color: var(--ink); min-height: var(--tap); font-size: var(--t-sm);
}
.co-card {
  border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 12px; margin-bottom: 6px; background: var(--surface);
}
.co-card .row { font-size: var(--t-sm); }
.co-pending { border-left: 3px solid var(--age-yellow-c); }
/* v3.25.17: an UNFINISHED (drafting) CO — dashed rail so it reads as not-yet-submitted, distinct from pending. */
.co-drafting { border-left: 3px dashed var(--ink-2); opacity: 0.95; }
.co-approved { border-left: 3px solid var(--age-green-c); }
/* Rev 18g: sent-back (yellow, like scope send-back) + declined (red) */
.co-sentback { border-left: 3px solid var(--age-yellow-c); }
.co-declined { border-left: 3px solid var(--age-red-c); }
.co-status { font-size: var(--t-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
/* Rev 18g: the permanent owner note on a CO — visible to both roles */
.owner-note {
  margin-top: 6px; padding: 6px 10px; border-radius: 6px;
  background: var(--bg-2, #262c34); font-size: var(--t-sm); line-height: 1.5;
  overflow-wrap: anywhere;
}
.conote-input {
  width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 6px;
  padding: 8px; background: var(--bg); color: var(--ink); font-size: var(--t-sm);
}
.profit-paste {
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  font: var(--t-xs)/1.6 var(--mono);
  border-radius: 6px; padding: 10px 12px; margin-top: 8px;
  white-space: pre-wrap; word-break: break-word;
}

/* ---------- toasts ---------- */
#toasts {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 90;
  display: flex; flex-direction: column; gap: 6px; pointer-events: none;
}
.toast {
  background: var(--toast-bg); color: var(--toast-ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; font-size: var(--t-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
  animation: pop .18s ease-out;
}
.toast.email { border-left: 3px solid var(--accent); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- misc ---------- */
.photo-tag {
  display: inline-block; font-size: var(--t-xs); color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 3px 8px; margin: 2px 4px 2px 0;
}
/* v3.25.30: landscaping photo gallery (owner-only) — before/after split, tiles
   with dates, delete inline. Reuses the CO lightbox for zoom/swipe. */
.lp-split { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.lp-half { flex: 1 1 240px; min-width: 0; }
.lp-head { font-size: var(--t-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-3); margin-bottom: 4px; }
.lp-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-tile { position: relative; width: 92px; }
.lp-tile img { width: 92px; height: 92px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); display: block; cursor: zoom-in; }
.lp-date { display: block; font-size: 10px; color: var(--ink-3); margin-top: 2px; }
.lp-del { padding: 2px 6px; min-height: 26px; font-size: 10px; margin-top: 2px; }
@media (max-width: 560px) { .lp-tile, .lp-tile img { width: 84px; } .lp-tile img { height: 84px; } }

/* v3.25.31: upload-link admin rows — live count is warning-tinted above one,
   because more than one live link is usually not what the owner intended. */
.lp-tokrow { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.lp-live { color: var(--age-green-c); font-weight: 700; font-size: var(--t-xs); }
.lp-live-warn { color: var(--age-yellow-c); font-weight: 700; }

/* v3.25.29: the ✓-verified address marker — deliberately quiet (no pill, no fill).
   It sits inline beside "Copy full address" and adds NO header line. */
.addr-verified {
  font-size: var(--t-xs); font-weight: 600; color: var(--age-green-c, #4caf50);
  margin-left: 6px; white-space: nowrap;
}
.back {
  display: inline-flex; align-items: center; margin-bottom: 8px; min-height: 32px;
  color: var(--accent); text-decoration: none; font-weight: 600; font-size: var(--t-sm);
}
.bignum { font-size: var(--t-lg); font-weight: 700; }
h3.jobhead { font-size: var(--t-lg); font-weight: 700; }
.lockbox {
  display: inline-block; border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg); color: var(--ink);
  padding: 3px 10px; font: 600 var(--t-sm) var(--mono); letter-spacing: .12em;
}
#copyOut .profit-paste { user-select: all; }

/* ---------- Rung 2: re-auth banner ---------- */
.authbanner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  max-width: 760px; margin: 8px auto 0; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--age-yellow-c);
  border-radius: var(--radius); font-size: var(--t-sm);
}
.authbanner input {
  flex: 1; min-width: 120px; border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; background: var(--bg); color: var(--ink); min-height: 40px;
}

/* ---------- Rev 14: themed segmented filter (Manager chips) ----------
   The .tA-sort rules died in the Rev 4 theme cleanup while the markup lived
   on — buttons fell back to the UA's light defaults (Sam's unreadable
   white bars). Site-theme chips: dark surface, readable labels, accent-
   filled selected state. */
.tA-sort {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.tA-sort button {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 8px 14px; min-height: 40px;
  font-size: var(--t-sm); font-weight: 600; white-space: nowrap;
}
.tA-sort button.on {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}
/* .tappable lost its rule in the same cleanup — restore the affordance */
.tappable { cursor: pointer; }

/* v3.25.8: dispatch screenshot-intake button — matches the pill controls */
.landshot {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 6px 12px; min-height: 36px;
  font-size: var(--t-sm); font-weight: 600; white-space: nowrap;
}
.landshot:active { filter: brightness(.97); }
a.cardlink:active .tappable { filter: brightness(.97); }

/* ---------- Rev 14: scope approval lives with the inspection scope ---------- */
.scope-approval { border-left: 3px solid var(--line); }
.sendback-note {
  border: 1px solid var(--line); border-left: 3px solid var(--age-red-c);
  border-radius: 6px; background: var(--bg);
  padding: 8px 12px; margin-top: 8px;
  font-size: var(--t-sm); color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
}

/* ---------- Rev 14: attachment viewer header bar ---------- */
.attbar {
  position: sticky; top: var(--header-h, 84px); z-index: 20;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-bottom: 1px solid var(--line);
  padding: 4px 0 8px; margin-bottom: 8px;
}
.attback {
  border: none; background: none; color: var(--accent);
  font-size: 26px; line-height: 1; font-weight: 600;
  min-width: 44px; min-height: 44px;
}
.attname {
  font-size: var(--t-md); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- Rev 18: per-client code hints ---------- */
.codehint {
  font-size: var(--t-xs); margin-top: 4px; line-height: 1.5;
  overflow-wrap: anywhere; /* ResiPro's phone-number hint wraps, never clips */
}

/* ---------- Rev 18f: refund/return marker ---------- */
.refund-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  border-radius: 4px; background: var(--age-yellow, #b8860b); color: #1a1a1a;
  vertical-align: middle;
}
.co-card.refund { border-left: 3px solid var(--age-yellow, #b8860b); }
b.credit { color: var(--age-yellow, #d0a030); }

/* ---------- Rev 18g: push permission banner + notifications setting ---------- */
.push-setting {
  text-align: center; margin-top: 10px; font-size: var(--t-xs);
  padding: 8px; min-height: 32px; cursor: pointer;
}
/* Rev 18h: dismissible INLINE enable strip (replaced the fixed z-320 overlay). */
.push-strip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; margin: 0 0 10px;
  font-size: var(--t-sm);
}

/* ---------- Rev 18e: overlays (multi-page prompt) + drop-image viewer ---------- */
.pm-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, .62);
  display: flex; align-items: center; justify-content: center;
}
.pm-sheet {
  background: var(--surface, #1b2027); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px; width: min(340px, calc(100vw - 40px));
}
.pm-sheet .btn { min-height: 44px; }
.dropthumb {
  width: 34px; height: 34px; object-fit: cover; border-radius: 4px;
  margin-right: 6px; cursor: pointer; flex-shrink: 0;
}
.pm-overlay.dv { flex-direction: column; background: rgba(0, 0, 0, .92); align-items: stretch; }
.dv-top {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  color: var(--ink, #e8ecf1);
}
.dv-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden; touch-action: none; /* our pointer handlers own gestures */
}
#dvImg, #cpvImg { /* v3.25.19: the CO-photo lightbox shares the drop viewer's image sizing/zoom */
  max-width: 100%; max-height: 100%; object-fit: contain;
  transform-origin: center center; user-select: none; -webkit-user-drag: none;
}
.dv-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  border: none; background: rgba(0, 0, 0, .45); color: #fff;
  font-size: 30px; line-height: 1; min-width: 44px; min-height: 44px;
  border-radius: 8px;
}
.dv-prev { left: 8px; }
.dv-next { right: 8px; }

/* ---------- Rev 17.8: CO photos — PM's own filtered gallery ---------- */
.cophoto-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.cophoto {
  position: relative; display: block; aspect-ratio: 1;
  border-radius: 8px; overflow: hidden; background: var(--bg-2, #262c34);
  border: 1px solid var(--line); text-decoration: none;
}
.cophoto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cophoto .cophoto-fallback {
  display: none; position: absolute; inset: 0;
  align-items: center; justify-content: center; text-align: center;
  font-size: var(--t-xs); padding: 8px;
}
.cophoto.noimg img { display: none; }
.cophoto.noimg .cophoto-fallback { display: flex; }
.cophoto-date {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: var(--t-xs); color: #fff; padding: 8px 6px 4px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65));
}

/* ---------- Rev 17: Sam's field-day batch ---------- */
/* CO summary line (collapsed change-order blocks) */
.cosummary {
  display: flex; align-items: center; gap: 6px; width: 100%; min-height: 44px;
  background: none; border: none; padding: 2px 0; text-align: left;
}
.cosummary .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cogroup {
  font-size: var(--t-xs); font-weight: 650; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-3); margin-top: 8px;
}
.coline select.cocat {
  flex: 1; min-width: 0; border: 1px dashed var(--line); border-radius: 6px;
  padding: 6px 10px; background: var(--bg); color: var(--ink-2);
  min-height: 36px; font-size: var(--t-xs);
}
/* Trello comments mirror */
.commentrow { border-bottom: 1px solid var(--line); padding: 6px 0; }
.commentrow:last-of-type { border-bottom: none; }
.commentclamp {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
/* lockbox chip doubles as the edit affordance (both roles) */
.lockboxbtn { cursor: pointer; border-style: dashed; }
/* sub notes + scheduled dates */
.subnote { font-size: var(--t-xs); color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; text-align: left; }
.subnote.ghost { color: var(--ink-3); border-bottom: 1px dashed var(--line); }
.subnote-edit {
  flex: 1; min-width: 60px; border: none; border-bottom: 1px solid var(--accent);
  outline: none; background: transparent; color: var(--ink); font-size: var(--t-xs); padding: 4px 0;
}
.sheetnote { font-size: 11px; color: var(--ink-3); font-weight: 400; }
.sheetsched { font-size: 10px; color: var(--ink-3); margin-left: 4px; text-transform: none; letter-spacing: 0; }
input.subdate {
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px;
  background: var(--surface); color: var(--ink); min-height: 40px; font-size: var(--t-xs);
}
/* handyman done gate */
.donegate { font-size: var(--t-xs); max-width: 260px; }
/* in-app Field Drop */
.dropframe {
  width: 100%; height: calc(100vh - 220px); min-height: 380px;
  border: 1px solid var(--line); border-radius: 8px; background: #ffffff; display: block;
}

/* ---------- Rev 13: working scope + in-app attachment viewer ---------- */
/* sleek blue link-style action (Copy scope as text, Show more, gallery copy) */
.linkbtn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 8px 0; min-height: 40px;
  margin-right: 16px;
  color: var(--accent); font-size: var(--t-sm); font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.linkbtn:last-child { margin-right: 0; }
.scopetext { cursor: text; }
.scopeclamp {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
}
.scopeta {
  width: 100%; min-height: 160px; resize: vertical;
  border: 1px solid var(--accent); border-radius: 6px;
  background: var(--bg); color: var(--ink);
  padding: 10px 12px; font: inherit; font-size: var(--t-sm); line-height: 1.5;
}
/* v3.25.16: CO photos — line-first tray. Thumbs stream through the entity-scoped
   proxy (or a local data: URI while still held); PM stores no bytes server-side. */
.cophoto-strip { display: flex; gap: 4px; flex-wrap: wrap; margin: 2px 0 6px; }
.cophoto-thumb { object-fit: cover; border-radius: 4px; border: 1px solid var(--line); display: block; }
.cophoto-row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.cophoto-row .cophoto-thumb { flex: 0 0 auto; }        /* thumbnail never shrinks */
.cophoto-body { flex: 1; min-width: 0; }               /* the fix: chips wrap within available width, not one-per-line */
.cophoto-chips { display: flex; flex-wrap: wrap; gap: 4px; }
/* v3.25.21: no-bytes filename fallback — same look as .photo-tag on desktop, but
   a SHRINKABLE, truncating flex child so it never squeezes the chips to a sliver. */
.cophoto-fname { flex: 0 1 auto; min-width: 0; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: inline-block; font-size: var(--t-xs); color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; }
.cophoto-held { font-size: var(--t-xs); color: var(--age-yellow-c); }
/* v3.25.19 addendum: on narrow/mobile viewports the area chips become compact
   wrapping pills (several per line) instead of a full-height skyscraper; the
   Remove button stays inline. Desktop (>560px) is unchanged. */
@media (max-width: 560px) {
  .cophoto-chips .btn.small { min-height: 32px; padding: 4px 10px; font-size: var(--t-xs); font-weight: 600; }
  .cophoto-remove { min-height: 32px; padding: 4px 10px; margin-left: auto; }
  /* v3.25.21: cap the filename so line 1 stays short (filename + Remove).
     Desktop is unaffected (max-width:100% above). */
  .cophoto-fname { max-width: 6.5em; }
  /* v3.25.22: THE fix. A filename-led row (no thumbnail bytes) gave its chip
     body only the sliver of width left between the filename and Remove — too
     narrow for two pills, so they stacked one-per-line. On mobile, break the
     body onto its OWN full-width line (order:3) with filename + Remove sharing
     line 1 (order:2 keeps Remove after the filename, margin-left:auto right-
     aligns it), so the pills wrap across the whole row. Thumbnail-led rows are
     untouched; desktop keeps the single-row layout. */
  .cophoto-row.fname-led .cophoto-body { flex-basis: 100%; order: 3; }
  .cophoto-row.fname-led .cophoto-remove { order: 2; }
}
/* v3.25.19: photos collapse — a summary toggle + per-line count badges. */
.cophoto-summary { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 8px;
  background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font: inherit; font-size: var(--t-sm); cursor: pointer; }
.cophoto-badge { display: inline-block; font-size: var(--t-xs); color: var(--ink-2); margin-left: 6px; white-space: nowrap; }
/* fullscreen CO-photo lightbox — shares .pm-overlay .dv with the drop viewer. */
.cpv-unavail { color: var(--ink-2); font-size: var(--t-sm); text-align: center; padding: 24px; }

/* v3.25.12: the Punch List box is the STAR while the job is in the Punch List
   stage — a left accent rail marks it. Position is fixed (above Scope); only
   this accent + the box's expanded state flip by stage. */
.punchstar { border-left: 3px solid var(--accent); }
.scopeflag {
  border: 1px solid var(--line); border-left: 3px solid var(--age-yellow-c);
  border-radius: 6px; padding: 8px 12px; margin-top: 8px;
  font-size: var(--t-sm); color: var(--ink-2);
}
.attviewer { margin-top: 8px; }
.attfull { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; display: block; }
/* Rev 14.1: PDFs are pdf.js canvases in OUR DOM — no native surface exists
   to cover the header or capture back gestures (the Galaxy trap). */
canvas.pdfpage {
  display: block; width: 100%; height: auto;
  background: #ffffff; border: 1px solid var(--line); border-radius: 8px;
  margin-bottom: 8px;
}

/* Rev 14.1: field diagnostics overlay (5 taps on the PILOT badge) */
#diagOverlay {
  position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 95;
  background: rgba(16, 19, 23, .96); border: 1px solid var(--age-yellow-c);
  border-radius: 8px; color: var(--ink);
}
#diagOverlay pre {
  margin: 0 8px 8px; max-height: 32vh; overflow: auto;
  font: 10.5px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all;
  color: var(--ink-2);
}
/* ---------- Rev 16: owner edit form (inside the tucked details) ---------- */
.editform { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.elab {
  display: flex; flex-direction: column; gap: 4px;
  font-size: var(--t-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-3);
}
.elab input, .elab select {
  border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px;
  background: var(--surface); color: var(--ink); min-height: var(--tap);
  font-size: var(--t-sm); font-weight: 400; text-transform: none; letter-spacing: normal;
}
input[type="date"] { color-scheme: dark; } /* native picker matches the Site theme */
/* Rev 16.1: the handyman day count IS the owner's date-edit affordance —
   reads like the plain text managers see, plus a quiet dotted underline */
.daybtn {
  background: none; border: none; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer;
  text-decoration: underline dotted var(--accent);
  text-underline-offset: 3px;
}

/* owner-only manual stage move — deliberately quiet, end of the page */
details.ownerstage { margin: 20px 2px 8px; color: var(--ink-3); }
details.ownerstage summary {
  font-size: var(--t-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; min-height: 44px; display: flex; align-items: center;
  cursor: pointer; list-style-position: inside;
}

/* ---------- Rev 6: completion % — quiet, never competes with age ---------- */
.pct {
  font-size: var(--t-xs); font-weight: 600; color: var(--ink-3);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.progress { height: 3px; background: var(--line); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--ink-2); border-radius: 2px; }

/* ---------- Rev 6: owner snapshot — light document, screen + paper ---------- */
.snap-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.snapshot {
  background: #ffffff; color: #17150f;
  border-radius: 8px; padding: 20px 22px;
  font-size: 13px; line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.snapshot h1 { font-size: 19px; font-weight: 700; margin-bottom: 2px; }
.snapshot .meta { color: #5c5850; font-size: 12px; margin-bottom: 12px; }
.snapshot h2 {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: #17150f; border-bottom: 1px solid #b9b4aa; padding-bottom: 3px; margin: 18px 0 6px;
  break-after: avoid; page-break-after: avoid;
}
.snapshot section { break-inside: auto; }
.snapshot .snap-line { margin: 4px 0 6px; font-size: 13px; }
.snapshot table { width: 100%; border-collapse: collapse; }
.snapshot th {
  text-align: left; font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: #6d675c; border-bottom: 1px solid #8f8a80; padding: 3px 8px 3px 0;
}
.snapshot td { border-bottom: 1px solid #e6e2d9; padding: 4px 8px 4px 0; vertical-align: top; }
.snapshot th.num, .snapshot td.num { text-align: right; white-space: nowrap; }
.snapshot tr { break-inside: avoid; page-break-inside: avoid; }
.snapshot tr.tot td { border-top: 1px solid #8f8a80; border-bottom: none; font-weight: 700; }
/* Rev 9: same band → indented-children hierarchy as the Subs tab, in print
   grayscale — address band larger + tinted, needs nested beneath. */
.snapshot tr.ghead td {
  font-weight: 700; font-size: 13.5px; padding: 6px 8px 6px 6px;
  background: #f2eee6; border-bottom: 1px solid #8f8a80;
}
.snapshot td.ind { padding-left: 16px; }
.snapshot .snap-empty { color: #6d675c; font-size: 12.5px; padding: 4px 0; }

/* v3.25.25: "Recent expense drops" collapse header — the title becomes a toggle
   button (mirrors the CO-photos collapse), with room for the Receipt report button. */
.dropssec-hd { display: flex; align-items: center; gap: 8px; }
.dropssec-toggle { background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }

/* v3.25.25: crew Receipt Pipeline report — MONEY-FREE print-clean overlay.
   On screen it's a dark modal sheet; @media print (below) flattens it to a plain
   black-on-white one-page document for text/email to the crew. */
.pm-overlay.rr { align-items: flex-start; padding: 24px 0; overflow-y: auto; }
.rr-sheet { background: var(--surface, #1b2027); border: 1px solid var(--line);
  border-radius: 12px; width: min(680px, calc(100vw - 32px));
  display: flex; flex-direction: column; overflow: hidden; }
.rr-controls { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.rr-print { padding: 16px 18px; }
.rr-title { font-size: var(--t-lg, 18px); font-weight: 700; }
.rr-sub { color: var(--ink-3); font-size: var(--t-xs); margin-top: 2px; }
.rr-asof { color: var(--ink-3); }
.rr-groups { margin-top: 12px; }
.rr-person { margin-bottom: 12px; break-inside: avoid; }
.rr-person-hd { border-bottom: 1px solid var(--line); padding-bottom: 3px; margin-bottom: 4px; }
.rr-row { display: flex; gap: 10px; padding: 2px 0; font-size: var(--t-sm); }
.rr-time { flex: 0 0 4.6em; color: var(--ink-2); }
.rr-addr { flex: 1; min-width: 0; }
.rr-status { flex: 0 0 auto; color: var(--ink-3); font-size: var(--t-xs); text-transform: capitalize; }
.rr-foot { margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: var(--t-xs); }

@media print {
  header, nav.tabs, .snap-controls, .matfooter, #toasts { display: none !important; }
  body, body.snapshot-open { background: #ffffff; padding: 0; }
  main { max-width: none; padding: 0; margin: 0; }
  .snapshot { border-radius: 0; padding: 0; }
  /* v3.25.25: when the receipt report is open, print ONLY it — hide everything
     else (scoped with :has so the snapshot print above is unaffected), flatten the
     dark overlay to a plain white sheet, and drop the range chips / action buttons. */
  body:has(#receiptOverlay) > *:not(#receiptOverlay) { display: none !important; }
  .pm-overlay.rr { position: static; background: #ffffff; padding: 0; display: block; overflow: visible; }
  .rr-sheet { border: 0; border-radius: 0; width: auto; box-shadow: none; }
  .rr-controls { display: none !important; }                    /* chips + Print/Close gone in the PDF */
  .rr-print, .rr-title, .rr-person-hd b, .rr-row, .rr-addr { color: #000 !important; }
  .rr-time, .rr-status, .rr-sub, .rr-asof, .rr-foot { color: #333 !important; }
  .rr-person { break-inside: avoid; }
}
