/* Look and feel: Buildertrend's sizes and spacing (measured 2026-11-23, see
   docs/ui-style.md), Quercus brand colours (Olive Green replaces BT's blue). */
@font-face {
  font-family: "Inter";
  src: url("/vendor/fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --ink: #202227;
  --ink-soft: #5c636d;
  --line: #d9dee3;
  --line-strong: #c4ccd5;
  --surface: #ffffff;
  --page: #f2f3f1;
  --brand: #2f4731;
  --brand-hover: #263a28;
  --brand-ink: #ffffff;
  --brand-soft: #e6ece6;
  --good: #1f6b3f;
  --good-soft: #e2f1e7;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --warn: #8a5a00;
  --warn-soft: #fcf1d9;
  --info: #3b5268;
  --info-soft: #e9eef3;
  --radius: 8px;
  --nav-h: 48px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: normal;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--page); }
h1 { font-size: 30px; line-height: 36px; font-weight: 700; margin: 0; }
h2 { font-size: 16px; line-height: 24px; font-weight: 600; margin: 0 0 .6rem; }
h3 { font-size: 14px; line-height: 20px; font-weight: 600; }
a { color: var(--brand); }
.muted { color: var(--ink-soft); }
.boot { padding: 3rem; text-align: center; color: var(--ink-soft); }
.wordmark { display: inline-flex; align-items: center; text-decoration: none; margin: 0; }
.wordmark img { height: 26px; width: auto; display: block; }
.gate .wordmark img { height: 34px; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }

/* ---- sign-in and Demo role picker ---- */
.gate { min-height: 100%; display: grid; place-items: center; padding: 1.5rem; }
.gate-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 2rem; width: min(100%, 380px); display: grid; gap: 1rem; }
.gate-wide { width: min(100%, 860px); }
.gate-card h1 { font-size: 30px; }
.gate { background: var(--brand); min-height: 100vh; }
.gate-card { box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.demo-tag { font-size: 12px; font-weight: 600; margin-left: .6rem; background: var(--warn-soft); color: var(--warn); padding: .15rem .5rem; border-radius: 99px; vertical-align: middle; }
.persona-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.persona { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .9rem; cursor: pointer; display: grid; gap: .15rem; font: inherit; color: inherit; min-height: 64px; }
.persona:hover, .persona:focus-visible { border-color: var(--brand); background: var(--brand-soft); }

/* ---- layout ---- */
.layout { min-height: 100%; display: flex; flex-direction: column; }
.demo-bar { background: var(--warn-soft); color: var(--warn); padding: 4px 16px; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; font-size: 13px; border-bottom: 1px solid #ecd9a8; }
.demo-bar label { margin-left: auto; display: flex; gap: .4rem; align-items: center; white-space: nowrap; }
.demo-bar select { max-width: 60vw; min-height: 28px; padding: 2px 6px; font-size: 13px; }
/* top navigation (Buildertrend: one 48px band, modules across, menus drop down) */
.topnav { background: var(--brand); color: #fff; height: var(--nav-h); display: flex; align-items: center; gap: 2px; padding: 0 16px; position: sticky; top: 0; z-index: 8; }
.topnav .wordmark { margin-right: 18px; }
.topnav .wordmark img { height: 18px; }
.topnav-group { position: relative; }
.topnav-btn { font: inherit; font-weight: 500; color: #fff; background: none; border: 0; border-radius: 6px; padding: 6px 10px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; line-height: 20px; }
.topnav-btn:hover, .topnav-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .14); }
.topnav-btn.on { background: rgba(255, 255, 255, .2); }
.topnav-btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.topnav-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topnav-icon { width: 32px; height: 32px; padding: 0; justify-content: center; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--brand); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.nav-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .16); padding: 4px; display: grid; z-index: 9; }
.nav-menu-right { left: auto; right: 0; }
.nav-menu a, .nav-menu button { font: inherit; text-align: left; background: none; border: 0; color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.nav-menu a:hover, .nav-menu button:hover { background: var(--page); }
.nav-menu a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-menu .nav-soon { color: var(--ink-soft); }
.nav-menu-head { padding: 8px 12px 4px; font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; color: var(--ink-soft); }
.nav-menu-user { padding: 8px 12px; display: grid; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.nav-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.nav-soon { color: var(--ink-soft); }
.body { flex: 1; display: flex; min-height: 0; }
.content { flex: 1; min-width: 0; padding: 16px 24px 64px; }
.page { max-width: 1240px; margin: 0 auto; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.page > * { min-width: 0; }
.page-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.page-head .spacer { flex: 1; }
.page-project { font-size: 14px; line-height: 20px; color: var(--ink-soft); margin-top: 2px; }
.crumb { font-size: 14px; font-weight: 500; color: var(--ink); }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }

/* ---- pieces ---- */
.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; flex: 1; }
.btn { font: inherit; font-weight: 500; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 5px 12px; cursor: pointer; min-height: 32px; white-space: nowrap; line-height: 20px; }
.btn:hover:not(:disabled) { background: #f6f7f6; border-color: #aeb7c0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { color: var(--bad); border-color: #ebc0bb; }
.btn-small { padding: 3px 10px; min-height: 28px; font-size: 13px; }
.btn-link { border: 0; background: none; color: var(--brand); padding: 0; min-height: 0; text-decoration: underline; }
.icon-btn { font: inherit; font-size: 18px; line-height: 1; border: 0; background: none; cursor: pointer; width: 32px; height: 32px; border-radius: 6px; color: var(--ink); }
.icon-btn:hover { background: var(--page); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.badge { display: inline-block; font-size: 12px; line-height: 16px; font-weight: 500; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: #eceeec; color: var(--ink-soft); }
.note { background: var(--info-soft); color: var(--info); border-radius: var(--radius); padding: 10px 12px; display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.note-bad { background: var(--bad-soft); color: var(--bad); }
.note-warn { background: var(--warn-soft); color: var(--warn); }
.empty { color: var(--ink-soft); padding: 1.5rem; text-align: center; margin: 0; }

/* ---- forms ---- */
.field { display: grid; gap: 4px; min-width: 0; align-content: start; }
.field-label { font-size: 12px; line-height: 16px; font-weight: 700; }
.field-hint { font-size: 12px; line-height: 16px; color: var(--ink-soft); }
.field-error { font-size: 12px; line-height: 16px; color: var(--bad); }
input, select, textarea { font: inherit; color: inherit; border: 1px solid #ccd2d8; border-radius: 4px; padding: 5px 8px; background: var(--surface); width: 100%; min-height: 32px; min-width: 0; line-height: 20px; }
input:hover, select:hover, textarea:hover { border-color: #aeb7c0; }
textarea { min-height: 80px; resize: vertical; }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; padding: 0; flex: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, .nav-item:focus-visible, .icon-btn:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; align-items: start; }
.check { display: flex; gap: .5rem; align-items: center; }
.check-list { display: grid; gap: .45rem; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; }
.toolbar .grow { flex: 1 1 220px; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 14px; color: var(--ink); font-weight: 500; padding: 14px 8px 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f6f8f6; }
tr.struck td { color: var(--ink-soft); }
tfoot td { font-weight: 600; border-bottom: 0; }
tfoot tr.grand td { font-size: 16px; border-top: 2px solid var(--ink); }

/* ---- quotation editor lines ---- */
.lines { display: grid; gap: .6rem; }
.line { display: grid; grid-template-columns: minmax(180px, 3fr) 90px 130px 90px 120px 40px; gap: .5rem; align-items: start; }
.line .check { min-height: 40px; }
.line .amount { text-align: right; padding: .5rem 0; font-variant-numeric: tabular-nums; }
.line-head { font-size: 14px; color: var(--ink); font-weight: 500; }
.totals { margin-left: auto; width: min(100%, 320px); display: grid; gap: .25rem; }
.totals div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 700; font-size: 16px; border-top: 2px solid var(--ink); padding-top: .35rem; }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin: 0; }
.meta dt { font-size: 12px; line-height: 16px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.timeline li { border-left: 3px solid var(--line); padding-left: .7rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- modal and toasts ---- */
.modal { border: 0; border-radius: var(--radius); padding: 0; width: min(94vw, 520px); max-height: 90vh; color: var(--ink); }
.modal-wide { width: min(94vw, 860px); }
.modal::backdrop { background: rgba(20, 28, 36, .45); }
.modal-head { display: flex; align-items: center; padding: .9rem 1rem .5rem 1.2rem; }
.modal-head h2 { flex: 1; margin: 0; font-size: 20px; line-height: 24px; }
.modal-body { padding: .5rem 1.2rem 1rem; display: grid; gap: .9rem; overflow-y: auto; }
.modal-foot { padding: .8rem 1.2rem; border-top: 1px solid var(--line); display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
.toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); display: grid; gap: .4rem; z-index: 20; width: min(92vw, 420px); }
.toast { background: var(--ink); color: #fff; padding: .65rem .9rem; border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0, 0, 0, .2); }

/* ---- phones ---- */
@media (max-width: 820px) {
  .content { padding: 12px 14px 64px; }
  h1 { font-size: 24px; line-height: 30px; }
  /* phones: 16px inputs stop iPhone zooming in; 40px touch targets */
  input, select, textarea { font-size: 16px; min-height: 40px; }
  .btn { min-height: 40px; padding: 9px 14px; }
  .btn-small { min-height: 34px; }
  .icon-btn { width: 40px; height: 40px; }
  .demo-bar label { margin-left: 0; width: 100%; }
  .demo-bar select { max-width: none; flex: 1; }
  .line { grid-template-columns: 1fr 1fr; padding: .7rem; border: 1px solid var(--line); border-radius: var(--radius); }
  .line > :first-child { grid-column: 1 / -1; }
  .line-head { display: none; }
  .line .amount { text-align: left; }
  .only-wide { display: none !important; }
}
@media (min-width: 821px) {
  .only-narrow { display: none !important; }
  .line .field-label { display: none; }
}

/* ==== shared workspace (docs/buildertrend-research/00-ui-conventions.md) ==== */
.screen { display: flex; gap: 1rem; align-items: flex-start; }
.screen-main { flex: 1; min-width: 0; max-width: none; margin: 0; }
.spacer { flex: 1; }

/* project rail */
.rail { width: 260px; flex: none; position: sticky; top: calc(var(--nav-h) + 16px); display: grid; gap: .6rem; align-content: start; max-height: calc(100vh - 5.5rem); }
.rail-collapsed { width: 40px; }
.rail-toggle { justify-self: end; font-size: 1.1rem; }
.rail-tools { display: flex; justify-content: flex-end; }
.picker-head .picker-new { justify-self: end; }
.rail-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 12px; display: grid; gap: 2px; }
.rail-card strong { font-size: 16px; line-height: 24px; font-weight: 600; }
.rail-card .badge { margin-bottom: 4px; }
.rail-card .badge { justify-self: start; }
.rail-card { position: relative; }
.rail-card:has(.rail-card-edit) strong { padding-right: 28px; }
.rail-card-edit { position: absolute; top: 8px; right: 8px; }
.rail-list { display: grid; gap: .15rem; overflow-y: auto; min-height: 0; }
.rail-item { font: inherit; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.rail-item:hover { background: var(--surface); }
.rail-item-on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.rail-none { padding: .4rem .55rem; margin: 0; }

/* status tabs */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.tab { font: inherit; font-weight: 500; border: 0; background: none; padding: 10px 8px; cursor: pointer; color: var(--ink-soft); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab-on { color: var(--brand); border-bottom-color: var(--brand); }
.tab-count { display: inline-block; margin-left: 4px; color: var(--ink-soft); font-weight: 400; }
.tab-on .tab-count { color: var(--ink-soft); }

/* list card, totals row, phone cards */
.list-card { padding: .4rem .6rem; }
.cards { display: grid; gap: .5rem; }
.cards-total { display: flex; justify-content: space-between; align-items: baseline; padding: .4rem .2rem .2rem; }
.cards-total strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.card-row { font: inherit; color: inherit; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem; display: flex; gap: .5rem; align-items: center; cursor: pointer; }
.card-row.struck { opacity: .7; }
.card-main { flex: 1; min-width: 0; display: grid; gap: .15rem; }
.card-line { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.card-amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.card-chevron { color: var(--ink-soft); font-size: 1.4rem; }

/* empty states */
.empty-state { padding: 2rem 1rem; text-align: center; display: grid; gap: .5rem; justify-items: center; }
.empty-state p { margin: 0; max-width: 46ch; }
.empty-clear strong { color: var(--good); }

/* filter drawer */
.drawer-scrim { position: fixed; inset: 0; background: rgba(20, 28, 36, .3); z-index: 16; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(92vw, 340px); background: var(--surface); z-index: 17; display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(0, 0, 0, .15); }
.drawer-head { display: flex; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.drawer-head h2 { flex: 1; margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1rem; display: grid; gap: .9rem; align-content: start; }
.drawer-foot { padding: .8rem 1rem; border-top: 1px solid var(--line); display: flex; gap: .5rem; justify-content: flex-end; }

/* record window */
.win-scrim { position: fixed; inset: 0; background: rgba(20, 28, 36, .45); z-index: 13; }
.win { position: fixed; z-index: 14; top: 3vh; bottom: 3vh; left: 50%; transform: translateX(-50%); width: min(96vw, 1320px); background: var(--page); border-radius: var(--radius); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); outline: none; }
.win-head { display: flex; align-items: flex-start; gap: .4rem; padding: 12px 16px 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.win-title { min-width: 0; flex: 1; }
.win-title-line { display: flex; align-items: center; gap: .3rem .6rem; flex-wrap: wrap; }
.win-title h1 { font-size: 20px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.win-title .crumb { font-size: 14px; font-weight: 500; color: var(--ink); }
.win-badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.icon-on { background: var(--brand-soft); }
.win-main { flex: 1; min-height: 0; display: flex; }
.win-errors { padding: 10px 20px 0; display: grid; gap: 6px; }
.win-errors .note { margin: 0; }
.win-body { flex: 1; min-width: 0; overflow-y: auto; padding: 16px 20px 24px; display: grid; gap: 16px; align-content: start; }
.win-side { width: 320px; flex: none; border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
.win-foot { background: var(--surface); border-top: 1px solid var(--line); padding: 10px 20px; border-radius: 0 0 var(--radius) var(--radius); }
.win-form { display: grid; gap: 1rem; }
.side-panel { padding: 1rem; display: grid; gap: .6rem; align-content: start; }

/* status bar and action bar */
.status-bar { border-radius: var(--radius); padding: 10px 12px; display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--info-soft); color: var(--info); }
.status-good { background: var(--good-soft); color: var(--good); }
.status-bad { background: var(--bad-soft); color: var(--bad); }
.status-warn { background: var(--warn-soft); color: var(--warn); }
.status-muted { background: #eceeec; color: var(--ink-soft); }
.action-bar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.more { position: relative; }
.more-menu { position: absolute; bottom: calc(100% + .35rem); left: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .15); min-width: 200px; padding: .3rem; z-index: 3; display: grid; }
.more-item { font: inherit; text-align: left; border: 0; background: none; padding: .55rem .7rem; border-radius: 6px; cursor: pointer; color: var(--ink); }
.more-item:hover { background: var(--page); }
.more-danger { color: var(--bad); }

@media (max-width: 820px) {
  .screen { display: block; }
  .rail-select { margin-bottom: .8rem; }
  .win { inset: 0; transform: none; width: auto; border-radius: 0; }
  .win-head, .win-foot { border-radius: 0; }
  .win-head { padding: .6rem .8rem; }
  .win-body { padding: .8rem; }
  .win-with-side .win-body { display: none; }
  .win-side { width: 100%; border-left: 0; }
  .win-foot { padding: .6rem .8rem calc(.6rem + env(safe-area-inset-bottom)); }
  .lines-table thead { display: none; }
  .lines-table tr { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); padding: .4rem 0; }
  .lines-table td { border: 0; padding: .2rem .3rem; text-align: left; }
  .lines-table td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .lines-table td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; color: var(--ink-soft); font-size: .8rem; }
}
td.nowrap, th.nowrap { white-space: nowrap; }
tfoot td:first-child { white-space: nowrap; }

/* ---- Stage lists ---- */
.stage-items { list-style: none; margin: 0 0 .8rem; padding: 0; border: 1px solid var(--line); border-radius: 8px; }
.stage-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .35rem .6rem; min-height: 48px; border-top: 1px solid var(--line); }
.stage-row:first-child { border-top: 0; }
.stage-row.struck .stage-name { color: var(--ink-soft); text-decoration: line-through; }
.stage-name { flex: 1 1 auto; }
.stage-tools { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.stage-tools .icon-btn { font-size: 1rem; }
.stage-tools .icon-btn:disabled { opacity: .3; cursor: default; }
.stage-edit, .stage-add { display: flex; gap: .5rem; flex: 1 1 100%; flex-wrap: wrap; }
.stage-edit input, .stage-add input { flex: 1 1 200px; }

/* ---- form helpers ---- */
.text-bad { color: var(--bad); font-weight: 600; }
.text-warn { color: var(--warn); font-weight: 600; }
.plain-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form-section { font-size: .95rem; margin: .4rem 0 -.3rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.form-section .muted { font-weight: 400; font-size: .85rem; }

/* ==== phone habits from the Buildertrend app (docs/buildertrend-research/11-mobile-app.md) ==== */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.tabbar-item { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 0 5px; color: var(--ink-soft); text-decoration: none; font-size: 11px; line-height: 14px; font-weight: 500; min-height: 54px; }
.tabbar-item[aria-current="page"] { color: var(--brand); font-weight: 600; }
.project-button { font: inherit; font-size: .9rem; border: 0; background: none; padding: .2rem 0; color: var(--brand); cursor: pointer; text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker { position: fixed; inset: 0; z-index: 15; background: var(--page); display: flex; flex-direction: column; }
.picker-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: .7rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.picker-head h2 { margin: 0; font-size: 1rem; }
.picker-head .btn-link { justify-self: start; }
.picker-search { padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.picker-search input { width: 100%; }
.picker-body { flex: 1; overflow-y: auto; padding-bottom: 2rem; }
.pick-group { font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; color: var(--ink-soft); padding: .9rem 1rem .3rem; }
.pick-row { font: inherit; color: inherit; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: .5rem; text-align: left; background: var(--surface); border: 0; border-bottom: 1px solid var(--line); padding: .8rem 1rem; min-height: 48px; cursor: pointer; }
.pick-on { color: var(--brand); }
.pick-tick { font-weight: 700; }
.fab { position: fixed; right: 1rem; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 9; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); font-size: 1.8rem; line-height: 1; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); cursor: pointer; }
.card-small { font-size: .82rem; }
.more-user { display: grid; gap: .15rem; }
.more-group { padding: 0; overflow: hidden; }
.more-group summary { list-style: none; cursor: pointer; padding: .8rem 1rem; display: flex; justify-content: space-between; }
.more-group summary::-webkit-details-marker { display: none; }
.more-group summary h2 { margin: 0; }
.more-group summary::after { content: "▾"; color: var(--ink-soft); }
.more-group:not([open]) summary::after { content: "▸"; }
.more-link { display: flex; justify-content: space-between; padding: .8rem 1rem; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; min-height: 48px; align-items: center; }
@media (max-width: 820px) {
  .topnav { display: none; }
  .content { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  .action-bar { flex-wrap: nowrap; }
  .action-bar > .btn-primary { flex: none; }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* ---- Purchase Order ---- */
.line.line-stage { grid-template-columns: minmax(160px, 3fr) minmax(120px, 1.4fr) 80px 120px 70px 110px 40px; }
.card-line-start { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.progress { position: relative; height: 12px; border-radius: 99px; background: #e6e9ed; overflow: hidden; }
.progress span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.progress-billed { background: #9cc3ad; }
.progress-paid { background: var(--good); }
@media (max-width: 820px) {
  .line.line-stage { grid-template-columns: 1fr 1fr; }
}

/* ---- Bill ---- */
.win-left { width: 44%; flex: none; border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; }
.invoice-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.invoice-view { flex: 1; width: 100%; min-height: 420px; border: 1px solid var(--line); border-radius: var(--radius); object-fit: contain; background: var(--page); }
.invoice-drop { font: inherit; color: var(--ink-soft); flex: 1; min-height: 200px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--page); cursor: pointer; padding: 1rem; }
.line-skipped { opacity: .55; }
tr.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.pay-row { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; padding: .6rem 0; border-top: 1px solid var(--line); }
.pay-row:first-child { border-top: 0; }
.pay-row .grow { flex: 1 1 220px; min-width: 0; }
.pay-voided { opacity: .6; }
.pay-voided .card-amount { text-decoration: line-through; }
.alloc { font-size: .85rem; }
@media (max-width: 820px) {
  .win-split { flex-direction: column; overflow-y: auto; }
  .win-split .win-left { width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: .8rem; }
  .win-split .win-body { overflow: visible; }
  .invoice-view { min-height: 260px; max-height: 50vh; }
  .invoice-drop { min-height: 90px; }
}

/* ---- formula bar (A − B = C) and stage tree ---- */
.formula { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.formula > div { display: grid; }
.formula strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.formula-op { font-size: 1.3rem; color: var(--ink-soft); }
.tree .tree-head td { background: var(--surface); border-top: 1px solid var(--line); }
.tree .tree-child td { font-size: .88rem; color: var(--ink-soft); padding-left: 2rem; }
.tree .tree-child td:first-child { padding-left: 2.2rem; }
.tree-toggle { display: inline-block; width: 1.2rem; color: var(--ink-soft); }
.sticky-total td { position: sticky; bottom: 0; background: var(--surface); font-weight: 700; border-top: 2px solid var(--ink); }
.line.budget-line { grid-template-columns: minmax(140px, 1.2fr) minmax(180px, 2fr) 150px 40px; }
@media (max-width: 820px) {
  .line.budget-line { grid-template-columns: 1fr 1fr; }
  .tree .tree-child td:first-child { padding-left: 1rem; }
}

/* ---- Client preview (A4-like sheet) ---- */
.sheet-wrap { display: grid; gap: .6rem; }
.sheet-tools { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.sheet { position: relative; background: #fff; color: #111; width: 100%; max-width: 794px; margin: 0 auto; padding: 40px 44px; box-shadow: 0 2px 12px rgba(0,0,0,.12); border-radius: 4px; font-size: 13px; overflow: hidden; }
.sheet-watermark { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-24deg); font-size: 64px; font-weight: 800; color: rgba(163, 42, 42, .14); letter-spacing: .08em; pointer-events: none; white-space: nowrap; }
.sheet-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid #111; padding-bottom: .8rem; margin-bottom: 1rem; }
.sheet-company { font-size: 16px; }
.sheet-title { text-align: right; }
.sheet-title h2 { margin: 0 0 .2rem; font-size: 20px; letter-spacing: .06em; }
.sheet-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.sheet-parties h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #555; margin: 0 0 .2rem; }
.sheet-lines { width: 100%; border-collapse: collapse; margin: .6rem 0; }
.sheet-lines th, .sheet-lines td { border-bottom: 1px solid #ddd; padding: .35rem .3rem; text-align: left; vertical-align: top; }
.sheet-lines th { font-size: 11px; text-transform: uppercase; color: #555; }
.sheet-lines .num { text-align: right; white-space: nowrap; }
.sheet-totals { margin-left: auto; width: min(100%, 280px); display: grid; gap: .2rem; }
.sheet-totals div { display: flex; justify-content: space-between; }
.sheet-totals .grand { font-weight: 700; border-top: 2px solid #111; padding-top: .3rem; }
.sheet-pay { margin-top: 1.2rem; border-top: 1px solid #ddd; padding-top: .8rem; display: grid; gap: .25rem; }
.sheet-due { font-size: 15px; }
.sheet-terms { display: grid; gap: .5rem; margin: 0 0 1rem; }
.sheet-terms dt { font-size: 11px; text-transform: uppercase; color: #555; }
.sheet-terms dd { margin: 0; }
.sheet-sign { display: grid; grid-template-columns: 2fr 1.5fr 1fr; gap: 1rem; margin-top: 2.5rem; }
.sheet-sign div { border-top: 1px solid #111; padding-top: .3rem; font-size: 11px; color: #555; }
.win-tabs { margin: -.2rem 0 .2rem; }
@media (max-width: 820px) {
  .sheet { padding: 20px 16px; font-size: 12px; }
  .sheet-parties { grid-template-columns: 1fr; }
  .sheet-doc th:nth-child(2), .sheet-doc td:nth-child(2), .sheet-doc th:nth-child(3), .sheet-doc td:nth-child(3) { display: none; }
}
@media print {
  body * { visibility: hidden; }
  .sheet, .sheet * { visibility: visible; }
  .sheet { position: absolute; left: 0; top: 0; box-shadow: none; max-width: none; }
  .no-print { display: none; }
}
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: 2px; background: var(--surface); width: fit-content; }
.segmented button { font: inherit; border: 0; background: none; padding: .4rem .9rem; border-radius: 99px; cursor: pointer; color: var(--ink-soft); min-height: 36px; }
.segmented .seg-on { background: var(--brand); color: var(--brand-ink); }
/* Rows in the record window keep their full height (scroll containers like the tab strip would otherwise collapse). */
.win-body { grid-auto-rows: max-content; }
.sheet-group td { background: #f2f4f6; padding-top: .5rem; }
.sheet-subtotal td { font-weight: 600; border-top: 1px solid #999; }
.sheet-terms.pnl div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #eee; padding: .35rem 0; }
.sheet-terms.pnl dd { font-variant-numeric: tabular-nums; }
/* ---- Schedule ---- */
.text-good { color: var(--good); font-weight: 600; }
.sched-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .45rem; flex: none; }
.sched-title { display: inline-flex; align-items: center; }
.tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #9aa5b1; background: var(--surface); color: #fff; font-weight: 700; font-size: .8rem; cursor: pointer; display: inline-grid; place-items: center; padding: 0; flex: none; }
.tick-on { background: var(--good); border-color: var(--good); }
.tick:disabled { cursor: default; opacity: .7; }
.progress { display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: #e5e9ee; vertical-align: middle; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--good); }
.progress-num { margin-left: .4rem; font-size: .85rem; }
.row-done td, .card-row.row-done { color: var(--ink-soft); }
.sched-card { display: flex; gap: .7rem; align-items: flex-start; }
.toolbar .check { align-self: center; }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-nav { display: flex; align-items: center; gap: .4rem; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.cal-nav h2 { margin: 0 0 0 .4rem; font-size: 1.05rem; }
.cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { font-size: 12px; font-weight: 600; color: var(--ink-soft); padding: .3rem .4rem; border-bottom: 1px solid var(--line); }
.cal-week { grid-template-rows: 1.6rem repeat(var(--lanes), 1.55rem) .4rem; min-height: 6rem; position: relative; border-bottom: 1px solid var(--line); }
.cal-day { grid-row: 1 / -1; border-right: 1px solid var(--line); padding: .2rem .35rem; }
.cal-day:nth-child(7) { border-right: 0; }
.cal-num { font-size: .8rem; color: var(--ink-soft); }
.cal-out { background: #fafbfc; }
.cal-out .cal-num { opacity: .5; }
.cal-off { background: repeating-linear-gradient(135deg, #f6f7f9, #f6f7f9 6px, #eef1f4 6px, #eef1f4 12px); }
.cal-today .cal-num { background: var(--brand); color: #fff; border-radius: 99px; padding: 0 .4rem; }
.cal-bar { z-index: 1; margin: 1px 3px; border: 0; border-radius: 4px; background: var(--bar); color: #fff; font: inherit; font-size: .78rem; text-align: left; padding: 0 .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; min-height: 0; }
.cal-bar-done { opacity: .55; }
.cal-bar.cut-start { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.cal-bar.cut-end { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.grid-2, .grid-3 { display: grid; gap: .9rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#schedule-form .plain-fieldset { display: grid; gap: .9rem; grid-column: 1 / -1; }
#schedule-form { grid-template-columns: 1fr; }
.swatches { display: flex; gap: .45rem; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; outline-offset: 2px; }
.swatch-on { outline: 2px solid var(--ink); }
.swatch-none { background: linear-gradient(135deg, #fff 45%, #c9ced4 45%, #c9ced4 55%, #fff 55%); border-color: var(--line); }
.exception-form { display: grid; grid-template-columns: 170px 190px 1fr auto; gap: .8rem; align-items: end; margin-bottom: .8rem; }
@media (max-width: 820px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > :first-child { grid-column: 1 / -1; }
  .grid-2 { grid-template-columns: 1fr; }
  .exception-form { grid-template-columns: 1fr 1fr; }
  .exception-form > :nth-child(3), .exception-form .exception-add { grid-column: 1 / -1; }
  .cal-bar { font-size: .68rem; padding: 0 .2rem; }
  .cal-week { grid-template-rows: 1.4rem repeat(var(--lanes), 1.3rem) .3rem; min-height: 4.5rem; }
}
.weekdays { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.handover { display: grid; gap: .5rem; }
.handover-row { display: grid; grid-template-columns: 1fr minmax(180px, 240px); gap: .6rem; align-items: center; }
@media (max-width: 820px) { .handover-row { grid-template-columns: 1fr; } }
.card-row-outer { display: flex; align-items: stretch; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-row-outer > .card-row { flex: 1; border: 0; background: none; min-width: 0; }
.card-lead { display: flex; align-items: center; padding-left: .8rem; }
/* ---- Daily Log ---- */
.log-feed { display: grid; gap: .8rem; }
.log-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; cursor: pointer; display: grid; gap: .55rem; }
.log-card:hover { border-color: #c4ccd5; }
.log-head { display: flex; gap: .6rem; align-items: flex-start; }
.log-date { font-size: 16px; font-weight: 600; color: var(--brand); text-decoration: underline; margin-right: .5rem; }
.log-title { font-size: 1rem; }
.log-badges { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.log-body { margin: 0; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.log-full { margin: .8rem 0 0; }
.log-count { font-size: .8rem; margin-top: -.3rem; }
.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 160px)); gap: .4rem; }
.thumb-wrap { position: relative; }
.thumb-more { position: absolute; inset: 0; background: rgba(20, 28, 36, .55); color: #fff; border: 0; border-radius: 6px; font-size: 1.3rem; font-weight: 700; cursor: pointer; }
.photo { display: block; width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 6px; padding: 0; background: #eef1f4; overflow: hidden; cursor: zoom-in; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-file { display: grid; place-items: center; height: 100%; font-size: .75rem; padding: .3rem; word-break: break-all; color: var(--ink-soft); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.photo-edit { position: relative; }
.photo-x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(20, 28, 36, .7); color: #fff; font-size: 1.1rem; cursor: pointer; }
.chips, .pick-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { background: #eef1f4; border-radius: 99px; padding: .15rem .6rem; font-size: .8rem; }
.chip-sub { background: var(--info-soft); color: var(--info); }
.chip-btn { font: inherit; font-size: .85rem; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: .35rem .75rem; cursor: pointer; min-height: 36px; }
.chip-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.log-form { display: grid; gap: .9rem; }
.file-pick { cursor: pointer; }
@media (max-width: 820px) {
  .thumbs { grid-template-columns: 1fr; }
  .thumbs .thumb-wrap:not(:first-child) { display: none; }
  .log-head { flex-wrap: wrap; }
}
/* ---- To-Do ---- */
.filter-chips { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-bottom: .7rem; }
.fchip { display: inline-flex; align-items: center; gap: .3rem; background: var(--info-soft); color: var(--info); border-radius: 99px; padding: .2rem .3rem .2rem .7rem; font-size: .85rem; }
.fchip button { border: 0; background: none; color: inherit; font-size: 1rem; cursor: pointer; width: 26px; height: 26px; border-radius: 50%; }
.add-filter { position: relative; }
.add-filter .more-menu { left: 0; right: auto; top: 100%; bottom: auto; }
.todo-list { padding: 0; }
.todo-row { display: flex; align-items: center; gap: .7rem; padding: .55rem .9rem; border-bottom: 1px solid var(--line); }
.todo-main { flex: 1; text-align: left; border: 0; background: none; font: inherit; color: inherit; padding: .2rem 0; cursor: pointer; display: grid; min-width: 0; }
.todo-main:disabled { cursor: default; }
.todo-title { overflow-wrap: anywhere; }
.todo-meta { font-size: .85rem; }
.todo-done .todo-title { text-decoration: line-through; color: var(--ink-soft); }
.todo-add input { flex: 1; border: 0; font: inherit; padding: .5rem 0; background: none; outline: none; }
.tick-ghost { border-style: dashed; color: var(--ink-soft); cursor: default; }
.owner-pick { display: inline-flex; gap: .4rem; align-items: center; }
/* ---- Home ---- */
.home-page > .card { margin-bottom: .9rem; }
.action-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; }
.action-tile { display: grid; gap: .2rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--info-soft); }
.action-tile strong { font-size: 1.6rem; color: var(--info); line-height: 1.1; }
.tile-bad { background: var(--bad-soft); }
.tile-bad strong { color: var(--bad); }
.quiet { font-size: .85rem; margin: .7rem 0 0; }
.log-remind li, .week-list li a { display: flex; justify-content: space-between; gap: .8rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.week-list li a { color: inherit; text-decoration: none; align-items: center; }
.week-title { flex: 1; }
.remind-warn span:last-child { color: var(--warn); font-weight: 600; }
@media (max-width: 820px) { .action-tiles { grid-template-columns: 1fr 1fr; } .log-remind li { flex-direction: column; gap: .1rem; } }
/* ---- OHS ---- */
.tabs-scroll { overflow-x: auto; }
.tabs-scroll .tabs { flex-wrap: nowrap; }
.ohs-checks { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; }
.ohs-check { color: var(--ink-soft); }
.ohs-check.ok { color: var(--good); font-weight: 600; }
.action-tile { font: inherit; text-align: left; cursor: pointer; }
.worker-list { display: grid; }
.worker-row { display: flex; justify-content: space-between; gap: .7rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.worker-row.status-expected { border-left: 3px solid var(--bad); padding-left: .6rem; }
.worker-state { font-size: .85rem; }
.swms-steps { display: grid; gap: .6rem; margin-bottom: .6rem; }
.swms-step { display: flex; gap: .7rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; }
.swms-num { font-weight: 700; color: var(--ink-soft); min-width: 1.4rem; }
.swms-fields { display: grid; gap: .5rem; flex: 1; grid-template-columns: 1fr 1fr; }
.swms-read { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; margin: 0; flex: 1; }
.swms-read dt { color: var(--ink-soft); font-size: .85rem; }
.swms-read dd { margin: 0; }
.talk { border-top: 1px solid var(--line); padding: .6rem 0; }
.talk > .check-list, .talk > .btn, .talk > .actions, .talk > div { margin-top: .35rem; }
.talk:first-of-type { border-top: 0; }
.talk-form { display: grid; gap: .6rem; border-top: 1px dashed var(--line); padding-top: .7rem; margin-top: .4rem; }
.stepper { display: flex; flex-wrap: wrap; gap: .3rem; }
.step { font-size: .78rem; padding: .2rem .55rem; border-radius: 99px; background: #eef1f4; color: var(--ink-soft); }
.step-done { background: var(--good-soft); color: var(--good); }
.step-on { background: var(--brand); color: #fff; }
.private-box { border: 1px dashed var(--warn); border-radius: var(--radius); padding: .6rem; background: var(--warn-soft); }
.plan-sections { display: grid; gap: .7rem; }
.plan-read summary { cursor: pointer; font-weight: 600; margin: .5rem 0; }
.form-grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.form-card { border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; display: grid; gap: .3rem; }
.trade-panel { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .3rem; display: grid; gap: .5rem; }
.worker-add { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: .5rem; }
@media (max-width: 820px) {
  .swms-fields { grid-template-columns: 1fr; }
  .worker-add { grid-template-columns: 1fr 1fr; }
  .ohs-summary { grid-template-columns: 1fr 1fr; }
}
/* ---- Checklist ---- */
.cl-layout { display: grid; grid-template-columns: 280px 1fr; gap: .9rem; align-items: start; margin-top: .8rem; }
.cl-stages { display: grid; gap: .15rem; position: sticky; top: .5rem; max-height: calc(100vh - 2rem); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .3rem; }
.cl-stage { font: inherit; font-size: .88rem; text-align: left; border: 0; background: none; padding: .45rem .5rem; border-radius: 6px; cursor: pointer; display: grid; gap: .15rem; }
.cl-stage:hover { background: #f3f5f7; }
.cl-stage-on { background: var(--brand-soft); font-weight: 600; }
.cl-stage-meta { font-size: .78rem; }
.cl-items { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; display: grid; gap: .1rem; }
.cl-item { display: grid; grid-template-columns: 1fr minmax(220px, auto); gap: .8rem; padding: .7rem .2rem; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; padding-left: .5rem; }
.cl-Y { border-left-color: var(--good); }
.cl-N { border-left-color: var(--bad); }
.cl-NA { border-left-color: #9aa5b1; }
.cl-inactive { opacity: .55; }
.cl-code { font-size: .75rem; }
.cl-side { display: grid; gap: .35rem; justify-items: end; align-content: start; }
.cl-answers button { min-width: 3.4rem; }
.cl-answers button:disabled { cursor: default; }
.cl-reason { color: var(--bad); font-size: .88rem; text-align: right; }
.cl-who { font-size: .78rem; }
.cl-reason-form { display: grid; gap: .4rem; width: 100%; }
.cl-summary { margin-top: .4rem; }
@media (max-width: 820px) {
  .cl-layout { grid-template-columns: 1fr; }
  .cl-item { grid-template-columns: 1fr; }
  .cl-side { justify-items: stretch; }
  .cl-answers { width: 100%; }
  .cl-answers button { flex: 1; min-height: 44px; }
  .cl-reason { text-align: left; }
}
.cl-items .card-head { flex-wrap: wrap; }
@media (max-width: 820px) { .cl-items .card-head h2 { flex: 1 1 100%; } }
/* ---- Files ---- */
.files-bar { align-items: center; margin-bottom: .6rem; }
.crumbs { font-size: .95rem; }
.crumbs .btn-link { font-weight: 600; }
.folder-icon { color: #d7a21f; flex: none; }
.folder-system { color: #4f6f8f; }
.file-name { display: inline-flex; align-items: center; gap: .55rem; }
.file-badge { font-size: .62rem; font-weight: 700; background: #eef1f4; color: var(--ink-soft); border-radius: 4px; padding: .15rem .3rem; min-width: 2.4rem; text-align: center; flex: none; }
.file-sub { display: block; font-size: .8rem; }
.record-chip { display: inline-block; background: var(--info-soft); color: var(--info); border-radius: 99px; padding: .1rem .55rem; font-size: .8rem; text-decoration: none; white-space: nowrap; }
.file-menu { position: relative; display: inline-block; }
.file-menu-pop { position: fixed; left: auto; bottom: auto; text-align: left; z-index: 50; max-height: calc(100vh - 16px); overflow-y: auto; }
.file-menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: .25rem 0; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem; }
.file-tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; display: grid; overflow: visible; }
.file-tile:hover { border-color: #b9c2cc; }
.file-tile-img { aspect-ratio: 4 / 3; display: grid; place-items: center; background: #f3f5f7; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.file-tile-img img { width: 100%; height: 100%; object-fit: cover; }
.file-tile-img .folder-icon { width: 54px; height: 54px; }
.file-ext { font-weight: 700; color: var(--ink-soft); font-size: 1.1rem; }
.file-tile-text { padding: .5rem .6rem; display: grid; gap: .1rem; min-width: 0; }
.file-tile-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.file-tile-text span { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-tile-menu { position: absolute; top: .3rem; right: .3rem; background: rgba(255, 255, 255, .9); border-radius: 6px; }
.trash-row { display: flex; justify-content: space-between; gap: .6rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); }
@media (max-width: 820px) { .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tpl-tree, .tpl-children { display: grid; gap: .35rem; }
.tpl-children { margin: .35rem 0 0 1.6rem; border-left: 2px solid var(--line); padding-left: .7rem; }
.tpl-row { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.tpl-row input { flex: 1 1 200px; }
ul.plain.tpl-children { margin: .35rem 0 0 1.6rem; padding-left: .7rem; border-left: 2px solid var(--line); }
.move-tree { max-height: 55vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: .3rem; gap: 0; }
.move-tree ul.plain { gap: 0; }
.move-row { display: flex; align-items: center; gap: .45rem; padding: .35rem .4rem; border-radius: 6px; cursor: pointer; min-height: 40px; }
.move-row:hover { background: #f3f5f7; }
.move-here { opacity: .6; cursor: default; }
.move-row .folder-icon { width: 18px; height: 18px; }
.move-row input[type=radio] { width: 18px; height: 18px; min-height: 0; flex: none; margin: 0; padding: 0; }
.move-row span:not(.muted) { flex: 1; }

/* Customer Relation System */
.client-picker { display: grid; gap: .4rem; }
.client-picker .actions input { flex: 1; min-width: 12rem; }
.client-picker .picked { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pick-list { border: 1px solid var(--line); border-radius: var(--radius); max-height: 16rem; overflow: auto; background: var(--surface); }
.pick-list .pick-row { width: 100%; text-align: left; }
.card-row-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }

/* Suppliers & Trades: insurance certificates */
.cert-list { display: grid; gap: .6rem; }
.cert-row { display: grid; grid-template-columns: minmax(12rem, 16rem) 1fr; gap: .4rem 1rem; align-items: end; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.cert-file { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; min-height: 40px; }
.cert-file a { word-break: break-all; }
@media (max-width: 700px) { .cert-row { grid-template-columns: 1fr; align-items: start; } }

/* Insurance & licences (Compliance) */
.compliance-panel { display: grid; gap: .6rem; }
.compliance-sub { margin: .6rem 0 .2rem; font-size: .95rem; }
.compliance-table td { vertical-align: top; }
.compliance-table tr.row-bad td:first-child { box-shadow: inset 3px 0 0 var(--bad, #b42318); }
.compliance-history li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.link-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; cursor: pointer; justify-self: start; }
.worker-warning { color: var(--bad, #b42318); font-size: .85rem; }
@media (max-width: 700px) {
  .compliance-table thead { display: none; }
  .compliance-table tr { display: grid; grid-template-columns: 1fr auto; gap: .1rem .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
  .compliance-table td { border: 0; padding: 0; }
  .compliance-table td:first-child { grid-column: 1 / -1; }
}
.small-note { font-size: .82rem; margin-top: .2rem; }

/* Admin → Contract */
.contract-reminders { display: grid; gap: .35rem; }
.reminder { border-radius: var(--radius); padding: .55rem .8rem; font-size: .92rem; }
.reminder-bad { background: var(--bad-soft); color: var(--bad); }
.reminder-warn { background: #fff4e0; color: #8a5a00; }
.contract-file-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.contract-file-groups h3 { font-size: .95rem; margin: 0 0 .4rem; }
.contract-files { display: grid; gap: .4rem; justify-items: start; }

/* Directory → Projects: extra access */
.access-person { padding: .6rem 0; border-bottom: 1px solid var(--line); display: grid; gap: .4rem; }
.access-row { display: grid; grid-template-columns: 1fr minmax(9rem, 12rem); align-items: center; gap: .6rem; }
.access-row select { max-width: 12rem; }

/* Schedule: predecessors and Gantt */
.pred-box { display: grid; gap: .45rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem; background: var(--page); }
.pred-head .muted { font-size: .85rem; }
.pred-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: .5rem; align-items: center; }
.pred-lag { display: flex; align-items: center; gap: .3rem; white-space: nowrap; font-size: .9rem; }
.pred-lag input { width: 4.5rem; }
@media (max-width: 700px) { .pred-row { grid-template-columns: 1fr; } }
.gantt { display: grid; gap: .5rem; }
.gantt-tools { flex-wrap: wrap; }
.gantt-frame { display: grid; grid-template-columns: minmax(9rem, 15rem) 1fr; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.gantt-names { border-right: 1px solid var(--line); min-width: 0; }
.gantt-head-cell { height: 46px; display: flex; align-items: flex-end; padding: 0 .6rem .4rem; font-size: 14px; font-weight: 500; color: var(--ink); border-bottom: 1px solid var(--line); }
.gantt-name { display: flex; align-items: center; gap: .35rem; width: 100%; height: 36px; padding: 0 .6rem; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; font-size: .88rem; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: inherit; }
.gantt-name:hover { background: var(--brand-soft); }
.gantt-scroll { overflow-x: auto; }
.gantt-canvas { position: relative; }
.gantt-months, .gantt-days { position: relative; height: 23px; border-bottom: 1px solid var(--line); font-size: .72rem; color: var(--ink-soft); }
.gantt-months span { position: absolute; top: 4px; padding-left: 4px; white-space: nowrap; font-weight: 600; color: var(--ink); border-left: 1px solid var(--line); }
.gantt-days span { position: absolute; top: 4px; text-align: center; }
.gantt-off-label { color: #a0a8b2; }
.gantt-body { position: relative; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 35px, var(--line) 35px, var(--line) 36px); }
.gantt-off { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, #f1f3f5 0 4px, #e9ecef 4px 8px); }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); opacity: .6; }
.gantt-bar { position: absolute; height: 22px; border: 0; border-radius: 5px; background: color-mix(in srgb, var(--bar) 35%, white); cursor: pointer; padding: 0; overflow: hidden; text-align: left; font: inherit; }
.gantt-fill { position: absolute; inset: 0 auto 0 0; background: var(--bar); opacity: .9; }
.gantt-label { position: relative; padding: 0 .4rem; font-size: .75rem; line-height: 22px; white-space: nowrap; color: #111; font-weight: 600; }
.gantt-bar-done { opacity: .55; }
.gantt-bar-late { outline: 2px solid var(--bad); }
.gantt-lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.gantt-arrow { fill: none; stroke: #5b6673; stroke-width: 1.4; }
.gantt-arrow-head { fill: #5b6673; }
.weather-place { display: grid; gap: .4rem; }
.weather-place .actions input { flex: 1; min-width: 10rem; }
.weather-fill .muted { font-size: .85rem; }
.note-good { background: var(--good-soft); color: var(--good); }
.reset-code { font-size: 2rem; font-weight: 700; letter-spacing: .15em; text-align: center; font-variant-numeric: tabular-nums; margin: .5rem 0; padding: .8rem; background: var(--page); border-radius: var(--radius); }
.gantt-bar-drag { cursor: grab; }
.gantt-bar-dragging { cursor: grabbing; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); z-index: 2; }
.gantt-grip { position: absolute; top: 0; right: 0; bottom: 0; width: 8px; cursor: ew-resize; background: linear-gradient(to right, transparent 3px, rgba(0, 0, 0, .25) 3px, rgba(0, 0, 0, .25) 5px, transparent 5px); }
.gantt-arrow-ss, .gantt-arrow-ff { stroke-dasharray: 4 3; }
.gantt-bar { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.gantt-bar-drag { touch-action: pan-x pan-y; }
@media (max-width: 820px) { .gantt-grip { width: 18px; background: linear-gradient(to right, transparent 8px, rgba(0, 0, 0, .3) 8px, rgba(0, 0, 0, .3) 11px, transparent 11px); } }
@media (max-width: 820px) { .gantt-frame { grid-template-columns: 7.5rem 1fr; } .gantt-name { font-size: .8rem; padding: 0 .4rem; } }
/* Gantt table beside the bars (item, start, working days, +) */
.gantt-frame { grid-template-columns: clamp(14rem, 34%, 24rem) 1fr; }
.gantt-row { display: grid; grid-template-columns: minmax(0, 1fr) 3.4rem 2.4rem 1.8rem; align-items: center; height: 36px; border-bottom: 1px solid var(--line); }
.gantt-row .gantt-name { border-bottom: 0; height: 35px; }
.gantt-row.gantt-head-cell { height: 46px; align-items: end; padding: 0 0 .4rem .6rem; }
.gantt-col { font-size: .8rem; color: var(--ink-soft); text-align: right; padding-right: .4rem; }
.gantt-num { font-variant-numeric: tabular-nums; }
.gantt-add { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-weight: 700; line-height: 1; cursor: pointer; padding: 0; }
.gantt-add:hover { filter: brightness(1.15); }
.gantt-row-critical .gantt-name { color: var(--bad); font-weight: 600; }
.gantt-progress { position: absolute; bottom: -1px; width: 0; height: 0; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 7px solid #1f2933; cursor: ew-resize; opacity: 0; }
.gantt-bar:hover .gantt-progress, .gantt-bar-dragging .gantt-progress { opacity: .85; }
.gantt-progress::before { content: ''; position: absolute; left: -9px; top: -10px; width: 18px; height: 18px; }
.gantt-link-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #5b6673; background: #fff; cursor: crosshair; opacity: .35; z-index: 3; }
.gantt-link-dot:hover, .gantt-linking .gantt-link-dot { opacity: 1; }
.gantt-drawing { stroke: var(--brand); stroke-width: 2; stroke-dasharray: 5 3; }
.gantt-arrow-hit { fill: none; stroke: transparent; stroke-width: 10; pointer-events: stroke; cursor: pointer; }
.gantt-arrow-hit:hover { stroke: rgba(185, 28, 28, .18); }
.gantt-bar-critical { box-shadow: 0 0 0 2px var(--bad); }
.gantt-arrow-critical { stroke: var(--bad); stroke-width: 2; }
.gantt-arrow-head-critical { fill: var(--bad); }
.gantt-hint { flex: 1 1 100%; font-size: .85rem; }
@media (max-width: 820px) {
  .gantt-frame { grid-template-columns: 7.5rem 1fr; }
  .gantt-row { grid-template-columns: minmax(0, 1fr); }
  .gantt-row .gantt-col { display: none; }
  .gantt-progress { opacity: .7; border-left-width: 7px; border-right-width: 7px; border-bottom-width: 9px; margin-left: -7px; }
}
/* Site induction */
.induction-point { align-items: flex-start; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.induction-point input { margin-top: .2rem; }
.induction-card { padding: .7rem .8rem; }
.induction-read { margin: 0; padding-left: 1.3rem; display: grid; gap: .25rem; }
/* OHS site checks */
.check-form { display: grid; gap: .6rem; }
.check-section { display: grid; gap: .1rem; }
.check-q { display: grid; grid-template-columns: 1fr auto; gap: .3rem .8rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.check-q-bad { background: color-mix(in srgb, var(--bad) 6%, transparent); }
.check-q-text { font-size: .93rem; }
.check-note, .check-note-read, .check-controls { grid-column: 1 / -1; }
.check-note-read { color: var(--bad); font-size: .9rem; }
.check-controls { margin: 0; padding-left: 1.2rem; font-size: .88rem; color: var(--ink-soft); }
.check-answers button { min-width: 3.2rem; }
.check-new { flex-wrap: wrap; margin-bottom: .6rem; }
.check-row { width: 100%; text-align: left; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
.check-row:hover { background: var(--brand-soft); }
.tpl-item { display: grid; gap: .3rem; padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius); }
.tpl-item-row { display: grid; grid-template-columns: 1fr auto auto auto auto; gap: .4rem; align-items: center; }
@media (max-width: 700px) {
  .check-q { grid-template-columns: 1fr; }
  .check-answers button { min-width: 4.2rem; min-height: 2.6rem; }
  .tpl-item-row { grid-template-columns: 1fr 1fr; }
}
.check-q > .badge { justify-self: start; }
.ohs-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .6rem; }
.ohs-stats > div { display: grid; gap: .1rem; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); }
.ohs-stats strong { font-size: 1.35rem; }
.ohs-stats span { font-size: .8rem; }
/* Toolbox inside Workers on site */
.toolbox-bar { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .75rem; margin-bottom: .7rem; background: var(--page); display: grid; gap: .3rem; }
.toolbox-form { border-top: 0; margin-top: 0; padding-top: 0; }
.briefed { margin-top: .25rem; font-size: .88rem; }
.swms-trade { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.swms-trade .field { flex: 1 1 14rem; }
/* Amounts are: Excl. GST / Incl. GST (web/shared/gst-mode.mjs) */
.gst-mode { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.gst-mode .segmented button { min-height: 32px; padding: .25rem .8rem; }
.lines-optional { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.quote-files { margin: .25rem 0 0; padding-left: 1.1rem; }
/* Lines beside a document preview (Bill beside the invoice, PO beside the quotation): narrower columns so Amount stays visible. */
.win-split .win-body .line.line-stage { grid-template-columns: minmax(120px, 3fr) minmax(90px, 1.2fr) 64px 100px 56px 96px 32px; }
@media (max-width: 820px) { .win-split .win-body .line.line-stage { grid-template-columns: 1fr 1fr; } }

/* Client portal */
.client-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 8px; }
.client-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.client-log .card-head { flex-wrap: wrap; gap: 4px 12px; }
.invite-link { display: flex; gap: 8px; align-items: center; }
.invite-link input { flex: 1; font-family: ui-monospace, monospace; font-size: 13px; }
.client-access li { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 4px 0; }

/* Leads board (Planner habit) */
.lead-board { margin-top: 4px; }
.lead-columns { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(264px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; scroll-snap-type: x proximity; }
.lead-col { background: #e9ebe7; border-radius: var(--radius); padding: 10px; display: grid; gap: 8px; min-height: 120px; scroll-snap-align: start; border: 2px solid transparent; }
.lead-col.drop-on { border-color: var(--brand); background: var(--brand-soft); }
.lead-col-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.lead-col-head h2 { font-size: 15px; line-height: 20px; margin: 0; font-weight: 600; }
.lead-col-add { justify-self: start; }
.lead-col-cards { display: grid; gap: 8px; }
.lead-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 4px; cursor: pointer; }
.lead-card:hover { border-color: var(--line-strong); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.lead-card[draggable="true"] { cursor: grab; }
.lead-card.dragging { opacity: .5; }
.lead-card strong { font-size: 14px; line-height: 20px; }
.lead-card .small { font-size: 13px; }
.lead-card-notes { margin: 0; font-size: 13px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.lead-card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; margin-top: 4px; }
.lead-card-foot .spacer { flex: 1; }
.lead-labels { display: flex; flex-wrap: wrap; gap: 4px; }
.lead-label { font-size: 12px; line-height: 16px; padding: 1px 8px; border-radius: 99px; color: var(--ink); }
.lead-people { display: inline-flex; gap: 2px; }
.lead-avatar { width: 24px; height: 24px; font-size: 11px; background: var(--brand-soft); color: var(--brand); }
.lead-priority { font-weight: 600; }
.lead-priority.p-high { color: var(--warn); }
.lead-priority.p-urgent { color: var(--bad); }
.lead-card-details .check-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lead-checklist { display: grid; gap: 6px; margin-top: 12px; }
.done-text { text-decoration: line-through; }
.stage-edit li { flex-wrap: wrap; padding: 4px 0; }
@media (max-width: 760px) { .lead-columns { grid-auto-columns: 86vw; } }

/* ---- Public holidays import (Schedule → Workday Exceptions) ---- */
.exceptions-head { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; }
.exceptions-head p { margin-top: 0; }
.holiday-section { margin: 0 0 1rem; }
.holiday-section h3 { font-size: 14px; margin: 0 0 .4rem; }
.holiday-years { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.check-line { display: inline-flex; align-items: center; gap: .5rem; min-height: 32px; cursor: pointer; }
.holiday-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.holiday-row { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.holiday-row .check-line { flex: 1 1 320px; }
.holiday-row.is-off .holiday-name, .holiday-row.is-off .holiday-date { color: var(--muted); text-decoration: line-through; }
.holiday-date { display: inline-block; min-width: 9.5rem; font-variant-numeric: tabular-nums; }
.holiday-tags { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.holiday-note { flex-basis: 100%; padding-left: 1.7rem; }
@media (max-width: 820px) {
  .exceptions-head { flex-direction: column; }
  .holiday-date { min-width: 0; }
  .holiday-row .check-line { flex-basis: 100%; align-items: flex-start; }
}

/* ---- Schedule calendar: click a day to add an item ---- */
.cal-day.cal-pick { cursor: pointer; position: relative; }
.cal-day.cal-pick:hover { background-color: var(--brand-soft); }
.cal-add { position: absolute; top: .15rem; right: .35rem; font-size: 16px; line-height: 20px; color: var(--brand); font-weight: 600; opacity: 0; }
.cal-day.cal-pick:hover .cal-add { opacity: 1; }

/* ---- "+ New supplier" next to the supplier list ---- */
.new-supplier-link { margin-top: .35rem; font-size: 13px; }
.new-supplier-form { grid-template-columns: 1fr 1fr; }
@media (max-width: 820px) { .new-supplier-form { grid-template-columns: 1fr; } }

/* ---- Project list on the left (Buildertrend habit, 2026-11-24) ---- */
.rail-card { border-left-color: var(--rail-color, var(--brand)); gap: 4px; }
.rail-card-name { font-size: 16px; line-height: 22px; font-weight: 600; }
.rail-card-meta { display: flex; align-items: center; gap: .5rem; }
.rail-card-meta .badge { margin: 0; }
.rail-card-address { color: var(--ink-soft); text-decoration: none; }
.rail-card-address:hover { text-decoration: underline; color: var(--brand); }
.rail-card-toggle { font-size: 12px; margin-top: 2px; }
.rail-card-section { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; display: grid; gap: 2px; }
.rail-card-section a { color: var(--brand); text-decoration: none; }
.rail-card-section a:hover { text-decoration: underline; }
.rail-card-email { overflow-wrap: anywhere; }
.rail-card-label { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.rail-card-role { display: inline-block; min-width: 2.2rem; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.rail-status { justify-self: stretch; display: flex; }
.rail-status button { flex: 1; }
.rail-item { display: grid; gap: 1px; border-left: 3px solid var(--rail-color, transparent); border-radius: 0 6px 6px 0; padding: 6px 10px; }
.rail-item-name { font-weight: 600; line-height: 18px; }
.rail-item-sub { font-size: 12px; line-height: 16px; color: var(--ink-soft); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-item-off .rail-item-name, .rail-item-off .rail-item-sub { color: var(--ink-soft); }
.rail-item-on .rail-item-sub { color: var(--brand); }
.rail-status { width: auto; }
/* All my projects (2026-11-27): a clear button above the project filter, so it is not mistaken for the Active / Inactive / All filter. */
.rail-all { font: inherit; text-align: left; display: grid; gap: 1px; padding: 8px 12px; border: 1.5px solid var(--brand); border-radius: 8px; background: var(--surface); color: var(--brand); cursor: pointer; }
.rail-all:hover { background: var(--brand-soft); }
.rail-all-name { font-weight: 600; line-height: 18px; }
.rail-all-sub { font-size: 12px; line-height: 16px; color: var(--ink-soft); }
.rail-all-on { background: var(--brand); color: #fff; }
.rail-all-on:hover { background: var(--brand); }
.rail-all-on .rail-all-sub { color: rgba(255,255,255,.85); }
.rail-tools { justify-content: flex-start; } /* "+ Project" on the left (user, 2026-11-24) */

/* ---- Marketing (2026-11-25): campaign board, tasks, expenses ---- */
.mkt-progress { display: grid; gap: 3px; font-size: 12px; min-width: 140px; }
.mkt-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.mkt-bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.mkt-summary { display: grid; gap: 8px; }
.mkt-summary-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.2rem; }
.mkt-task-add { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .6rem 12px .4rem; border-top: 1px solid var(--line); }
.mkt-task-add > * { width: auto; min-width: 0; }
.mkt-task-add .grow { flex: 1 1 260px; }
.mkt-task-add select { flex: 0 1 220px; }
.mkt-task-add input[type="date"] { flex: 0 0 160px; }
.mkt-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.mkt-totals .card { display: grid; gap: 4px; }
.mkt-big { font-size: 22px; line-height: 28px; }
.mkt-split { align-items: start; }
table.mini { width: 100%; border-collapse: collapse; }
table.mini th, table.mini td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.mini th { font-weight: 500; }
table.mini .num { text-align: right; white-space: nowrap; }
tr.row-muted td, .card-row.row-muted { color: var(--ink-soft); }
.mkt-mine { margin-top: 12px; }
@media (max-width: 820px) {
  .mkt-split { grid-template-columns: 1fr; }
  .mkt-task-add select, .mkt-task-add input[type="date"] { flex: 1 1 40%; }
}

/* Password rules checklist (2026-11-25) */
.password-rules { margin: -.4rem 0 0; font-size: .85rem; color: var(--muted, #667); display: grid; gap: 2px; }
.password-rules .rule-ok { color: var(--brand); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Client portal: new items and things to act on (2026-11-25). Soft brand olive, not red. */
.new-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #7d8f5a; vertical-align: middle; flex: none; }
.tab-flag { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 9px; background: #e8ecdc; color: #4d5a33; font-size: .78rem; font-weight: 600; line-height: 18px; text-align: center; }
.client-summary { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border-radius: var(--radius); background: #f1f3ea; color: #4d5a33; font-weight: 500; }
.client-list-tools { display: flex; align-items: center; margin: 0 0 8px; }
.client-log.is-unread { border-left: 4px solid #a5b37f; cursor: pointer; }
.client-log h2 { display: flex; align-items: center; gap: 8px; }
.client-docs .dot-col { width: 22px; padding-right: 0; }
.client-docs tr.needs-action td { background: #f6f7ef; }
.client-docs tr.is-unread td { font-weight: 600; }
.client-docs .doc-number { font-weight: inherit; }
.client-variation-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.client-variation-sheet { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.client-accept { display: grid; gap: .7rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.client-accept h3 { margin: 0; }
.client-access li { flex-wrap: wrap; }
.client-access li > span:first-child { flex: 1 1 14rem; min-width: 0; }
.client-access li .actions { flex-wrap: nowrap; justify-content: flex-end; margin-left: auto; }
.client-reset-note { padding: 6px 10px; }

/* Trades list (2026-11-25) */
.trade-add input { flex: 1; min-width: 10rem; }
.trade-list { max-height: 55vh; overflow: auto; margin-top: .6rem; }
.trade-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.trade-list .actions { flex-wrap: nowrap; }

/* Project shown as text on document forms (2026-11-25) */
.project-choice-value { display: flex; align-items: center; gap: 10px; min-height: 38px; flex-wrap: wrap; }

/* OneDrive page (2026-11-25) */
.onedrive-list li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; word-break: break-word; }

/* Warranty inspection records (2026-11-25) */
.warranty-record { border-top: 1px solid var(--line); padding: 10px 0; display: grid; gap: 4px; }
.warranty-record-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.warranty-add { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; display: grid; gap: .6rem; }
.people-pick { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 0; }
code[data-redirect] { word-break: break-all; }
.photo-edit { position: relative; }
.photo-edit .photo-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; line-height: 26px; cursor: pointer; }
.photo-edit .photo-replace { position: absolute; bottom: 6px; right: 6px; background: rgba(255,255,255,.92); }
.todo-warnings { margin-bottom: 12px; }

/* CRM referrers (2026-11-25) */
.referrer-add { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 6px; margin-top: 6px; align-items: center; }
.referral-table tr.muted td { color: var(--ink-soft); }

/* Gate code on the project (2026-11-26) */
.gate-code { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; font-size: .9rem; }
.gate-code .rail-card-label { margin: 0; }
.gate-code-edit input { width: 9rem; }

.schedule-online { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.client-files { margin-top: 8px; display: grid; gap: 6px; }
.client-files a { display: inline-flex; align-items: center; gap: .5rem; }
.sheet-signed div, .sheet-signing div { display: flex; flex-direction: column; justify-content: flex-end; gap: .25rem; border-top: 0; padding-top: 0; }
.sheet-signed div > span, .sheet-signing div > span { border-top: 1px solid #111; padding-top: .3rem; }
.sheet-signed strong, .sheet-signing strong { font-size: 13px; color: #111; font-weight: 500; }
.sign-image { max-width: 100%; height: 56px; object-fit: contain; object-position: left bottom; }
.sign-pad { position: relative; }
.sign-pad canvas { display: block; width: 100%; height: 110px; background: #fbfbf7; border: 1px dashed #9aa3ab; border-radius: 6px; touch-action: none; cursor: crosshair; }
.sign-clear { position: absolute; top: 4px; right: 8px; font-size: 12px; }
.sheet-signing input { font-size: 14px; }
@media (max-width: 820px) { .sheet-signing { grid-template-columns: 1fr; } }

/* Dragging files onto a card, window or dialog that takes files (2026-11-27). */
.drop-on { position: relative; outline: 2px dashed var(--brand); outline-offset: 2px; }
.drop-on::after { content: 'Drop files here'; position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--brand-soft) 85%, transparent); color: var(--brand); font-weight: 600; border-radius: inherit; pointer-events: none; z-index: 5; }
/* Supplier picker: type to find (2026-11-27). */
.supplier-picker { position: relative; }
.supplier-picker-input { width: 100%; }
.supplier-picker-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 4px 0; }
.supplier-picker-head { font-size: 12px; color: var(--ink-soft); padding: 6px 12px 4px; }
.supplier-picker-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; cursor: pointer; font-weight: 400; color: var(--ink); }
.supplier-picker-row.on { background: var(--brand-soft); }
.supplier-picker-row.chosen .supplier-picker-name { font-weight: 600; }
.supplier-picker-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supplier-avatar { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--brand-soft); color: var(--brand); }
.supplier-picker-flag { flex: none; font-size: 11px; color: var(--bad, #b42318); }
.supplier-picker-create { color: var(--brand); font-weight: 600; border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 9px; }
.supplier-picker-none { padding: 8px 12px; font-size: 13px; }
/* New project: similar earlier projects (2026-11-27). */
.similar-projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.similar-projects li { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.similar-why { font-size: 12px; color: var(--warn); margin-top: 2px; }
/* Calendar: drag to move, drag the right end to change the working days (2026-11-27). */
.cal-bar { position: relative; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.cal-bar-drag { cursor: grab; touch-action: pan-x pan-y; }
.cal-bar-dragging { cursor: grabbing; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); z-index: 3; }
.cal-dragging .cal-day { cursor: grabbing; }
.cal-grip { position: absolute; top: 0; right: 0; bottom: 0; width: 8px; cursor: ew-resize; background: linear-gradient(to right, transparent 3px, rgba(255, 255, 255, .7) 3px, rgba(255, 255, 255, .7) 5px, transparent 5px); }
.cal-hint { margin-left: auto; font-size: 12px; text-align: right; }
.gantt-bar, .gantt-label, .gantt-body { -webkit-user-drag: none; -webkit-tap-highlight-color: transparent; }
.gantt-body { -webkit-user-select: none; user-select: none; }
.cal-day.cal-drop { background: color-mix(in srgb, var(--brand) 16%, white); box-shadow: inset 0 0 0 1px var(--brand); }
@media (max-width: 820px) { .cal-grip { width: 16px; background: linear-gradient(to right, transparent 7px, rgba(255, 255, 255, .8) 7px, rgba(255, 255, 255, .8) 10px, transparent 10px); } .cal-nav { flex-wrap: wrap; } .cal-hint { flex-basis: 100%; text-align: left; margin-left: 0; } }
/* Site sign-in (2026-11-30): the trade's link page, and the OHS tab. */
.signin-page { max-width: 640px; margin: 0 auto; padding: 12px 12px 48px; }
.signin-brand { text-align: center; padding: 10px 0 6px; }
.signin-brand img { height: 26px; }
.signin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; display: grid; gap: .6rem; }
.signin-card h1 { margin: 0; font-size: 1.25rem; }
.signin-card h2 { margin: 0; font-size: 1.05rem; }
.signin-card h3 { margin: 0 0 .2rem; font-size: .95rem; }
.signin-company { margin-top: .2rem; }
.signin-text { font-size: .92rem; line-height: 1.45; }
.signin-today { border-left: 4px solid var(--warn); }
.signin-item + .signin-item { border-top: 1px solid var(--line); padding-top: .6rem; }
.signin-workers { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .3rem .8rem; }
.signin-added { display: flex; justify-content: space-between; align-items: center; padding: .2rem 0; }
.signin-add { display: flex; gap: .5rem; }
.signin-add input { flex: 1; min-width: 0; }
.signin-count { margin: 0; font-size: 13px; }
.signin-agree { align-items: flex-start; font-weight: 600; }
.signin-agree input { margin-top: .2rem; }
.signin-list { display: grid; }
.signin-row { display: flex; gap: .8rem; justify-content: space-between; align-items: flex-start; padding: .7rem 0; border-top: 1px solid var(--line); }
.signin-row:first-child { border-top: 0; }
.signin-missing strong { color: var(--bad); }
.signin-share { flex-wrap: nowrap; }
.signin-url { width: 100%; font-size: 13px; }
.signin-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .3rem .8rem; margin-top: .3rem; }
.signin-opt-edit { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: grid; gap: .5rem; }
.signin-opt-edit.off { opacity: .6; }
.signin-signature { max-width: 100%; height: 110px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fbfbf7; }
.signin-names { margin: .3rem 0 0; padding-left: 1.1rem; }
@media (max-width: 820px) { .signin-row { flex-direction: column; } .signin-row .actions { flex-wrap: wrap; } }
/* Home: OHS today (2026-11-30). */
.ohs-today-list { display: grid; gap: 6px; }
.ohs-today-row { display: grid; grid-template-columns: 1fr auto auto; gap: .3rem 1rem; align-items: center; text-align: left; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--bad); border-radius: var(--radius); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; }
.ohs-today-row.done { border-left-color: var(--good); }
.ohs-today-row:hover { background: var(--brand-soft); }
.ohs-today-facts, .ohs-today-checks { display: flex; gap: .8rem; flex-wrap: wrap; font-size: 13px; }
@media (max-width: 820px) { .ohs-today-row { grid-template-columns: 1fr; } }
/* The system's confirm window (2026-12-01). */
.ask-dialog { width: min(92vw, 420px); }
.ask-message { margin: 0 0 1rem; line-height: 1.45; white-space: pre-line; }
.ask-actions { justify-content: flex-end; }
.ask-dialog .btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
/* Home: time to completion (2026-12-01). */
.countdown-list { display: grid; gap: 8px; }
.countdown-row { display: grid; gap: 6px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; }
.countdown-row:hover { background: var(--brand-soft); }
.countdown-top { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; align-items: baseline; }
.countdown-left strong { font-size: 1.35rem; }
.countdown-row.behind .countdown-left strong, .countdown-row.over .countdown-left strong { color: var(--bad); }
.countdown-bar { position: relative; height: 10px; border-radius: 5px; background: #e5e9ee; overflow: visible; }
.countdown-done { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--good); }
.countdown-row.behind .countdown-done, .countdown-row.over .countdown-done { background: var(--bad); }
.countdown-time { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); }
.countdown-facts { display: flex; gap: .9rem; flex-wrap: wrap; font-size: 13px; }
/* Home weather (2026-12-01). */
.weather-source { font-size: 12px; }
.weather-today { display: flex; gap: 14px; align-items: center; }
.weather-icon { font-size: 40px; line-height: 1; width: 48px; text-align: center; }
.weather-big strong { font-size: 1.8rem; }
.weather-big span { margin-left: .2rem; }
.text-rain { color: #1f5fa8; }
.pollen-row { margin-top: .35rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; font-size: 13px; }
.pollen-chip, .pollen-mini { border-radius: 99px; padding: 1px 8px; font-size: 12px; }
.tone-good { background: var(--good-soft); color: var(--good); }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-bad { background: var(--bad-soft); color: var(--bad); }
.weather-week { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: .8rem; }
.weather-day { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 4px; text-align: center; font-size: 13px; display: grid; gap: 2px; align-content: start; }
.weather-day.wet { border-color: #9cc0e8; background: #f1f6fc; }
.weather-dname { font-weight: 600; }
.weather-icon-sm { font-size: 20px; line-height: 1.2; }
.pollen-mini { padding: 0 4px; font-size: 11px; }
@media (max-width: 820px) { .weather-week { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Gantt full screen (2026-12-01): covers the window, above the top bar, bottom tabs and the + button */
.gantt-full { position: fixed; inset: 0; z-index: 30; background: var(--page); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.gantt-full-head { display: flex; align-items: center; gap: 10px; padding-top: env(safe-area-inset-top); }
.gantt-full-head strong { font-size: 18px; }
.gantt-full .gantt-tools { flex: none; }
.gantt-full .gantt-frame { flex: 1; min-height: 0; overflow: auto; align-content: start; }
body.gantt-full-open .fab, body.gantt-full-open .tabbar { display: none; }
/* an item opened from the full-screen Gantt opens on top of it */
body.gantt-full-open .win-scrim { z-index: 31; }
body.gantt-full-open .win { z-index: 32; }
body.gantt-full-open .toasts, body.gantt-full-open .drawer-scrim, body.gantt-full-open .drawer { z-index: 33; }
/* Bill from a PO: what is left to bill (2026-12-01). */
.totals.po-unbilled { margin-top: .9rem; padding: .6rem .7rem; background: var(--info-soft, #eef4fb); border-radius: var(--radius); width: min(100%, 360px); }
.totals.po-unbilled div span:first-child { margin-right: .8rem; }
.totals.po-unbilled .grand { font-size: 15px; border-top-width: 1px; }
/* Bill → Pay: Send to Xero or Other payment (2026-12-01). */
.pay-option { display: grid; gap: .25rem; text-align: left; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card, #fff); cursor: pointer; font: inherit; color: inherit; }
.pay-option:hover:not(:disabled) { border-color: var(--ink); }
.pay-option:disabled { opacity: .6; cursor: not-allowed; }
.todo-quick { margin: 0 0 .6rem; }
/* To-Do: sharing and voice notes (2026-12-01) */
.todo-invites { border-left: 4px solid var(--brand); }
.todo-invites .todo-row .actions { flex: none; }
.todo-shared { color: var(--ink-soft); }
.todo-add .voice-rec { flex: none; }
.voice-rec { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.rec-on { border-color: #b42318; color: #b42318; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #b42318; display: inline-block; margin-right: .35rem; animation: rec-blink 1s infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
.voice-list { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .5rem; }
.voice-list li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.voice-list audio { height: 36px; max-width: 100%; }
.todo-voice h3, .todo-people h3 { margin: 0; font-size: 1rem; }
.todo-people .chip-btn { cursor: default; }
.chip-declined { opacity: .6; text-decoration: line-through; }
.chip-x { border: 0; background: none; cursor: pointer; font-size: 1rem; padding: 0 0 0 .3rem; color: inherit; }
.share-pick { margin-top: .5rem; }
@media (max-width: 820px) { .todo-add .voice-rec .btn { padding: 6px 10px; } .todo-invites .todo-row { flex-wrap: wrap; } }
.todo-invites .card-head { padding: .7rem .9rem .2rem; }

/* A: worker self induction (2026-12-02) */
.induct-link { margin-bottom: 1rem; }
.induct-link h3 { margin: 0; }
.induct-url { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.induct-url input { flex: 1 1 16rem; min-width: 0; font-size: .85rem; }
.induct-sub { margin: .9rem 0 .3rem; font-size: .9rem; }
.induct-detail { display: grid; gap: .8rem; }
.induct-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .5rem 1rem; margin: 0; }
.induct-dl dt { font-size: .75rem; color: var(--ink-soft); }
.induct-dl dd { margin: 0; overflow-wrap: anywhere; }
.induct-sign { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.induct-form .check { align-items: flex-start; }
.induct-point, .induct-step { display: flex; gap: .55rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.induct-point input, .induct-step input { margin-top: .2rem; flex: none; width: 1.2rem; height: 1.2rem; }
.induct-line { display: block; margin-top: .2rem; white-space: pre-line; }
.induct-form select, .induct-form input:not([type=checkbox]) { width: 100%; }

/* B: toolbox weekly + phone sign-in (2026-12-02) */
.toolbox-week { font-size: .88rem; }
.toolbox-week.ok { color: var(--good); }
.toolbox-week.due { color: var(--bad); font-weight: 600; }
.toolbox-link { margin-top: .4rem; }
.toolbox-url { font-size: .78rem; padding: .15rem .35rem; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 4px; max-width: 100%; overflow-wrap: anywhere; }
.toolbox-signin .toolbox-workers { grid-template-columns: 1fr; }
.toolbox-worker { padding: .55rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); align-items: flex-start; }
.toolbox-worker input[type=radio] { width: 20px; height: 20px; min-height: 0; flex: none; margin: .1rem 0 0; padding: 0; }
.toolbox-worker > span { flex: 1; min-width: 0; }
.toolbox-worker.signed { background: var(--page); }
.toolbox-find { width: 100%; margin-bottom: .5rem; }

/* A2: worker-written SWMS at induction (2026-12-02) */
.induct-own { display: grid; gap: .7rem; margin-top: .6rem; }
.induct-own-step { display: grid; gap: .4rem; padding: .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--page); }
.induct-own-head { display: flex; justify-content: space-between; align-items: center; }
.induct-own textarea { width: 100%; }
.induct-own-read { margin: .3rem 0 0; padding-left: 1.2rem; }
.induct-own-read li { margin-bottom: .4rem; }

/* B2: OHS tabs by frequency, SWMS per trade, Test & Tag weekly (2026-12-02) */
.ohs-section-title { font-size: 1.05rem; margin: 1.2rem 0 .5rem; }
.ohs-section-title:first-child { margin-top: .2rem; }
.swms-trades-today { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .2rem 0 .3rem; }
.on-site-today .toolbar { margin: 0 0 .6rem; }
.tag-week-tick { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .6rem; }
.tag-week-tick input { flex: 1 1 14rem; }

/* B3: Sign in with Microsoft / Google (2026-12-03) */
.sso-buttons { display: grid; gap: .5rem; }
.sso-btn { display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 42px; background: #fff; border: 1px solid #c9cfd6; color: var(--ink, #1f2a30); font-weight: 600; text-decoration: none; }
.sso-btn:hover { background: #f5f6f7; }
.sso-mark { width: 18px; height: 18px; flex: none; }
.sso-ms { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.sso-ms i { display: block; }
.sso-ms i:nth-child(1) { background: #f25022; } .sso-ms i:nth-child(2) { background: #7fba00; }
.sso-ms i:nth-child(3) { background: #00a4ef; } .sso-ms i:nth-child(4) { background: #ffb900; }
.sso-g { display: grid; place-items: center; border-radius: 50%; border: 1px solid #dadce0; font: 700 12px/1 Arial, sans-serif; color: #4285f4; }
.sso-or { display: flex; align-items: center; gap: .6rem; color: var(--ink-soft); font-size: .82rem; margin: .3rem 0 .1rem; }
.sso-or::before, .sso-or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.signin-steps { margin: 0 0 .8rem; padding-left: 1.2rem; display: grid; gap: .35rem; font-size: .9rem; }
.signin-uri { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; max-width: 100%; }
.signin-uri code { overflow-wrap: anywhere; font-size: .82rem; }

/* A1: QMS ↔ OneDrive files (2026-12-03) */
.od-card > * { min-width: 0; }
.od-steps summary { cursor: pointer; font-weight: 600; }
.od-steps ol { margin: .5rem 0 0; padding-left: 1.2rem; display: grid; gap: .3rem; }
.od-steps code, .od-paths code { overflow-wrap: anywhere; }
.od-search { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.od-search input, .od-search select { flex: 1 1 14rem; min-width: 0; }
.od-pick { display: grid; gap: .35rem; margin: 0; }
.od-pick li { display: flex; gap: .5rem; flex-wrap: wrap; align-items: baseline; }
.od-pick .btn-link.on { font-weight: 700; }
.od-mode { display: grid; gap: .4rem; justify-items: start; }
.od-mode label { display: flex; gap: .5rem; align-items: flex-start; }
.od-mode input[type=radio] { width: auto; flex: none; margin: .2rem 0 0; }
.od-paths { display: grid; gap: .3rem; margin: 0; }
.od-paths li { display: grid; grid-template-columns: 9.5rem 1fr; gap: .5rem; }
.od-map td:last-child { width: 60%; }
.od-map input { width: 100%; }
.od-switch { align-items: flex-start; }
.od-folder { display: grid; gap: .5rem; }
.od-folder-pick { display: grid; gap: .5rem; }
.od-needs { margin-bottom: 1rem; }
.od-hidden-toggle { white-space: nowrap; }
.od-pending { font-size: .8rem; color: var(--ink-soft); white-space: nowrap; }
.od-is-hidden { opacity: .55; }
.od-is-pending { cursor: default; }
@media (max-width: 820px) { .od-paths li { grid-template-columns: 1fr; gap: 0; } }

/* A2-doc: Read document (2026-12-03) */
.doc-read { display: inline-flex; flex-direction: column; gap: .3rem; align-items: flex-end; }
.doc-read-error { max-width: 22rem; }
.doc-read-summary { display: grid; gap: .4rem; }
.doc-read-hide, .doc-read-po .btn-link { justify-self: start; font-size: .85rem; }
.doc-read-po { display: grid; gap: .3rem; }
.doc-flag, input.doc-flag, .doc-flag select, .doc-flag input { outline: 2px solid var(--warn); outline-offset: 1px; background: var(--warn-soft); border-radius: 4px; }
.doc-flag-line { box-shadow: inset 3px 0 0 var(--warn); background: var(--warn-soft); }
.doc-read-privacy { background: var(--info-soft); }
.doc-read-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .3rem; }
.invoice-pane .card-head .actions { gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.doc-read-other > summary { cursor: pointer; font-weight: 600; }
.doc-read-other[open] > summary { margin-bottom: .6rem; }
.doc-read-other .doc-read-key { box-shadow: none; border: 0; padding: 0; }

/* A-ai: AI switches (IT → AI, My settings) and the AI button / note */
.ai-mark { color: var(--brand); font-size: .9em; }
.ai-area { display: grid; gap: .5rem; }
.ai-area .form-section { margin: .3rem 0 0; }
.ai-switch { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; }
.ai-switch input[type=checkbox] { width: auto; flex: none; margin: .2rem 0 0; }
.ai-switch > span { display: grid; gap: .1rem; min-width: 0; }
.ai-switch-meta { font-size: .8rem; }
.ai-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ai-bar .file-pick.is-busy { opacity: .6; pointer-events: none; }
.ai-box { display: grid; gap: .5rem; padding: .7rem; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--page); }
.ai-box .actions { justify-content: flex-end; }
.ai-note { display: grid; gap: .4rem; }
.ai-note-hide { justify-self: start; font-size: .85rem; }
/* A-ai step 2: photo hazard, SWMS step and toolbox drafts */
.swms-ai { margin: .6rem 0; }
.swms-step .ai-note { grid-column: 1 / -1; }
.toolbox-form .ai-bar, .toolbox-form .ai-note { margin-bottom: .5rem; }

/* B-ai: AI drafts in Daily Log, Client Report, Quotations, Variations, Warranty, Schedule, CRM (2026-12-03) */
.ai-draft-text { display: grid; gap: .4rem; }
.ai-draft-text textarea { width: 100%; }
.client-summary textarea { width: 100%; }
.variation-ai, .warranty-ai, .lead-ai { margin-top: .6rem; }
.ai-compare-table th { text-align: left; vertical-align: top; }
.ai-compare-table td { vertical-align: top; min-width: 9rem; }
.ai-compare-table ul { margin: 0; padding-left: 1.1rem; }
/* main: gear menu sections (2026-12-03) */
.more-section { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: .6rem 0 .2rem; }
