/* J Group project portal.
   Layout: charcoal top band like jgrouprenovations.com, white work cards on a quiet
   grey ground, brand orange kept for actions and progress. Built phone-first. */
:root {
  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --ink: #111827;
  --muted: #5F6672;
  --line: #E4E7EC;
  --line-strong: #CDD2DA;
  --charcoal: #1C1E22;
  --charcoal-2: #2C2F35;
  --on-dark: #F9FAFB;
  --on-dark-muted: #A3A8B2;
  --brand: #ED7D23;
  --brand-soft: #FFF1E5;
  --btn: #B95A0C;
  --btn-hover: #A14E09;
  --ok: #15803D;
  --warn: #9A5700;
  --crit: #B42318;
  --info: #1D4ED8;
  --focus: #2563EB;
  --font-display: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-lg: 0 4px 16px rgba(16, 24, 40, .08);
  --side: 236px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
img { max-width: 100%; }
a { color: var(--info); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.minw { min-width: 0; }
.flush { margin: 0; }
.spacer { flex: 1; }
.hint { font-size: 13px; color: var(--muted); }
.eyebrow { margin: 0; font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
.h-hero { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 4vw, 32px); line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
.h-page { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.25; letter-spacing: -.015em; }
.h-sec { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.3; letter-spacing: -.01em; }
.h-card { font-family: var(--font-display); font-weight: 650; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.h-phase { font-size: 16px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }

/* ---- Shell ---------------------------------------------------------------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: var(--charcoal); color: var(--on-dark); padding-top: env(safe-area-inset-top, 0px); }
.topbar-in, .demo-in, .page {
  width: 100%; max-width: 1180px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.topbar-in { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; margin-right: auto; min-width: 0; }
.brand img, .login-brand img { height: 46px; width: auto; flex: none; }
.brand-name { display: block; font-family: var(--font-display); font-size: 17px; line-height: 1.2; }
.brand-sub { display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--on-dark-muted); text-decoration: none; font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: var(--r-sm); }
.nav a:hover { color: var(--on-dark); }
.nav a.on { color: var(--on-dark); background: var(--charcoal-2); }
.me { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--on-dark-muted); }
.me-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me button { background: transparent; color: var(--on-dark); border: 1px solid #5A5955; border-radius: var(--r-sm); padding: 6px 10px; cursor: pointer; font-size: 14px; }
.me button:hover { border-color: var(--on-dark-muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid #5A5955; }
.pill:empty { display: none; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--on-dark-muted); }
.pill.live i { background: #4CC38A; animation: pulse 2.4s infinite; }
.pill.offline i { background: #F0A040; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 195, 138, .55); }
  70% { box-shadow: 0 0 0 7px rgba(76, 195, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 195, 138, 0); }
}
@media (prefers-reduced-motion: reduce) { .pill.live i { animation: none; } * { transition: none !important; } }
@media (max-width: 640px) {
  .me-name { display: none; }
  .brand-name { font-size: 15px; }
  .brand img { height: 38px; }
}

.demo { background: var(--brand-soft); border-bottom: 1px solid #F1C9A3; font-size: 14px; }
.demo-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-block: 8px; }
.demo b { font-weight: 800; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--info); text-decoration: underline; cursor: pointer; font-size: 14px; }

.page { flex: 1; display: flex; flex-direction: column; gap: 20px; padding-top: 24px; padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.stack.tight { gap: 6px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row.tight { gap: 6px; }
.row.end { justify-content: flex-end; }
.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; }
.empty { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.empty p { margin: 0; max-width: 62ch; color: var(--muted); }
.loading, .boot { padding: 56px 16px; text-align: center; color: var(--muted); font-family: var(--font-body); }
.back { color: var(--muted); text-decoration: none; font-size: 15px; align-self: flex-start; }
.back:hover { color: var(--ink); }

/* ---- Controls ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 9px 16px; border-radius: var(--r); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 700; font-size: 15px; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--btn); border-color: var(--btn); color: #FFFFFF; }
.btn.primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn.big { min-height: 50px; font-size: 16px; width: 100%; }
.btn.danger:hover { color: var(--crit); }
.btn.armed { background: var(--crit); border-color: var(--crit); color: #FFFFFF; }
.btn.armed:hover { color: #FFFFFF; background: var(--crit); }
.link { background: none; border: 0; padding: 4px 0; cursor: pointer; font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.link.danger:hover { color: var(--crit); }
.link.armed { color: var(--crit); font-weight: 700; text-decoration: none; }
.x { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 8px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; flex: none; }
.x:hover { color: var(--crit); background: #F8E5E3; }
.x.armed { background: var(--crit); color: #FFFFFF; font-size: 13px; font-weight: 700; }
.icon { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; color: var(--muted); font-size: 15px; }
.icon:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.icon:disabled { opacity: .35; cursor: default; }

.tone-ok { --tone: var(--ok); }
.tone-warn { --tone: var(--warn); }
.tone-crit { --tone: var(--crit); }
.tone-info { --tone: var(--info); }
.tone-muted { --tone: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--tone);
  background: var(--surface-2); background: color-mix(in srgb, var(--tone) 12%, var(--surface));
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.tag { display: inline-block; padding: 1px 8px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--muted); }
.count { font-size: 12px; color: var(--muted); font-weight: 700; }

.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 12px; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; min-height: 38px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--charcoal); color: var(--on-dark); }

.form { display: flex; flex-direction: column; gap: 14px; }
.form.inset { padding: 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
input:not([type]), input[type="text"], input[type="email"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); font-size: 16px;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
.select-inline { width: auto; min-height: 36px; padding: 6px 10px; font-size: 15px; }
.check-line { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.check-line input, .mini-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--btn); }
.tpl-preview { margin: 0 0 0 28px; font-size: 13px; color: var(--muted); }

/* ---- Board ---------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.kpi { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-n { font-family: var(--font-display); font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-l { font-size: 13px; color: var(--muted); line-height: 1.25; }
.kpi.tone-crit .kpi-n { color: var(--crit); }
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:last-child { grid-column: 1 / -1; }
  .kpi-n { font-size: 26px; }
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; gap: 12px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.pcard:hover { border-color: var(--line-strong); box-shadow: 0 2px 12px rgba(30, 30, 30, .07); }
.pcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pcard .h-card { font-size: 20px; font-weight: 400; margin-top: 2px; }
.pcard .muted.small { margin: 2px 0 0; }
.now { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; font-size: 15px; }
.next { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.next li { display: flex; gap: 8px; align-items: flex-start; }
.box { width: 13px; height: 13px; border: 1.5px solid var(--line-strong); border-radius: 3px; margin-top: 3px; flex: none; }
.pcard-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }

.prog { display: flex; flex-direction: column; gap: 6px; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width .3s; }
.bar.on-dark { background: #464643; border-color: #52514D; }
.prog-l { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- Project page --------------------------------------------------------- */
.phead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 16px 28px; }
@media (max-width: 760px) { .phead { grid-template-columns: minmax(0, 1fr); } }
.phead .muted { margin: 4px 0 0; }
.phead .dates { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.phead-side { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.phead-side .prog { align-self: stretch; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 15px; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--brand); }

.phase { display: flex; flex-direction: column; gap: 12px; }
.phase.st-blocked { border-color: var(--crit); }
.phase.st-done { background: var(--surface-2); }
.phase-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; }
.phase-ctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.meta { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); }
.due.crit { color: var(--crit); font-weight: 700; }
.due.warn { color: var(--warn); font-weight: 700; }
select.status {
  width: auto; min-height: 36px; padding: 5px 10px; font-size: 14px; font-weight: 700; color: var(--tone);
  background-color: var(--surface); background-color: color-mix(in srgb, var(--tone) 10%, var(--surface));
  border-color: var(--line-strong); border-color: color-mix(in srgb, var(--tone) 40%, var(--line));
}
select.status option { color: var(--ink); background: var(--surface); }
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); }
.check { display: flex; gap: 12px; flex: 1; min-width: 0; padding: 10px 0; cursor: pointer; align-items: flex-start; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--ok); }
.tt { overflow-wrap: anywhere; }
.task.done .tt { text-decoration: line-through; color: var(--muted); }
.by { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.add-task { display: flex; gap: 8px; }
.add-task input { flex: 1; min-width: 0; }
.all-done { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm); font-weight: 700; font-size: 14px; color: var(--ok); background: var(--surface-2); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.add-phase { align-self: flex-start; }

.log-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 780px; width: 100%; }
.composer { display: flex; flex-direction: column; gap: 12px; }
.composer-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.file-btn { position: relative; overflow: hidden; border-style: dashed; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.thumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs li { position: relative; width: 84px; height: 84px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-sm); display: block; }
.thumbs .x { position: absolute; top: 3px; right: 3px; min-width: 26px; height: 26px; font-size: 16px; background: rgba(0, 0, 0, .62); color: #FFFFFF; }
.share { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; background: var(--surface-2); }
.share.on { border-color: var(--brand); background: var(--brand-soft); }
.share input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--btn); flex: none; }
.share b { display: block; }

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; color: var(--muted); }
.entry-meta strong { color: var(--ink); }
.entry-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry-actions { display: flex; justify-content: flex-end; }
.share-pill { margin-left: auto; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.share-pill.on { background: var(--brand-soft); border-color: var(--brand); color: var(--btn); }
.share-pill.still { cursor: default; }

.photos { display: grid; gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.photos.n1 { grid-template-columns: minmax(0, 1fr); }
.photos.n2, .photos.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.photo { padding: 0; border: 0; border-radius: var(--r-sm); overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; background: var(--surface-2); max-width: 100%; }
.photos.n1 .photo { aspect-ratio: 16 / 10; max-width: 560px; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-missing { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 13px; }
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 15, 15, .93);
  display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lightbox .photo-missing { color: #DDDDDD; }
.lb-close, .lb-prev, .lb-next { position: absolute; border: 0; background: rgba(255, 255, 255, .16); color: #FFFFFF; width: 46px; height: 46px; border-radius: 50%; font-size: 28px; line-height: 1; cursor: pointer; }
.lb-close { top: calc(12px + env(safe-area-inset-top, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); }
.lb-prev { left: calc(12px + env(safe-area-inset-left, 0px)); top: 50%; transform: translateY(-50%); }
.lb-next { right: calc(12px + env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); color: #DDDDDD; font-size: 14px; }

.checks { list-style: none; margin: 0; padding: 0; }
.check-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 0; border-top: 1px solid var(--line); align-items: center; }
.check-row:first-child { border-top: 0; padding-top: 0; }
.check-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.check-name { font-weight: 700; overflow-wrap: anywhere; }
.check-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: flex-end; }
.check-ctl input[type="date"] { width: auto; min-height: 36px; padding: 5px 8px; font-size: 15px; }
.check-row .notes { grid-column: 1 / -1; min-height: 38px; padding: 6px 10px; font-size: 15px; background: var(--surface-2); }
.mini-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
@media (max-width: 640px) { .check-row { grid-template-columns: minmax(0, 1fr); } .check-ctl { justify-content: flex-start; } }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card > .sugg { margin-top: 12px; }
.chip-btn { border: 1px dashed var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--ink); }
.chip-btn:hover { border-style: solid; border-color: var(--btn); color: var(--btn); }

.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.people li:first-child { border-top: 0; padding-top: 4px; }
.people li > div:first-child { display: flex; flex-direction: column; }
.inline-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.inline-form.four { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto; }
@media (max-width: 720px) { .inline-form, .inline-form.four { grid-template-columns: minmax(0, 1fr); } }
.preview-frame { border: 2px dashed var(--line-strong); border-radius: calc(var(--r) + 4px); padding: 14px; background: var(--bg); }

/* ---- Homeowner view ------------------------------------------------------- */
.client { display: flex; flex-direction: column; gap: 18px; }
.client-hero { background: var(--charcoal); color: var(--on-dark); border-radius: var(--r); padding: 26px 24px; display: flex; flex-direction: column; gap: 10px; }
.client-hero .eyebrow { color: var(--brand); }
.light-muted { margin: 0; color: var(--on-dark-muted); }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 16px; margin: 10px 0 4px; }
.hero-stats > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hs-n { font-family: var(--font-display); font-size: 36px; line-height: 1; }
.hs-k { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--on-dark-muted); }
.hs-v { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.hs-l { font-size: 13px; color: var(--on-dark-muted); }
.client-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .client-grid { grid-template-columns: minmax(0, 1fr); } }

.timeline { list-style: none; margin: 12px 0 0; padding: 0; }
.tl { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 4px 12px; padding: 9px 0; align-items: center; }
.tl::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl:first-child::before { top: 50%; }
.tl:last-child::before { bottom: 50%; }
.tl:only-child::before { display: none; }
.tl-dot { position: relative; z-index: 1; justify-self: center; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); }
.tl-done .tl-dot { background: var(--ok); border-color: var(--ok); }
.tl-in_progress .tl-dot { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.tl-blocked .tl-dot { border-color: var(--warn); }
.tl-name { font-weight: 700; overflow-wrap: anywhere; }
.tl-done .tl-name { color: var(--muted); font-weight: 400; }
.tl-state { font-size: 13px; color: var(--muted); text-align: right; }
.tl-in_progress .tl-state { color: var(--btn); font-weight: 700; }
.tl-blocked .tl-state { color: var(--warn); font-weight: 700; }

.client-checks { list-style: none; margin: 10px 0 0; padding: 0; }
.client-checks li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.client-checks li:first-child { border-top: 0; }
.client-checks .muted { flex-basis: 100%; }
.contact p { margin: 8px 0 0; }
.contact a { color: var(--btn); font-weight: 800; font-size: 18px; text-decoration: none; white-space: nowrap; }

/* ---- Sign in -------------------------------------------------------------- */
.login {
  min-height: 100vh; background: var(--charcoal); display: flex; align-items: center; justify-content: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.login-card { width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--r); padding: 0 24px 24px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.login-brand { display: flex; align-items: center; gap: 12px; margin: 0 -24px 6px; padding: 16px 24px; background: #333331; color: var(--on-dark); border-bottom: 3px solid var(--brand); }
.alert { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: #FBE9E7; color: var(--crit); font-size: 14px; }
.sent { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sent p { margin: 0; }
.demo-pick { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }

/* ---- Notices -------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 60; width: max-content; max-width: min(92vw, 520px); background: var(--charcoal); color: var(--on-dark);
  padding: 12px 18px; border-radius: var(--r); box-shadow: 0 8px 28px rgba(0, 0, 0, .25); font-size: 15px;
}
.toast.bad { background: var(--crit); color: #FFFFFF; }

/* ---- Receipts and expenses ------------------------------------------------- */
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.four .kpi:last-child { grid-column: auto; }
}
.note { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; }
.note.ok { background: #E6F2EC; color: var(--ok); }
.note.warn { background: #FBF0E0; color: var(--warn); }

.rc-sum { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 28px; }
.rc-sum > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.rc-big { font-family: var(--font-display); font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.rc-cats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; }
.rc-cats li { display: flex; gap: 6px; }
.rc-cats span { color: var(--muted); }

.rc-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.rc-list > li { border-top: 1px solid var(--line); }
.rc-list > li:first-child { border-top: 0; }
.rc-row {
  display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%;
  padding: 12px 18px; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.rc-row:hover, .rc-list > li.open .rc-row { background: var(--surface-2); }
.rc-date { font-size: 14px; color: var(--muted); }
.rc-main { display: flex; flex-direction: column; gap: 2px; }
.rc-total { font-weight: 800; font-variant-numeric: tabular-nums; }
.rc-detail { display: flex; flex-wrap: wrap; gap: 16px; padding: 6px 18px 18px; background: var(--surface-2); }
.rc-detail > .stack, .rc-detail > form { flex: 1; min-width: min(100%, 240px); }
.rc-photo { width: 140px; flex: none; }
.rc-items, .rc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rc-items td, .rc-table td, .rc-table th { padding: 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.rc-table th { font-size: 13px; color: var(--muted); }
.rc-items .num, .rc-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.rc-table .link { padding: 0; text-align: left; color: var(--info); }
.rc-totals { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 2px 16px; margin: 0; font-size: 14px; }
.rc-totals dt { color: var(--muted); }
.rc-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.rc-pick { display: flex; flex-direction: column; gap: 12px; }
.rc-spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--btn); border-radius: 50%; animation: rc-spin .8s linear infinite; }
@keyframes rc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rc-spinner { animation-duration: 2.4s; } }
.rc-form { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.rc-form > .stack { flex: 1; min-width: min(100%, 280px); }
.rc-preview { width: 150px; max-height: 260px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.rc-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.rc-edit-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rc-edit-items li { display: grid; grid-template-columns: minmax(0, 1fr) 64px 96px auto; gap: 6px; align-items: center; }
.kpi.tone-warn .kpi-n { color: var(--warn); }
.backup-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.backup-note a { color: var(--btn); font-weight: 700; }
.backup-note .link { color: var(--warn); }

/* ---- Change orders ---------------------------------------------------------- */
.co { display: flex; flex-direction: column; gap: 12px; }
.co.waiting { border-color: var(--info); box-shadow: inset 0 0 0 1px var(--info); }
.co-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.co-desc { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.co-money { justify-content: start; }
.co-decide { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.co-list { list-style: none; margin: 0 0 10px; padding: 0; }
.co-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.co-list li:first-child { border-top: 0; padding-top: 0; }
.co-list .minw { flex: 1 1 220px; display: flex; flex-direction: column; }
.co-amt { font-weight: 800; font-variant-numeric: tabular-nums; }

.rc-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 12px; align-items: end; }

/* ---- Walkthroughs ------------------------------------------------------------ */
.wt { display: flex; flex-direction: column; gap: 14px; max-width: 780px; width: 100%; }
.wt-start { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.wt-tips { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.wt-link { align-self: flex-start; }
.wt-video { display: block; width: 100%; max-height: 60vh; aspect-ratio: 3 / 4; object-fit: cover; background: #111111; border-radius: var(--r-sm); }
@media (min-width: 700px) { .wt-video { aspect-ratio: 16 / 9; } }
.wt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.wt-rec { display: inline-flex; align-items: center; gap: 8px; color: var(--crit); font-weight: 800; }
.wt-rec i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: wt-blink 1.2s steps(2, start) infinite; }
@keyframes wt-blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .wt-rec i { animation: none; } }
.wt-time { font-family: var(--font-display); font-size: 24px; font-variant-numeric: tabular-nums; }
.wt-last { width: 44px; height: 44px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
.wt-words { margin: 0; white-space: pre-wrap; max-height: 220px; overflow: auto; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r-sm); font-size: 14px; }
.wt-set { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.wt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wt-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 14px; }
.wt-phases { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wt-phase { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.wt-phase-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.wt-phase-head input { font-weight: 700; }
.wt-num { min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--charcoal); color: var(--on-dark); font-size: 13px; font-weight: 800; }
.wt-tasks { list-style: none; margin: 0; padding: 0 0 0 34px; display: flex; flex-direction: column; gap: 6px; }
.wt-tasks li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: start; }
.wt-tasks textarea { min-height: 44px; resize: none; overflow: hidden; line-height: 1.35; }
.wt-tasks .x { margin-top: 5px; }
.wt-add { align-self: flex-start; margin-left: 34px; }
@media (max-width: 520px) {
  .wt-phase-head { grid-template-columns: auto minmax(0, 1fr); }
  .wt-phase-head > .row { grid-column: 1 / -1; justify-content: flex-end; }
  .wt-tasks { padding-left: 0; }
  .wt-add { margin-left: 0; }
}

/* ---- Voice updates ------------------------------------------------------------ */
.voice-bar { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; flex-basis: 100%; padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.voice-time { font-variant-numeric: tabular-nums; font-size: 18px; }
.rc-spinner.small { width: 18px; height: 18px; border-width: 2px; }
.voice-done { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); }

/* ---- Sharing updates: crew ask, admins decide ------------------------------------ */
.share-pill.ask { border-color: var(--warn); color: var(--warn); background: #FBF0E0; }
.share-ask { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; border-radius: var(--r-sm); background: #FBF0E0; color: var(--warn); font-size: 14px; font-weight: 700; }
.share-queue { border-color: var(--warn); }
.share-queue .feed { margin: 0; }

/* ---- Site visits ------------------------------------------------------------------ */
.wt-existing { font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.wt-phase-head.visit { grid-template-columns: auto minmax(0, 1fr) auto; }
.wt-extras { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wt-extras li { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.wt-extras textarea { min-height: 60px; }
.wt-extras .link { align-self: flex-start; }

/* ---- Easier on a phone ------------------------------------------------------------ */
.work-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.phase.folded { padding: 0; }
.phase-fold { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: var(--r); }
.phase-fold:hover { background: var(--surface-2); }
.phase-fold .h-phase { flex: 1; font-size: 15px; color: var(--muted); }
.fold-tick { width: 22px; height: 22px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--ok); color: #FFFFFF; font-size: 13px; font-weight: 800; }
.fold-show { font-size: 13px; font-weight: 700; color: var(--info); }
.fold-tasks, .add-task-link { align-self: flex-start; }
.t-short { display: none; }

/* Every section of a job in view at once, rather than tabs scrolling off the side. */
@media (max-width: 900px) {
  .tabs { flex-wrap: wrap; gap: 6px; border-bottom: 0; overflow: visible; }
  .tabs a { padding: 6px 12px; font-size: 14px; border: 1px solid var(--line-strong); border-radius: 999px; margin: 0; background: var(--surface); }
  .tabs a.on { background: var(--charcoal); border-color: var(--charcoal); color: var(--on-dark); }
  .tabs a.on .count { color: var(--on-dark-muted); }
}

@media (max-width: 640px) {
  /* Header: name and Sign out on one line, the menu under it. */
  .topbar-in { gap: 6px 10px; padding-block: 8px; }
  .brand { order: 1; gap: 8px; }
  .brand img { height: 32px; }
  .brand-sub { font-size: 10px; }
  .me { order: 2; gap: 6px; }
  .pill-t { display: none; }
  .pill { padding: 5px; }
  .me button { padding: 5px 9px; font-size: 13px; }
  .nav { order: 3; flex-basis: 100%; }
  .nav a { padding: 6px 10px; font-size: 14px; }
  .page { gap: 14px; padding-top: 14px; }

  /* Board: a smaller summary, and the project filter across the full width. */
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi { padding: 9px 10px; gap: 2px; }
  .kpi-n { font-size: 22px; }
  .kpi-l { font-size: 12px; }
  .kpi:last-child { grid-column: span 2; }
  .sec-head .seg { display: flex; width: 100%; flex-wrap: nowrap; }
  .sec-head .seg button { flex: 1 1 0; min-width: 0; white-space: normal; line-height: 1.2; font-size: 13px; padding: 6px 6px; }
  .sec-head .row { width: 100%; }

  /* Project page: a shorter header, and every section in view at once. */
  .phead { padding: 14px; gap: 10px; }
  .phead .h-hero { font-size: 24px; }
  .phead .dates { font-size: 13px; margin-top: 4px; }
  .phead-side { gap: 8px; }
  .phead-side .btn, .phead-side .select-inline { min-height: 34px; padding-block: 5px; font-size: 14px; }
  .tabs a { padding: 5px 10px; font-size: 13px; }
  .tabs .count { font-size: 11px; }
  .t-long { display: none; }
  .t-short { display: inline; }
}


/* ---- Directions to the site ---------------------------------------------------------- */
.dir { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; max-width: 100%; }
.dir-link { display: inline-flex; align-items: flex-start; gap: 5px; color: var(--info); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.dir-pin { width: 16px; height: 16px; flex: none; margin-top: 2px; fill: currentColor; }
.dir-change { font-size: 12px; padding: 0; }
.dir-menu { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex-basis: 100%; }
.phead-addr { margin: 6px 0 0; }
.phead-addr .dir.with-map { max-width: 560px; margin-top: 4px; }
.pcard { position: relative; }
.pcard-link { position: absolute; inset: 0; border-radius: inherit; }
.pcard-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pcard-addr { position: relative; z-index: 1; margin: 4px 0 0; }

/* ---- Selections, budget, Today ------------------------------------------------------------ */
.sel-list { list-style: none; margin: 0; padding: 0; }
.sel { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.sel:first-child { border-top: 0; padding-top: 0; }
.sel:last-child { padding-bottom: 0; }
.sel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 6px 12px; }
.sel-head .minw { display: flex; flex-direction: column; gap: 2px; flex: 1 1 200px; }
.sel-details { white-space: pre-wrap; }
.sel-choice { margin: 0; overflow-wrap: anywhere; }
.sel-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sel-pick input { flex: 1 1 220px; }
.money-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 14px; }
.money-grid > div { display: flex; flex-direction: column; gap: 2px; }
.money-l { font-size: 13px; font-weight: 700; color: var(--muted); }
.money-n { font-family: var(--font-display); font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.money-n.tone-crit, .money-line.tone-crit { color: var(--crit); }
.money-line { margin: 0; font-weight: 700; color: var(--muted); }
.money-line.tone-warn { color: var(--warn); }
.money-cats { justify-content: start; }
.check-line.top { align-items: flex-start; }
.check-line.top input { margin-top: 3px; flex: none; }
.today-soon { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.today-soon li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.today-job { display: flex; flex-direction: column; gap: 12px; }
.today-name { color: inherit; text-decoration: none; }
.today-name:hover .h-card { text-decoration: underline; }
.today-phase { display: flex; flex-direction: column; gap: 6px; }
.tag.you { background: var(--brand-soft); border-color: var(--brand); color: var(--btn); }
.sel > .link { align-self: flex-start; }

/* ---- Hours, bills, documents, schedule, punch list ---------------------------------------- */
.clock-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; border-color: var(--crit); }
.clock-bar .minw { flex: 1 1 160px; }
.hours-list, .bill-list, .doc-list { list-style: none; margin: 0; padding: 0; }
.hours-list li, .bill-list > li, .doc-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.hours-list li:first-child, .bill-list > li:first-child, .doc-list li:first-child { border-top: 0; }
.hours-list .minw, .bill .minw { flex: 1 1 180px; display: flex; flex-direction: column; }
.hours-day { width: 64px; flex: none; font-size: 14px; color: var(--muted); }
.hours-n { font-weight: 800; font-variant-numeric: tabular-nums; }
.rate-in { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.rate-in input { width: 90px; min-height: 36px; padding: 6px 8px; text-align: right; }
.doc-open { flex: 1 1 200px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; min-width: 0; }
.doc-name { color: var(--info); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.sched { display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.sched-months { position: relative; height: 16px; margin-left: 0; font-size: 12px; color: var(--muted); }
.sched-months span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.sched-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sched-rows li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
.sched-name { font-weight: 700; color: inherit; text-decoration: none; }
.sched-name:hover { text-decoration: underline; }
.sched-track { position: relative; height: 18px; background: var(--surface-2); border-radius: 999px; }
.sched-bar { position: absolute; top: 4px; height: 10px; border-radius: 999px; background: var(--brand-soft); border: 1px solid var(--brand); }
.sched-bar.open { border-style: dashed; }
.sched-today { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--crit); z-index: 1; }
.sched-dot { position: absolute; top: 4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--tone); border: 2px solid var(--surface); z-index: 2; }
.sched-dates { font-size: 12px; }
.sched-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sched-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.sched-day { width: 100px; flex: none; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.client-punch { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.client-punch li { display: flex; align-items: flex-start; gap: 10px; }
.client-punch li .fold-tick { background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ok); }
.client-punch li.done .fold-tick { background: var(--ok); border-color: var(--ok); color: #FFFFFF; }
.client-punch li.done span:last-child { color: var(--muted); }

/* ---- Schedule calendar ---------------------------------------------------------------------- */
.tone-pick { --tone: #7A4FB5; }
.tone-walk { --tone: #0E7C86; }
.tone-trade { --tone: #BE185D; }
.cal { display: flex; flex-direction: column; gap: 12px; }
.cal-head { display: flex; align-items: center; gap: 8px; }
.cal-title { min-width: 11ch; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.cal-dow { background: var(--surface-2); padding: 6px 4px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; }
.cal-day { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; min-height: 100px; padding: 5px 5px 6px; background: var(--surface); border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.other { background: #FAFAF8; color: var(--muted); }
.cal-day.past .cal-n { color: var(--muted); }
.cal-day.on { box-shadow: inset 0 0 0 2px var(--info); }
.cal-n { font-size: 13px; font-weight: 700; line-height: 24px; min-width: 24px; }
.cal-day.today .cal-n { display: inline-flex; align-self: flex-start; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--btn); color: #FFFFFF; }
.cal-evs { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-ev { display: block; padding: 1px 4px; border-left: 3px solid var(--tone); border-radius: 3px; font-size: 11px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); background: var(--surface-2); background: color-mix(in srgb, var(--tone) 12%, var(--surface)); }
.cal-more { padding-left: 4px; font-size: 11px; color: var(--muted); }
.cal-dots { display: none; flex-wrap: wrap; justify-content: center; gap: 3px; }
.cal-dots i, .cal-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-day-list { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .cal { padding: 12px; }
  .cal-day { align-items: center; min-height: 52px; padding: 4px 2px; }
  .cal-day.today .cal-n { align-self: center; }
  .cal-evs { display: none; }
  .cal-dots { display: flex; }
  .cal-dow { padding: 4px 1px; font-size: 11px; }
}

/* ==== The app look: menu, cards, controls ====================================================== */

/* Cards and controls: softer, like a modern web app. */
.card { border-color: var(--line); box-shadow: var(--shadow); }
.btn { border-radius: var(--r-sm); font-weight: 600; font-size: 14px; min-height: 40px; padding: 8px 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.btn.small { min-height: 34px; padding: 6px 11px; font-size: 13px; }
.btn.big { min-height: 52px; font-size: 16px; border-radius: var(--r); }
.btn.ghost { box-shadow: none; }
.btn .ic { flex: none; }
input:not([type]), input[type="text"], input[type="email"], input[type="date"], input[type="time"], select, textarea { border-radius: var(--r-sm); font-size: 15px; }
input:not([type]):focus, input[type="text"]:focus, input[type="email"]:focus, input[type="date"]:focus, input[type="time"]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.chip { font-weight: 600; }
.tag { font-weight: 600; }
.kpi-n, .hs-n, .rc-big, .money-n { font-weight: 700; letter-spacing: -.02em; }
.pcard .h-card { font-size: 18px; font-weight: 650; }
.pcard:hover { box-shadow: var(--shadow-lg); }
.tabs a { font-weight: 600; }
.ic { display: inline-block; vertical-align: middle; }

/* Brand */
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { font-weight: 650; }

/* The app frame. The team has a sidebar on a computer and a tab bar on a phone. */
.app { min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.side, .tabbar { display: none; }
.pill { border-color: rgba(255, 255, 255, .18); }

@media (min-width: 900px) {
  .app.with-nav { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
  .app.with-nav .topbar { display: none; }
  .side {
    display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 18px 14px; background: var(--charcoal); color: var(--on-dark);
  }
  .side .brand { margin: 0 4px; }
  .side .brand img { height: 40px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav a {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-sm);
    color: var(--on-dark-muted); text-decoration: none; font-weight: 600; font-size: 14px;
  }
  .side-nav a:hover { color: var(--on-dark); background: rgba(255, 255, 255, .06); }
  .side-nav a.on { color: var(--on-dark); background: var(--charcoal-2); box-shadow: inset 3px 0 0 var(--brand); }
  .side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 12px 4px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
  .side-foot .pill { align-self: flex-start; color: var(--on-dark-muted); }
  .side-me { display: flex; align-items: center; gap: 10px; font-size: 13px; }
  .side-me .minw { display: flex; flex-direction: column; }
  .side-me b { color: var(--on-dark); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-me span:not(.avatar) { color: var(--on-dark-muted); }
  .avatar {
    width: 32px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--brand); color: #FFFFFF; font-weight: 700; font-size: 14px;
  }
  .side-out {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--r-sm);
    background: transparent; color: var(--on-dark-muted); font-size: 13px; font-weight: 600; cursor: pointer;
  }
  .side-out:hover { color: var(--on-dark); border-color: rgba(255, 255, 255, .3); }
  .app.with-nav .page { max-width: 1120px; padding-left: 32px; padding-right: 32px; padding-top: 28px; }
  .app.with-nav .demo-in { padding-left: 32px; padding-right: 32px; }
}

@media (max-width: 899px) {
  .app.with-nav .page { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(var(--tabs, 3), minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -2px 12px rgba(16, 24, 40, .06);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: var(--r-sm);
    color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600;
  }
  .tabbar a.on { color: var(--btn); }
  .tabbar a.on .ic { stroke-width: 2.2; }
  .app.with-nav .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .app.with-nav .nav { display: none; }
}

/* ==== Today for crew and trades: one job, big buttons ============================================ */
.crew { max-width: 640px; width: 100%; }
.crew-q { margin: 6px 0 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.pick-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pick-job {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 14px 16px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); cursor: pointer; font: inherit; color: inherit;
}
.pick-job:hover, .pick-job:focus-visible { border-color: var(--btn); }
.pick-job .minw { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.pick-job b { font-size: 17px; font-weight: 650; }
.pick-job .minw span { font-size: 14px; color: var(--muted); }
.pick-job .ic { color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-size: 15px; text-decoration: none; color: var(--muted); }
.crew-job { display: flex; flex-direction: column; gap: 10px; }
.crew-job .h-page { font-size: 26px; }
.crew-addr .dir-link { font-size: 16px; }
.crew-clock { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--r); background: #ECFDF3; color: var(--ok); }
.crew-clock > span { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.crew-alert { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.big-tasks .task { border-top-color: var(--line); }
.big-tasks .check { padding: 14px 0; gap: 14px; align-items: center; }
.big-tasks .check input { width: 28px; height: 28px; }
.big-tasks .tt { font-size: 17px; line-height: 1.35; }
.crew-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.crew-action {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 104px; padding: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; font-weight: 650; font-size: 16px; line-height: 1.3;
}
.crew-action .ic { color: var(--btn); }
.crew-action:hover { border-color: var(--btn); }
.hours-list li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 4px 10px; flex-wrap: nowrap; }
.hours-day { width: auto; }
.stack > .link, .card.stack > .link { align-self: flex-start; }

/* A job's sections, as pills that wrap at every screen size (there are up to 11). */
.tabs { flex-wrap: wrap; gap: 6px; border-bottom: 0; overflow: visible; }
.tabs a { padding: 6px 12px; font-size: 14px; border: 1px solid var(--line-strong); border-radius: 999px; margin: 0; background: var(--surface); }
.tabs a:hover { border-color: var(--ink); }
.tabs a.on { background: var(--charcoal); border-color: var(--charcoal); color: var(--on-dark); }
.tabs a.on .count { color: var(--on-dark-muted); }

/* ==== Checklists ================================================================================= */
.cl-page { max-width: 820px; }
.cl-dot { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--brand); vertical-align: middle; }
.cl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cl-phase { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
.cl-top { display: flex; align-items: flex-start; gap: 10px; }
.cl-top .cl-n, .cl-top .cl-tools { margin-top: 5px; }
.cl-n {
  flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 650;
}
.cl-top .cl-name { flex: 1; min-width: 0; min-height: 40px; resize: none; overflow: hidden; font-weight: 650; font-size: 16px; line-height: 1.35; }
.cl-tools { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.cl-tasks { list-style: none; margin: 0; padding: 0 0 0 38px; display: flex; flex-direction: column; gap: 6px; }
.cl-tasks li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: start; }
.cl-tasks textarea { min-height: 40px; resize: none; overflow: hidden; line-height: 1.35; }
.cl-tasks .x { margin-top: 3px; }
.cl-add { align-self: flex-start; margin-left: 38px; }
/* Messages show above the save bar instead of over it. */
.app:has(.savebar) .toast { bottom: 84px; }
@media (max-width: 899px) {
  .app.with-nav:has(.savebar) .toast { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
}
.savebar {
  position: sticky; bottom: 12px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  padding: 10px 12px; border-radius: var(--r); background: var(--charcoal); color: var(--on-dark); box-shadow: var(--shadow-lg);
}
.savebar > span { flex: 1 1 200px; font-weight: 600; font-size: 14px; }
.savebar .btn.ghost { color: var(--on-dark); background: transparent; border-color: rgba(255, 255, 255, .25); }
@media (max-width: 899px) {
  .app.with-nav .savebar { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 520px) {
  .cl-phase { padding: 10px 12px; }
  .cl-top { gap: 8px; }
  .cl-n { display: none; }
  .cl-tasks { padding-left: 0; }
  .cl-add { margin-left: 0; }
}

/* ==== "Get the app" bar (phones in the browser) ================================================== */
.install-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 16px;
  background: var(--brand-soft); border-bottom: 1px solid #F5D7BC; color: var(--ink); font-size: 14px; line-height: 1.4;
}
.install-bar img { flex: none; border-radius: 9px; }
.install-bar p { flex: 1 1 200px; margin: 0; }
.install-btns { display: flex; gap: 6px; margin-left: auto; }

/* Sign-in code */
.sent form { align-self: stretch; }
.code-in { font-size: 22px; letter-spacing: .3em; font-variant-numeric: tabular-nums; }

/* ==== Plans ======================================================================================== */
.plan-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.plan-bar .seg button { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.25; padding-block: 6px; }
.plan-seg-rev { font-size: 12px; font-weight: 500; opacity: .75; }
.plan-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 16px; }
.plan-head .minw { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }
.plan-rev { margin-left: 6px; font-weight: 600; color: var(--btn); }
.plan-old { margin: 0; padding: 8px 12px; border-radius: var(--r-sm); background: #FBF0E0; color: var(--warn); font-size: 14px; }
.plan-old .link { color: inherit; margin-left: 4px; }
.plan-admin { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.plan-admin-note { flex: 1 1 100%; }
.plan-hist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.plan-hist li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.plan-hist li.on .doc-name { color: var(--ink); text-decoration: none; }
.plan-frame { display: block; width: 100%; height: 70vh; min-height: 320px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.plan-wait { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 240px; border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--surface); padding: 20px; text-align: center; }
.plan-full { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; background: var(--charcoal); }
.plan-full-bar {
  display: flex; align-items: center; gap: 10px; color: var(--on-dark); font-size: 14px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
}
.plan-full-bar b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-full .plan-frame, .plan-full .plan-wait { flex: 1; height: auto; min-height: 0; border: 0; border-radius: 0; }
.plan-full .plan-wait { color: var(--on-dark); background: var(--charcoal); }
body.no-scroll { overflow: hidden; }
.plan-prep { display: flex; flex-direction: column; gap: 6px; }
.plan-changes { margin: 0; padding-left: 18px; color: var(--muted); }
.plan-warn { padding: 8px 12px; border-radius: var(--r-sm); background: #FBF0E0; color: var(--warn); }
.field-l { font-size: 13px; font-weight: 700; color: var(--muted); }
.share-list { list-style: none; margin: 0; padding: 0; }
.share-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.share-top { display: flex; align-items: center; gap: 10px; }
.share-label { flex: 1; min-width: 0; min-height: 36px; padding: 6px 10px; }
.share-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.share-exp { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.share-exp input { width: auto; min-height: 36px; padding: 4px 8px; }
@media (max-width: 640px) {
  /* Plans use the whole width of the phone. */
  .plan-frame, .plan-wait { width: calc(100% + 32px); margin-inline: -16px; border-radius: 0; border-inline: 0; }
  .plan-full .plan-frame, .plan-full .plan-wait { width: 100%; margin-inline: 0; }
}

/* ==== Invoices =================================================================================== */
.action-card { border-left: 4px solid var(--brand); }
.inv-list { list-style: none; margin: 0; padding: 0; }
.card.inv-list { padding: 4px 18px; }
.inv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.inv-row:first-child { border-top: 0; }
.inv-row .minw { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; }
.inv-row > .row { margin-left: auto; }
.inv-lines-edit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.inv-lines-edit li { display: grid; grid-template-columns: minmax(0, 1fr) 70px 110px 100px auto; gap: 6px; align-items: center; }
.inv-lines-edit .num, .inv-share .num { text-align: right; }
.inv-share .num { width: 64px; }
.inv-amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.inv-sum { font-size: 15px; }
@media (max-width: 620px) {
  .inv-lines-edit li { grid-template-columns: 56px minmax(0, 1fr) auto; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .inv-lines-edit li > input:first-child { grid-column: 1 / -1; }
  .inv-lines-edit .inv-amt { grid-column: 1 / 3; text-align: left; }
}
.inv-tools { align-items: center; }

/* The invoice itself: a page that prints well. */
.inv-doc {
  max-width: 820px; width: 100%; padding: 40px; background: #FFFFFF; color: #111827;
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 28px; overflow: hidden;
}
.inv-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.inv-from { display: flex; gap: 18px; align-items: center; }
.inv-logo { flex: none; height: 100px; width: auto; }
.inv-from > div, .inv-parties > div { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: #374151; }
.inv-co { font-size: 18px; color: #111827; }
.inv-meta { text-align: right; }
.inv-meta h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: .04em; text-transform: uppercase; color: var(--btn); }
.inv-meta dl { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 0; font-size: 14px; justify-content: end; }
.inv-meta dt { color: #6B7280; }
.inv-meta dd { margin: 0; font-weight: 600; text-align: right; }
.inv-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; padding: 16px 0; border-top: 1px solid #E5E7EB; border-bottom: 1px solid #E5E7EB; }
.inv-parties b { font-size: 15px; color: #111827; }
.inv-k { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6B7280; margin-bottom: 2px; }
.inv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.inv-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #6B7280; padding: 8px 6px; border-bottom: 2px solid #111827; }
.inv-table td { padding: 10px 6px; border-bottom: 1px solid #E5E7EB; vertical-align: top; }
.inv-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.inv-qty-line { display: none; }
.inv-totals { display: grid; grid-template-columns: auto minmax(110px, auto); justify-content: end; gap: 6px 24px; margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.inv-totals dt { color: #4B5563; text-align: right; }
.inv-totals dd { margin: 0; text-align: right; }
.inv-totals .grand { font-size: 17px; font-weight: 700; color: #111827; }
.inv-note p { margin: 4px 0 0; white-space: pre-wrap; font-size: 14px; }
.inv-foot { font-size: 13px; color: #6B7280; text-align: center; padding-top: 16px; border-top: 1px solid #E5E7EB; }
.inv-badge {
  display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px; background: #E5E7EB; color: #374151;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.inv-badge.ok { background: #DCFCE7; color: #166534; }
@media (max-width: 620px) {
  .inv-doc { padding: 22px 16px; gap: 20px; }
  .inv-meta { text-align: left; }
  .inv-logo { height: 76px; }
  .inv-meta dl { justify-content: start; }
  .inv-table th:nth-child(2), .inv-table td:nth-child(2), .inv-table th:nth-child(3), .inv-table td:nth-child(3) { display: none; }
  .inv-qty-line { display: block; color: #6B7280; font-size: 13px; }
}

@media print {
  @page { margin: 14mm; }
  body { background: #FFFFFF; }
  .side, .topbar, .tabbar, .demo, .install-bar, .toast-slot, .no-print, .back { display: none !important; }
  .app.with-nav { display: block; }
  .main, .app { min-height: 0; }
  .page, .app.with-nav .page { padding: 0 !important; max-width: none; }
  .inv-doc { border: 0; box-shadow: none; padding: 0; max-width: none; }
}

/* ==== Estimates ================================================================================== */
.est-sec { display: flex; flex-direction: column; gap: 10px; }
.est-h { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--btn); padding-bottom: 6px; border-bottom: 1px solid #E5E7EB; }
.rich { font-size: 14px; line-height: 1.55; color: #1F2937; }
.rich h4 { margin: 14px 0 4px; font-size: 14px; font-weight: 700; color: #111827; }
.rich h4:first-child { margin-top: 0; }
.rich p { margin: 0 0 6px; }
.rich ul { margin: 0 0 8px; padding-left: 20px; }
.rich li { margin: 2px 0; }
.est-notes .rich h4 { font-size: 13px; letter-spacing: .04em; }
.est-notes .rich h4:first-child { font-size: 13px; letter-spacing: .08em; color: var(--btn); padding-bottom: 6px; border-bottom: 1px solid #E5E7EB; margin-bottom: 8px; }
.est-accepted { padding: 12px 14px; border-radius: var(--r-sm); background: #ECFDF3; color: #14532D; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.est-accepted p { margin: 2px 0 0; font-size: 14px; }
.est-accept { max-width: 820px; border-left: 4px solid var(--brand); }
.es-scope { min-height: 220px; line-height: 1.5; font-size: 14px; }
.sched-edit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sched-edit li { display: grid; grid-template-columns: minmax(0, 1fr) 96px 110px auto; gap: 6px; align-items: center; }
.sched-edit li:not(:has(.inv-amt)) { grid-template-columns: minmax(0, 1fr) 96px auto; }
.sched-pct { display: inline-flex; align-items: center; gap: 4px; }
.sched-pct input { width: 64px; text-align: right; }
@media (max-width: 620px) {
  .sched-edit li { grid-template-columns: minmax(0, 1fr) auto; }
  .sched-edit li > input:first-child { grid-column: 1 / -1; }
}
@media print {
  .est-sec h2, .rich h4 { break-after: avoid; }
  .inv-table tr, .rich li { break-inside: avoid; }
}

/* ==== Crew plan ================================================================================== */
.crew-day-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.crew-day-nav .minw { display: flex; flex-direction: column; min-width: 140px; }
.crew-day-nav input[type="date"] { width: auto; }
.crew-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.crew-person { display: flex; flex-direction: column; gap: 8px; }
.crew-who { display: flex; align-items: center; gap: 8px; }
.crew-stop { display: grid; grid-template-columns: minmax(0, 1.4fr) 120px minmax(0, 1.6fr) auto; gap: 6px; align-items: center; }
.crew-stop:has(> select:only-child), .crew-stop:has(> select + .btn) { grid-template-columns: minmax(0, 1fr) auto; }
.crew-more { align-self: flex-start; }
.crew-stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
@media (max-width: 620px) {
  .crew-stop { grid-template-columns: minmax(0, 1fr) 118px auto; }
  .crew-stop > input:not([type="time"]) { grid-column: 1 / -1; grid-row: 2; }
}
.crew-start { display: flex; align-items: center; gap: 6px; font-size: 17px; }
.crew-note { background: var(--brand-soft); color: var(--ink); }
.pick-job.planned { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand), var(--shadow); }
.your-stop { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.your-stop:first-of-type { border-top: 0; }
.your-stop .minw { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; }

/* Priority jobs */
.pcard-flags { display: inline-flex; align-items: center; gap: 6px; flex: none; position: relative; z-index: 1; }
.star { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--line-strong); cursor: pointer; flex: none; }
button.star:hover { color: var(--brand); background: var(--brand-soft); }
.star.on { color: var(--brand); }
.ic-fill { fill: currentColor; }
.phead-title { display: flex; align-items: center; gap: 6px; }

/* ==== Today for crew: where the job is, in colour ================================================== */
.stage-top { display: flex; flex-direction: column; gap: 2px; }
.stage-top b { font-size: 20px; font-weight: 700; line-height: 1.25; }
.stage-strip { list-style: none; margin: 4px 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.stage { flex: 1 1 0; height: 12px; border-radius: 4px; background: var(--line); }
.stage.s-done { background: var(--ok); }
.stage.s-in_progress { background: var(--brand); }
.stage.s-blocked { background: var(--crit); }
.stage.now { height: 20px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand); }
.stage.now.s-blocked { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--crit); }
.stage-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; font-size: 14px; color: var(--muted); }
.stage-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.stage-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.stage-key.s-done { background: var(--ok); }
.crew-action.wide { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; }
.crew-action.wide .minw { display: flex; flex-direction: column; gap: 2px; }

/* ==== Addresses: suggestions while typing, and a street map ====================================== */
.addr { position: relative; display: block; }
.addr-list {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 10px 28px rgba(17, 24, 39, .16);
  max-height: 320px; overflow-y: auto;
}
.addr-list li { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; cursor: pointer; }
.addr-list li b { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.addr-list li span { font-size: 13px; color: var(--muted); }
.addr-list li.on, .addr-list li:hover { background: var(--surface-2); }
.addr-list li.addr-credit { padding: 4px 12px 2px; font-size: 11px; color: var(--muted); cursor: default; background: none; }
.dir.with-map { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; max-width: 640px; } /* Google sends at most 640 wide; never stretched past it */
.site-views { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; height: 180px; }
.site-views.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.site-photo, .site-map, .site-wait { position: relative; display: block; min-width: 0; height: 180px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-sm); background: #EEEBE4; }
.site-photo img, .site-map > img { display: block; width: 100%; height: 100%; object-fit: fill; }
.site-map .street-map { height: 100%; border: 0; border-radius: 0; }
.site-chip { position: absolute; top: 6px; left: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 7px; border-radius: 999px; background: rgba(255, 255, 255, .94); color: var(--ink); font-size: 12px; font-weight: 650; box-shadow: 0 1px 4px rgba(17, 24, 39, .25); }
.site-chip .ic { color: var(--btn); }
.map-street {
  position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px 0 10px;
  border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 650; text-decoration: none;
  box-shadow: 0 2px 8px rgba(17, 24, 39, .28);
}
.map-street .ic { color: var(--btn); }
.street-map { position: relative; display: block; height: 180px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-sm); background: #EEEBE4; }
.street-map img { position: absolute; max-width: none; }
.map-pin { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; transform: translate(-50%, -92%); fill: var(--brand); stroke: #FFFFFF; stroke-width: 1.5; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.map-pin circle { fill: #FFFFFF; stroke: none; }
.map-credit { position: absolute; right: 0; bottom: 0; padding: 1px 6px; border-top-left-radius: 6px; background: rgba(255, 255, 255, .85); color: #374151; font-size: 10px; font-weight: 500; }
/* The client's plans: a small card, each plan opens full screen when tapped. */
.plan-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.plan-tile {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; text-align: left; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface-2); color: inherit; font: inherit;
}
.plan-tile:hover { border-color: var(--btn); }
.plan-tile b { font-size: 15px; }
.plan-tile span { grid-column: 1; font-size: 13px; color: var(--muted); }
.plan-tile .plan-tile-go { grid-column: 2; grid-row: 1 / span 2; font-weight: 600; font-size: 14px; color: var(--btn); }
/* The client list (admins), and "Your details" on a client's project page. */
.ct-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ct-tools input { flex: 1 1 240px; min-width: 0; }
.ct-list { list-style: none; margin: 0; padding: 0; }
.ct-list > li { padding: 12px 0; border-top: 1px solid var(--line); }
.ct-list > li:first-child { border-top: 0; padding-top: 4px; }
.ct { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px 12px; }
.ct-who { display: flex; flex-direction: column; gap: 1px; overflow-wrap: anywhere; }
.ct-who .muted.small:empty { display: none; }
@media (max-width: 640px) {
  .ct { grid-template-columns: minmax(0, 1fr) auto; }
  .ct > span:nth-child(2) { grid-column: 1; grid-row: 2; justify-self: start; }
}
.ct-mine { display: flex; flex-direction: column; gap: 1px; overflow-wrap: anywhere; }
.ct-news { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; cursor: pointer; padding-top: 8px; border-top: 1px solid var(--line); }
.ct-news input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--btn); }
/* On a job's Client tab: add someone already on file. */
.pick-person { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.known-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); }
.known-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; }
.known-list li + li { border-top: 1px solid var(--line); }
/* The jobs map on Today (jobsmap.js). Its own stacking layer, so the map's
   layers never cover the menus. */
.jm-map { position: relative; z-index: 0; isolation: isolate; height: 300px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: #EEEBE4; }
.jm-map.tall { height: calc(100vh - 300px); height: calc(100dvh - 300px); min-height: 380px; }
.jm-map.leaflet-container { font: inherit; }
.jm-pin { fill: var(--btn); fill-opacity: 1; stroke: #FFFFFF; stroke-width: 2.5; }
.jm-pin.s-planning { fill: var(--info); }
.jm-pin.s-on_hold { fill: #8A8F98; }
.jm-pin.on { stroke: var(--ink); stroke-width: 3; }
.jm-key { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0; font-size: 13px; color: var(--muted); }
.jm-key span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.jm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--btn); }
.jm-dot.s-planning { background: var(--info); }
.jm-dot.s-on_hold { background: #8A8F98; }
.jm-line { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 5 6; stroke-opacity: .5; fill: none; }
.leaflet-tooltip.jm-tip { pointer-events: auto; padding: 2px 7px; font-size: 12px; font-weight: 650; line-height: 1.3; color: var(--ink); border-radius: 6px; box-shadow: 0 1px 3px rgba(17, 24, 39, .25); cursor: pointer; }
.leaflet-tooltip.jm-hide { visibility: hidden; }
.leaflet-tooltip.jm-tip.on { background: var(--charcoal); border-color: var(--charcoal); color: #FFFFFF; }
.leaflet-tooltip-top.jm-tip.on::before { border-top-color: var(--charcoal); }
.leaflet-tooltip.jm-km { padding: 1px 6px; font-size: 11px; font-weight: 700; line-height: 1.3; color: var(--ink); background: #FFFFFF; border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: none; }
.leaflet-tooltip.jm-km::before { display: none; }
.jm-panel { padding-top: 10px; border-top: 1px solid var(--line); }
.jm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.jm-head a { color: inherit; text-decoration: none; font-size: 16px; }
.jm-far { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.jm-far li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
.jm-far li span { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ==== Drawings on a walkthrough ================================================================== */
.wt-drawings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wt-drawings li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.wt-drawings img, .wt-dthumb { width: 56px; height: 56px; flex: none; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #FFFFFF; }
.wt-drawings .minw { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.wt-drawings b { font-weight: 650; overflow-wrap: anywhere; }
.wt-add-drawing { align-self: flex-start; }
/* A job's sections: four groups in one row, then that group's tabs. */
.tab-groups { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.tab-groups a { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 6px; color: var(--muted); font-weight: 650; font-size: 15px; text-decoration: none; }
.tab-groups a + a { border-left: 1px solid var(--line); }
.tab-groups a:hover { color: var(--ink); background: var(--surface-2); }
.tab-groups a.on { background: var(--charcoal); color: var(--on-dark); }
.tg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--btn); flex: none; }
.tab-groups + .tabs { margin-top: -4px; }

/* ==== Changing tasks and reordering phases ======================================================= */
.x.tedit:hover { color: var(--ink); background: var(--surface-2); }
.task.editing { display: block; padding: 8px 0; }
.task-edit { display: flex; flex-direction: column; gap: 8px; }
.task-phase { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 420px; }
.task-edit-btns { justify-content: flex-end; }
.task-phase select { flex: 1; min-width: 0; }
.po-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.po-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.po-row.dragging { border-color: var(--btn); box-shadow: 0 6px 18px rgba(17, 24, 39, .18); position: relative; z-index: 1; }
.po-grip { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); cursor: grab; touch-action: none; }
.po-row.dragging .po-grip { cursor: grabbing; color: var(--btn); }
.po-num { min-width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--charcoal); color: var(--on-dark); font-size: 12px; font-weight: 800; flex: none; }
.po-name { flex: 1; font-weight: 650; overflow-wrap: anywhere; }

/* ==== Purchases the client pays for ============================================================== */
.rc-client { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.rc-items td.rc-ck { width: 28px; padding-right: 4px; }
.rc-items td.rc-ck input { width: 18px; height: 18px; margin: 0; accent-color: var(--btn); }
.rc-items tr.rc-for-client td { color: var(--btn); }
.rc-client-tag { align-self: flex-start; margin-top: 2px; background: #FFF1E6; color: var(--btn); border-color: transparent; }
.rc-client-sum { display: block; margin-top: 4px; font-size: 14px; font-weight: 650; color: var(--btn); }
.rc-price { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.rc-price .row input { flex: 0 1 160px; min-width: 0; }
.send-check { display: flex; flex-direction: column; gap: 6px; }
.send-check ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.send-check li .btn { margin-left: 4px; }
.pay-how { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.pay-how .btn { align-self: flex-start; }
.rc-price .fields { margin: 0; }
/* Job notes (notes.js): long notes wrap, keeping their line breaks. */
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
/* The walkthrough's areas of work: tick every one a whole-home job covers. */
.wt-areas { display: flex; flex-wrap: wrap; gap: 6px; }
.wt-area { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer; }
.wt-area input { margin: 0; accent-color: var(--btn); }
.wt-area.on { border-color: var(--btn); background: var(--brand-soft); }
/* Phone notifications (notify.js): the offer on Today, and the on/off line. */
.notify-card { border-color: var(--btn); }
.notify-line { text-align: center; }
/* Suppliers (suppliers.js): the list, and the client's nearest showrooms. */
.sup-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.sup-wrap { display: flex; flex-direction: column; gap: 6px; }
.sup { display: flex; flex-direction: column; gap: 6px; height: 100%; }
.sup.on { border-color: var(--btn); box-shadow: 0 0 0 2px var(--brand-soft); }
/* Each kind of supplier's colour (kindOf in suppliers.js): its pin on the map,
   the edge of its card and the dot on its Show chip. Kept clear of the
   big-box stores' orange, blue and red. */
.k-tile { --k: #0E7C86; }
.k-plumbing { --k: #0EA5E9; }
.k-lighting { --k: #EAB308; }
.k-flooring { --k: #92400E; }
.k-cabinets { --k: #7C3AED; }
.k-countertops { --k: #64748B; }
.k-appliances { --k: #BE185D; }
.k-hardware { --k: #16A34A; }
.k-paint { --k: #C026D3; }
.k-doors { --k: #84CC16; }
.k-windows { --k: #6366F1; }
.k-other { --k: #9CA3AF; }
.jm-pin.kc { fill: var(--k); }
.sup.kc { border-left: 5px solid var(--k); }
.sup-dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: var(--k, var(--btn)); box-shadow: 0 0 0 1.5px #FFFFFF; vertical-align: -1px; }
.sup-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sup-head b { font-size: 16px; overflow-wrap: anywhere; }
.sup-far { flex: none; font-size: 13px; font-weight: 700; color: var(--btn); white-space: nowrap; }
.sup-note { padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface-2); }
.sup-actions { justify-content: flex-end; }
.sup-mini { list-style: none; margin: 0; padding: 0; }
.sup-mini li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.sup-mini li:first-child { border-top: 0; }
.sup-mini .minw { display: flex; flex-direction: column; }
.sup-cats .chip-btn.on { border-style: solid; border-color: var(--charcoal); background: var(--charcoal); color: var(--on-dark); }
.jm-pin.jm-home { fill: var(--charcoal); }
/* The big-box store layer on the Suppliers map: small dots in each chain's colour. */
.jm-pin.jm-store { stroke-width: 1.5; }
.jm-pin.jm-store.on { stroke-width: 3; }
.jm-pin.c-hd { fill: #F26B1D; }
.jm-pin.c-rona { fill: #1F4E9C; }
.jm-pin.c-hh { fill: #C8102E; }
.store-key { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; font-size: 13px; color: var(--muted); }
.store-key .nowrap { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.store-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.store-dot.c-hd { background: #F26B1D; }
.store-dot.c-rona { background: #1F4E9C; }
.store-dot.c-hh { background: #C8102E; }
/* Clear buttons on supplier cards: Directions, Call, Website. */
.sup-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-top: auto; padding-top: 6px; }
.sup-buttons .btn, .sup-buttons .dir { width: 100%; }
.sup-buttons .dir { display: flex; flex-direction: column; gap: 6px; }
.btn.dir-btn, .sup-buttons .btn { justify-content: center; gap: 6px; min-height: 44px; text-decoration: none; }
.btn.dir-btn .dir-pin { width: 18px; height: 18px; margin-top: 0; fill: currentColor; }
.sup-all { justify-content: center; gap: 6px; min-height: 44px; }
.sup-cats .hint { margin-right: 2px; }
/* Find on Google, in the supplier form. */
.biz-find { display: flex; flex-wrap: wrap; gap: 8px; }
.biz-find input { flex: 1 1 200px; min-width: 0; }
.biz-find .btn { flex: none; }
.biz-matches { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.biz-matches .known-list { background: var(--surface); }
.biz-match { display: flex; flex-direction: column; }
.biz-foot { justify-content: space-between; }
/* Leave a Google review, on a finished job's client page. */
.review-ask .btn { align-self: flex-start; }
/* The crew plan, stop by stop. */
.day-stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.stop-card { display: flex; flex-direction: column; gap: 6px; }
.stop-card.on { border-color: var(--btn); box-shadow: 0 0 0 2px var(--brand-soft); }
.stop-head { display: flex; align-items: flex-start; gap: 10px; }
.stop-n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--charcoal); color: var(--on-dark); font-weight: 700; font-size: 14px; }
.stop-what { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.stop-what b { font-size: 16px; overflow-wrap: anywhere; }
.stop-time { font-size: 13px; font-weight: 700; color: var(--btn); }
.stop-who { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.stop-note { padding: 6px 10px; border-radius: var(--r-sm); background: var(--brand-soft); }
.stop-gap { margin: 0; padding: 6px 0 6px 22px; font-size: 13px; color: var(--muted); border-left: 2px dashed var(--line-strong); margin-left: 23px; }
.day-stops > li + li { margin-top: 0; }
.day-stops > li:not(:has(.stop-gap)) { margin-bottom: 10px; }
.stop-form .wt-area.off { opacity: .45; }
.crew-pickup { font-weight: 700; overflow-wrap: anywhere; }
/* Today's stops on Today: the day in order, the next one marked. */
.day-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.day-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.day-list li:first-child { border-top: 0; padding-top: 2px; }
.day-list li > .btn, .day-list li > .tag { flex: none; align-self: center; }
.day-list li.is-next .stop-time { color: var(--btn); }
.day-list .stop-note { padding: 4px 8px; border-radius: var(--r-sm); background: var(--brand-soft); align-self: flex-start; }
/* Search, filter and sort on Projects. */
.board-tools { display: flex; flex-direction: column; gap: 10px; }
.board-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--muted); }
.board-search:focus-within { border-color: var(--btn); box-shadow: 0 0 0 3px var(--brand-soft); }
.board-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; min-height: 44px; font-size: 16px; color: var(--ink); padding: 0; }
.board-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 8px 10px; }
.board-picks .field { gap: 3px; }
.board-count { justify-content: space-between; }
/* The office's Today: the priority jobs heading. */
.today-pri-head { margin-top: 6px; }
/* Refresh, and the notice when a new version is out. */
.me .me-refresh { display: inline-flex; align-items: center; justify-content: center; padding: 6px 8px; }
.side-foot .side-out + .side-out { margin-top: -4px; }
.new-version { background: var(--brand-soft); border-bottom: 1px solid var(--line); }
.new-version-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; max-width: 1120px; margin: 0 auto; padding: 10px 16px; font-size: 15px; font-weight: 600; }
.new-version .btn { gap: 6px; }
/* A job's showrooms: hidden ones faded. */
.job-showrooms .sup-off .minw { opacity: .6; }
/* Bookings on the calendar: walkthroughs and trades. */
.booking { gap: 12px; }
.sched-list li.sched-booking { align-items: center; }
.sched-booking .row { margin-left: auto; }
/* Changing a booking in place. */
.sched-what { padding: 0; text-align: left; color: var(--ink); text-decoration: none; }
.sched-what b { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.sched-list li.sched-edit, .day-list li.day-edit { display: block; border-top: 0; padding: 4px 0 10px; }
.day-list .day-acts { flex: none; align-self: center; }
/* Job cards coloured by type of work, so they're easy to tell apart: a
   coloured edge, a light tint, and the type in that colour. */
.kind-kitchen { --kind: #C2410C; }
.kind-bathroom { --kind: #0369A1; }
.kind-basement { --kind: #6D28D9; }
.kind-whole_home { --kind: #B45309; }
.kind-addition { --kind: #047857; }
.kind-custom_home { --kind: #1D4ED8; }
.kind-garden_suite { --kind: #0F766E; }
.kind-commercial { --kind: #475569; }
.kind-landscaping { --kind: #4D7C0F; }
.kind-repairs { --kind: #BE185D; }
.kind-other { --kind: #6B7280; }
.pcard[class*="kind-"], .today-job[class*="kind-"] {
  border-left: 5px solid var(--kind);
  background: var(--surface); background: color-mix(in srgb, var(--kind) 5%, var(--surface));
}
.pcard[class*="kind-"] .eyebrow { color: var(--kind); }
/* Stops on Today and the crew plan, coloured by kind: a job in its type of
   work's colour, a walkthrough teal, a pickup brown. */
.kind-walk { --kind: #0E7C86; }
.kind-pickup { --kind: #92400E; }
.day-list > li[class*="kind-"] { border-left: 4px solid var(--kind); padding-left: 10px; }
.day-list > li[class*="kind-"] .stop-n, .stop-card[class*="kind-"] .stop-n { background: var(--kind); }
.day-list > li.is-next { background: var(--surface-2); background: color-mix(in srgb, var(--kind, var(--btn)) 8%, var(--surface)); }
.stop-card[class*="kind-"] { border-left: 5px solid var(--kind); }
.stop-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.stop-kind { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--kind, var(--muted)); }
/* Searching the supplier list. */
.stack > .board-search { background: var(--surface); }

/* ==== Bids: trade partners, bid requests and prices ============================================ */
.bid-list { list-style: none; margin: 6px 0 0; padding: 0; }
.bid-list li + li { border-top: 1px solid var(--line); }
.bid-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 12px 0; color: inherit; text-decoration: none; }
.bid-row .minw { display: flex; flex-direction: column; gap: 2px; }
.bid-row:hover b, .bid-row:focus-visible b { color: var(--btn); }
.bid-row-r { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.bid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.bid-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); min-width: 0; }
.bid-card.won { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.bid-card .btn { align-self: flex-start; margin-top: 4px; }
.bid-amount { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 8px 16px; margin: 0; }
.facts dt { font-size: 12px; font-weight: 700; color: var(--muted); }
.facts dd { margin: 0; font-size: 14px; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.pick-chips legend { padding: 0; margin-bottom: 6px; }
.pick-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; cursor: pointer; background: var(--surface); }
.pick-chip input { margin: 0; accent-color: var(--btn); }
.pick-chip.on { border-color: var(--btn); color: var(--btn); font-weight: 600; }
.pick-trades { list-style: none; margin: 0; padding: 0; }
.pick-trades li + li { border-top: 1px solid var(--line); }
.pick-trades label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.pick-trades input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--btn); }
.pick-trades .minw { display: flex; flex-direction: column; gap: 2px; }
.pending-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pending-files li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; overflow-wrap: anywhere; }
a.pick-job { text-decoration: none; }
a.alert-card { display: block; border-color: #F2C4BE; background: #FDF1EF; color: var(--crit); text-decoration: none; font-size: 14px; }

/* ==== J Group Pro: the trade partner portal's own look (setPro in util.js) ======================== */
html.pro { --bg: #EEF2F6; --charcoal: #10243A; --charcoal-2: #1D3754; --on-dark-muted: #A7B8CB; }
html.pro .login-brand { background: var(--charcoal); }
.pro-badge {
  display: inline-block; margin-right: 3px; padding: 0 5px; border-radius: 4px; background: var(--brand); color: #FFFFFF;
  font-size: 10px; font-weight: 800; line-height: 15px; letter-spacing: .1em; text-transform: uppercase; vertical-align: 1px;
}
