@font-face { font-family: Poppins; font-weight: 400; src: url(fonts/Poppins-Regular.ttf); }
@font-face { font-family: Poppins; font-weight: 500; src: url(fonts/Poppins-Medium.ttf); }
@font-face { font-family: Poppins; font-weight: 600; src: url(fonts/Poppins-SemiBold.ttf); }
@font-face { font-family: Poppins; font-weight: 700; src: url(fonts/Poppins-Bold.ttf); }

:root {
  --primary: #123B67;
  --primary-deep: #0B2747;
  --accent: #F39200;
  --accent-soft: #FFF3E0;
  --bg: #F4F6FA;
  --card: #FFFFFF;
  --ink: #142235;
  --muted: #5E6B7D;
  --line: #E1E6EE;
  --line-strong: #CBD3DF;
  --good: #1E7A4C;
  --good-soft: #E6F4EC;
  --warn: #9A5B00;
  --warn-soft: #FFF4E0;
  --stop: #B42318;
  --stop-soft: #FDECEA;
  --info-soft: #EAF1F9;
  --on-accent: #1A1A1A;
  --side-bg: #123B67;
  --primary-ink: #123B67;
  --surface-1: #F8FAFC;
  --surface-2: #EEF1F6;
  --ink-2: #33425A;
  --stop-line: #F2C4BF;
  --good-line: #BFE3CD;
  --warn-line: #F7D29A;
  --purple-soft: #F0EAFB;
  --pink-soft: #FCE8EB;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 34, 60, .06), 0 2px 8px rgba(16, 34, 60, .05);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { color-scheme: light; }
html.night { color-scheme: dark; }
body {
  font-family: Poppins, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  display: grid;
  grid-template-columns: 248px 1fr;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- sidebar ---------- */
.sidebar {
  background: var(--side-bg, var(--primary));
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 22px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 14px; }
.brand-mark { width: 46px; height: 38px; color: #fff; flex: none; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand-co { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-top: 2px; }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  background: none; border: 0; border-radius: 8px;
  color: rgba(255,255,255,.82);
  padding: 9px 10px; text-align: left; font-weight: 500;
}
.nav-item svg { width: 19px; height: 19px; flex: none; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.5); margin: 18px 10px 6px; }
.nav-item.nav-line { font-weight: 400; font-size: 13px; }
.nav-item.nav-line .plus { margin-left: auto; color: var(--accent); font-weight: 600; }
.nav-spacer { flex: 1; min-height: 16px; }
.backup-pill {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: rgba(0,0,0,.18); font-size: 12px; line-height: 1.4; cursor: pointer;
  display: flex; gap: 9px; align-items: flex-start;
}
.backup-pill .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; background: #8a96a8; }
.backup-pill.ok .dot { background: #4ADE80; }
.backup-pill.bad .dot { background: var(--accent); }
.backup-pill small { display: block; color: rgba(255,255,255,.6); }

/* ---------- main ---------- */
main { overflow-y: auto; padding: 28px 36px 48px; outline: none; }
.page { max-width: 1240px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 4px; }
h1 { font-size: 28px; line-height: 1.15; margin: 0; color: var(--primary-ink); font-weight: 700; }
h2 { font-size: 17px; margin: 0; color: var(--primary-ink); font-weight: 600; }
.sub { color: var(--muted); margin: 6px 0 0; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; min-width: 300px; height: 42px; box-shadow: var(--shadow);
}
.search svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.search input { border: 0; outline: none; background: none; flex: 1; height: 100%; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* line tiles */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 12px; }
.section-title p { margin: 0; color: var(--muted); font-size: 13px; }
.lines { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.line-tile {
  position: relative; display: flex; flex-direction: column;
  padding: 18px 18px 16px; border-top: 4px solid var(--primary);
  transition: transform .12s ease, box-shadow .12s ease;
}
.line-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16,34,60,.10); }
.line-tile .ico { width: 42px; height: 42px; border-radius: 10px; background: var(--info-soft); color: var(--primary-ink); display: grid; place-items: center; margin-bottom: 12px; }
.line-tile .ico svg { width: 24px; height: 24px; }
.line-tile h3 { margin: 0 0 4px; font-size: 16px; color: var(--primary-ink); }
.line-tile p { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; line-height: 1.5; flex: 1; }
.line-tile .counts { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.line-tile .counts b { display: block; font-size: 20px; color: var(--ink); font-weight: 600; line-height: 1.1; }
.line-tile .actions { display: flex; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 8px; border: 1px solid var(--line-strong); background: var(--card);
  padding: 8px 14px; font-weight: 500; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #1c1200); font-weight: 600; }
.btn.primary:hover { filter: brightness(.93); }
.btn.navy { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.navy:hover { background: var(--primary-deep); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn.danger { color: var(--stop); border-color: var(--stop-line); }
.btn.danger:hover { background: var(--stop-soft); border-color: var(--stop); }
.btn.grow { flex: 1; }
.btn svg { width: 16px; height: 16px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 28px; }
.stat { padding: 16px 18px; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }

/* tables */
.table-card { overflow: hidden; }
.table-card .head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 18px; background: var(--surface-1); border-bottom: 1px solid var(--line); }
td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--surface-1); }
tbody tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; }
.cname { font-weight: 600; color: var(--ink); }
.csub { color: var(--muted); font-size: 12px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 99px; background: var(--info-soft); color: var(--primary-ink); white-space: nowrap; }
.chip svg { width: 14px; height: 14px; }
.status { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.status.Lead { background: var(--surface-2); color: var(--ink-2); }
.status.Quoted { background: var(--warn-soft); color: var(--warn); }
.status.Active { background: var(--good-soft); color: var(--good); }
.status.Inactive { background: var(--surface-2); color: var(--muted); }

/* side panel */
.panel { padding: 18px; }
.panel + .panel { margin-top: 16px; }
.panel h2 { margin-bottom: 10px; }
.panel p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; margin-bottom: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.banner { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--warn-line); margin-bottom: 24px; }
.banner svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.banner div { flex: 1; }
.banner b { display: block; }
.banner span { color: var(--muted); font-size: 13px; }

/* filters */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; }
.tab { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font-weight: 500; color: var(--muted); }
.tab.active { background: var(--card); color: var(--primary-ink); box-shadow: var(--shadow); }
.tab .n { font-size: 11px; color: var(--muted); margin-left: 4px; }
.toolbar select { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--card); }
.toolbar .search { box-shadow: none; height: 36px; min-width: 200px; flex: 1; }

/* ---------- form ---------- */
.form-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.form-head .ico { width: 52px; height: 52px; border-radius: 12px; background: var(--primary); color: #fff; display: grid; place-items: center; flex: none; }
.form-head .ico svg { width: 28px; height: 28px; }
.form-head .grow { flex: 1; }
.form-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
fieldset { border: 0; margin: 0 0 16px; padding: 18px 20px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
legend { float: left; width: 100%; font-weight: 600; color: var(--primary-ink); font-size: 15px; margin-bottom: 14px; padding: 0; }
legend + * { clear: both; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label, .field .lbl { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field .req { color: var(--accent); }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=number], .field input[type=date], .field input[type=time], .field input[type=password], .field select, .field textarea {
  width: 100%; height: 40px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--card);
}
.field textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(18,59,103,.12); }
.field .help { font-size: 11.5px; color: var(--muted); }
.field.invalid input, .field.invalid select { border-color: var(--stop); }
.field .err { font-size: 11.5px; color: var(--stop); }
.check { display: flex; align-items: center; gap: 9px; font-size: 13px; padding: 9px 0 0; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.multi { display: flex; flex-wrap: wrap; gap: 8px; }
.multi label { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 99px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; background: var(--card); user-select: none; }
.multi input { position: absolute; opacity: 0; pointer-events: none; }
.multi label:has(input:checked) { background: var(--primary); border-color: var(--primary); color: #fff; }
.multi label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-actions { position: sticky; bottom: -48px; display: flex; gap: 10px; align-items: center; padding: 14px 0 0; background: linear-gradient(to bottom, rgba(244,246,250,0), var(--bg) 30%); }
.form-actions .spacer { flex: 1; }
.form-actions .meta { color: var(--muted); font-size: 12px; }

.rules { position: sticky; top: 0; }
.rules .panel h2 { display: flex; align-items: center; gap: 8px; }
.note { border-radius: 9px; padding: 10px 12px; margin-bottom: 10px; font-size: 12.5px; line-height: 1.5; background: var(--info-soft); border-left: 3px solid var(--primary); }
.note b { display: block; font-size: 13px; margin-bottom: 2px; }
.note.good { background: var(--good-soft); border-color: var(--good); }
.note.warn { background: var(--warn-soft); border-color: var(--accent); }
.note.stop { background: var(--stop-soft); border-color: var(--stop); }
.note.stop b { color: var(--stop); }

/* backup page */
.cloud-list { display: grid; gap: 10px; margin: 6px 0 14px; }
.cloud-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); text-align: left; }
.cloud-opt:hover { border-color: var(--primary); background: var(--surface-1); }
.cloud-opt b { display: block; }
.cloud-opt span { color: var(--muted); font-size: 12px; word-break: break-all; }
.cloud-opt .go { margin-left: auto; color: var(--accent); font-weight: 600; }
.path { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-1); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; word-break: break-all; margin-bottom: 12px; }
.steps { margin: 0 0 6px; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* toast */
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--primary-deep); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-weight: 500; transform: translateY(16px); opacity: 0; pointer-events: none; transition: .2s ease; max-width: 420px; }
.toast.show { transform: none; opacity: 1; }
.toast.bad { background: var(--stop); }

@media (max-width: 1180px) {
  .lines, .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two-col, .form-wrap { grid-template-columns: 1fr; }
  .rules { position: static; }
  .grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
[hidden]{display:none !important}
main:focus, main:focus-visible { outline: none; }
.num { white-space: nowrap; }
.form-actions .meta { white-space: nowrap; }

/* ---------- sidebar New client button ---------- */
.nav-new {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 16px 2px 0; padding: 10px 12px; border: 0; border-radius: 9px;
  background: var(--accent); color: #1c1200; font-weight: 600;
}
.nav-new svg { width: 17px; height: 17px; }
.nav-new:hover { background: #e08600; }

/* ---------- business line tags ---------- */
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.tag-rental { background: var(--info-soft); color: #1F4E86; }
.tag-str { background: var(--pink-soft); color: #B4233A; }
.tag-commercial { background: var(--purple-soft); color: #6A3FB5; }
.tag-residential { background: var(--good-soft); color: #1E7A4C; }

/* ---------- pop-up ---------- */
body.modal-open main { overflow: hidden; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(11, 22, 38, .45);
  display: grid; place-items: center; padding: 24px;
}
.modal {
  background: var(--card); border-radius: 14px; box-shadow: 0 24px 64px rgba(8, 20, 40, .3);
  width: min(880px, 100%); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 6px; }
.modal-head h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.modal-intro { margin: 8px 0 0; font-size: 16px; color: var(--ink); line-height: 1.45; }
.icon-btn { border: 0; background: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; margin-bottom: 6px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.back-link svg { width: 15px; height: 15px; }
.back-link:hover { color: var(--primary-ink); }
.modal-body { padding: 14px 24px 18px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--card); }
.modal-note { font-size: 12.5px; color: var(--muted); }
.foot-btns { display: flex; gap: 8px; }
.modal-foot .btn { padding: 10px 18px; }
.btn:disabled { background: var(--line-strong); border-color: var(--line-strong); color: var(--ink-2); cursor: not-allowed; }

.pick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pick-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left;
  padding: 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--card);
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.pick-card:hover { border-color: var(--primary); }
.pick-card.selected { border-color: var(--primary); background: var(--surface-1); box-shadow: 0 0 0 3px rgba(18, 59, 103, .14); }
.pick-sub { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.pick-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.pick-card li { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; padding-left: 12px; position: relative; }
.pick-card li::before { content: "•"; position: absolute; left: 0; }

.m-section { border: 0; box-shadow: none; padding: 0; margin: 0 0 18px; border-radius: 0; background: none; }
.m-section + .m-section { border-top: 1px solid var(--line); padding-top: 16px; }
.m-section legend { font-size: 14px; margin-bottom: 10px; }

@media (max-width: 860px) {
  .pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .modal-backdrop { padding: 10px; }
  .pick-grid, .modal .grid { grid-template-columns: 1fr; }
  .modal-foot { flex-direction: column; align-items: stretch; }
  .modal-note { text-align: center; }
}

/* business line colors (match the tags) */
.lc-rental { --lc: #1F4E86; --lc-soft: #E6EEF8; }
.lc-str { --lc: #B4233A; --lc-soft: #FCE8EB; }
.lc-commercial { --lc: #6A3FB5; --lc-soft: #F0EAFB; }
.lc-residential { --lc: #1E7A4C; --lc-soft: #E5F4EB; }
.line-tile { border-top-color: var(--lc); }
.line-tile .ico { background: var(--lc-soft); color: var(--lc); }
.line-tile h3 { color: var(--lc); }
.form-head .ico { background: var(--lc); }
.form-head .eyebrow { display: flex; align-items: center; gap: 8px; letter-spacing: normal; text-transform: none; margin-bottom: 6px; }
.tab .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lc); margin-right: 6px; vertical-align: 1px; }
.chip.tag-rental, .chip.tag-str, .chip.tag-commercial, .chip.tag-residential { font-weight: 600; }

.legend-help { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.field .note { margin: 0; }
.field.span2 { grid-column: span 2; }
@media (max-width: 760px) { .field.span2 { grid-column: 1 / -1; } }

/* ---------- client profile ---------- */
.head-btns { display: flex; gap: 8px; align-self: flex-start; flex-wrap: wrap; }
.form-head .eyebrow .status { font-size: 11.5px; }
.ptabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-strong); margin: 0 0 22px; overflow-x: auto; scrollbar-width: thin; }
.ptab { position: relative; border: 0; background: none; padding: 11px 14px 12px; font-weight: 500; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.ptab:hover { color: var(--ink); }
.ptab.active { color: var(--ink); font-weight: 600; }
.ptab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--lc); }
.ptab .n { font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--muted); padding: 1px 7px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.ptab .n.warn { background: var(--warn-soft); color: var(--warn); }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat.alert { border-color: var(--stop-line); background: var(--stop-soft); }
.stat.alert .value { color: var(--stop); }
.stat.warnline { border-color: var(--warn-line); }
.two-col.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
td.right, th.right { text-align: right; }
.nowrap { white-space: nowrap; }
.num-strong { font-variant-numeric: tabular-nums; font-weight: 600; }
td.late { color: var(--stop); font-weight: 600; }
tr.static { cursor: default; }
tr.static:hover td { background: none; }
.btn.mini { padding: 3px 9px; font-size: 12px; margin-left: 6px; }
.small-select { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--card); }
.status.job-Scheduled { background: var(--info-soft); color: var(--primary-ink); }
.status.job-Completed { background: var(--warn-soft); color: var(--warn); }
.status.job-Invoiced { background: var(--purple-soft); color: #6A3FB5; }
.status.job-Paid { background: var(--good-soft); color: var(--good); }
.status.job-Canceled { background: var(--surface-2); color: var(--muted); }
.flag-stop { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--stop); background: var(--stop-soft); padding: 2px 8px; border-radius: 99px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.person { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; }
.person.clickable { cursor: pointer; }
.person.clickable:hover { border-color: var(--primary); }
.person .grow { flex: 1; min-width: 0; }
.person .pmeta { font-size: 12.5px; color: var(--muted); margin-top: 4px; word-break: break-word; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 600; font-size: 14px; flex: none; }
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; height: 220px; align-items: end; padding-top: 8px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar { width: 100%; max-width: 44px; background: var(--primary); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar-val { font-size: 10.5px; color: var(--muted); margin-bottom: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-lbl { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.timeline li:first-child { border-top: 0; }
.timeline .t-when { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.timeline li.manual .t-text { color: var(--ink); }
@media (max-width: 1180px) { .two-col.even { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .stats.three { grid-template-columns: 1fr; } .timeline li { grid-template-columns: 1fr; gap: 2px; } .bars { gap: 3px; } .bar-val { display: none; } }
.ptabs { overflow-y: hidden; }
.two-col.even + * , .two-col.even .panel + .panel { margin-top: 0; }

/* ---------- read-only info cards + small buttons + back ---------- */
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; gap: 5px; }
.btn.sm svg { width: 14px; height: 14px; }
.head-actions { display: flex; gap: 6px; align-items: center; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.info-card { overflow: hidden; }
.info-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.info-head h2 { font-size: 15.5px; }
.info-help { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.info-rows { display: grid; grid-template-columns: minmax(110px, 40%) minmax(0, 1fr); margin: 0; }
.info-rows dt, .info-rows dd { margin: 0; padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 13px; }
.info-rows dt { color: var(--muted); background: var(--surface-1); }
.info-rows dd { font-weight: 500; word-break: break-word; }
.info-rows dd.pre { white-space: pre-wrap; font-weight: 400; }
.info-rows dt:nth-last-child(2), .info-rows dd:last-child { border-bottom: 0; }
.info-card .note { margin: 12px 18px 16px; }
.record-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 12px 4px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.people-grid.inset { padding: 16px 18px 18px; }
.back-top { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 4px 8px 4px 2px; margin: -8px 0 12px; color: var(--muted); font-weight: 500; font-size: 13px; border-radius: 6px; }
.back-top svg { width: 17px; height: 17px; }
.back-top:hover { color: var(--primary-ink); background: var(--surface-2); }
@media (max-width: 900px) { .card-grid { grid-template-columns: 1fr; } }

/* archive */
.status.Archived { background: var(--surface-2); color: var(--ink-2); }
.banner.archived { background: var(--surface-2); border-color: var(--line-strong); }
.banner.archived svg { color: var(--ink-2); }
.strip-right { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.strip-note { color: var(--muted); }

/* ---------- layout builders ---------- */
.modal.form.wide { max-width: 980px; }
.builder-field .builder-title { font-size: 14px; font-weight: 600; color: var(--primary-ink); }
.plans { display: grid; gap: 12px; }
.plan-card { border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-1); padding: 14px 16px; display: grid; gap: 10px; }
.plan-card.single { background: var(--surface-1); }
.plan-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-num { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12.5px; font-weight: 600; display: grid; place-items: center; flex: none; }
.plan-name { flex: 1; min-width: 180px; height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; font-weight: 600; background: var(--card); }
.plan-units { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.plan-units input { width: 76px; height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; background: var(--card); }
.lay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stepper-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.stepper-field .lbl, .sub-lbl { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.sub-lbl { display: block; margin-top: 2px; }
.stepper { display: grid; grid-template-columns: 36px 1fr 36px; height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--card); }
.stepper button { border: 0; background: var(--surface-1); font-size: 18px; font-weight: 600; color: var(--primary-ink); }
.stepper button:hover { background: var(--surface-2); }
.stepper input { border: 0; text-align: center; width: 100%; min-width: 0; font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper-field input.sqft { height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: var(--card); }
.room-chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.room-chip { border: 1px solid var(--line-strong); background: var(--card); border-radius: 99px; padding: 5px 11px; font-size: 12.5px; color: var(--ink-2); }
.room-chip:hover { border-color: var(--primary); }
.room-chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.room-other { display: inline-flex; gap: 6px; align-items: center; }
.room-other input { height: 32px; width: 140px; border: 1px solid var(--line-strong); border-radius: 99px; padding: 0 12px; font-size: 12.5px; background: var(--card); }
.plan-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 10px; border-top: 1px dashed var(--line-strong); font-size: 12.5px; color: var(--muted); }
.plan-foot b { color: var(--ink); font-weight: 600; }
.builder-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.builder-total { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.site-total { height: 38px; display: flex; align-items: center; font-size: 13px; }
.area-rows { display: grid; gap: 6px; }
.area-row { display: grid; grid-template-columns: minmax(150px, 1.6fr) 90px 110px minmax(120px, 1.4fr) 34px; gap: 8px; align-items: center; }
.area-row.head span { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.area-row input { height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: var(--card); min-width: 0; width: 100%; }
.builder-empty { margin: 0; font-size: 12.5px; color: var(--muted); }
@media (max-width: 760px) { .area-row { grid-template-columns: 1fr 70px 80px 34px; } .area-row input[data-path$=".notes"], .area-row.head span:nth-child(4) { display: none; } }

/* grouped chips, presets, beds */
.sub-block { display: grid; gap: 6px; }
.sub-lbl .muted { font-weight: 400; color: var(--muted); margin-left: 6px; }
.chip-groups { display: grid; gap: 6px; }
.chip-group { border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.chip-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.chip-group > summary::-webkit-details-marker { display: none; }
.chip-group > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
.chip-group[open] > summary::before { transform: rotate(45deg); }
.chip-group > summary:hover { color: var(--ink); }
.chip-group .room-chips { padding: 2px 12px 12px; }
.pick-count { font-size: 11px; font-weight: 600; background: var(--primary); color: #fff; border-radius: 99px; padding: 1px 7px; }
.preset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.preset-row .lbl { font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-right: 4px; }
.preset-chip { border: 1px dashed var(--primary); background: var(--surface-1); color: var(--primary-ink); border-radius: 8px; padding: 5px 10px; font-size: 12.5px; font-weight: 500; }
.preset-chip:hover { background: var(--info-soft); border-style: solid; }
.bed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.stepper-field.small .stepper { height: 34px; grid-template-columns: 30px 1fr 30px; }
.stepper-field.small .lbl { font-size: 12px; }
.stepper-field.wide2 { grid-column: span 2; }

/* business line tiles: View sits beside the counts */
.line-tile .counts { align-items: flex-end; margin-bottom: 0; }
.line-tile .counts .view-btn { margin-left: auto; align-self: center; }

.table-card { overflow-x: auto; }
.table-card .cname { min-width: 150px; }

/* two-step confirm */
.btn.armed { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.danger.armed { background: var(--stop); border-color: var(--stop); color: #fff; }
.review-box { border: 1px solid var(--warn-line); background: var(--warn-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: 13px; line-height: 1.5; }
.review-box ul { margin: 6px 0 0; padding-left: 18px; }
.review-box s { color: var(--muted); }
.review-box .rv-k { font-weight: 600; }
.info-rows[data-dbl-card] { cursor: default; }
.info-rows dd.calc { color: var(--primary-ink); }
.flag-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 2px; }
.acct-flag { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--stop-soft); color: var(--stop); }
.acct-flag.vip { background: var(--accent-soft); color: var(--warn); }
.flag-note { font-size: 12px; color: var(--muted); }

/* property form sections, unit list, flags */
.form-heading { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.grid > .form-heading:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-heading h3 { margin: 0; font-size: 14.5px; color: var(--primary-ink); font-weight: 600; }
.unit-add { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 8px; }
.unit-add input, .unit-add select, .unit-row input, .unit-row select { height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: var(--card); min-width: 0; width: 100%; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 12px; max-height: 260px; overflow-y: auto; padding-right: 4px; }
.unit-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) 30px; gap: 6px; align-items: center; }
.area-row { grid-template-columns: minmax(140px, 1.5fr) 80px 96px 130px minmax(110px, 1.2fr) 34px; }
.area-row select { height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 6px; background: var(--card); min-width: 0; width: 100%; }
.unit-hint { color: var(--primary-ink); font-weight: 500; }
.prop-flags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.pflag { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.pflag.warn { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 760px) { .unit-add { grid-template-columns: 1fr; } .area-row { grid-template-columns: 1fr 64px 76px 34px; } .area-row select, .area-row.head span:nth-child(4) { display: none; } }

.form-heading + .builder-field .builder-title { display: none; }

/* expandable property rows */
.prop-row .caret { display: inline-block; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); margin: 0 9px 2px 0; transition: transform .15s; }
.prop-row.open .caret { transform: rotate(45deg); }
.prop-row.open td { background: var(--surface-1); border-bottom-color: transparent; }
.prop-detail > td { background: var(--surface-1); padding: 4px 18px 20px; cursor: default; }
.prop-detail:hover > td { background: var(--surface-1); }
.pd { display: grid; gap: 12px; }
.pd .note { margin: 0; }
.pd-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pd-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.pd-stats > div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; min-width: 120px; }
.pd-stats span { display: block; font-size: 11.5px; color: var(--muted); }
.pd-stats b { font-size: 16px; font-variant-numeric: tabular-nums; }
.pd-actions { display: flex; gap: 8px; }
.pd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.pd-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.pd-card h4 { margin: 0 0 8px; font-size: 13px; color: var(--primary-ink); font-weight: 600; }
.pd-card dl { display: grid; grid-template-columns: minmax(100px, 40%) minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 12.5px; }
.pd-card dt { color: var(--muted); }
.pd-card dd { margin: 0; font-weight: 500; word-break: break-word; }
.pd-card dd.pre { white-space: pre-wrap; font-weight: 400; }
.pd-card dd.break { word-break: break-all; }
.pd-card table { font-size: 12.5px; }
.pd-card .table-wrap { overflow-x: auto; }
.mini-table th { padding: 6px 10px; font-size: 10.5px; }
.mini-table td { padding: 8px 10px; font-size: 12.5px; }
.lay-line { font-size: 13px; margin-bottom: 6px; }
.price-tag { color: var(--primary-ink); font-weight: 500; }
.sub-line { font-size: 11.5px; color: var(--muted); margin: 8px 0 4px; font-weight: 500; }
.mini-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.mini-chips span { font-size: 11.5px; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.muted-p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* work orders */
.li-table { display: grid; gap: 6px; }
.li-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 100px 100px 32px; gap: 8px; align-items: center; }
.li-row.head span { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.li-row input { height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: var(--card); min-width: 0; width: 100%; }
.li-row.base input { border-color: var(--primary); }
.li-desc { display: flex; align-items: center; gap: 6px; min-width: 0; }
.li-desc em { font-style: normal; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--primary-ink); background: var(--info-soft); padding: 2px 6px; border-radius: 5px; flex: none; }
.li-note { font-size: 12px; color: var(--primary-ink); margin: -2px 0 4px; }
.li-opts { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.li-opts label { display: inline-flex; align-items: center; gap: 6px; }
.li-opts input { width: 80px; height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; background: var(--card); }
.li-exempt, .li-hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.li-totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 6px 0 0; padding-top: 10px; border-top: 1px dashed var(--line-strong); font-size: 13px; max-width: 420px; margin-left: auto; width: 100%; }
.li-totals dt { color: var(--muted); }
.li-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.li-totals .grand { font-size: 16px; font-weight: 700; color: var(--ink); padding-top: 6px; border-top: 1px solid var(--line); }
.ck-progress { display: flex; align-items: center; gap: 12px; }
.ck-progress .progress { flex: 1; margin: 0; }
.ck-group { display: grid; gap: 2px; }
.ck-head { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--primary-ink); margin-top: 4px; }
.ck-item { display: flex; align-items: flex-start; gap: 10px; text-align: left; border: 0; background: none; padding: 6px 4px; border-radius: 6px; font-size: 13px; color: var(--ink); }
.ck-item:hover { background: var(--surface-2); }
.ck-box { width: 17px; height: 17px; border: 2px solid var(--line-strong); border-radius: 4px; flex: none; margin-top: 1px; display: grid; place-items: center; background: var(--card); }
.ck-item[aria-checked="true"] .ck-box { background: var(--good); border-color: var(--good); }
.ck-item[aria-checked="true"] .ck-box::after { content: ""; width: 5px; height: 9px; border: solid var(--card); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.ck-item[aria-checked="true"] { color: var(--muted); text-decoration: line-through; }
.rush-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--stop-soft); color: var(--stop); white-space: nowrap; }
@media (max-width: 760px) { .li-row { grid-template-columns: minmax(0, 1fr) 56px 76px 32px; } .li-row > [data-calc], .li-row.head span:nth-child(4) { display: none; } }

/* ---------- Company work orders page ---------- */
.wo-stats .wo-stat { text-align: left; cursor: pointer; font: inherit; color: inherit; border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s; }
.wo-stats .wo-stat:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(16,42,87,.08); }
.wo-alert { display: block; width: 100%; text-align: left; font: inherit; font-size: 13px; margin: -12px 0 18px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--warn-line); background: var(--warn-soft); color: var(--warn); cursor: pointer; }
.wo-alert b { font-weight: 600; }
.wo-table tr.wo-day td { background: var(--surface-1); font-size: 12px; font-weight: 600; color: var(--primary-ink); padding-top: 8px; padding-bottom: 8px; cursor: default; }
.wo-table tr.wo-day:hover td { background: var(--surface-1); }
.wo-client { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--ink, inherit); cursor: pointer; text-align: left; }
.wo-client:hover { text-decoration: underline; }
.wo-client .dot, .wo-pick-row .dot { flex: none; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--lc); }
.wo-table th { padding: 10px 14px; }
.wo-table td { padding: 10px 14px; font-size: 13.5px; }
.wo-table td .csub { font-size: 12px; }
.wo-client { font-size: 13.5px; }
.late-tag { background: var(--stop-soft) !important; color: var(--stop) !important; }
.wo-foot { padding: 12px 18px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.modal.wo-pick { width: min(520px, 94vw); }
.wo-pick-search { height: 40px; margin-bottom: 10px; }
.wo-pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow: auto; }
.wo-pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font: inherit; text-align: left; cursor: pointer; }
.wo-pick-row:hover, .wo-pick-row:focus-visible { border-color: var(--primary); background: var(--surface-1); }
.wo-pick-row b { display: block; font-weight: 600; font-size: 14px; }
.wo-pick-row small { color: var(--muted); font-size: 12px; }
.wo-pick-row[hidden] { display: none; }

/* ---------- Account flags shown app-wide ---------- */
.flag-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 3px 0 1px; }
.flag-chips + .csub { margin-top: 1px; }
.acct-flag.sm { font-size: 10.5px; padding: 1px 7px; line-height: 1.5; }
.acct-flag.warn { background: var(--warn-soft); color: var(--warn); }
.wo-client + .flag-chips, .cname + .flag-chips { display: flex; }
.wo-pick-row .flag-chips { margin: 2px 0; }
.dot-inline { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lc); margin-right: 7px; vertical-align: 1px; }

/* ---------- Settings: price book ---------- */
.pb-tabs { margin: 4px 0 16px; flex-wrap: wrap; }
.pb-saved { font-size: 13px; color: var(--good); font-weight: 500; }
.pb-unsaved { font-size: 13px; color: var(--warn); font-weight: 600; margin-right: 4px; }
.pb-review { padding: 18px 20px; margin-bottom: 16px; border-color: var(--accent); }
.pb-review h2 { margin: 0 0 8px; font-size: 16px; }
.pb-review ul { margin: 0; padding-left: 18px; font-size: 13px; max-height: 260px; overflow: auto; }
.pb-review li { margin: 3px 0; }
.pb-review li span { color: var(--muted); }
.pb-review s { color: var(--muted); }
.pb-review-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.pb-check-card { padding: 16px 18px; margin-bottom: 16px; background: var(--surface-1); }
.pb-check-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 10px; }
.pb-check-head b { font-size: 14px; color: var(--primary-ink); }
.pb-check-head span, .pb-svcs-head span, .pb-grid-card summary span { font-size: 12.5px; color: var(--muted); }
.pb-svcs { padding: 6px 0 12px; margin-bottom: 16px; }
.pb-svcs-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; padding: 12px 18px 8px; }
.pb-svcs-head h2 { margin: 0; font-size: 16px; }
.pb-svc { border-top: 1px solid var(--line); }
.pb-svc > summary { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr) auto; gap: 12px; align-items: center; padding: 11px 18px; cursor: pointer; list-style: none; }
.pb-svc > summary::-webkit-details-marker { display: none; }
.pb-svc > summary:hover { background: var(--surface-1); }
.pb-svc[open] > summary { background: var(--surface-1); }
.pb-name { font-weight: 600; font-size: 13.5px; }
.pb-meth { font-size: 12px; color: var(--muted); }
.pb-ex { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--primary-ink); text-align: right; font-size: 13.5px; }
.pb-tag { font-style: normal; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); margin-left: 6px; }
.pb-tag.edit { background: var(--warn-soft); color: var(--warn); }
.pb-svc-body { padding: 6px 18px 16px; background: var(--surface-1); border-top: 1px solid var(--line); }
.pb-sub { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
.pb-row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-start; }
.pb-box { display: flex; flex-direction: column; gap: 3px; width: 132px; }
.pb-box.wide { width: 280px; }
.pb-lbl { font-size: 12px; color: var(--ink-2); font-weight: 500; line-height: 1.25; min-height: 15px; }
.pb-in { display: flex; align-items: center; gap: 4px; height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); padding: 0 8px; }
.pb-in:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(18,59,103,.12); }
.pb-in i { font-style: normal; color: var(--muted); font-size: 12.5px; }
.pb-in input { border: 0; outline: 0; width: 100%; min-width: 0; height: 100%; background: none; font: inherit; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.pb-box select { height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; background: var(--card); font: inherit; font-size: 13px; }
.pb-sug { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.pb-box.changed .pb-in { border-color: var(--accent); background: var(--warn-soft); }
.pb-box.changed .pb-sug { color: var(--warn); }
.pb-undo { border: 0; background: none; color: var(--primary-ink); font: inherit; font-size: 11.5px; font-weight: 600; padding: 0; cursor: pointer; text-decoration: underline; }
.pb-check { display: flex; gap: 7px; align-items: center; font-size: 12.5px; padding-top: 22px; }
.pb-market { font-size: 12.5px; color: var(--ink-2); margin: 12px 0 0; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; }
.pb-market a { color: var(--primary-ink); font-weight: 600; }
.pb-help { font-size: 12.5px; color: var(--muted); margin: 8px 18px; }
.pb-svc-foot { margin-top: 12px; }
.danger-text { color: var(--stop) !important; }
.pb-add { display: flex; gap: 8px; padding: 12px 18px 4px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pb-add input { flex: 1; min-width: 220px; height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; font: inherit; font-size: 13px; }
.pb-add select { height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; max-width: 300px; }
.pb-grid-card { padding: 4px 18px 14px; margin-bottom: 16px; }
.pb-grid-card > summary { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 12px 0 6px; cursor: pointer; }
.pb-grid-card > summary b { font-size: 15px; color: var(--primary-ink); }
.pb-addon-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 18px 12px; }
.pb-addon { display: grid; grid-template-columns: minmax(0, 2.2fr) 90px 110px minmax(0, 1.4fr) 140px 32px; gap: 8px; align-items: center; }
.pb-addon > input, .pb-addon > select { height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; min-width: 0; }
.pb-svcs > .btn { margin: 0 18px 6px; }
.pb-sources li { margin: 4px 0; }
.pb-sources a { color: var(--primary-ink); }
.pb-reset-all { margin: 8px 0 24px; }
/* Suggested rate on work orders */
.sug-box { margin: 4px 0 8px; padding: 9px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line-strong); font-size: 12.5px; }
.sug-box.muted { background: var(--surface-1); border-color: var(--line); color: var(--muted); }
.sug-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sug-line > span:first-child { color: var(--ink-2); font-weight: 500; }
.sug-line b { color: var(--primary-ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.sug-sub { color: var(--muted); }
.sug-how { margin-top: 6px; }
.sug-how summary { cursor: pointer; color: var(--primary-ink); font-weight: 500; font-size: 12px; }
.sug-how ul { list-style: none; margin: 6px 0 0; padding: 0; }
.sug-how li { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; border-bottom: 1px dashed var(--line-strong); }
.sug-how li b { font-variant-numeric: tabular-nums; }
.sug-market { margin: 6px 0 0; color: var(--muted); font-size: 11.5px; }
.sug-item { display: flex; gap: 6px; align-items: center; }
.plan-agreed { display: flex; flex-direction: column; gap: 2px; }
.sug-under { font-size: 11px; color: var(--muted); padding-left: 2px; }

/* ---------- Settings navigation ---------- */
.set-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.set-nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.set-nav-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: none; padding: 10px; border-radius: 8px; font: inherit; color: var(--ink); cursor: pointer; }
.set-nav-item svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--muted); }
.set-nav-item b { display: block; font-size: 13.5px; font-weight: 600; }
.set-nav-item small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.35; margin-top: 1px; }
.set-nav-item:hover { background: var(--surface-1); }
.set-nav-item.active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.set-nav-item.active svg, .set-nav-item.active b { color: var(--primary-ink); }
.set-main { min-width: 0; }
.set-main .pb-tabs { margin-top: 0; }
.set-two { margin-top: 0; }
@media (max-width: 1100px) { .set-layout { grid-template-columns: 1fr; } .set-nav { position: static; flex-direction: row; flex-wrap: wrap; } .set-nav-item { width: auto; } }

/* ---------- Volume discounting and affiliates ---------- */
.field.locked .check { color: var(--muted); }
.lock-msg { display: block; font-size: 12px; color: var(--warn); margin-top: 4px; }
.vol-card { padding: 12px 14px; }
.vol-period { margin-bottom: 10px; }
.vol-row, .vol-pb { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 6px; }
.vol-arrow { padding-top: 26px; color: var(--muted); }
.vol-row .icon-btn, .vol-pb .icon-btn { margin-top: 22px; }
.vol-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }
.vol-custom { font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 2px 9px; border-radius: 99px; }
.vol-default { font-size: 12px; font-weight: 600; color: var(--good); background: var(--good-soft); padding: 2px 9px; border-radius: 99px; }
.vol-card .note { margin-top: 10px; }
.aff-list { display: flex; flex-direction: column; }
.aff-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.aff-row .csub { flex: 1 1 100%; order: 3; }
.aff-row .btn { margin-left: auto; }
.aff-name { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--primary-ink); cursor: pointer; }
.aff-name:hover { text-decoration: underline; }
.aff-total { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0 8px; padding: 9px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.aff-total b { color: var(--primary-ink); }
.aff-pct { font-weight: 600; color: var(--good); }
.aff-chip { font: inherit; font-size: 11.5px; font-weight: 600; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--primary-ink); cursor: pointer; }
.aff-pick { gap: 10px; }
.aff-pick .grow { flex: 1; min-width: 0; }
.aff-pick .grow b, .aff-pick .grow small { display: block; }
.vol-card .pb-in input, .modal .vol-card .pb-in input { border: 0; height: 100%; padding: 0; box-shadow: none; background: none; }
.aff-card > .aff-list, .aff-card > .muted-p, .aff-card > .aff-total, .aff-card > .btn { margin-left: 18px; margin-right: 18px; }
.aff-card > .btn { margin-bottom: 14px; }
.aff-card > .muted-p { margin-top: 6px; }
.vol-tabs { margin: 0 0 12px; display: inline-flex; }
.vol-cur { font-size: 10.5px; font-weight: 600; margin-left: 7px; padding: 1px 7px; border-radius: 99px; background: var(--good-soft); color: var(--good); }

/* ---------- Profile quick actions and account freeze ---------- */
.pact { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.pact .btn.sm { background: var(--card); }
.pact .n { font-size: 10.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); padding: 0 6px; border-radius: 99px; margin-left: 2px; font-variant-numeric: tabular-nums; }
.pact .n.warn { background: var(--warn-soft); color: var(--warn); }
.pact-gap { flex: 1; min-width: 12px; }
.pact .btn.freeze { color: var(--stop); border-color: var(--stop-line); }
.pact .btn.freeze:hover { background: var(--stop-soft); }
.pact .btn.unfreeze { background: var(--stop) !important; color: #fff; border-color: var(--stop); }
.form-head .grow { min-width: 0; flex: 1; }
.banner.frozen { background: var(--stop-soft); border-color: var(--stop-line); }
.banner.frozen svg { color: var(--stop); }
.banner.frozen b { color: var(--stop); }
.banner.arrange { background: var(--good-soft); border-color: var(--good-line); }
.banner.arrange svg { color: var(--good); }
.banner.override { background: var(--surface-2); border-color: var(--line-strong); }
.banner.override svg { color: var(--primary-ink); }
.acct-flag.frozen { background: var(--stop); color: #fff; }
.fz-modal { width: min(620px, 94vw); }
.fz-late { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--stop-line); border-radius: 8px; background: var(--stop-soft); }
.fz-late li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 8px 12px; font-size: 13px; border-top: 1px solid var(--stop-line); }
.fz-late li:first-child { border-top: 0; }
.fz-late em { font-style: normal; color: var(--stop); font-weight: 600; font-size: 12px; }
.fz-opt { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.fz-opt h3 { margin: 0 0 2px; font-size: 14.5px; color: var(--primary-ink); }
.fz-opt p { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.fz-opt .grid { margin-bottom: 10px; }
.fz-opt .field.wide { margin-bottom: 10px; }

/* ---------- Billing periods and invoices ---------- */
.head .csub { font-size: 12px; }
.inv-modal { width: min(860px, 95vw); }
.inv-lines { width: 100%; }
.inv-lines tr.off td { opacity: .45; }
.inv-lines td, .inv-lines th { padding: 8px 10px; }
.inv-totals { max-width: 420px; margin-left: auto; margin-top: 10px; }
.inv-view { width: min(860px, 95vw); }
.inv-paper { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 28px 32px; }
.inv-top { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.inv-co { font-size: 18px; font-weight: 700; color: var(--primary-ink); }
.inv-meta h1 { margin: 0 0 6px; font-size: 26px; color: var(--primary-ink); text-align: right; }
.inv-meta dl { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 0; font-size: 12.5px; }
.inv-meta dt { color: var(--muted); text-align: right; }
.inv-meta dd { margin: 0; font-weight: 500; }
.inv-bill { margin-bottom: 16px; font-size: 13px; }
.inv-note { font-size: 13px; margin: 14px 0 0; }
.inv-terms { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
@media print {
  body.printing-invoice { display: block !important; background: #fff !important; height: auto; overflow: visible; }
  body.printing-invoice > *:not(.modal-backdrop) { display: none !important; }
  body.printing-invoice .modal-backdrop { position: static !important; background: none !important; display: block !important; padding: 0 !important; }
  body.printing-invoice .modal { box-shadow: none !important; max-height: none !important; width: auto !important; border: 0 !important; }
  body.printing-invoice .modal-body { overflow: visible !important; padding: 0 !important; }
  body.printing-invoice .no-print { display: none !important; }
  body.printing-invoice .inv-paper { border: 0; padding: 0; }
}
.inv-pull { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.vol-rules { display: flex; flex-direction: column; padding: 0 18px 8px; }
.vol-rule { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.vol-rule:first-child { border-top: 0; }
.vol-rule > input { margin-top: 3px; }
.vol-rule b { display: block; font-size: 13.5px; font-weight: 600; }
.vol-rule small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.vol-pay { display: flex; gap: 16px; }
.vol-fu { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 6px; }
.pb-link-card { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px; }
.pb-link-card b { color: var(--primary-ink); }
.pb-link-card span { font-size: 12.5px; color: var(--muted); flex: 1; }
.pb-grid-card > summary .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--lc); }

/* ---------- Schedule board ---------- */
.sched-page { max-width: none; }
.sched-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 10px 14px; margin-bottom: 12px; }
.sched-nav { display: flex; gap: 6px; align-items: center; }
.sched-nav h2 { margin: 0 8px; font-size: 17px; min-width: 210px; }
.sched-nav input[type=date] { height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; }
.icon-btn.flip svg { transform: scaleX(-1); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.active { background: var(--primary); color: #fff; }
.sched-bar select { height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; }
.sched-lines { margin-left: auto; }
.sched-alert { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: var(--stop-soft); color: var(--stop); font-size: 13px; font-weight: 500; border: 1px solid var(--stop-line); }
.sched-wrap { padding: 0; overflow: auto; max-height: calc(100vh - 300px); min-height: 420px; }
.sched-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin: 10px 2px 24px; }
.sched-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; background: var(--lc); }
.sched-legend .lg-closed { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 3px, var(--surface-2) 3px, var(--surface-2) 6px); }
.sched-legend .lg-block { background: repeating-linear-gradient(45deg, var(--stop-soft), var(--stop-soft) 3px, var(--stop-soft) 3px, var(--stop-soft) 6px); }
.sched-legend .lg-done { background: var(--card); border: 1px dashed var(--muted); }
/* time grid */
.sg { --tw: 64px; min-width: calc(var(--tw) + var(--cols) * 120px); }
.sg-head, .sg-allday, .sg-body { display: grid; grid-template-columns: var(--tw) repeat(var(--cols), minmax(120px, 1fr)); }
.sg-head { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); }
.sg-h { padding: 8px 8px 6px; text-align: center; border-left: 1px solid var(--line); font-size: 13px; }
.sg-h b { font-weight: 600; }
.sg-h.today { background: var(--warn-soft); }
.sg-day { border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); padding: 0; }
.sg-day:hover { color: var(--primary-ink); text-decoration: underline; }
.hol { display: block; font-size: 10.5px; font-weight: 600; color: var(--stop); }
.sg-allday { border-bottom: 2px solid var(--line); background: var(--surface-1); position: sticky; top: 49px; z-index: 4; }
.sg-t { font-size: 10.5px; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-6px); }
.sg-t.ad { transform: none; padding-top: 8px; font-weight: 600; }
.sg-ad { border-left: 1px solid var(--line); min-height: 34px; padding: 3px; display: flex; flex-direction: column; gap: 3px; }
.sg-times { border-right: 1px solid var(--line); }
.sg-col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(to bottom, var(--surface-2) 1px, transparent 1px); background-size: 100% calc(var(--rh, 22px) * 2); cursor: copy; }
.sg[data-rh="14"] .sg-col { background-size: 100% 56px; }
.sg[data-rh="22"] .sg-col { background-size: 100% 44px; }
.sg[data-rh="40"] .sg-col { background-size: 100% 40px; }
.sg-col.today { background-color: var(--warn-soft); }
.sg-col.drop-ok, .sg-ad.drop-ok, .sm-cell.drop-ok { outline: 2px dashed var(--accent); outline-offset: -2px; }
.sh { position: absolute; left: 0; right: 0; pointer-events: none; }
.sh.closed { background: repeating-linear-gradient(45deg, rgba(225,230,238,.55), rgba(225,230,238,.55) 4px, rgba(210,217,228,.55) 4px, rgba(210,217,228,.55) 8px); }
.sh.block { background: repeating-linear-gradient(45deg, rgba(253,236,234,.85), rgba(253,236,234,.85) 4px, rgba(247,211,206,.85) 4px, rgba(247,211,206,.85) 8px); border-top: 2px solid var(--stop-line); }
.sh.block.tech { opacity: .7; }
.sh span { position: absolute; top: 3px; left: 6px; font-size: 10.5px; font-weight: 600; color: var(--stop); }
.sh.closed span { color: var(--muted); }
.now { position: absolute; left: 0; right: 0; height: 2px; background: var(--stop); z-index: 3; pointer-events: none; }
.now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--stop); }
.drop-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--accent); z-index: 6; pointer-events: none; font-size: 10.5px; font-weight: 700; color: var(--warn); padding-left: 4px; line-height: 1.4; }
/* events */
.ev { position: absolute; z-index: 2; border-radius: 6px; background: var(--lc-soft); border-left: 4px solid var(--lc); padding: 3px 6px 3px 6px; font-size: 11.5px; line-height: 1.25; overflow: hidden; cursor: grab; box-shadow: 0 1px 2px rgba(16,42,87,.12); color: var(--ink); }
.ev:hover { box-shadow: 0 3px 10px rgba(16,42,87,.18); z-index: 3; }
.ev b { display: block; font-size: 11px; font-weight: 700; color: var(--lc); }
.ev .ev-c { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev small { display: block; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; }
.ev .ev-tech { position: absolute; right: 4px; top: 3px; font-style: normal; font-size: 9.5px; font-weight: 700; background: var(--card); color: var(--lc); border-radius: 99px; padding: 0 5px; }
.ev .ev-tech.none { color: var(--stop); }
.ev.compact { position: relative; padding: 2px 6px; display: flex; gap: 6px; align-items: baseline; }
.ev.compact b, .ev.compact .ev-c { display: inline; }
.ev.compact .ev-tech { position: static; margin-left: auto; }
.ev.st-Completed, .ev.st-Invoiced, .ev.st-Paid { background: var(--card); border-style: dashed; border-width: 1px 1px 1px 4px; border-color: var(--lc); opacity: .8; }
.ev.conflict { outline: 2px solid var(--stop); outline-offset: -1px; }
.ev.dragging { opacity: .35; }
.ev-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.ev-resize::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 18px; margin-left: -9px; height: 2px; border-radius: 2px; background: var(--lc); opacity: .5; }
/* month */
.sm-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 2; }
.sm-head div { padding: 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.sm-grid { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); grid-auto-rows: minmax(112px, auto); }
.sm-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sm-cell.other { background: var(--surface-1); }
.sm-cell.other .sm-num { color: var(--muted); }
.sm-cell.closed { background-image: repeating-linear-gradient(45deg, rgba(238,241,246,.7), rgba(238,241,246,.7) 4px, transparent 4px, transparent 8px); }
.sm-cell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.sm-top { display: flex; align-items: center; gap: 6px; }
.sm-num { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 0 4px; border-radius: 4px; color: var(--ink); }
.sm-num:hover { background: var(--surface-2); }
.sm-top .hol { display: inline; }
.sm-top .blk { font-size: 10.5px; font-weight: 600; color: var(--stop); background: var(--stop-soft); border-radius: 99px; padding: 0 6px; }
.sm-more { border: 0; background: none; font: inherit; font-size: 11px; font-weight: 600; color: var(--primary-ink); text-align: left; cursor: pointer; padding: 0 4px; }
.sched-warn { display: block; margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--stop); }
.toast.has-action { pointer-events: auto; display: flex; gap: 14px; align-items: center; }
.toast-btn { border: 1px solid rgba(255,255,255,.4); background: none; color: #fff; font: inherit; font-weight: 600; font-size: 12.5px; padding: 3px 10px; border-radius: 6px; cursor: pointer; }
.toast-btn:hover { background: rgba(255,255,255,.12); }
/* Scheduling settings */
.sc-team { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 18px 4px; }
.sc-chip { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 12px; border-radius: 99px; background: var(--surface-2); font-weight: 600; font-size: 13px; color: var(--primary-ink); }
.sc-chip .icon-btn { width: 24px; height: 24px; }
.sc-add { display: inline-flex; gap: 6px; }
.sc-add input, .sc-addrow input, .sc-in { height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; background: var(--card); }
.sc-hours { padding: 0 18px 10px; }
.sc-hrow { display: grid; grid-template-columns: 110px 80px 120px 24px 120px 1fr; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.sc-hrow:first-child { border-top: 0; }
.sc-hrow input[type=time] { height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; }
.sc-hrow.off b { color: var(--muted); }
.sc-hrow span { color: var(--muted); font-size: 12px; text-align: center; }
.sc-list { padding: 0 18px; }
.sc-item { display: grid; grid-template-columns: minmax(140px, auto) 110px 1fr 32px; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.sc-addrow { display: flex; gap: 8px; padding: 10px 18px 4px; flex-wrap: wrap; }
.sc-addrow input[type=text] { flex: 1; min-width: 220px; }
.sc-blockform { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-start; padding: 12px 18px 6px; margin-top: 6px; border-top: 1px solid var(--line); background: var(--surface-1); }
.sc-blockform .pb-box.wide { width: 280px; }
.sc-blockform .bk-days { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: flex-start; flex-basis: 100%; }
.sc-blockform #bkAdd { margin-top: 20px; }
.ev.compact b { white-space: nowrap; flex: none; }
.ev.compact .ev-c { flex: 1; min-width: 0; }
.sh.block.slim { left: auto; right: 0; width: 6px; border-top: 0; background: var(--stop-line); opacity: .9; }
.ad-block { font-size: 10.5px; font-weight: 600; color: var(--stop); background: var(--stop-soft); border-radius: 4px; padding: 1px 6px; }

/* ---------- Job board ---------- */
.jb-page { max-width: none; }
.jb-lanes { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; align-items: start; margin-bottom: 24px; }
.jb-lane { background: var(--surface-2); border-radius: 12px; padding: 10px; min-height: 200px; border: 2px solid transparent; }
.jb-lane.drop-ok { border-color: var(--accent); border-style: dashed; }
.jb-lane header { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 2px 4px 10px; }
.jb-lane header h2 { margin: 0; font-size: 15px; }
.jb-lane header .n { font-size: 11px; font-weight: 700; background: var(--card); border-radius: 99px; padding: 1px 8px; color: var(--primary-ink); }
.jb-lane header small { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }
.jb-cards { display: flex; flex-direction: column; gap: 8px; }
.jb-empty { font-size: 12.5px; color: var(--muted); margin: 6px 4px; }
.jcard { background: var(--card); border-radius: 10px; border-left: 4px solid var(--lc); box-shadow: 0 1px 2px rgba(16,42,87,.1); padding: 9px 11px; cursor: grab; font-size: 13px; }
.jcard:hover { box-shadow: 0 4px 12px rgba(16,42,87,.14); }
.jcard.dragging { opacity: .4; }
.jc-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.jc-top b { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.jc-client { font-weight: 600; margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.jc-svc { font-size: 12.5px; color: var(--ink-2); }
.jc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; }
.jc-tech { display: inline-flex; gap: 2px; }
.jc-tech i { font-style: normal; font-size: 10px; font-weight: 700; background: var(--lc-soft); color: var(--lc); border-radius: 99px; padding: 1px 6px; }
.jc-tech i.none { background: var(--stop-soft); color: var(--stop); }
.jc-need { margin-top: 6px; font-size: 11.5px; font-weight: 600; color: var(--warn); }
.jc-act { display: flex; gap: 4px; margin-top: 8px; }
.jc-act .btn.mini { margin-left: 0; }
.due { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.due.soon { background: var(--warn-soft); color: var(--warn); }
.due.today { background: var(--accent); color: #fff; }
.due.late { background: var(--stop); color: #fff; }
.due.none { background: none; color: var(--muted); font-weight: 500; }
/* Job board tray on the schedule */
.sched-main.with-tray { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 12px; align-items: start; }
.sched-tray { padding: 10px; max-height: calc(100vh - 300px); display: flex; flex-direction: column; background: var(--surface-2); }
.sched-tray header { display: flex; flex-direction: column; padding: 2px 4px 8px; }
.sched-tray header b { font-size: 14.5px; color: var(--primary-ink); }
.tray-list { overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px; }
.tray-tile.focus .jcard { box-shadow: 0 0 0 3px var(--accent); }
.tray-help { font-size: 11.5px; color: var(--muted); margin: 8px 4px 0; }
.tray-n { font-size: 10.5px; font-weight: 700; background: var(--accent); color: #fff; border-radius: 99px; padding: 0 6px; margin-left: 4px; }
@media (max-width: 1100px) { .jb-lanes { grid-template-columns: 1fr; } .sched-main.with-tray { grid-template-columns: 1fr; } }

/* ---------- Cleaning scopes ---------- */
.scope-backdrop { z-index: 60; }
.scope-modal { width: min(820px, 95vw); }
.scope-modal .seg { margin-bottom: 12px; }
.scope-paper { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 22px 26px; }
.scope-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 2px solid var(--primary); padding-bottom: 10px; margin-bottom: 12px; }
.scope-head h3 { margin: 4px 0 2px; font-size: 20px; color: var(--primary-ink); }
.scope-sum { text-align: right; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.scope-sum b { color: var(--ink); }
.scope-sec { break-inside: avoid; margin-bottom: 12px; }
.scope-sec h4 { margin: 0 0 4px; font-size: 13.5px; color: var(--primary-ink); text-transform: uppercase; letter-spacing: .04em; }
.scope-sec ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; }
.scope-sec li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 3px 0; break-inside: avoid; }
.scope-sec .sq { flex: none; width: 13px; height: 13px; border: 1.5px solid #8A96A8; border-radius: 3px; margin-top: 3px; }
.lvtag { font-style: normal; font-size: 10px; font-weight: 700; padding: 0 6px; border-radius: 99px; margin-left: 4px; flex: none; }
.lvtag.lv2 { background: var(--surface-2); color: var(--primary-ink); }
.lvtag.lv3 { background: var(--warn-soft); color: var(--warn); }
.scope-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.ck-progress .btn.sm { margin-left: auto; }
.ck-progress { flex-wrap: wrap; gap: 8px; }
@media print {
  body.printing-scope { display: block !important; background: #fff !important; height: auto; overflow: visible; }
  body.printing-scope > *:not(.scope-backdrop) { display: none !important; }
  body.printing-scope .scope-backdrop { position: static !important; background: none !important; display: block !important; padding: 0 !important; }
  body.printing-scope .modal { box-shadow: none !important; max-height: none !important; width: auto !important; border: 0 !important; }
  body.printing-scope .modal-body { overflow: visible !important; padding: 0 !important; }
  body.printing-scope .no-print { display: none !important; }
  body.printing-scope .scope-paper { border: 0; padding: 0; }
}

/* ---------- Walk-through inspection ---------- */
.insp-page { max-width: 1180px; }
.insp-sum { position: sticky; top: 0; z-index: 8; padding: 12px 14px; margin-bottom: 12px; box-shadow: 0 6px 18px rgba(16,42,87,.10); }
.is-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.is-cell { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface-1); min-width: 0; }
.is-cell span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.is-cell b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.is-cell small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-cell.rep b { color: var(--primary-ink); }
.is-cell.tot { background: var(--surface-2); border-color: var(--line-strong); }
.is-cell.warn { background: var(--warn-soft); border-color: var(--accent); }
.is-cell.warn b { color: var(--warn); }
.is-alert { display: flex; gap: 12px; align-items: center; margin-top: 8px; padding: 9px 12px; border-radius: 10px; font-size: 13px; }
.is-alert > div { flex: 1; }
.is-alert b { display: block; }
.is-alert span { color: var(--ink-2); font-size: 12.5px; }
.is-alert.deep { background: var(--warn-soft); border: 1px solid var(--accent); }
.is-alert.up { background: var(--surface-2); border: 1px solid var(--line-strong); }
.is-alert.ok { background: var(--good-soft); border: 1px solid var(--good-line); }
.insp-strip { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 13px; margin: 0 2px 12px; }
.insp-strip .iss, .iroom .iss { color: var(--stop); font-weight: 600; }
.ins-status { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.ins-status.st-in-progress, .jc-insp.st-in-progress { background: var(--warn-soft); color: var(--warn); }
.ins-status.st-done, .jc-insp.st-done { background: var(--good-soft); color: var(--good); }
.jc-insp { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.jc-insp.st-not-started { background: var(--stop-soft); color: var(--stop); }
.insp-rooms { display: flex; flex-direction: column; gap: 10px; margin-bottom: 30px; }
.iroom { padding: 0; overflow: hidden; }
.iroom > summary { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; cursor: pointer; list-style: none; }
.iroom > summary::-webkit-details-marker { display: none; }
.iroom > summary b { font-size: 15px; color: var(--primary-ink); }
.iroom[open] > summary { border-bottom: 1px solid var(--line); background: var(--surface-1); }
.iroom.has-issue > summary { box-shadow: inset 4px 0 0 var(--stop); }
.lvchip { font-size: 11px; font-weight: 600; padding: 1px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.lvchip.lv-touch, .sm-seg button.lv-touch { background: var(--good-soft) !important; color: var(--good) !important; }
.lvchip.lv-standard, .sm-seg button.lv-standard { background: var(--info-soft) !important; color: var(--primary-ink) !important; }
.lvchip.lv-deep, .sm-seg button.lv-deep { background: var(--warn-soft) !important; color: var(--warn) !important; }
.iroom-body { padding: 6px 16px 14px; }
.isub { padding: 10px 0; border-top: 1px solid var(--line); }
.isub:first-child { border-top: 0; }
.isub-t { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.sm-seg button { padding: 5px 14px; }
.sm-seg button.active { font-weight: 600; }
.iphotos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.iphoto { position: relative; aspect-ratio: 4 / 3; border: 2px dashed var(--line-strong); border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; background: var(--surface-1); overflow: hidden; color: var(--muted); font-size: 13px; font-weight: 600; }
.iphoto:hover { border-color: var(--primary); color: var(--primary-ink); }
.iphoto.has { border-style: solid; border-color: var(--line); }
.iphoto img { width: 100%; height: 100%; object-fit: cover; }
.iph-x { position: absolute; top: 4px; right: 4px; background: rgba(255,255,255,.9); border: 0; border-radius: 99px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 11px; font-weight: 700; }
.iph-x svg { width: 14px; height: 14px; }
.iph-x.armed { background: var(--stop); color: #fff; }
.ichk { display: flex; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
.ichk > span:first-child { flex: 1; }
.ichk.issue > span:first-child { color: var(--stop); font-weight: 600; }
.ichk.ok > span:first-child { color: var(--good); }
.ichk.na > span:first-child { color: var(--muted); text-decoration: line-through; }
.ichk-btns { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; }
.ichk-btns button { border: 0; background: var(--card); font: inherit; font-size: 12px; padding: 3px 10px; cursor: pointer; }
.ichk-btns button + button { border-left: 1px solid var(--line-strong); }
.ichk-btns button.on { color: #fff; }
.ichk.ok .ichk-btns button.on { background: var(--good); }
.ichk.issue .ichk-btns button.on { background: var(--stop); }
.ichk.na .ichk-btns button.on { background: #8A96A8; }
.irec { display: grid; grid-template-columns: 110px minmax(0, 1fr) 120px 110px 80px auto 32px; gap: 8px; align-items: center; margin-top: 6px; font-size: 13px; }
.irec > input { height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; min-width: 0; }
.irec .pb-in { height: 32px; }
.irec-type { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; text-align: center; }
.irec-type.repair { background: var(--info-soft); color: var(--primary-ink); }
.irec-type.clean { background: var(--good-soft); color: var(--good); }
.irec-amt { text-align: right; font-variant-numeric: tabular-nums; }
.irec.covered, .irec.applied { opacity: .55; }
.iroom textarea { width: 100%; min-height: 64px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; }
.insp-lead .btn { margin-top: 8px; }
@media (max-width: 1100px) { .is-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .irec { grid-template-columns: 1fr 1fr; } .iphotos { grid-template-columns: repeat(2, 1fr); } }
.is-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 0 18px 8px; }
.is-list h3 { margin: 0 0 6px; font-size: 14px; color: var(--primary-ink); }
.is-list .pb-check { display: flex; font-size: 13px; }
.is-custom { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; }
.is-custom span { flex: 1; }
.warn-t { color: var(--warn) !important; font-weight: 600; }
.is-kinds .tab { font-size: 12.5px; }
@media (max-width: 1100px) { .is-cols { grid-template-columns: 1fr; } }

/* ---------- Walk-through (WalkWise flow) ---------- */
.ww-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 12px; }
.ww-step { font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.ww-step.done { background: var(--good-soft); color: var(--good); }
.ww-step.cur { background: var(--primary); color: #fff; }
.ww-facts { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 14px 18px; margin-bottom: 12px; }
.ww-facts dl { display: grid; grid-template-columns: repeat(3, auto minmax(0, 1fr)); gap: 8px 14px; margin: 0; font-size: 13px; align-items: baseline; }
.ww-facts dt { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ww-facts dd { margin: 0; font-weight: 500; min-width: 0; }
.ww-facts dd input { height: 30px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 0 8px; font: inherit; font-size: 13px; width: 100%; }
.ww-visit { border-left: 1px solid var(--line); padding-left: 16px; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.ww-visit b { display: block; }
.ww-visit select { height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; font: inherit; }
.is-cell span { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.is-tag { font-style: normal; font-size: 9.5px; font-weight: 800; letter-spacing: .05em; padding: 1px 6px; border-radius: 99px; text-transform: uppercase; }
.is-tag.rec { background: var(--accent); color: #fff; }
.is-tag.cap { background: var(--good-soft); color: var(--good); }
.is-tag.over { background: var(--warn-soft); color: var(--warn); }
.is-tag.save { background: var(--good); color: #fff; }
.is-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 8px; font-size: 12.5px; }
.key { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; }
.key.k-ok { background: var(--good-soft); color: var(--good); }
.key.k-att { background: var(--stop-soft); color: var(--stop); }
.key.k-na { background: var(--surface-2); color: var(--ink-2); }
.key.k-nt { background: var(--warn-soft); color: var(--warn); }
.ww-prog { width: 90px; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ww-prog span { display: block; height: 100%; background: var(--good); }
.iroom.need-ph.show-missing, .iroom.show-missing.need-ph { border: 2px solid var(--stop); }
.iphoto.req { border-color: var(--stop-line); }
.iroom.show-missing .iphoto.req { border-color: var(--stop); background: var(--stop-soft); }
.ichk.nt > span:first-child { color: var(--warn); }
.ichk.nt .ichk-btns button.on { background: var(--warn); }
.ww-clean.issue > span:first-child { color: var(--warn); font-weight: 600; }
.ww-clean.issue .ichk-btns button.on { background: var(--warn); }
.ww-detail { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 0 10px 14px; border-left: 3px solid var(--line); margin: 2px 0 6px; }
.ww-detail > input, .ww-detail > select { height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; min-width: 160px; flex: 1; }
.ww-detail > select { flex: 0 0 120px; min-width: 0; }
.ww-detail .pb-in { width: 110px; height: 32px; }
.ww-detail.att { border-left-color: var(--stop); }
.ww-thumbs { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ww-th { position: relative; width: 54px; height: 40px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.ww-th img { width: 100%; height: 100%; object-fit: cover; }
.ww-th .iph-x { width: 18px; height: 18px; top: 1px; right: 1px; }
.ww-addph { cursor: pointer; margin-left: 0 !important; }
.cat-tag { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .03em; }
.cat-tag.safety { background: var(--stop); color: #fff; }
.cat-tag.repair { background: var(--warn-soft); color: var(--warn); }
.cat-tag.upgrade { background: var(--info-soft); color: var(--primary-ink); }
.cat-tag.clean { background: var(--good-soft); color: var(--good); }
.ww-sec-foot { display: flex; gap: 10px; align-items: flex-start; }
.ww-sec-foot textarea { flex: 1; min-height: 44px; }
.ww-locked { position: relative; }
.ww-locked .iroom { opacity: .6; pointer-events: none; }
.ww-lock-msg { padding: 12px 16px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line-strong); color: var(--primary-ink); font-weight: 600; font-size: 13.5px; }
.ww-find { padding: 14px 18px; margin-bottom: 12px; border-color: var(--accent); }
.ww-find-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.ww-find-head h2 { margin: 0; font-size: 16px; }
.ww-dec-top { display: flex; gap: 12px; align-items: flex-end; margin: 12px 0 6px; }
.ww-dec { display: flex; flex-direction: column; }
.ww-dec-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 110px auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.ww-dec-row.approve { background: linear-gradient(90deg, rgba(31,122,77,.06), transparent); }
.ww-dec-row.decline > div { opacity: .6; }
.ww-dec-row .cat-tag { text-align: center; }
.ww-dec-row .ichk-btns button.on.ap { background: var(--good); }
.ww-dec-row .ichk-btns button.on.dc { background: #8A96A8; }
.ww-dec-row .ichk-btns button:disabled { opacity: .45; cursor: not-allowed; }
.ww-q { height: 32px; }
.rp-ph { display: flex; gap: 6px; margin-top: 6px; }
.rp-ph img { width: 90px; height: 68px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.ins-status.st-new { background: var(--stop-soft); color: var(--stop); }
.ins-status.st-inspecting, .jc-insp.st-inspecting { background: var(--warn-soft); color: var(--warn); }
.ins-status.st-ready, .jc-insp.st-ready { background: var(--info-soft); color: var(--primary-ink); }
.ins-status.st-sent, .jc-insp.st-sent { background: var(--accent-soft); color: var(--warn); }
.ins-status.st-approved, .jc-insp.st-approved { background: var(--good-soft); color: var(--good); }
.jc-insp.st-new { background: var(--stop-soft); color: var(--stop); }
.lib-list { padding: 0 18px 10px; }
.lib-row { display: grid; grid-template-columns: 24px minmax(0, 1.6fr) 130px minmax(0, 1.6fr) 130px 70px; gap: 10px; align-items: start; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.lib-row.head { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-top: 0; }
.lib-row.off > span { opacity: .45; }
.lib-row .sc-in { width: 100%; height: 32px; }
.lib-row > span:nth-child(2) { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; }
.lib-row .pb-in { height: 32px; }
@media (max-width: 1440px) { .ww-facts dl { grid-template-columns: repeat(2, auto minmax(0, 1fr)); } }
@media (max-width: 1100px) { .ww-facts { grid-template-columns: 1fr; } .ww-facts dl { grid-template-columns: auto minmax(0, 1fr); } .ww-visit { border-left: 0; padding-left: 0; } .ww-dec-row, .lib-row { grid-template-columns: 1fr 1fr; } }

/* ---------- Photo capture: Take photo or Upload ---------- */
.ph-btns { display: inline-flex; gap: 6px; }
.ph-btns .btn svg, .iph-acts svg { width: 15px; height: 15px; flex: none; }
.ph-btns .btn { display: inline-flex; align-items: center; gap: 5px; }
.iphoto { flex-direction: column; gap: 8px; cursor: default; }
.iphoto:hover { color: var(--muted); }
.iph-l { font-size: 12.5px; }
.iph-acts { display: flex; gap: 6px; }
.iph-acts button { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--primary-ink); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.iph-acts button:hover { border-color: var(--primary); background: var(--surface-1); }
@media (max-width: 1100px), (pointer: coarse) { .iph-acts span { display: none; } .iph-acts button { height: 40px; width: 44px; justify-content: center; padding: 0; } .iph-acts svg { width: 20px; height: 20px; } .ph-btns .btn { min-height: 36px; } }
.cam-backdrop { z-index: 1200; }
.cam-modal { width: min(820px, 96vw); }
.cam-stage { position: relative; margin: 0 20px; background: #0B1626; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; max-height: 62vh; display: flex; align-items: center; justify-content: center; }
.cam-stage video { width: 100%; height: 100%; object-fit: contain; }
.cam-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; color: #E6ECF5; font-size: 14px; line-height: 1.5; }
.cam-msg[hidden] { display: none; }
.cam-flash { position: absolute; inset: 0; background: var(--card); opacity: 0; pointer-events: none; }
.cam-flash.go { animation: camFlash .25s ease-out; }
@keyframes camFlash { from { opacity: .8; } to { opacity: 0; } }
.cam-shots { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 20px 0; min-height: 10px; }
.cam-shots .ww-th img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }
.cam-foot { display: flex; align-items: center; gap: 8px; }
.cam-foot .spacer { flex: 1; }
.cam-shutter { width: 58px; height: 58px; border-radius: 50%; border: 4px solid var(--primary); background: var(--accent, #F29A00); box-shadow: inset 0 0 0 3px var(--card); cursor: pointer; flex: none; }
.cam-shutter:disabled { opacity: .4; cursor: default; }
.cam-shutter:not(:disabled):active { transform: scale(.94); }

/* ---------- Tablet and phone: icon rail nav, roomy touch targets on walk-throughs ---------- */
@media (max-width: 820px) {
  body { grid-template-columns: 64px 1fr; }
  .sidebar { padding: 14px 8px; }
  .brand { padding: 0 0 14px; justify-content: center; }
  .brand > div:last-child, .demo-tag, .backup-pill small, .backup-pill > :not(.dot) { display: none; }
  .brand-mark { width: 38px; height: 32px; }
  .nav-item { font-size: 0; justify-content: center; padding: 12px 0; }
  .nav-item svg { width: 22px; height: 22px; }
  .backup-pill { justify-content: center; }
  main { padding: 18px 14px 40px; }
  .page-head { flex-wrap: wrap; align-items: flex-start; }
}
@media (max-width: 640px) {
  .ichk { padding: 8px 0; align-items: center; }
  .ichk > span:first-child { flex: 1 1 0; min-width: 0; }
  .ichk-btns { flex: 0 0 58%; display: grid; grid-template-columns: 1fr 1fr; }
  .iphotos { grid-template-columns: repeat(2, 1fr); }
  .is-row { grid-template-columns: 1fr 1fr; }
  .irec, .ww-dec-row, .lib-row { grid-template-columns: 1fr; }
  .cam-stage { margin: 0 12px; }
}
@media (max-width: 820px) {
  .page-head > * { min-width: 0; max-width: 100%; }
  .page-head h1 { overflow-wrap: anywhere; }
  .head-actions { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .insp-sum { position: static; box-shadow: none; }
  .head-actions .btn { white-space: normal; }
}
.test-tag { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); border: 1px dashed var(--warn-line); }

/* ---------- Appearance: night mode details ---------- */
html.night body { background: var(--bg); }
html.night .btn:hover { border-color: var(--primary-ink); }
html.night input, html.night select, html.night textarea { background-color: var(--card); color: var(--ink); border-color: var(--line-strong); }
html.night .modal-backdrop { background: rgba(0, 0, 0, .6); }
html.night img[data-photo] { filter: brightness(.92); }
html.night .note { color: var(--ink); }
@media print { :root, html.night { --card: #fff; --bg: #fff; --ink: #142235; --ink-2: #33425A; --muted: #5E6B7D; --line: #E1E6EE; --line-strong: #CBD3DF; --surface-1: #F8FAFC; --surface-2: #EEF1F6; --primary-ink: #123B67; color-scheme: light; } html { zoom: 1 !important; } }

/* Sun / moon switch in the side nav */
.theme-toggle .ic-sun { display: none; }
.theme-toggle.is-night .ic-sun { display: block; }
.theme-toggle.is-night .ic-moon { display: none; }

/* Spacing: compact */
html.density-compact main { padding: 16px 24px 32px; }
html.density-compact .page-head { margin-bottom: 14px; }
html.density-compact .nav-item { padding-top: 7px; padding-bottom: 7px; }
html.density-compact .btn { padding: 6px 12px; }
html.density-compact td, html.density-compact th { padding-top: 6px; padding-bottom: 6px; }
html.density-compact .card { --pad: 12px; }
html.density-compact .ichk { padding: 2px 0; }
html.density-compact .field input, html.density-compact .field select { height: 34px; }

/* Corners */
html.corners-sharp { --radius: 3px; }
html.corners-sharp :is(.card, .btn, .modal, .seg, .ichk-btns, .iphoto, .note, input, select, textarea, .set-nav, .set-nav-item, .nav-item, .ap-scheme, .jcard, .ev, .is-cell, .pick-card, .backup-pill) { border-radius: 3px !important; }
html.corners-soft { --radius: 20px; }
html.corners-soft :is(.btn, input, select, textarea, .seg, .ichk-btns, .nav-item, .set-nav-item, .note, .jcard, .ev, .is-cell, .backup-pill) { border-radius: 14px !important; }
html.corners-soft :is(.modal, .iphoto, .ap-scheme, .pick-card) { border-radius: 22px !important; }

/* Reduce motion */
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* Side nav: icons only */
html.nav-icons body { grid-template-columns: 64px 1fr; }
html.nav-icons .sidebar { padding: 14px 8px; }
html.nav-icons .brand { padding: 0 0 14px; justify-content: center; }
html.nav-icons .brand > div:last-child, html.nav-icons .demo-tag, html.nav-icons .backup-pill small, html.nav-icons .backup-pill > :not(.dot) { display: none; }
html.nav-icons .brand-mark { width: 38px; height: 32px; }
html.nav-icons .nav-item { font-size: 0; justify-content: center; padding: 12px 0; }
html.nav-icons .nav-item svg { width: 22px; height: 22px; }
html.nav-icons .backup-pill { justify-content: center; }

/* Appearance page */
.ap-schemes { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 10px; }
.ap-scheme { text-align: left; background: var(--card); border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; font: inherit; color: var(--ink); }
.ap-scheme:hover { border-color: var(--primary-ink); }
.ap-scheme.on { border: 2px solid var(--primary-ink); padding: 11.5px 11.5px 9.5px; box-shadow: var(--shadow); }
.ap-scheme b { font-size: 13.5px; margin-top: 8px; }
.ap-scheme small { color: var(--muted); font-size: 12px; }
.ap-sw { display: flex; gap: 5px; }
.ap-sw i { width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(0,0,0,.08); }
.ap-custom { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface-1); }
.ap-custom label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.ap-custom input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); cursor: pointer; }
.ap-custom span { display: flex; flex-direction: column; font-size: 13px; }
.ap-custom small { color: var(--muted); font-size: 12px; }
.ap-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 16px; }
.ap-seg { background: var(--surface-2); border: 0; border-radius: 99px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.ap-seg button { border: 0 !important; border-radius: 99px; background: none; color: var(--ink-2); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; }
.ap-seg button svg { width: 15px; height: 15px; }
.ap-seg button.active { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.vol-rule .ap-seg { margin-top: 8px; display: inline-flex; }
.ap-times { display: inline-flex; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-2); }
.ap-times input { height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; font: inherit; margin-left: 4px; }
.ap-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.ap-foot { font-size: 12.5px; color: var(--muted); margin: 4px 2px 0; }
.ap-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; margin: 16px 0; }
.ap-grid > .card { margin: 0; }
@media (max-width: 1100px) { .ap-grid { grid-template-columns: 1fr; } }
.ap-text { display: flex; align-items: center; gap: 12px; }
.ap-text input[type=range] { flex: 1; accent-color: var(--accent); }
.ap-text b { min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.ap-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip-btn { border: 1px solid var(--line-strong); background: var(--card); color: var(--ink-2); border-radius: 99px; padding: 5px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.chip-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.ap-preview { display: grid; grid-template-columns: 54px 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-height: 196px; }
.ap-pv-side { background: var(--side-bg); display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 12px 0; }
.ap-pv-logo { width: 26px; height: 18px; border-top: 4px solid var(--accent); border-radius: 3px 3px 0 0; margin-bottom: 6px; }
.ap-pv-side i { width: 28px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.28); }
.ap-pv-side i.on { background: rgba(255,255,255,.75); box-shadow: -10px 0 0 -6px var(--accent); }
.ap-pv-main { background: var(--bg); padding: 12px 14px; }
.ap-pv-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.ap-pv-h { font-size: 20px; font-weight: 700; color: var(--primary-ink); margin: 0 0 8px; }
.ap-pv-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.ap-pv-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.ap-pv-row .due { margin-left: auto; }
.ap-pv-sub { font-size: 12px; color: var(--muted); }
.chip-ok, .chip-att, .chip-na { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.chip-ok { background: var(--good-soft); color: var(--good); }
.chip-att { background: var(--stop-soft); color: var(--stop); }
.chip-na { background: var(--surface-2); color: var(--muted); }
/* Night: business-line colors brightened so they read on dark */
html.night .lc-rental { --lc: #6FA3E6; --lc-soft: rgba(111, 163, 230, .16); }
html.night .lc-str { --lc: #FF6F86; --lc-soft: rgba(255, 111, 134, .16); }
html.night .lc-commercial { --lc: #B595F2; --lc-soft: rgba(181, 149, 242, .17); }
html.night .lc-residential { --lc: #5BCB8C; --lc-soft: rgba(91, 203, 140, .15); }
html.night .ev { box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.ap-body { padding: 0 18px 18px; }
.ap-custom-note { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.lib-ans { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.lib-ans i { font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.lib-ans i.a0 { background: var(--good-soft); color: var(--good); }
.lib-ans i.a1 { background: var(--stop-soft); color: var(--stop); }
.isub-t small { display: block; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); font-size: 12px; margin-top: 2px; }
.ichk-btns button { white-space: nowrap; }
@media (max-width: 640px) { .ichk-btns button { white-space: normal; line-height: 1.2; } }

/* Questions on the left, answers on the right */
.ichk { flex-wrap: nowrap; }
.ichk > span:first-child { min-width: 0; }
.ichk-btns { flex: none; }
@media (max-width: 1100px) { .ichk-btns button { padding: 4px 8px; } }

/* ---------- Photo tiles (numbered) ---------- */
.ph-strip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ph-tile { position: relative; width: 62px; height: 46px; border-radius: 9px; border: 1px solid rgba(255,255,255,.18); background: linear-gradient(135deg, #2F5480, #6E8FB4); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0; cursor: pointer; overflow: hidden; box-shadow: 0 1px 3px rgba(16,42,87,.18); font: inherit; }
.ph-tile svg { width: 15px; height: 15px; opacity: .9; }
.ph-tile b { font-size: 12px; font-weight: 700; line-height: 1; }
.ph-tile.has img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph-tile.has b { position: absolute; left: 4px; bottom: 3px; background: rgba(11,22,38,.72); border-radius: 99px; min-width: 17px; height: 17px; display: grid; place-items: center; font-size: 10.5px; padding: 0 4px; }
.ph-tile:not(.has) { background: linear-gradient(135deg, var(--surface-2), var(--line)); color: var(--muted); border: 1.5px dashed var(--line-strong); box-shadow: none; }
.ph-tile.req:not(.has) { border-color: var(--stop-line); color: var(--stop); }
.ph-tile.add b { font-size: 15px; }
.ph-tile:hover { box-shadow: 0 0 0 2px var(--accent-soft, #FFF3E0), 0 3px 8px rgba(16,42,87,.22); }
.ph-tile.cur { outline: 2px solid var(--accent); outline-offset: 2px; }
.isub > .ph-strip { margin-top: 4px; }
.ph-strip .ph-btns { margin-left: 4px; }

/* ---------- Photo viewer ---------- */
.pv-backdrop { position: fixed; inset: 0; z-index: 1100; background: rgba(6, 12, 22, .72); display: flex; align-items: center; justify-content: center; padding: 18px; }
.pv { width: min(1000px, 100%); max-height: 100%; background: #0E1B2E; color: #fff; border-radius: 16px; display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.pv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.pv-ttl { min-width: 0; }
.pv-ttl b { display: block; font-size: 16px; line-height: 1.35; }
.pv-ttl small { display: block; color: rgba(255,255,255,.7); font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; }
.pv-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; flex: none; }
.pv-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.55); background: transparent; color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pv-btn svg { width: 15px; height: 15px; }
.pv-btn:hover { background: rgba(255,255,255,.08); }
.pv-btn.danger { border-color: #F2A39B; }
.pv-btn.danger.armed { background: #B42318; border-color: #B42318; }
.pv-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pv-x { width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.55); background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer; }
.pv-x svg { width: 16px; height: 16px; }
.pv-stage { position: relative; flex: 1; min-height: 260px; aspect-ratio: 16 / 9; max-height: 64vh; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, #2F5480, #6E8FB4); display: flex; align-items: center; justify-content: center; }
.pv-stage > img { width: 100%; height: 100%; object-fit: contain; background: #0B1626; }
.pv-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 20px; }
.pv-empty > svg { width: 56px; height: 56px; }
.pv-empty b { font-size: 18px; }
.pv-empty span { font-size: 13px; color: rgba(255,255,255,.85); }
.pv-empty-acts { display: flex; gap: 8px; margin-top: 6px; }
.pv-empty-acts .btn svg { width: 15px; height: 15px; }
.pv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(11,22,38,.55); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding-bottom: 3px; }
.pv-nav:hover { background: rgba(11,22,38,.8); }
.pv-nav.prev { left: 12px; } .pv-nav.next { right: 12px; }
.pv-foot > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: rgba(255,255,255,.9); }
.pv-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.pv .ph-tile:not(.has) { background: linear-gradient(135deg, #2F5480, #6E8FB4); color: #fff; border: 1px solid rgba(255,255,255,.2); }
@media (max-width: 640px) { .pv { padding: 12px; } .pv-head { flex-direction: column; } .pv-acts { justify-content: flex-start; } .pv-btn { height: 34px; padding: 0 10px; } .pv-stage { aspect-ratio: 4 / 3; } }
@media (max-width: 640px) {
  .ichk { gap: 8px; }
  .ichk > span:first-child { flex: 1 1 45%; min-width: 0; font-size: 13px; }
  .ichk-btns { flex: 0 0 52%; min-width: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ichk-btns button { min-width: 0; white-space: normal; overflow-wrap: anywhere; font-size: 11.5px; padding: 7px 3px; }
}
/* Viewer: every button readable on the dark panel */
.pv .btn:not(.primary) { background: transparent; border: 1px solid rgba(255,255,255,.6); color: #fff; }
.pv .btn:not(.primary):hover { background: rgba(255,255,255,.1); border-color: #fff; }
.pv .btn.primary { color: var(--on-accent); }
.pv .btn { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Answers: each one its own button ---------- */
.ichk-btns { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; border: 0; border-radius: 0; overflow: visible; background: none; }
.ichk-btns button { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--ink); padding: 6px 12px; font-size: 12.5px; font-weight: 500; min-height: 32px; transition: border-color .12s, background .12s; }
.ichk-btns button + button { border-left: 1px solid var(--line-strong); }
.ichk-btns button:hover { border-color: var(--primary-ink); background: var(--surface-1); }
.ichk-btns button.on { border-color: transparent; font-weight: 600; box-shadow: 0 1px 3px rgba(16,42,87,.18); }
html.corners-soft .ichk-btns button { border-radius: 14px; }
html.corners-sharp .ichk-btns button { border-radius: 3px; }
.ichk { padding: 6px 0; gap: 14px; }
@media (max-width: 1100px) { .ichk-btns button { padding: 6px 9px; } }
@media (max-width: 640px) {
  .ichk-btns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5px; flex: 0 0 54%; }
  .ichk-btns button { padding: 7px 4px; font-size: 11.5px; min-height: 36px; }
}

/* ---------- Add-photo pop-up ---------- */
.ph-choice { position: fixed; z-index: 1150; width: 236px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(16,42,87,.22); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.ph-choice > b { font-size: 14px; }
.ph-choice > small { font-size: 12px; color: var(--muted); margin-top: -4px; margin-bottom: 4px; }
.ph-choice button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); color: var(--ink); padding: 9px 10px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.ph-choice button:hover, .ph-choice button:focus-visible { border-color: var(--primary-ink); background: var(--surface-1); }
.ph-choice button svg { width: 20px; height: 20px; flex: none; color: var(--primary-ink); }
.ph-choice button span { display: flex; flex-direction: column; }
.ph-choice button span small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.ph-choice .pc-cancel { justify-content: center; border-color: transparent; color: var(--muted); font-weight: 500; padding: 6px; }
html.night .ph-choice { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
@media (max-width: 640px) { .ph-choice { left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto; padding: 14px; } .ph-choice button { padding: 12px; } }
/* Concern and deep-clean lines: photos on their own row under the notes */
.ww-detail .ww-photos { flex: 1 1 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.ww-ph-l { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); min-width: 52px; }
/* Past inspections */
.past-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 0 18px 12px; }
.past-table td { vertical-align: top; }
.head-actions .btn svg { flex: none; }
/* Section Back / Next */
.ww-secnav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 2px; border-top: 1px dashed var(--line); margin-top: 6px; }
.ww-secnav .csub { font-size: 12px; }
.sec-alldone { font-size: 13px; font-weight: 600; color: var(--good); }
.sec-done { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--good); color: #fff; font-size: 12px; margin-right: 8px; vertical-align: 2px; }
.iroom.is-done > summary { background: var(--good-soft); }
/* ---------- Answer buttons: uniform size, aligned columns ---------- */
.iroom .ichk-btns { display: grid; grid-template-columns: repeat(4, 128px); gap: 6px; flex: none; justify-content: end; }
.iroom .ww-clean .ichk-btns { grid-template-columns: repeat(2, 128px); }
.iroom .ichk-btns button { width: 100%; height: 40px; min-height: 0; padding: 0 8px; display: flex; align-items: center; justify-content: center; text-align: center;
  white-space: normal; line-height: 1.15; font-size: 12px; font-weight: 500; overflow: hidden; }
.iroom .ichk-btns button.on { font-weight: 600; }
.iroom .ichk { min-height: 52px; }
@media (max-width: 1240px) { .iroom .ichk-btns { grid-template-columns: repeat(4, 112px); } .iroom .ww-clean .ichk-btns { grid-template-columns: repeat(2, 112px); } .iroom .ichk-btns button { font-size: 11.5px; padding: 0 6px; } }
@media (max-width: 640px) {
  .iroom .ichk-btns, .iroom .ww-clean .ichk-btns { grid-template-columns: repeat(2, minmax(0, 1fr)); flex: 0 0 56%; gap: 5px; }
  .iroom .ichk-btns button { height: 42px; font-size: 11.5px; padding: 0 4px; }
}
/* Photo tiles switch: Take photo / Upload / Ask each time */
.ph-mode { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-mode-l { font-size: 12px; font-weight: 600; color: var(--muted); }
.ph-mode-seg { display: inline-flex; background: var(--surface-2); border-radius: 99px; padding: 3px; gap: 2px; }
.ph-mode-seg button { border: 0; background: none; border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; min-height: 32px; }
.ph-mode-seg button svg { width: 15px; height: 15px; }
.ph-mode-seg button.on { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
@media (max-width: 640px) { .ph-mode { width: 100%; } .ph-mode-seg { width: 100%; } .ph-mode-seg button { flex: 1; justify-content: center; padding: 8px 6px; min-height: 40px; } }
/* Settings button on every page */
.page-head .head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn.page-set { gap: 6px; }
.btn.page-set svg { flex: none; }
.jb-lanes.two { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
@media (max-width: 1100px) { .jb-lanes.two { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .btn.page-set span { display: none; } }
.form-head .fh-acts { align-self: flex-start; margin-left: auto; }
/* ---------- Work checklist ---------- */
.wk-task { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.wk-task:last-child { border-bottom: 0; }
.wk-chk { flex: none; width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: var(--card); color: #fff; font-size: 16px; font-weight: 700; display: grid; place-items: center; cursor: pointer; margin-top: 1px; }
.wk-chk:hover:not(:disabled) { border-color: var(--good); }
.wk-chk:disabled { cursor: default; opacity: .6; }
.wk-task.on .wk-chk { background: var(--good); border-color: var(--good); }
.wk-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.wk-task.on .wk-txt > span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.wk-txt small { color: var(--muted); font-size: 12px; }
.wk-ph { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.wk-before { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; }
.wk-before img { width: 46px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.wk-who { flex: none; font-size: 10.5px; font-weight: 700; background: var(--good-soft); color: var(--good); border-radius: 99px; padding: 2px 7px; margin-top: 6px; }
.wk-repair .wk-chk { border-color: var(--stop-line); }
.wk-addon .wk-chk { border-color: var(--warn-line); }
.wk-sum { padding: 12px 16px; }
.wk-sum-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ww-prog.big { flex: 1; min-width: 160px; height: 8px; }
.is-locked { opacity: .55; pointer-events: none; }
.wk-page .note { margin-bottom: 12px; }
.wk-page .note .btn { margin-top: 8px; }
@media (max-width: 640px) { .wk-chk { width: 36px; height: 36px; } .wk-txt { font-size: 14px; } }
.wk-txt em { display: inline-block; text-decoration: none; }
/* Pop-up headers: long titles wrap, the close button always stays tappable */
.modal-head { gap: 12px; }
.modal-head > h2, .modal-head > div { min-width: 0; overflow-wrap: anywhere; }
.modal-head > .icon-btn { flex: none; position: relative; z-index: 1; }
/* Reports and scopes on a phone: everything wraps inside the screen */
.scope-modal { max-width: calc(100vw - 16px); }
.scope-modal .modal-body { overflow-x: hidden; }
.scope-modal .mini-table { width: 100%; table-layout: fixed; }
.scope-modal .mini-table td { white-space: normal; overflow-wrap: anywhere; }
.scope-modal .mini-table td.right { width: 84px; }
@media (max-width: 640px) {
  .scope-backdrop { padding: 8px; }
  .scope-modal { width: 100%; }
  .scope-paper { padding: 14px; }
  .scope-head { flex-direction: column; gap: 6px; }
  .scope-sum { text-align: left !important; }
  .scope-modal .modal-foot .foot-btns { width: 100%; display: flex; gap: 8px; }
  .scope-modal .modal-foot .foot-btns .btn { flex: 1; }
}
.ww-dec-top { flex-wrap: wrap; }
.ww-dec-top .pb-box { min-width: 0; flex: 1 1 200px; }
@media (max-width: 640px) { .ww-dec-top > .btn { width: 100%; } .ww-find .head-actions .btn { flex: 1; } }
.wl-prog { display: flex; align-items: center; gap: 8px; min-width: 120px; } .wl-prog .ww-prog { flex: 1; }
.ins-status { white-space: nowrap; display: inline-block; }
.ws-wrap { padding: 0 18px 16px; display: flex; flex-direction: column; gap: 6px; }
.ws-row { display: flex; align-items: center; gap: 8px; }
.ws-row .sc-in { flex: 1; height: 34px; }
.ws-n { width: 22px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.ws-wrap .sc-addrow { margin-top: 6px; }
/* ---------- Job flow: steps and the Next step ---------- */
.flow-card { padding: 12px 16px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.flow-card.big { border: 2px solid var(--accent); box-shadow: 0 4px 16px rgba(243, 146, 0, .14); }
.modal .flow-card { margin-bottom: 14px; }
.flow-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; }
.flow-steps li { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); padding-right: 22px; position: relative; }
.flow-steps li:not(:last-child)::after { content: ''; position: absolute; right: 6px; top: 50%; width: 10px; height: 2px; background: var(--line-strong); }
.flow-steps li span { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 11px; color: #fff; flex: none; background: var(--card); }
.flow-steps li.done { color: var(--good); }
.flow-steps li.done span { background: var(--good); border-color: var(--good); }
.flow-steps li.cur { color: var(--primary-ink); }
.flow-steps li.cur span { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.flow-next { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.flow-next b { display: block; font-size: 14px; }
.flow-next small { color: var(--muted); font-size: 12.5px; }
.flow-next .btn { flex: none; }
.flow-docs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-top: 1px dashed var(--line); padding-top: 8px; }
.flow-docs .btn { display: inline-flex; align-items: center; gap: 5px; }
@media (max-width: 640px) { .flow-next .btn { width: 100%; } .flow-steps li { font-size: 11px; padding-right: 16px; } }
/* Check-out bar at the bottom of the walk-through and work checklist */
.end-bar { position: sticky; bottom: 12px; z-index: 7; margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: var(--card); border: 2px solid var(--accent); border-radius: 14px; padding: 12px 16px; box-shadow: 0 8px 24px rgba(16,42,87,.18); }
.end-bar b { display: block; font-size: 14px; }
.end-bar small { color: var(--muted); font-size: 12.5px; }
.end-bar .btn { flex: none; min-height: 42px; padding: 0 22px; }
.end-flow { margin-top: 14px; }
html.night .end-bar { box-shadow: 0 8px 24px rgba(0,0,0,.5); }
@media (max-width: 640px) { .end-bar { bottom: 8px; padding: 10px 12px; } .end-bar .btn { width: 100%; } }
/* ---------- Message center ---------- */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
html.nav-icons .nav-badge, .sidebar .nav-item .nav-badge { font-size: 11px; }
html.nav-icons .nav-item, .nav-item { position: relative; }
html.nav-icons .nav-badge { position: absolute; top: 4px; right: 6px; min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px; }
@media (max-width: 820px) { .nav-badge { position: absolute; top: 4px; right: 6px; min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px; } }
.msg-page { max-width: 1280px; }
.msg-me { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.msg-me select { height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; font: inherit; font-weight: 500; color: var(--ink); background: var(--card); }
.msg-wrap { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 230px); min-height: 460px; overflow: hidden; padding: 0; }
.msg-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding: 12px; gap: 8px; }
.msg-list .search { width: 100%; }
.msg-tabs { flex-wrap: wrap; }
.msg-tabs .tab { padding: 5px 9px; font-size: 12px; }
.msg-items { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; padding: 0 6px; }
.msg-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; border-radius: 10px; padding: 9px 8px; cursor: pointer; font: inherit; color: var(--ink); }
.msg-item:hover { background: var(--surface-1); }
.msg-item.on { background: var(--info-soft); }
.msg-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--primary-ink); }
.msg-av svg { width: 19px; height: 19px; }
.msg-av.client { background: var(--lc-soft, var(--surface-2)); color: var(--lc, var(--primary-ink)); }
.msg-it { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.msg-it b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-it small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item.unread .msg-it b, .msg-item.unread .msg-it small { color: var(--ink); font-weight: 700; }
.msg-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.msg-meta small { font-size: 11px; color: var(--muted); }
.msg-meta i { font-style: normal; min-width: 18px; height: 18px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.msg-meta em { font-style: normal; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--warn); background: var(--warn-soft); border-radius: 99px; padding: 1px 6px; }
.msg-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.msg-th { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.msg-th-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.msg-th-t b { font-size: 15px; }
.msg-th-t small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.msg-th-a { display: flex; gap: 6px; flex-wrap: wrap; }
.msg-th-a .btn { display: inline-flex; align-items: center; gap: 5px; }
.msg-back { display: none; }
.msg-review { background: var(--warn-soft); color: var(--warn); font-size: 12.5px; font-weight: 600; padding: 8px 16px; }
.msg-body { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-1); }
.msg-day { text-align: center; margin: 8px 0 4px; }
.msg-day span { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; }
.msg-b { max-width: min(560px, 78%); align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 8px 12px; box-shadow: var(--shadow); }
.msg-b.mine { align-self: flex-end; background: var(--primary); border-color: var(--primary); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg-b.client { background: var(--accent-soft); border-color: var(--warn-line); }
.msg-b.sys { align-self: center; background: none; border: 0; box-shadow: none; padding: 0; font-size: 11.5px; color: var(--muted); }
.msg-who { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.msg-b.mine .msg-who, .msg-b.mine .msg-time { color: rgba(255,255,255,.75); }
.msg-text { font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.msg-time { font-size: 10.5px; color: var(--muted); text-align: right; margin-top: 2px; }
.msg-wo { border: 0; background: rgba(243,146,0,.18); color: inherit; font: inherit; font-weight: 700; border-radius: 5px; padding: 0 4px; cursor: pointer; text-decoration: underline; }
.msg-compose { border-top: 1px solid var(--line); padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--card); }
.msg-compose.ro { flex-direction: row; align-items: center; justify-content: space-between; }
.msg-row { display: flex; gap: 8px; align-items: flex-end; }
.msg-row textarea { flex: 1; resize: none; min-height: 44px; max-height: 160px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 13.5px; background: var(--card); color: var(--ink); }
.msg-row .btn { min-height: 44px; padding: 0 20px; }
.msg-from { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.msg-from > button { border: 1px solid var(--line-strong); background: var(--card); border-radius: 99px; padding: 4px 12px; font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.msg-from > button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.msg-from select, .msg-from input { height: 30px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 12.5px; background: var(--card); color: var(--ink); }
.msg-none { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); }
.msg-none b { color: var(--ink); font-size: 15px; }
.msg-dlg { z-index: 1100; }
.msg-dlg .modal { width: min(520px, 96vw); }
.msg-dlg .modal-body { padding: 16px 20px 18px; }
@media (max-width: 900px) {
  .msg-wrap { grid-template-columns: 1fr; height: calc(100vh - 210px); }
  .msg-page.has-cur .msg-list { display: none; }
  .msg-page:not(.has-cur) .msg-thread { display: none; }
  .msg-back { display: inline-flex; }
  .msg-b { max-width: 88%; }
}

/* ---------- Quotes ---------- */
.ins-status.q-draft { background: var(--surface-2); color: var(--ink-2); }
.ins-status.q-sent { background: var(--info-soft); color: var(--primary-ink); }
.ins-status.q-accepted, .ins-status.q-converted { background: var(--good-soft); color: var(--good); }
.ins-status.q-declined { background: var(--stop-soft); color: var(--stop); }
.ins-status.q-expired { background: var(--warn-soft); color: var(--warn); }
.ok-t { color: var(--good); font-weight: 600; }
.quote-facts .ww-visit .q-dec { display: flex; gap: 8px; flex-wrap: wrap; }
.ql-card { padding-bottom: 6px; }
.ql-list { display: flex; flex-direction: column; }
.ql-row { display: grid; grid-template-columns: minmax(200px, 2.2fr) 70px 1fr 1.3fr 1.4fr 1fr 34px; gap: 12px; align-items: start; padding: 14px 18px; border-top: 1px solid var(--line); }
.ql-row > * > span:first-child, .ql-qty > span, .ql-our > span:first-child { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.ql-what { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ql-what .ql-kind { font-size: 11px; color: var(--muted); }
.ql-sug b, .ql-mkt b, .ql-amt b { font-size: 15px; display: block; }
.ql-mkt small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-our small { display: block; font-size: 11px; margin-top: 4px; }
.ql-amt { text-align: right; }
.ql-how { font-size: 12px; color: var(--muted); }
.ql-how summary { cursor: pointer; color: var(--primary-ink); }
.ql-how ul { list-style: none; margin: 6px 0 0; padding: 0; }
.ql-how li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; border-bottom: 1px dashed var(--line); }
.ql-add { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line); }
.ql-tot { display: flex; justify-content: flex-end; padding: 8px 18px 16px; border-top: 1px solid var(--line); }
.ql-tot .li-totals { min-width: 320px; display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; margin: 0; }
.ql-tot dd { margin: 0; text-align: right; }
.ql-tot .grand { font-weight: 700; font-size: 17px; border-top: 1px solid var(--line-strong); padding-top: 6px; }
.q-small { width: 70px !important; display: inline-block; padding: 3px 6px !important; }
.q-words { display: grid; gap: 12px; padding: 4px 18px 18px; }
.q-words .lbl { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.q-words textarea { width: 100%; }
.q-hist { list-style: none; margin: 0; padding: 4px 18px 14px; }
.q-hist li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.q-hist li span { color: var(--muted); margin-right: 10px; font-size: 12px; }
.linkish { background: none; border: 0; padding: 0; color: var(--primary-ink); text-decoration: underline; cursor: pointer; font: inherit; }
.pq-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; }
.pq-l { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: 4px; }
.pq-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-1); border-radius: 999px; padding: 4px 6px 4px 12px; cursor: pointer; color: var(--ink); font: inherit; font-size: 13px; }
.pq-chip:hover { border-color: var(--line-strong); }
.pq-sp { flex: 1; }
@media (max-width: 900px) {
  .ql-row { grid-template-columns: 1fr 1fr; }
  .ql-what { grid-column: 1 / -1; }
  .ql-amt { text-align: left; }
  .ql-tot .li-totals { min-width: 0; width: 100%; }
}

/* ---------- Follow-ups ---------- */
.fu-list { display: flex; flex-direction: column; }
.fu-item { display: flex; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line); border-left: 3px solid transparent; }
.fu-item.late { border-left-color: var(--warn); }
.fu-main { flex: 1; min-width: 0; }
.fu-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fu-rule { font-size: 11px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 2px 8px; }
.fu-title { font-weight: 600; margin: 4px 0 2px; }
.fu-msg { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-1); border: 1px dashed var(--line-strong); font-size: 13px; color: var(--ink-2); }
.fu-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.fu-when { font-weight: 600; font-size: 13px; text-align: right; }
.fu-when.late { color: var(--warn); }
.fu-when small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.fu-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fu-snz { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fu-set.off small, .fu-set.off b { opacity: .7; }
.fu-set textarea { width: 100%; margin-top: 8px; }
.fu-set > span { display: flex; flex-direction: column; gap: 6px; width: 100%; }
@media (max-width: 700px) {
  .fu-item { flex-direction: column; }
  .fu-side { align-items: flex-start; }
  .fu-acts { justify-content: flex-start; }
}
.ql-row input, .ql-row select { min-width: 0; max-width: 100%; box-sizing: border-box; }
.ql-qty input { width: 100%; }
.ql-row > * { min-width: 0; }

/* ---------- Settings › Company ---------- */
.co-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; padding: 6px 18px 18px; }
.co-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.co-f.wide { grid-column: 1 / -1; }
.co-f > span { font-size: 12px; font-weight: 600; }
.co-f small { color: var(--muted); font-size: 12px; }
.co-f input { width: 100%; box-sizing: border-box; }
.co-checks { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 6px 18px 18px; }
.co-prev { padding: 6px 18px 18px; }
.co-prev iframe { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
@media (max-width: 700px) { .co-grid { grid-template-columns: 1fr; } .co-prev iframe { height: 460px; } }

/* ---------- Employees, sign-in, time clock ---------- */
.lock-screen { position: fixed; inset: 0; z-index: 9999; background: var(--side-bg, #0B2747); display: grid; place-items: center; padding: 16px; }
body.locked .sidebar, body.locked aside { visibility: hidden; }
.lock-card { width: min(400px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.lock-card h1 { margin: 4px 0 0; font-size: 24px; }
.lock-brand { display: flex; align-items: center; gap: 12px; color: var(--primary-ink); }
.lock-brand svg { width: 48px; height: 40px; }
.lock-brand b { display: block; font-size: 17px; } .lock-brand small { color: var(--muted); }
.lock-card .btn { justify-content: center; }
.user-chip { display: flex; align-items: center; gap: 10px; margin: 6px 12px 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.06); color: #fff; }
.user-chip .uc-n { flex: 1; min-width: 0; } .user-chip .uc-n b { display: block; font-size: 13px; } .user-chip .uc-n small { opacity: .75; font-size: 11px; }
.uc-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.35); flex: none; }
.uc-dot.in { background: #3BD16F; } .uc-dot.brk { background: #F5B740; }
.uc-out { background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 7px; padding: 3px 8px; font: inherit; font-size: 12px; cursor: pointer; }
.emp-av { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--c, var(--primary)); color: #fff; font-size: 11px; font-weight: 700; margin-right: 8px; vertical-align: middle; }
.emp-av.big { width: 56px; height: 56px; font-size: 20px; margin: 0; }
.emp-hd { display: flex; gap: 16px; align-items: center; }
.emp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.emp-grid > .table-card:last-child { grid-column: 1 / -1; }
.emp-sched { padding: 4px 18px 10px; display: flex; flex-direction: column; gap: 6px; }
.es-row { display: grid; grid-template-columns: 90px 120px auto 120px 1fr; gap: 8px; align-items: center; }
.es-row.off { opacity: .75; }
.emp-can { padding: 4px 18px 12px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.emp-hrs { display: flex; gap: 24px; padding: 4px 18px 14px; flex-wrap: wrap; }
.emp-hrs small { display: block; color: var(--muted); font-size: 12px; } .emp-hrs b { font-size: 20px; }
.tc-tabs { margin-bottom: 16px; }
.tc-panel { display: grid; grid-template-columns: auto 1fr auto; gap: 18px 24px; align-items: center; padding: 20px 22px; margin-bottom: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--line-strong); box-shadow: var(--shadow); }
.tc-panel.in { border-left-color: #22A55A; } .tc-panel.brk { border-left-color: #E8A317; }
.tc-time { font-size: 34px; font-weight: 700; line-height: 1; } .tc-now small { color: var(--muted); }
.tc-who b { display: block; font-size: 18px; } .tc-who span { display: block; } .tc-who small { color: var(--muted); }
.tc-acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; max-width: 520px; }
.tc-acts select, .tc-acts input { min-width: 220px; flex: 1; }
.tc-big { padding: 14px 22px; font-size: 16px; }
.tc-switch { width: 100%; font-size: 13px; text-align: right; } .tc-switch summary { cursor: pointer; color: var(--primary-ink); }
.tc-switch select { margin: 8px 8px 0 0; min-width: 220px; }
.tc-per { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; }
.tc-per small { display: block; color: var(--muted); font-size: 12px; }
.tc-sheet tr[data-tse] { cursor: pointer; } .tc-sheet tr.open { background: var(--surface-1); }
.tc-detail td { background: var(--surface-1); padding: 0 !important; }
.tc-days { padding: 10px 18px 14px; } .tc-days table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tc-days th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 6px; } .tc-days td { padding: 6px; border-top: 1px solid var(--line); }
.tc-days .right, .tc-days th.right { text-align: right; } .tc-days tr.stale td { background: var(--stop-soft); }
.tc-tot td { border-top: 2px solid var(--line-strong); }
.role-wrap { overflow-x: auto; padding: 0 18px 8px; }
.role-table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 13px; }
.role-table th { padding: 8px 6px; vertical-align: bottom; min-width: 110px; } .role-table th input { width: 100%; font-weight: 600; } .role-table th small { display: block; font-weight: 400; color: var(--muted); margin-top: 3px; }
.role-table td { padding: 7px 6px; border-top: 1px solid var(--line); text-align: center; } .role-table td:first-child { text-align: left; }
.role-table .role-grp td { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-1); }
@media (max-width: 900px) {
  .emp-grid { grid-template-columns: 1fr; }
  .tc-panel { grid-template-columns: 1fr; } .tc-acts { justify-content: stretch; max-width: none; } .tc-acts .btn { flex: 1; }
  .es-row { grid-template-columns: 80px 1fr auto 1fr; } .es-row .csub:last-child { display: none; }
}
body.locked .scope-backdrop, body.locked .msg-dlg-wrap, body.locked .toast { z-index: 10001; }
body.locked .msg-dlg { z-index: 10001; }
.emp-facts .pb-svcs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.emp-facts dl { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); gap: 8px 14px; padding: 4px 18px 14px; margin: 0; font-size: 14px; }
.emp-facts dt { color: var(--muted); font-size: 13px; } .emp-facts dd { margin: 0; overflow-wrap: anywhere; }
.emp-facts .ql-add .btn { height: auto; }
.tc-panel { grid-template-columns: auto minmax(0, 1fr) auto; } .tc-panel > * { min-width: 0; }
@media (max-width: 900px) { .tc-panel { grid-template-columns: minmax(0, 1fr); } .tc-acts select, .tc-acts input { min-width: 0; width: 100%; flex-basis: 100%; } .tc-switch select { min-width: 0; width: 100%; } }
.emp-grid > * { min-width: 0; } @media (max-width: 900px) { .emp-grid { grid-template-columns: minmax(0, 1fr); } }
.es-row input[type=time] { min-width: 0; width: 100%; box-sizing: border-box; } @media (max-width: 900px) { .es-row { grid-template-columns: 70px minmax(0,1fr) auto minmax(0,1fr); } }

/* ---------- Agreements ---------- */
.ag-props { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ag-rates { display: flex; flex-direction: column; }
.ag-rate { display: grid; grid-template-columns: minmax(0, 2fr) 140px minmax(0, 1fr) 34px; gap: 10px; align-items: center; padding: 8px 18px; border-top: 1px solid var(--line); }
.ag-rate input { width: 100%; box-sizing: border-box; min-width: 0; }
.ag-secs { display: flex; flex-direction: column; padding: 0 18px 12px; gap: 6px; }
.ag-sec { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-1); }
.ag-sec.off { opacity: .6; }
.ag-sec summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.ag-sec summary::-webkit-details-marker { display: none; }
.ag-sec textarea, .ag-sec-ed input { width: 100%; box-sizing: border-box; margin: 0 0 6px; }
.ag-sec > textarea, .ag-sec > p, .ag-sec-ed { padding: 0 12px 10px; display: block; }
.ag-sec > textarea { margin: 0 12px 6px; width: calc(100% - 24px); }
@media (max-width: 700px) { .ag-rate { grid-template-columns: minmax(0, 1fr) 110px 34px; } .ag-rate input[data-agrf=unit] { grid-column: 1 / 3; } }
.quote-facts input[type=checkbox], .ag-props input[type=checkbox] { width: auto !important; height: auto; flex: none; }
.ag-plan td { text-align: left; vertical-align: top; } .ag-plan th { text-align: left; font-size: 12px; }
.ag-plan .pb-in { width: 110px; } .ag-plan input { width: 100%; min-width: 0; }
.ag-plan td small { display: block; margin-top: 2px; }

/* ---------- Job costs ---------- */
.warn-t { color: var(--warn); font-weight: 600; }
.jc-bars { padding: 16px 20px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.jc-bar { display: grid; grid-template-columns: 80px minmax(0, 1fr) 100px; gap: 12px; align-items: center; }
.jc-bar > div { display: flex; height: 16px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.jc-bar i { display: block; height: 100%; } .jc-bar b { text-align: right; }
.jc-bar i.rev { background: #22A55A; } .jc-bar i.lab { background: var(--primary); } .jc-bar i.oth { background: var(--accent); }
.jc-bars .csub { margin: 0; }

/* ---------- Access and permissions on the employee profile ---------- */
.acc-card { grid-column: 1 / -1; }
.acc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; padding: 0 18px 8px; }
.acc-grid h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 0 6px; }
.acc-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px; border-top: 1px solid var(--line); cursor: pointer; }
.acc-row small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.acc-row.diff { background: var(--warn-soft); } .acc-row.diff small { color: var(--warn); font-weight: 600; }
.acc-row input:disabled + span { color: var(--ink-2); }
.title-roles { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.tr-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 80px 34px; gap: 8px; align-items: center; }
.tr-row input, .tr-row select { width: 100%; min-width: 0; }
@media (max-width: 700px) { .acc-grid { grid-template-columns: minmax(0, 1fr); } .tr-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; } .tr-row .csub { display: none; } }

/* ---------- Inventory ---------- */
tr.inv-low td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.ei-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.ei-row .field { min-width: 0; } .ei-row input, .ei-row select { width: 100%; box-sizing: border-box; }
.iv-cat { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 130px 70px 34px; }
@media (max-width: 700px) { .iv-cat { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* ---------- Bookkeeping and charts ---------- */
:root { --viz-1: #2a78d6; --viz-2: #eb6834; }
:root.night { --viz-1: #3987e5; --viz-2: #d95926; }
.viz-card { padding-bottom: 12px; margin-bottom: 16px; }
.viz-svg { width: 100%; height: auto; display: block; padding: 0 12px; box-sizing: border-box; }
.viz-grid { stroke: var(--line); stroke-width: 1; }
.viz-base { stroke: var(--line-strong); stroke-width: 1; }
.viz-ax { fill: var(--muted); font-size: 11px; font-family: inherit; }
.viz-svg rect[data-tip]:hover { fill: rgba(127, 127, 127, .07); }
.viz-leg { display: inline-flex; gap: 14px; font-size: 12px; color: var(--ink-2); }
.viz-leg i, .viz-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.viz-tip { position: fixed; z-index: 20000; pointer-events: none; background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); max-width: 260px; }
.viz-tip b { display: block; margin-bottom: 3px; }
.viz-hb { display: flex; flex-direction: column; gap: 6px; padding: 4px 18px 6px; }
.viz-hr { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr) 84px; gap: 10px; align-items: center; font-size: 13px; cursor: default; }
.viz-hl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.viz-ht { height: 12px; background: var(--surface-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.viz-ht i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.viz-hr b { text-align: right; }
.bk-aging { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 4px 18px 14px; }
.bk-aging small { display: block; color: var(--muted); font-size: 12px; } .bk-aging b { display: block; font-size: 18px; } .bk-aging .csub { font-size: 11px; }
.bk-inbox { display: block; width: 100%; text-align: left; cursor: pointer; margin-bottom: 16px; font: inherit; }
.bk-rbox { min-height: 40px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 8px; margin-bottom: 8px; background: var(--surface-1); }
.bk-rbox img { max-width: 100%; max-height: 220px; border-radius: 6px; }
.bk-rview img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 8px; }
.bk-pl .pl-h td { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-1); }
.bk-pl .pl-t td { font-weight: 700; border-top: 1px solid var(--line-strong); }
.bk-pl .pl-g td { font-weight: 800; font-size: 17px; border-top: 2px solid var(--ink); }
@media (max-width: 700px) { .bk-aging { grid-template-columns: repeat(2, minmax(0, 1fr)); } .viz-hr { grid-template-columns: minmax(0, 1fr) 76px; } .viz-ht { grid-column: 1 / -1; grid-row: 2; } }

/* ---------- Sign-in pop-up ---------- */
.lock-screen { background: radial-gradient(1200px 700px at 30% 20%, rgba(243, 146, 0, .18), transparent 60%), linear-gradient(160deg, var(--side-bg, #0B2747), #06182d); backdrop-filter: blur(6px); }
body.locked #view, body.locked .sidebar, body.locked aside { visibility: hidden !important; }
.lock-pop { width: min(420px, 100%); animation: lkIn .18s ease-out; }
@keyframes lkIn { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.reduce-motion .lock-pop { animation: none; }
.lock-card { box-shadow: 0 24px 60px rgba(0, 0, 0, .35); border-radius: 16px; }
.lock-card input { width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 15px; }
.lk-pw { position: relative; display: block; }
.lk-pw input { padding-right: 70px; }
.lk-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--surface-2); color: var(--ink-2); border-radius: 6px; padding: 4px 8px; font: inherit; font-size: 12px; cursor: pointer; }
.lg-card { display: grid; gap: 10px; padding: 14px; border-radius: 10px; background: var(--surface-1); border: 1px solid var(--line); }
.lg-card small { display: block; color: var(--muted); font-size: 12px; } .lg-card b { font-size: 16px; }
.lg-tmp { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .03em; }
.lk-tabs { display: flex; margin: 2px 0 4px; } .lk-tabs .tab { flex: 1; justify-content: center; display: inline-flex; align-items: center; gap: 6px; }
#lkClockPane, #lkSignPane { display: flex; flex-direction: column; gap: 14px; } #lkClockPane[hidden], #lkSignPane[hidden] { display: none; }
#lkClockPane .tc-panel { grid-template-columns: minmax(0, 1fr); padding: 14px; margin: 0; } #lkClockPane .tc-acts { justify-content: stretch; max-width: none; } #lkClockPane .tc-acts select, #lkClockPane .tc-acts input { min-width: 0; width: 100%; } #lkClockPane .tc-acts .btn { flex: 1; }
#pkForm { display: flex; flex-direction: column; gap: 12px; } #pkForm[hidden] { display: none; }
#lkClockPane .tc-acts input, #lkClockPane .tc-acts select, .msg-dlg .tc-acts input, .msg-dlg .tc-acts select { flex: 1 1 100%; }

/* ---------- Undo bar, problem reports, activity log ---------- */
.undo-bar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 9000; display: flex; align-items: center; gap: 12px; background: #142235; color: #fff; padding: 12px 12px 12px 18px; border-radius: 12px; box-shadow: 0 12px 34px rgba(0,0,0,.3); min-width: min(460px, calc(100vw - 32px)); max-width: calc(100vw - 32px); overflow: hidden; }
.undo-bar[hidden] { display: none; }
.ub-t { flex: 1; min-width: 0; font-size: 14px; } .ub-n { font-size: 12px; opacity: .7; min-width: 28px; text-align: right; }
.ub-btn { background: var(--accent, #F39200); color: #142235; border: 0; border-radius: 8px; padding: 8px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.ub-x { background: none; border: 0; color: #fff; opacity: .7; cursor: pointer; padding: 4px; display: inline-flex; } .ub-x svg { width: 16px; height: 16px; }
.ub-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent, #F39200); transition: width 1s linear; }
.help-link { display: flex; align-items: center; gap: 8px; margin: 0 12px 8px; padding: 6px 10px; border: 0; background: none; color: rgba(255,255,255,.75); font: inherit; font-size: 12px; cursor: pointer; border-radius: 8px; text-align: left; }
.help-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.rp-shot img { max-width: 100%; max-height: 220px; border: 1px solid var(--line); border-radius: 8px; display: block; margin: 6px 0; }
.pr-dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 12px; margin: 0 0 10px; font-size: 14px; } .pr-dl dt { color: var(--muted); font-size: 13px; } .pr-dl dd { margin: 0; overflow-wrap: anywhere; }
.pr-steps { margin: 6px 0 10px; padding-left: 20px; font-size: 13px; color: var(--ink-2); }
.pr-pre { white-space: pre-wrap; font-size: 11px; max-height: 200px; overflow: auto; background: var(--surface-1); padding: 8px; border-radius: 8px; }

/* Sign out at the top, remember email, idle warning */
.top-user { position: fixed; top: 12px; right: 28px; z-index: 40; display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 6px; background: var(--card, #fff); border: 1px solid var(--line, #e3e7ee); border-radius: 999px; box-shadow: 0 2px 10px rgba(16, 34, 64, .08); font-size: 13px; }
.top-user[hidden] { display: none; }
.top-user .tu-n { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink, #12284b); padding-right: 4px; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-user .tu-av { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent, #F39200); color: var(--on-accent, #1A1A1A); font-size: 12px; font-weight: 700; }
.top-user .tu-out { display: flex; align-items: center; gap: 5px; border: 0; background: var(--surface-2, #EEF1F6); color: var(--ink, #12284b); font: inherit; font-weight: 600; padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.top-user .tu-out:hover { background: #fde7c6; color: #7a4300; }
.top-user .tu-out:focus-visible { outline: 2px solid var(--orange, #f39c12); outline-offset: 2px; }
.top-user .tu-out svg { width: 15px; height: 15px; }
body.locked .top-user { display: none; }
.lk-rem { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink, #12284b); margin: 2px 0 4px; cursor: pointer; }
.lk-rem input { width: 17px; height: 17px; accent-color: var(--orange, #f39c12); }
.idle-warn { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: rgba(10, 22, 44, .45); }
.idle-warn .iw-card { width: min(400px, 100%); display: grid; gap: 10px; justify-items: start; padding: 22px 24px; background: var(--card, #fff); color: var(--ink, #12284b); border-radius: 16px; border: 1px solid var(--line, #e3e7ee); box-shadow: 0 18px 50px rgba(0, 0, 0, .25); }
.idle-warn[hidden] { display: none; }
.idle-warn b { font-size: 18px; }
.idle-warn #iwN { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Profile photos */
.emp-av.ph { background: var(--surface-2, #EEF1F6); overflow: hidden; padding: 0; }
.emp-av.ph img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.emp-av.sm { width: 24px; height: 24px; font-size: 11px; margin: 0; }
.emp-av.huge { width: 140px; height: 140px; font-size: 44px; margin: 0; }
.emp-av-btn { position: relative; border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; flex: none; }
.emp-av-btn .eab-tag { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); white-space: nowrap; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--accent, #F39200); color: var(--on-accent, #1A1A1A); box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.emp-av-btn:hover .emp-av, .emp-av-btn:focus-visible .emp-av { box-shadow: 0 0 0 3px var(--accent, #F39200); }
.emp-av-btn:focus-visible { outline: none; }
.ph-dlg { display: grid; gap: 10px; justify-items: center; text-align: center; }
.ph-dlg .ph-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
/* View as (owner, look only) */
body.viewas .top-user { border-color: var(--accent, #F39200); box-shadow: 0 0 0 3px var(--accent-soft, #FFF3E0), 0 2px 10px rgba(16, 34, 64, .08); }
body.viewas::after { content: ''; position: fixed; inset: 0; border: 3px solid var(--accent, #F39200); pointer-events: none; z-index: 39; }
.top-user .tu-n b { font-weight: 700; }
.top-user .tu-back { background: var(--accent, #F39200); color: var(--on-accent, #1A1A1A); }
.top-user .tu-back:hover { background: #d98200; color: var(--on-accent, #1A1A1A); }
.btn svg { vertical-align: -3px; }

/* ============ Fit and spacing pass ============ */
/* Column headings and numbers stay on one line; long tables scroll sideways inside their card. */
th { white-space: nowrap; }
td.right, td.num, td.nowrap, td.num-strong, td .nw, .nw { white-space: nowrap; }
.wo-table th, .wo-table td { padding-left: 12px; padding-right: 12px; }
.wo-table th:first-child, .wo-table td:first-child { padding-left: 18px; }
.wo-table th:last-child, .wo-table td:last-child { padding-right: 18px; }
.table-card, .pd-card .table-wrap { overflow-x: auto; }
/* Tabs keep each label on one line and wrap to a second row when there are many. */
.tabs { flex-wrap: wrap; row-gap: 4px; }
.tab { white-space: nowrap; flex: none; }
/* Summary boxes that are also buttons line up like the others (left aligned). */
button.stat, button.card.stat { text-align: left; font: inherit; color: inherit; width: 100%; }
/* Multi-line boxes were stuck at one line tall. */
textarea.sc-in { height: auto; min-height: 92px; padding: 8px 10px; line-height: 1.45; resize: vertical; width: 100%; max-width: 100%; }
.q-words input.sc-in, .q-words select.sc-in { width: 100%; }
/* Inspection fix library: more room for the repair wording. */
.lib-row { grid-template-columns: 24px minmax(0, 1.4fr) 120px minmax(0, 2fr) 120px 64px; }
/* Expense and income bars: show the whole category name (two lines at most). */
.viz-hr { grid-template-columns: minmax(110px, 38%) minmax(50px, 1fr) 84px; }
.viz-hl { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.viz-hr b { white-space: nowrap; }
/* Settings rows with one box per business line wrap instead of running off the card. */
.vol-pay { flex-wrap: wrap; row-gap: 8px; }
.vol-rule > span { min-width: 0; flex: 1; }
.vol-rule small { overflow-wrap: anywhere; }
/* Messages list never wider than the screen. */
.msg-list, .msg-thread { min-width: 0; }
/* Time clock: the person's status gets real room; buttons drop below when space is tight. */
.tc-panel { grid-template-columns: auto minmax(220px, 1fr) auto; }
.tc-who { min-width: 0; }
.tc-who small { display: block; margin-top: 2px; }
@media (max-width: 1320px) { .tc-panel { grid-template-columns: auto minmax(0, 1fr); } .tc-acts { grid-column: 1 / -1; justify-content: flex-start; max-width: none; } }
@media (max-width: 640px) { .tc-panel { grid-template-columns: 1fr; } }
/* Long names and file paths break cleanly instead of spilling out. */
.path, .pr-pre { overflow-wrap: anywhere; }
td, .card h2, .card h3 { overflow-wrap: break-word; }
.wo-client { text-align: left; }
/* Checkbox labels line up with the box. */
label.pb-check { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
label.pb-check input { margin: 0; }
/* Name columns (a bold name with a line under it) get enough room before other columns. */
.wo-table td:not(.num):not(.right):has(> b:first-child) { min-width: 170px; }
.wo-table td:not(.num):not(.right):has(> .emp-av:first-child) { min-width: 150px; }
/* Company notes: two short lines instead of one cut-off line. */
textarea.sc-in.co-note { min-height: 56px; }
/* Phone: name boxes in settings lists get the full width. */
@media (max-width: 700px) {
  .tr-row { grid-template-columns: minmax(0, 1fr) 34px; }
  .tr-row > :first-child { grid-column: 1 / -1; }
  .tr-row > :first-child + * { grid-column: 1 / 2; }
  .lib-row { grid-template-columns: 24px minmax(0, 1fr); }
  .lib-row > :not(:first-child) { grid-column: 2 / -1; }
  .sc-hrow { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); row-gap: 6px; column-gap: 8px; }
  .sc-hrow > b { grid-column: 1 / 2; }
  .sc-hrow > label.pb-check { grid-column: 2 / 4; justify-self: end; }
  .sc-hrow > input[type=time] { width: 100%; min-width: 0; }
  .sc-hrow > :last-child:not(input) { grid-column: 1 / -1; }
  .tr-row { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .tr-row:last-of-type { border-bottom: 0; }
  .sc-add { display: flex; flex-wrap: wrap; width: 100%; }
  .sc-add input { flex: 1; min-width: 0; }
}
.ws-row .sc-in { min-width: 0; }
@media (max-width: 700px) {
  .sc-item { grid-template-columns: minmax(0, 1fr) 32px; row-gap: 2px; }
  .sc-item > :not(button) { grid-column: 1; }
  .sc-item > button { grid-column: 2; grid-row: 1 / span 3; }
  .tr-row.iv-cat { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tr-row.iv-cat > :first-child { grid-column: 1 / -1; }
  .tr-row.iv-cat > :first-child + * { grid-column: auto; }
  .tr-row.iv-cat > * { min-width: 0; }
}

/* ---------- Key box ---------- */
.key-table tr.key-late td { background: var(--stop-soft); }
.key-table tr.key-late:hover td { background: var(--stop-soft); }
tr.key-late td:first-child { box-shadow: inset 4px 0 0 var(--stop); }
.key-od { margin: 0 0 14px; }
.key-od b { display: block; margin-bottom: 2px; }
.key-rule { margin: 10px 2px 0; }
.key-dlg { display: grid; gap: 12px; }
.key-top { display: flex; align-items: center; gap: 12px; }
.key-top > div { flex: 1; min-width: 0; }
.key-ic { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft, #FFF3E0); color: var(--accent, #F39200); }
.key-ic svg { width: 22px; height: 22px; }
.key-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 13.5px; }
.key-dl dt { color: var(--muted); }
.key-dl dd { margin: 0; overflow-wrap: break-word; }
.key-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.key-h { font-size: 14px; margin: 4px 0 0; color: var(--primary-ink); }
.key-dlg .q-hist { max-height: 220px; overflow-y: auto; margin: 0; }
.ck-card { margin-top: 16px; }
.ck-card .pb-svcs-head { flex-wrap: wrap; gap: 8px; }
.ck-card .pb-svcs-head .btn { margin-left: auto; }
.key-banner svg { width: 26px; height: 26px; flex: none; color: var(--stop); }
.btn.danger { color: var(--stop); }
.banner.key-banner { background: var(--stop-soft); border-color: var(--stop-line); }
.note.key-od { background: var(--stop-soft); border-color: var(--stop); }

/* Popups: a little air between fields. */
.msg-dlg .modal-body > .field, .msg-dlg .modal-body > .ei-row, .msg-dlg .modal-body > label.pb-check { margin-bottom: 12px; }
.msg-dlg .modal-body > .ei-row .field { margin: 0; }
.key-table td.kc { min-width: 190px; }

/* ---------- Assigning several people to a job ---------- */
.multi-groups { display: grid; gap: 10px; }
.mu-gl { display: block; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.multi label.has-av { padding: 4px 12px 4px 4px; gap: 8px; }
.mu-av { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--c, var(--primary)); color: #fff; font-size: 10.5px; font-weight: 700; }
.mu-t { display: flex; flex-direction: column; line-height: 1.2; }
.mu-t small { font-size: 10.5px; color: var(--muted); }
.multi label:has(input:checked) .mu-t small { color: rgba(255,255,255,.8); }
.multi label:has(input:checked) .mu-av { box-shadow: 0 0 0 2px #fff; }

/* ---------- Checklist crew and initials on each task ---------- */
.wk-crew { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0 0; margin-top: 10px; border-top: 1px solid var(--line); }
.wk-crew-l { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.wk-crew-chips, .wk-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.wk-pick { justify-content: center; padding: 4px 0 6px; }
.wk-cm { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 99px; padding: 4px 14px 4px 4px; background: var(--card); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.wk-cm:disabled { cursor: default; opacity: 1; }
.wk-cm.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.wk-cm:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wk-av { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--c, var(--primary)); color: #fff; font-size: 11px; font-weight: 700; }
.wk-cn { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.wk-cn small { font-size: 10.5px; color: var(--muted); }
.wk-crew select { width: auto; max-width: 100%; }
.wk-crew-h { font-size: 12px; color: var(--muted); margin-left: auto; }
@media (max-width: 700px) { .wk-crew-h { display: none; } .wk-cn small { display: none; } .wk-cm { padding-right: 10px; } }
.wk-who { flex: none; min-width: 30px; height: 26px; padding: 0 7px; margin-top: 4px; border-radius: 99px; border: 0; background: var(--c, var(--good)); color: #fff; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .02em; cursor: pointer; }
.wk-who:disabled { cursor: default; }
.wk-who:not(:disabled):hover { box-shadow: 0 0 0 2px var(--accent-soft), 0 0 0 4px var(--accent); }

/* ---------- Approvals ---------- */
.rq-list { display: grid; gap: 12px; }
.rq-card { padding: 16px 18px; display: grid; gap: 8px; border-left: 4px solid var(--line-strong); }
.rq-card.rq-pending { border-left-color: var(--accent); }
.rq-card.rq-approved { border-left-color: var(--good); }
.rq-card.rq-denied { border-left-color: var(--stop); }
.rq-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rq-top b { flex: 1; min-width: 180px; font-size: 15px; }
.rq-kind { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.rq-lines { margin: 0; padding-left: 18px; font-size: 13.5px; }
.rq-card .note { margin: 0; }
.rq-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.banner.rq-banner svg { color: var(--primary-ink); }
/* Crew on site */
.wk-cm.here .wk-av { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--good); }
/* Sticky bars sit below the Sign out button at the top. */
body:has(.top-user:not([hidden])) .insp-sum, body:has(.top-user:not([hidden])) .set-nav { top: 56px; }

/* ---------- Alerts in the top bar ---------- */
.tu-alerts { display: inline-flex; align-items: center; gap: 4px; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--line); }
.top-user:not(:has(.tu-n)) .tu-alerts { border-right: 0; padding-right: 0; }
.tu-alert { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; font: inherit; color: var(--ink); padding: 4px 8px; border-radius: 999px; cursor: pointer; max-width: 340px; }
.tu-alert svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.tu-alert:hover { background: var(--surface-2); }
.tu-alert:focus-visible, .tu-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tu-n-al { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--primary-ink, #123B67); color: #fff; }
.tu-alert.lvl-stop .tu-n-al { background: var(--stop); } .tu-alert.lvl-stop svg { color: var(--stop); }
.tu-alert.lvl-warn .tu-n-al { background: var(--accent); color: var(--on-accent, #1A1A1A); } .tu-alert.lvl-warn svg { color: var(--accent); }
.tu-at { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tu-alert.lvl-stop .tu-at { color: var(--stop); }
.tu-more { border: 0; background: none; font: inherit; font-size: 12px; color: var(--primary-ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 4px 6px; white-space: nowrap; }
@media (max-width: 1100px) { .tu-alert { max-width: 230px; } }
@media (max-width: 700px) { .tu-at, .tu-more { display: none; } .top-user .tu-n > span:last-child { display: none; } }
/* The full list */
.al-modal { width: min(560px, 96vw) !important; }
.al-list { display: grid; gap: 8px; }
.al-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--c, var(--line-strong)); border-radius: 10px; background: var(--card); }
.al-row.lvl-stop { --c: var(--stop); } .al-row.lvl-warn { --c: var(--accent); } .al-row.lvl-info { --c: var(--primary); }
.al-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.al-txt b { display: block; font-size: 13.5px; }
.al-txt small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: break-word; }
.al-acts { display: flex; gap: 6px; }
.al-hid { margin-top: 6px; } .al-hid summary { cursor: pointer; font-size: 12.5px; color: var(--muted); padding: 4px 0; } .al-hid .al-row { opacity: .7; margin-top: 6px; }
.al-none { text-align: center; padding: 12px 0; }
.al-foot { margin-top: 12px; }
@media (max-width: 520px) { .al-row { grid-template-columns: 10px minmax(0, 1fr); } .al-acts { grid-column: 2; } }

/* ---------- Headquarters by position ---------- */
.hq-sec { margin-bottom: 26px; }
.hq-sec .section-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hq-sec .section-title .btn { margin-left: auto; }
.hq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 12px; }
.hq-clock { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.hq-clock > div { flex: 1; min-width: 0; } .hq-clock b { display: block; } .hq-clock small { color: var(--muted); font-size: 12.5px; }
.hq-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line-strong); flex: none; }
.hq-clock.in .hq-dot { background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); } .hq-clock.brk .hq-dot { background: #E8A317; }
.hq-hold { padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hq-hold > b { flex-basis: 100%; font-size: 13px; }
.hq-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); }
.hq-chip svg { width: 14px; height: 14px; } .hq-chip.late { background: var(--stop-soft); color: var(--stop); font-weight: 600; }
.hq-req { padding: 14px 16px; text-align: left; font: inherit; color: inherit; cursor: pointer; } .hq-req b { display: block; } .hq-req small { color: var(--muted); }
.hq-jobs { padding: 4px 0; }
.hq-job { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); }
.hq-job:first-child { border-top: 0; }
.hq-job.is-done { opacity: .7; }
.hq-time { font-weight: 700; font-size: 13px; white-space: nowrap; } .hq-time small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.hq-what { min-width: 0; } .hq-what b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hq-what small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hq-crew { display: flex; gap: 3px; }
.hq-ini { min-width: 26px; height: 22px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center; background: var(--c); color: #fff; font-size: 10.5px; font-weight: 700; }
.hq-pr { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.hq-pr.on { color: var(--primary-ink); } .hq-pr.done { color: var(--good); }
.hq-go { display: flex; justify-content: flex-end; }
.hq-stats { margin-bottom: 12px; }
@media (max-width: 760px) {
  .hq-job { grid-template-columns: 64px minmax(0, 1fr) auto; row-gap: 6px; }
  .hq-crew { grid-column: 2; grid-row: 2; } .hq-pr { grid-column: 3; grid-row: 1; }
  .hq-go { grid-column: 2 / -1; grid-row: 3; justify-content: flex-start; }
  .hq-what b, .hq-what small { white-space: normal; }
}

/* ---------- Vehicles ---------- */
.fl-table td.kc { min-width: 180px; }
.fl-due { margin-bottom: 14px; }
.fl-due-list { list-style: none; margin: 0; padding: 0 18px 10px; display: grid; gap: 6px; }
.fl-due-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; background: var(--surface-1); border-left: 3px solid var(--line-strong); font-size: 13px; }
.fl-due-list li.lvl-stop { border-left-color: var(--stop); background: var(--stop-soft); } .fl-due-list li.lvl-warn { border-left-color: var(--accent); }
.fl-due-list li span { color: var(--muted); text-align: right; }
.fl-h { font-size: 14px; color: var(--primary-ink); margin: 6px 0 8px; }
.fl-pre { display: grid; gap: 4px; padding: 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-1); }
.fl-pre > b { font-size: 13.5px; } .fl-pre > small { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.fl-pre-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 13px; }
.fl-seg { display: inline-flex; flex: none; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.fl-seg button { border: 0; background: var(--card); font: inherit; font-size: 12px; font-weight: 600; padding: 5px 10px; cursor: pointer; color: var(--ink-2); }
.fl-seg button + button { border-left: 1px solid var(--line-strong); }
.fl-seg button.on[data-pre$="|ok"] { background: var(--good); color: #fff; } .fl-seg button.on[data-pre$="|issue"] { background: var(--stop); color: #fff; }
button.hq-chip { border: 0; font: inherit; cursor: pointer; color: inherit; }
.emp-grid + .tabs { margin-top: 16px; }

/* ---------- Work order progress bar ---------- */
.pgb { display: grid; gap: 4px; min-width: 120px; max-width: 220px; margin-top: 6px; }
.pgb-track { display: flex; gap: 2px; height: 6px; }
.pgb-track span { flex: 1; border-radius: 3px; background: var(--line); position: relative; overflow: hidden; }
.pgb-track span.d { background: var(--good); }
.pgb-track span.c { background: var(--accent-soft, #FFF3E0); box-shadow: inset 0 0 0 1px var(--accent, #F39200); }
.pgb-track span.c::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: var(--accent, #F39200); }
.pgb.is-all .pgb-track span { background: var(--good); }
.pgb.is-cx .pgb-track span { background: repeating-linear-gradient(135deg, var(--line) 0 4px, transparent 4px 8px); }
.pgb-l { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.pgb-l b { font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.pgb-l span { flex: none; }
.pgb.sm { min-width: 110px; }
.pgb.line { margin: 3px 0 0; min-width: 0; max-width: none; }
.pgb.line .pgb-track { height: 3px; gap: 1px; }
.jcard .pgb { max-width: none; margin-top: 8px; }
.hq-pr .pgb { margin: 0; min-width: 130px; }
td.wo-st { min-width: 140px; }
.wo-crew { display: flex; gap: 3px; flex-wrap: wrap; margin-bottom: 2px; }
.jc-tech i[style*="--c"] { background: var(--c); color: #fff; }
.pgb-track span.s { background: repeating-linear-gradient(135deg, var(--line-strong) 0 2px, var(--surface-2) 2px 4px); }
