/* SafetyNet Renovation — tokens first; everything below uses them. */
:root {
  --ink: #252423;          /* brand charcoal: text, header band */
  --ink-2: #4a4845;
  --muted: #6a6965;
  --faint: #77756f;        /* 4.6:1 on paper (was #9a9893, 2.9:1) */
  --bg: #f5f5f3;
  --paper: #ffffff;
  --line: #e3e2de;
  --line-2: #8f8c86;       /* control edges 3.4:1 (was #cfcdc8, 1.6:1) */
  --brand: #f3c300;        /* brand yellow: primary action, active marker */
  --brand-soft: #fdf4cc;
  --ok: #007d27;  --ok-soft: #e3f4e8;
  --bad: #c41616; --bad-soft: #fde8e8;
  --warn: #9a6400; --warn-soft: #fbf0dc;
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Poppins", var(--font);
  --fs-xs: 13px; --fs-sm: 14px; --fs: 14px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 24px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r: 6px; --r-lg: 8px;
  --ctl: 34px;             /* control height */
  --tap: 40px;             /* phone tap target */
  --brand-hover: #e6b800; --brand-ink: #6b5500; --ok-ink: #00691f; --warn-ink: #8a5800; --bad-ink: #a70f0f;
  --chip: #ecebe7; --header-link: #d8d6d1;  /* design system: SafetyNet Operations (Claude Design) */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs)/1.45 var(--font); }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-xl); line-height: 1.2; }
h2 { font-size: var(--fs-md); }
h3 { font-size: var(--fs); }
p { margin: 0 0 var(--s3); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 3px; }

/* ---------- header band ---------- */
.top { background: var(--ink); color: #fff; }
.top .in { display: flex; align-items: center; gap: var(--s5); height: 52px; padding: 0 var(--s5); max-width: 1440px; margin: 0 auto; }
.top .logo img { height: 26px; display: block; }
.top nav { display: flex; gap: var(--s1); height: 100%; }
.top nav a { display: flex; align-items: center; padding: 0 var(--s3); color: var(--header-link); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.top nav a:hover { color: #fff; }
.top nav a.on { color: #fff; border-bottom-color: var(--brand); }
.top .who { margin-left: auto; font-size: var(--fs-sm); color: var(--header-link); display: flex; gap: var(--s3); align-items: center; }
.top .who a { color: #fff; }
.top.ext .in { justify-content: space-between; }

main { max-width: 1440px; margin: 0 auto; padding: var(--s5); }
main.narrow { max-width: 860px; }

/* ---------- buttons & controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: var(--ctl); padding: 0 var(--s4); border-radius: var(--r); border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font: 500 var(--fs) var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--ink); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink-2); padding: 0 var(--s2); }
.btn.quiet:hover { background: var(--chip); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 28px; padding: 0 var(--s3); font-size: var(--fs-sm); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

input[type=text], input[type=number], input[type=email], input[type=date], input[type=datetime-local],
input[type=search], input[type=url], input[type=password], select, textarea {
  height: var(--ctl); padding: 0 var(--s3); border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--paper); color: var(--ink); font: 400 var(--fs) var(--font); width: 100%; min-width: 0;
}
textarea { height: auto; min-height: 72px; padding: var(--s2) var(--s3); resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(243, 195, 0, .35); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; cursor: pointer; }
label.f { display: grid; gap: var(--s1); font-size: var(--fs-sm); color: var(--ink-2); font-weight: 500; }
label.f .hint { font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.span2 { grid-column: span 2; }
.actions { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--paper); }
.seg a, .seg button, .seg label { height: 32px; display: inline-flex; align-items: center; padding: 0 var(--s3); text-decoration: none; color: var(--ink-2); font: 500 var(--fs-sm) var(--font); border: 0; background: none; cursor: pointer; border-right: 1px solid var(--line); }
.seg > :last-child { border-right: 0; }
.seg .on, .seg input:checked + span { background: var(--ink); color: #fff; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg label span { display: inline-flex; align-items: center; height: 100%; padding: 0 var(--s3); margin: 0 calc(-1 * var(--s3)); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 var(--s2); border-radius: 10px; font-size: var(--fs-xs); font-weight: 500; background: var(--chip); color: var(--ink-2); white-space: nowrap; }
.badge.draft { background: var(--chip); }
.badge.submitted { background: var(--warn-soft); color: var(--warn-ink); }
.badge.approved { background: var(--ok-soft); color: var(--ok-ink); }
.badge.superseded { background: transparent; color: var(--faint); border: 1px solid var(--line); }
.badge.late { background: var(--bad-soft); color: var(--bad-ink); }
.badge.slow { background: var(--warn-soft); color: var(--warn-ink); }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- page head ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.head .meta { margin-top: var(--s1); color: var(--muted); font-size: var(--fs-sm); display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.crumb { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--s1); }
.crumb a { color: var(--muted); }
section.block { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: var(--s5); }
section.block > .bh { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
section.block > .bb { padding: var(--s4); }
.empty { padding: var(--s5); text-align: center; color: var(--muted); }
.notice { padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--brand-soft); border: 1px solid #f0dc8a; margin-bottom: var(--s4); font-size: var(--fs-sm); }
.notice.bad { background: var(--bad-soft); border-color: #f5b5b5; }
.notice.ok { background: var(--ok-soft); border-color: #a9dcb8; }

/* ---------- tables ---------- */
table.t { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.t th { text-align: left; font-weight: 500; color: var(--muted); padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t .r { text-align: right; }

/* ---------- board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(248px, 1fr); gap: var(--s3); overflow-x: auto; padding-bottom: var(--s3); }
.col { min-width: 0; }
.col h2 { font-size: var(--fs-sm); display: flex; justify-content: space-between; align-items: center; padding: 0 var(--s1) var(--s2); color: var(--ink-2); }
.col h2 .n { color: var(--faint); font-weight: 500; }
.col .list { display: grid; gap: var(--s2); }
.card { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s3); text-decoration: none; }
.card:hover { border-color: var(--line-2); }
.card .addr { font-weight: 500; line-height: 1.3; }
.card .sub { color: var(--muted); font-size: var(--fs-xs); margin-top: 2px; }
.card .row { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); margin-top: var(--s2); font-size: var(--fs-xs); }
.card .amt { font-family: var(--display); font-weight: 600; font-size: var(--fs-sm); }
.col .none { font-size: var(--fs-xs); color: var(--faint); padding: var(--s2) var(--s1); border: 1px dashed var(--line); border-radius: var(--r-lg); text-align: center; }

/* ---------- stage stepper (a real sequence) ---------- */
.steps { display: flex; gap: 6px; margin: 0 0 var(--s5); overflow-x: auto; padding-bottom: 2px; }
.steps form { flex: 1 1 0; min-width: 84px; margin: 0; }
.steps button { display: block; width: 100%; padding: 0 0 2px; background: none; border: 0; border-radius: 0; color: var(--muted);
                font: 500 var(--fs-xs)/1.3 var(--font); text-align: start; cursor: pointer; white-space: nowrap; }
.steps button::before { content: ""; display: block; height: 4px; border-radius: 2px; background: var(--line); margin-bottom: 7px; }
.steps .k { color: var(--faint); margin-inline-end: 4px; font-variant-numeric: tabular-nums; }
.steps .done button { color: var(--ink-2); }
.steps .done button::before { background: var(--ink-2); }
.steps .on button { color: var(--ink); font-weight: 600; }
.steps .on button::before { background: var(--brand); }
.steps .on .k { color: var(--ink); }
.steps button:hover { color: var(--ink); }
.steps button:hover::before { background: var(--line-2); }
.steps .done button:hover::before { background: var(--ink); }
.steps .on button:hover::before { background: var(--brand); }

/* ---------- estimate editor ---------- */
.ebar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: var(--s3) 0; margin: calc(-1 * var(--s3)) 0 var(--s4); border-bottom: 1px solid var(--line); }
.totals { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: var(--s3); overflow-x: auto; }
.tot { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s3) var(--s4); }
.tot .nm { display: flex; justify-content: space-between; align-items: center; font-weight: 500; font-size: var(--fs-sm); }
.tot .big { font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.15; margin-top: 2px; }
.tot .lbl { color: var(--muted); font-size: var(--fs-xs); }
.tot .head2 { display: flex; align-items: baseline; gap: var(--s3); }
.tot .kvs { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); justify-content: space-between; gap: var(--s3); margin-top: var(--s2); font-size: var(--fs-xs); }
.tot .kvs div { display: grid; gap: 1px; }
.tot .kvs span:first-child { color: var(--muted); }
.tot .kvs span:last-child { color: var(--ink-2); }
.tot.active { border-color: var(--ink); }
.saved { font-size: var(--fs-xs); color: var(--muted); min-width: 90px; text-align: right; }
.saved.err { color: var(--bad); }

.measures { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s3); align-items: end; }
.measures label.f input { height: 30px; }
.tools { display: flex; gap: var(--s3); align-items: center; margin: 0 0 var(--s3); flex-wrap: wrap; }
.tools input[type=search] { max-width: 320px; }
.tools label { display: inline-flex; gap: var(--s2); align-items: center; font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer; }

details.cat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: var(--s2); }
details.cat > summary { list-style: none; cursor: pointer; display: grid; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); }
details.cat > summary::-webkit-details-marker { display: none; }
details.cat > summary .cn { font-weight: 500; display: flex; align-items: center; gap: var(--s2); }
details.cat > summary .cn::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
details.cat[open] > summary .cn::before { transform: rotate(45deg); }
details.cat > summary .cs { text-align: right; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
details.cat > summary .cs.zero { color: var(--faint); }
details.cat[open] > summary { border-bottom: 1px solid var(--line); }

table.lines { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.lines td, table.lines th { padding: 6px var(--s3); border-bottom: 1px solid #efeeea; vertical-align: top; }
table.lines th { font-weight: 500; color: var(--muted); text-align: left; font-size: var(--fs-xs); }
table.lines tr:last-child td { border-bottom: 0; }
table.lines td.item { width: 100%; }
table.lines .es { display: block; color: var(--faint); font-size: var(--fs-xs); }
table.lines .lp { white-space: nowrap; color: var(--muted); text-align: right; }
table.lines td.c { width: 150px; min-width: 150px; }
table.lines tr.used td.item { font-weight: 500; }
table.lines tr.used { background: #fffdf3; }
.cell { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--s2); }
.cell input[type=number] { height: 30px; width: 84px; padding: 0 var(--s2); text-align: right; }
.cell .amt { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.cell .amt:empty::before { content: "—"; color: #d6d4cf; }
.cell .q { grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--muted); text-align: right; }
.cell input.note { grid-column: 1 / -1; height: 26px; font-size: var(--fs-xs); padding: 0 var(--s2); border-color: var(--line); }
.cell .pdiff { grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--warn); text-align: right; }
tr.custom td.item { color: var(--ink-2); }
.addline { display: flex; gap: var(--s2); padding: var(--s3); border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.addline input[name=name] { flex: 1 1 200px; }
.addline input[name=amount] { width: 110px; flex: 0 0 auto; }
.addline select { width: auto; flex: 0 0 auto; }
.scntabs { display: none; }
.hide { display: none !important; }

/* ---------- price list ---------- */
.pl-cat { scroll-margin-top: 12px; }
table.pl td.pr { width: 120px; }
table.pl td.pr input { height: 30px; text-align: right; }
table.pl tr.off td { color: var(--faint); }
table.pl .mode { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
table.pl .fix { color: var(--warn); font-size: var(--fs-xs); }
.pl-index { display: flex; gap: var(--s1) var(--s3); flex-wrap: wrap; font-size: var(--fs-sm); margin-bottom: var(--s4); }
.pl-index a { color: var(--ink-2); }

/* ---------- Scope of Work document ---------- */
.doc-tools { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; margin-bottom: var(--s4); }
.doc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); max-width: 820px; margin: 0 auto; padding: 48px 56px; }
.doc header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s5); padding-bottom: var(--s4); border-bottom: 2px solid var(--ink); }
.doc header img { height: 34px; }
.doc .dtitle { font-family: var(--display); font-weight: 600; font-size: 26px; margin: var(--s5) 0 var(--s1); }
.doc .daddr { font-size: var(--fs-md); font-weight: 500; }
.doc .dmeta { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 2px var(--s5); margin: var(--s4) 0 var(--s5); font-size: var(--fs-sm); }
.doc .dmeta dt { color: var(--muted); font-size: var(--fs-xs); }
.doc .dmeta dd { margin: 0; font-weight: 500; }
.doc .contractor-flag { font-size: var(--fs-xs); color: var(--muted); border: 1px solid var(--line-2); border-radius: var(--r); padding: 2px var(--s2); }
.doc .sec { padding: var(--s4) 0; border-top: 1px solid var(--line); break-inside: avoid; }
.doc .sec h2 { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); font-size: var(--fs-md); }
.doc .sec h2 .b { font-family: var(--font); font-weight: 500; font-size: var(--fs); font-variant-numeric: tabular-nums; }
.doc .sec h2 .was { color: var(--muted); font-weight: 400; font-size: var(--fs-sm); margin-right: var(--s2); }
.doc ul { margin: var(--s2) 0 0; padding-left: 20px; }
.doc li { margin: 3px 0; }
.doc li .qty { color: var(--ink-2); font-variant-numeric: tabular-nums; margin-left: var(--s2); }
.doc li .note { display: block; color: var(--muted); font-size: var(--fs-sm); }
.doc li .tag { font-size: 12px; font-weight: 500; color: var(--warn-ink); background: var(--warn-soft); border-radius: 8px; padding: 1px 6px; margin-left: var(--s2); white-space: nowrap; }
.doc .done { margin-top: var(--s2); font-size: var(--fs-sm); color: var(--ink-2); }
.doc .done b { font-weight: 500; }
.doc table.money { width: 100%; max-width: 420px; margin-left: auto; border-collapse: collapse; margin-top: var(--s2); }
.doc table.money td { padding: 6px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.doc table.money td:last-child { text-align: right; }
.doc table.money tr:last-child td { border-bottom: 0; border-top: 2px solid var(--ink); font-family: var(--display); font-weight: 600; font-size: var(--fs-md); padding-top: var(--s2); }
.doc .fine { font-size: var(--fs-sm); color: var(--ink-2); }

/* ---------- login ---------- */
.login { max-width: 380px; margin: 10vh auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); }
.login .who-btn { display: flex; width: 100%; justify-content: space-between; margin-top: var(--s2); }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  main { padding: var(--s4) var(--s3); }
  .top .in { padding: 0 var(--s3); gap: var(--s3); }
  .top nav a { padding: 0 var(--s2); font-size: var(--fs-sm); }
  .top .who span { display: none; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .board { grid-auto-flow: row; grid-auto-columns: auto; }
  .measures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn, input[type=text], input[type=number], select { min-height: var(--tap); }
  .scntabs { display: flex; margin-bottom: var(--s3); }
  .scntabs button { flex: 1; }
  table.lines td.c, table.lines th.c { display: none; }
  table.lines td.c.show, table.lines th.c.show { display: table-cell; width: 140px; min-width: 140px; }
  table.lines .lp { display: none; }
  details.cat > summary { grid-template-columns: 1fr auto !important; }
  details.cat > summary .cs { display: none; }
  details.cat > summary .cs.show { display: block; }
  .cell input[type=number] { height: var(--tap); width: 76px; }
  .totals { grid-auto-flow: row; }
  .tot:not(.active) { display: none; }
  .doc { padding: var(--s5) var(--s4); }
  .doc .dmeta { grid-template-columns: repeat(2, auto); }
}

@media print {
  body { background: #fff; }
  .top, .doc-tools, .noprint { display: none !important; }
  main { padding: 0; max-width: none; }
  .doc { border: 0; padding: 0; max-width: none; }
}

/* ---------- project tabs, money pages ---------- */
.ptabs { display: flex; gap: var(--s4); border-bottom: 1px solid var(--line); margin: 0 0 var(--s5); overflow-x: auto; }
.ptabs a { padding: var(--s2) 0; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ptabs a:hover { color: var(--ink); }
.ptabs a.on { color: var(--ink); border-bottom-color: var(--brand); }
.neg { color: var(--bad); }
.pos { color: var(--ok); }
.ok-t { color: var(--ok); }
.warn-t { color: #a35f00; }
tr.dimrow td, section.dimrow { opacity: .55; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { position: relative; display: inline-flex; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; gap: 6px; align-items: center; height: 30px; padding: 0 var(--s3); border: 1px solid var(--line-2); border-radius: 15px; font-size: var(--fs-sm); color: var(--ink-2); background: var(--paper); }
.chip span i { font-style: normal; color: var(--muted); font-size: var(--fs-xs); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input:checked + span i { color: var(--header-link); }
.chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s3) var(--s4); display: grid; gap: 2px; }
.kpi span { font-size: var(--fs-xs); color: var(--muted); }
.kpi b { font-family: var(--display); font-weight: 600; font-size: var(--fs-lg); }
.kpi i { font-style: normal; font-size: var(--fs-xs); color: var(--muted); }
.kline { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.kline div { display: grid; gap: 1px; }
.kline span { font-size: var(--fs-xs); color: var(--muted); }
.kline b { font-weight: 500; }
.steps-mini { display: flex; align-items: center; gap: 3px; }
.steps-mini span { width: 14px; height: 4px; border-radius: 2px; background: #e3e2de; }
.steps-mini span.done { background: var(--ink-2); }
.steps-mini span.on { background: var(--brand); }
.steps-mini b { font-weight: 500; font-size: var(--fs-sm); margin-left: var(--s2); }
table.pays td { vertical-align: top; }
.checkform { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.checkform input { height: 28px; font-size: var(--fs-sm); max-width: 210px; }
.checkform input[type=date] { max-width: 150px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; }
details.mini > summary { cursor: pointer; color: var(--muted); list-style: none; }
details.mini > summary::-webkit-details-marker { display: none; }
details.mini > summary:hover { color: var(--ink); }
table.t tfoot td { border-top: 1px solid var(--line-2); border-bottom: 0; }
.contract-doc p { font-size: var(--fs-sm); line-height: 1.55; }
.contract-doc .sched { margin: 0; padding-left: 0; list-style: none; }
.contract-doc .signs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6) var(--s5); padding-top: var(--s6); font-size: var(--fs-sm); color: var(--muted); }
.contract-doc .signs .line { border-bottom: 1px solid var(--ink); height: 28px; margin-bottom: 4px; }
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checkform input { max-width: none; flex: 1 1 140px; }
}

/* ---------- site QC ---------- */
.qcsum { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; font-size: var(--fs-sm); margin: 0 0 var(--s4); }
.qcsum b { font-family: var(--display); font-weight: 600; }
.qtabs { display: flex; gap: var(--s2); overflow-x: auto; margin: 0 0 var(--s4); padding-bottom: 2px; }
.qtabs a { flex: 0 0 auto; display: grid; gap: 1px; padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: var(--fs-sm); }
.qtabs a span { font-weight: 400; font-size: var(--fs-xs); color: var(--muted); }
.qtabs a.on { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--brand); color: var(--ink); }
.qcsec { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: var(--s3); }
.qch { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.qch h2 { flex: 1; }
.qclist { list-style: none; margin: 0; padding: 0; }
.qci { display: grid; grid-template-columns: 1fr auto; gap: 6px var(--s3); align-items: center; padding: 8px var(--s4); border-bottom: 1px solid #efeeea; border-left: 3px solid transparent; }
.qci:last-child { border-bottom: 0; }
.qci.st-ok { border-left-color: var(--ok); }
.qci.st-fix { border-left-color: var(--bad); background: #fffafa; }
.qci.st-wip { border-left-color: var(--warn); }
.qci.st-na .qtext { color: var(--faint); }
.qtext { font-size: var(--fs-sm); }
.qwho { display: block; font-size: var(--fs-xs); color: var(--faint); }
.qbtns { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.qbtns button { height: 30px; padding: 0 10px; border: 0; border-right: 1px solid var(--line); background: var(--paper); color: var(--ink-2); font: 500 var(--fs-xs) var(--font); cursor: pointer; }
.qbtns button:last-child { border-right: 0; }
.qbtns .b-ok[aria-pressed="true"] { background: var(--ok); color: #fff; }
.qbtns .b-fix[aria-pressed="true"] { background: var(--bad); color: #fff; }
.qbtns .b-wip[aria-pressed="true"] { background: var(--warn); color: #fff; }
.qbtns .b-na[aria-pressed="true"] { background: #8b8a86; color: #fff; }
.qextra { grid-column: 1 / -1; display: none; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.qextra.show { display: flex; }
.qnote { flex: 1 1 220px; height: 30px !important; font-size: var(--fs-sm) !important; }
.qcam { cursor: pointer; }
.qthumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.qthumbs a { position: relative; display: block; }
.qthumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); display: block; }
.qthumbs i { position: absolute; left: 2px; bottom: 2px; font-style: normal; font-size: 10px; background: var(--ink); color: #fff; padding: 0 4px; border-radius: 3px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s3); padding: var(--s4); }
.gallery a { text-decoration: none; color: var(--ink-2); font-size: var(--fs-xs); display: grid; gap: 4px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line); }
.gallery i { display: block; font-style: normal; color: var(--faint); }
@media (max-width: 760px) {
  .qci { grid-template-columns: 1fr; padding: 10px var(--s3); }
  .qbtns { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .qbtns button { height: var(--tap); padding: 0 4px; }
  .qch { padding: var(--s3); }
}

/* sign-in forms (login, welcome) */
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.stack label { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); }
.stack .btn { margin-top: var(--s2); justify-content: center; }

/* ---------- review fixes 2026-11-10: shared components ---------- */
/* <details> blocks look like <section> blocks */
details.block { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: var(--s5); }
details.block > summary { list-style: none; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px var(--s3); padding: var(--s3) var(--s4); padding-inline-end: 40px; cursor: pointer; position: relative; }
details.block > summary::-webkit-details-marker { display: none; }
details.block > summary::after { content: ""; position: absolute; inset-inline-end: var(--s4); top: 50%; width: 7px; height: 7px; margin-top: -6px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform .15s ease; }
details.block[open] > summary::after { transform: rotate(225deg); margin-top: -2px; }
details.block > summary:hover::after { border-color: var(--ink); }
@media (prefers-reduced-motion: reduce) { details.block > summary::after { transition: none; } }
details.block[open] > summary { border-bottom: 1px solid var(--line); }
details.block > .bb { padding: var(--s4); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.notice.info { background: var(--paper); border-color: var(--line); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.qci.unsaved { box-shadow: inset 3px 0 0 var(--bad); }
.chip-ok, .chip-no { display: inline-block; font-size: 12px; line-height: 16px; padding: 0 6px; border-radius: 8px; margin-left: 4px; }
.chip-ok { background: var(--ok-soft); color: #1d6b38; }
.chip-no { background: var(--bad-soft); color: var(--bad); }
/* board: stages with nothing in them shrink to their header, so the live work fits on screen */
.board { display: flex; }
.board .col { flex: 1 0 200px; min-width: 200px; }
.board .col.empty { flex: 0 0 128px; min-width: 128px; }
.board .col.empty .none { display: none; }
.board .col.empty h2 { color: var(--faint); }

/* ---------- review fixes 2026-11-10: phones ---------- */
@media (max-width: 760px) {
  /* header: the menu scrolls sideways inside the dark band; the name link (Team) is in the menu */
  .top .in { gap: var(--s2); }
  .top nav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a { white-space: nowrap; flex: none; }
  .top .who { margin-left: 0; flex: none; }
  .top .who a:first-child { display: none; }
  /* wide tables scroll inside their block instead of widening the page */
  table.t { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* decision tables (payments, approvals) stack: one row = one card, the button stays on screen */
  table.stack, table.stack tbody, table.stack tfoot, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack { overflow: visible; }
  table.stack thead { display: none; }
  table.stack tr { padding: var(--s3) 0; border-top: 1px solid var(--line); }
  table.stack tr:first-child { border-top: 0; }
  table.stack td { padding: 2px 0; border: 0; text-align: left; }
  table.stack td.r, table.stack td.nowrap { text-align: left; white-space: normal; }
  table.stack td:empty { display: none; }
  /* 16px stops iOS zooming into every field; every control gets the 40px tap height */
  input, select, textarea { font-size: 16px; }
  input[type=email], input[type=password], input[type=date], input[type=url], input[type=search],
  input[type=datetime-local], input[type=file] { min-height: var(--tap); }
  input[type=checkbox] { width: 24px; height: 24px; }
  /* the save status is a toast at the bottom of the screen */
  #saved:not(:empty) { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50; min-width: 0;
    background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px; box-shadow: 0 2px 10px rgba(0,0,0,.18);
    text-align: center; white-space: nowrap; }
  #saved.err:not(:empty) { background: var(--bad); color: #fff; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .kpi { padding: var(--s3); }
  /* board: one column per stage, empty stages hidden */
  .board { flex-direction: column; }
  .board .col, .board .col.empty { flex: none; min-width: 0; }
  .board .col.empty { display: none; }
}
.linkbtn.danger { color: var(--bad); }
@media print {
  .noprint, .top, .crumb { display: none !important; }
  #report { border: 0; }
  #report table.t { font-size: 11px; }
}

/* updates feed + post box */
.upform textarea { width: 100%; min-height: 72px; margin-bottom: var(--s2); }
.upd { padding: var(--s3) 0; border-top: 1px solid var(--line); }
.upd:first-child { border-top: 0; }
.upd .qthumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.iu-prev { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); background: #fff; }

/* ---------- a project page built around its stage (2026-11-10) ---------- */
.stagegrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s4); align-items: start; margin-bottom: var(--s5); }
.stagemain > .block:last-child, .stagemain > .kpis:last-child { margin-bottom: 0; }
.stagepanel { position: sticky; top: var(--s4); background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: var(--r-lg); padding: var(--s4); }
.sp-title { font-family: var(--display); font-weight: 600; font-size: var(--fs-md, 16px); line-height: 1.3; margin-bottom: var(--s3); }
.sp-list { list-style: none; margin: 0 0 var(--s4); padding: 0; display: grid; gap: 6px; }
.sp-list li { display: grid; grid-template-columns: 20px 1fr; gap: var(--s2); align-items: start; font-size: var(--fs-sm); color: var(--ink-2); }
.sp-mark { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); display: inline-flex; align-items: center;
  justify-content: center; font-size: 12px; line-height: 1; margin-top: 1px; }
.sp-list li.done { color: var(--muted); }
.sp-list li.done .sp-mark { background: var(--ok-soft); border-color: var(--ok-soft); color: var(--ok-ink); }
.sp-list li.next { color: var(--ink); font-weight: 600; }
.sp-list li.next .sp-mark { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(243, 195, 0, .25); }
.sp-label i { display: block; font-style: normal; font-weight: 400; font-size: var(--fs-xs); color: var(--muted); }
.sp-form { display: grid; gap: var(--s3); }
.sp-form label { display: grid; gap: 4px; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); }
.sp-form .btn { justify-content: center; }
.sp-sugg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sp-sugg > span { width: 100%; }
.chipbtn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: var(--fs-xs);
  cursor: pointer; color: var(--ink); }
.chipbtn:hover, .chipbtn.on { border-color: var(--ink); }
.sp-share { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); display: grid; gap: 6px; }
.sp-share input { font-size: var(--fs-xs); }
.sp-q { background: var(--bg); border-radius: var(--r); padding: var(--s2) var(--s3); }
.sp-q ul { margin: 4px 0 0; padding-left: 18px; font-size: var(--fs-sm); }
/* the request, read like a short thread */
.reqmeta { display: flex; flex-wrap: wrap; gap: 4px var(--s3); font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }
.reqscope { margin-bottom: var(--s4); }
.reqscope ol { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 4px; font-size: var(--fs-md, 15px); color: var(--ink); }
.reqmsg { padding: var(--s3) 0; border-top: 1px solid var(--line); }
.reqmsg.first { border-top: 0; padding-top: 0; }
.reqbody { white-space: pre-wrap; font-size: var(--fs-sm); line-height: 1.55; color: var(--ink); max-width: 72ch; }
.reqitems { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 3px; font-size: var(--fs-sm); }
.reqfiles { display: flex; flex-wrap: wrap; gap: 6px var(--s3); margin-top: var(--s3); font-size: var(--fs-sm); }
.reqfiles a::before { content: "📎 "; }
.reqpeek { font-size: var(--fs-xs); color: var(--ink-2); margin-top: 4px; max-width: 70ch; white-space: pre-wrap; }
.reqbody, .reqitems, .reqscope, .reqpeek, .reqmeta { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .stagegrid { grid-template-columns: minmax(0, 1fr); }
  .stagepanel { position: static; order: -1; }  /* on a phone the next step comes first, the request right under it */
}
.req > .bh { align-items: flex-start; }
.reqedit { border-bottom: 1px solid var(--line); }

/* anything marked hidden stays hidden, whatever its own display rule */
[hidden] { display: none !important; }

/* key details: label over value, compact grid */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s3) var(--s4); margin: 0; padding: var(--s3) var(--s4) var(--s4); }
.facts > div { min-width: 0; }
.facts > div.wide { grid-column: 1 / -1; }
.facts dt { font-size: var(--fs-xs); color: var(--muted); margin-bottom: 2px; }
.facts dd { margin: 0; font-size: var(--fs-sm); color: var(--ink); overflow-wrap: anywhere; }
.facts > div.wide dd { white-space: pre-wrap; max-width: 80ch; }

/* office verification — Ruth (Avi's AI) on the Zoho opportunity; project page + estimator link */
.sechead { padding: var(--s3) var(--s4) var(--s1); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); }
.sechead .xs { text-transform: none; letter-spacing: 0; font-weight: 400; }
.vtable { width: 100%; }
.vtable td { vertical-align: top; }
.vtable td.vform { width: 44%; }
.vtable .vform .actions { flex-wrap: nowrap; }
.vtable .vform input[type=text] { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .vtable td.vform { width: 100%; }
  .vtable .vform .actions { flex-wrap: wrap; }
  .vtable .vform input[type=text] { flex-basis: 100%; }
}

/* Documents: the rules fold at the bottom (docs.rules) */
.rules h3 { font-size: var(--fs-sm); font-weight: 600; margin: var(--s5) 0 var(--s2); }
.rules h3:first-child { margin-top: 0; }
.rules ul { margin: 0; padding-inline-start: 18px; font-size: var(--fs-sm); }
.rules li { margin-bottom: 4px; }
.rules p { margin: var(--s2) 0 0; }
.rules table.t { margin-top: 0; }
.rules-app { align-items: start; }

.rules .dwrap { overflow-x: auto; }
.rules .dwrap table.t { min-width: 640px; }

/* ---------- project page polish (Michael, 2026-11-11: "looks sloppy") ---------- */
/* the top numbers: one strip with dividers; a short last row stretches instead of leaving one card alone */
.stagemain .kpis { display: flex; flex-wrap: wrap; gap: 0; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--s5); }
.stagemain .kpi { flex: 1 1 140px; background: none; border: 0; border-radius: 0; padding: var(--s3) var(--s4);
  border-inline-start: 1px solid var(--line); border-top: 1px solid var(--line); margin-inline-start: -1px; margin-top: -1px; }
/* the stage panel: the one place the brand colour leads */
.stagepanel .sp-cta { width: 100%; justify-content: center; }
.sp-title { font-size: var(--fs-md); margin-bottom: var(--s3); }
/* the request: one text size, quiet labels */
.reqscope ol { font-size: var(--fs); gap: 2px; }
.reqscope > .xs.muted, .reqmsg > .xs.muted { font-weight: 500; margin-bottom: 2px; }
/* sub-headings inside a section: sentence case, not shouted */
.sechead { text-transform: none; letter-spacing: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
/* empty states inside a folded section: a quiet line, not a big centred box */
details.block > .empty { padding: var(--s3) var(--s4); text-align: start; font-size: var(--fs-sm); }
details.block .bb .empty, section.block .bb .empty { padding: var(--s2) 0; text-align: start; font-size: var(--fs-sm); }
/* Details: the edit form folds out inside the same card */
.editfold > summary { display: none; }
.editfold[open] { border-top: 1px solid var(--line); }
.editfold .editbar { padding-top: 0; }
#facts .empty { padding: var(--s3) var(--s4); text-align: start; font-size: var(--fs-sm); }
/* the stage line scrolls sideways on a phone without showing a scrollbar */
.steps { scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }

/* ---------- visibility pass (Michael, 2026-11-11; accessibility + critique reviews) ---------- */
/* the stage line: a taller tap area on each step */
.steps button { padding-bottom: 8px; min-height: 36px; }
/* the stage panel's notes and the fact labels read at caption size, in the stronger grey */
.sp-label i { color: var(--ink-2); }
.facts dt { color: var(--ink-2); }
/* row buttons are a full tap target on a phone */
@media (max-width: 640px) { .btn.sm { height: var(--tap); } }

/* the stage line sits on the grey page: its numbers take the stronger grey (faint is for white only) */
.steps .k { color: var(--muted); }

/* ---------- Projects board (Michael, 2026-11-11: "yuck") ----------
   Every column has the same header: a stage bar on top (charcoal with jobs, light without), the stage name, a count
   pill. Empty columns stay narrow but keep their shape, so the board reads as the pipeline. Headers line up. */
.board { display: flex; align-items: flex-start; gap: var(--s3); }
.board .col { flex: 1 0 220px; min-width: 220px; }
.board .col.empty { flex: 0 0 148px; min-width: 148px; }
.board .col h2 { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s2);
  font: 600 var(--fs-sm)/1.3 var(--font); color: var(--ink); padding: 10px var(--s1) var(--s2); margin: 0;
  border-top: 3px solid var(--ink-2); min-height: 44px; box-sizing: border-box; }
.board .col.empty h2 { color: var(--muted); border-top-color: var(--line); font-weight: 500; }
.board .col h2 .n { flex: none; min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--pill, 10px); background: var(--chip);
  color: var(--ink-2); font: 600 var(--fs-xs)/20px var(--font); text-align: center; }
.board .col.empty h2 .n { background: transparent; color: var(--muted); font-weight: 500; }
.board .col.empty .none { display: block; height: 64px; padding: 0; border: 1px dashed var(--line); border-radius: var(--r-lg);
  font-size: 0; background: transparent; }
.board .card { padding: var(--s3) var(--s4); }
.board .card .addr { font-weight: 600; font-size: var(--fs); }
.board .card .row { margin-top: var(--s3); }
.board .card .amt { font-size: var(--fs); }
@media (max-width: 760px) {
  .board { flex-direction: column; align-items: stretch; }
  .board .col, .board .col.empty { flex: none; min-width: 0; }
  .board .col.empty { display: none; }
}
/* an empty column is not an empty-state box: drop the generic .empty padding and centring */
.board .col.empty { padding: 0; text-align: start; }
/* two-line stage names ("Inspection & refine") get the same header height as one-line ones */
.board .col h2 { min-height: 56px; }
