/* Shimly app — base styles (sign-in pages for now) */
:root {
    --ink: #2e2e2e;
    --ink-soft: #666;
    --line: #e3ddd2;
    --bg: #f4f2ee;
    --card: #ffffff;
    --accent: #2e2e2e;
    --accent-ink: #ffffff;
    --error-bg: #f8d7da; --error-ink: #842029; --error-line: #f5c2c7;
    --ok-bg: #e6f4ea;    --ok-ink: #1e5631;    --ok-line: #b7dfc2;
    --note-bg: #fff8e1;  --note-ink: #6d4c00;  --note-line: #ffe082;
    --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-size: 16px;
    line-height: 1.5;
}
a { color: var(--ink); }

.auth-body { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 16px 32px; }
.auth-card {
    width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 28px; box-shadow: 0 2px 6px rgba(0,0,0,.05);
}
@media (max-width: 480px) { .auth-body { padding-top: 24px; } .auth-card { padding: 22px 18px; } }

.brand { font-weight: 700; font-size: 20px; letter-spacing: .2px; margin-bottom: 14px; }
.env-badge { font-size: 11px; font-weight: 700; background: var(--note-bg); color: var(--note-ink); border: 1px solid var(--note-line); border-radius: 4px; padding: 2px 6px; vertical-align: middle; }
h1 { font-size: 21px; margin: 0 0 6px; }
.sub { color: var(--ink-soft); margin: 0 0 18px; font-size: 15px; }

label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
input[type=email], input[type=password], input[type=text], input[type=url], input[type=number] {
    width: 100%; font: inherit; padding: 11px 12px; border: 1px solid #c9c2b5; border-radius: 6px; background: #fff;
}
input:focus { outline: 2px solid #2e2e2e33; border-color: var(--ink); }
.code-input { font-size: 24px; letter-spacing: 6px; text-align: center; }
.check-row { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 14px 0; cursor: pointer; }
.check-row input { width: auto; margin: 0; }

.btn {
    display: inline-block; width: 100%; margin-top: 18px; padding: 12px 16px; font: inherit; font-weight: 600;
    background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; cursor: pointer; text-align: center; text-decoration: none;
}
.btn:hover { opacity: .92; }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid #c9c2b5; }

.alert { padding: 10px 12px; border-radius: 6px; margin: 0 0 14px; font-size: 14px; border: 1px solid; }
.alert-error { background: var(--error-bg); color: var(--error-ink); border-color: var(--error-line); }
.alert-ok    { background: var(--ok-bg);    color: var(--ok-ink);    border-color: var(--ok-line); }
.alert-note  { background: var(--note-bg);  color: var(--note-ink);  border-color: var(--note-line); }

.links { margin-top: 18px; text-align: center; font-size: 14px; line-height: 2; }
.hint { color: var(--ink-soft); font-size: 13px; margin-top: 6px; }

.choice-list { list-style: none; margin: 8px 0 0; padding: 0; }
.choice-list li + li { margin-top: 10px; }
.choice-list button {
    width: 100%; text-align: left; font: inherit; background: #fff; border: 1px solid var(--line); border-radius: 6px;
    padding: 12px 14px; cursor: pointer;
}
.choice-list button:hover { border-color: var(--ink); }
.choice-list .role { display: block; color: var(--ink-soft); font-size: 13px; }

.kv { margin: 12px 0 0; padding: 0; list-style: none; font-size: 15px; }
.kv li { padding: 6px 0; border-bottom: 1px solid #f0ebe2; }
.kv strong { display: inline-block; min-width: 120px; }

.auth-card-wide { max-width: 640px; }
.section { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }
.section h2 { font-size: 17px; margin: 0 0 6px; }
.status { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; margin-left: 6px; vertical-align: middle; }
.status-on { background: var(--ok-bg); color: var(--ok-ink); }
.status-off { background: #f1eee8; color: var(--ink-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }
.btn-inline { width: auto; padding: 9px 14px; margin-top: 10px; }
.btn-danger { background: #a12a2a; }
.steps { padding-left: 20px; margin: 8px 0 14px; }
.steps li { margin: 4px 0; }
.qr { background: #fff; border: 1px solid var(--line); display: inline-block; padding: 8px; border-radius: 6px; }
.qr svg { display: block; width: 210px; height: 210px; }
.key { font-family: Consolas, monospace; font-size: 16px; letter-spacing: 1px; background: #f7f5f0; padding: 8px 10px; border-radius: 4px; display: inline-block; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; font-family: Consolas, monospace; font-size: 17px;
         background: var(--note-bg); border: 1px solid var(--note-line); padding: 14px 18px; border-radius: 6px; max-width: 360px; }
.device { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0ebe2; flex-wrap: wrap; }
.device .muted, .muted { color: var(--ink-soft); font-size: 13px; }
.topnav { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; margin: -4px 0 16px; }
@media print {
    body * { visibility: hidden; }
    .print-me, .print-me * { visibility: visible; }
    .print-me { position: absolute; left: 0; top: 0; }
    .print-me .btn { display: none; }
}

/* =====================================================================
   Company screens: header, navigation, pages, tables, forms
   ===================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app-body { min-height: 100vh; }
.app-top { background: #2e2e2e; color: #fff; }
.app-top a { color: #fff; }
.app-top-inner { max-width: 1180px; margin: 0 auto; padding: 10px 16px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.app-brand { font-weight: 700; font-size: 19px; text-decoration: none; }
.app-company { font-size: 15px; color: #ddd; }
.app-company a { color: #bbb; font-size: 13px; }
.app-user { margin-left: auto; font-size: 14px; color: #bbb; }
.app-nav { max-width: 1180px; margin: 0 auto; padding: 6px 16px 0; display: flex; gap: 4px; overflow-x: auto; }
.app-nav a { padding: 9px 14px; text-decoration: none; color: #ddd; font-weight: 600; font-size: 15px; border-radius: 6px 6px 0 0; white-space: nowrap; }
.app-nav a:hover { color: #fff; background: #3c3c3c; }
.app-nav a.on { background: var(--bg); color: var(--ink); }
.app-banner { background: var(--note-bg); color: var(--note-ink); border-bottom: 1px solid var(--note-line); padding: 10px 16px; text-align: center; font-size: 14px; }
.app-main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 48px; }
@media (max-width: 600px) { .app-user { margin-left: 0; width: 100%; } }

.crumbs { font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }
.crumbs .sep { margin: 0 6px; color: #aaa; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.page-head h1 { font-size: 24px; margin: 0; overflow-wrap: anywhere; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.head-actions .btn, .page-head > .btn { margin-top: 0; }
form.inline { display: inline; margin: 0; }

.btn-inline { display: inline-block; width: auto; margin-top: 0; padding: 9px 16px; }
.btn-small { padding: 6px 12px; font-size: 14px; }
.btn-light { width: auto; margin-top: 0; padding: 9px 14px; background: #fff; color: var(--ink); border: 1px solid #c9c2b5; }
.btn-danger { background: #a12a2a; color: #fff; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.panel h2 { font-size: 17px; margin: 0 0 10px; }
.panel h3 { font-size: 15px; margin: 18px 0 6px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.panel-head h2 { margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.danger-zone { border-color: #e4b9b9; }
.danger-zone h2 { color: #8a1f1f; }

.details { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; margin: 0; }
.details dt { font-weight: 600; color: var(--ink-soft); font-size: 14px; }
.details dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .details { grid-template-columns: 1fr; gap: 2px; } .details dd { margin-bottom: 10px; } }
.notes { white-space: normal; background: #faf8f4; border: 1px solid #ece6db; border-radius: 6px; padding: 12px 14px; }
.note { font-size: 14px; color: var(--ink-soft); }
.empty { background: var(--card); border: 1px dashed #cfc7b8; border-radius: var(--radius); padding: 36px 16px; text-align: center; color: var(--ink-soft); }
.count-line { margin-top: 8px; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
input[type=search], input[type=tel], input[type=date], select, textarea {
    width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #c9c2b5; border-radius: 6px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
input[aria-invalid=true], select[aria-invalid=true] { border-color: #b02a37; background: #fff7f7; }
.field-error { color: #9b1c28; font-size: 13px; margin-top: 4px; }
.opt { font-weight: 400; color: var(--ink-soft); font-size: 13px; }
input.short { max-width: 180px; }

.table-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); background: #faf8f4; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.list td { padding: 11px 12px; border-bottom: 1px solid #f0ebe2; vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list .num { text-align: right; }
.row-link { font-weight: 600; }
@media (max-width: 760px) {
    table.list thead { display: none; }
    table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
    table.list tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
    table.list tr:last-child { border-bottom: 0; }
    table.list td { border: 0; padding: 3px 0; text-align: left !important; }
    table.list td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-soft); font-size: 13px; }
    table.list td:first-child::before { content: none; }
    table.list td:first-child { font-size: 16px; padding-bottom: 6px; }
    table.list td.blank { display: none; }
}
tr[hidden] { display: none !important; }

/* Status badges: always show the word; the shape/outline differs too, so color is never the only cue. */
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 10px; border: 1px solid; white-space: nowrap; vertical-align: middle; }
.badge-lead            { background: #fff; color: #5a5245; border-style: dashed; border-color: #a99f8e; }
.badge-pending_deposit { background: #fff8e1; color: #6d4c00; border-color: #e6c35c; }
.badge-scheduled       { background: #e8f0fb; color: #1f4b85; border-color: #a9c3e8; }
.badge-in_progress     { background: #2e2e2e; color: #fff; border-color: #2e2e2e; }
.badge-completed       { background: #e6f4ea; color: #1e5631; border-color: #9fd2ad; }
.badge-closed          { background: #f1eee8; color: #6a6358; border-color: #d6cfc2; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; }
.chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips legend { float: left; font-size: 13px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; margin-right: 6px; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; font-size: 14px; background: #fff; border: 1px solid #cfc7b8; border-radius: 18px; padding: 5px 12px; cursor: pointer; }
.chip input { margin: 0; width: 16px; height: 16px; }
.chip:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.chip-n { font-weight: 400; color: var(--ink-soft); font-size: 13px; }
.filter-links { font-size: 14px; }

.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; max-width: 760px; }
.form-section { font-size: 16px; margin: 24px 0 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid3, .grid2 { grid-template-columns: 1fr; } }
.seg { border: 0; padding: 0; margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.seg legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.seg label { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; cursor: pointer; }
.seg input { margin: 0; }
.with-button { display: flex; gap: 8px; align-items: stretch; }
.with-button select { flex: 1; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.form-actions .btn { margin-top: 0; }
[hidden] { display: none !important; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 16px; overflow-x: auto; }
.tabs a { padding: 9px 16px; text-decoration: none; font-weight: 600; color: var(--ink-soft); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
.project-sub { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: -6px 0 6px; font-size: 15px; }

.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li { padding: 10px 0; border-bottom: 1px solid #f0ebe2; }
.item-list li:last-child { border-bottom: 0; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { padding: 10px 0; border-bottom: 1px solid #f0ebe2; }
.activity li:last-child { border-bottom: 0; }
.activity.compact li { padding: 8px 0; font-size: 15px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; }
.stat:hover { border-color: var(--ink); }
.stat-n { display: block; font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat-l { color: var(--ink-soft); font-size: 14px; }

.dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.dialog::backdrop { background: rgba(0,0,0,.4); }
.dialog h2 { margin: 0 0 12px; font-size: 19px; }
.confirm-modal { width: min(460px, calc(100vw - 32px)); }
.confirm-modal p { margin: 0 0 12px; line-height: 1.5; }
.cm-list { margin: 0 0 16px; padding: 10px 14px 10px 32px; background: var(--bg, #f3f1ec); border: 1px solid var(--line); border-radius: 8px; font-weight: 600; }
.cm-list li { margin: 3px 0; }
.cm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.cm-actions .btn { width: auto; margin-top: 0; }
.form-card > label:first-of-type, .form-card > .seg:first-child { margin-top: 0; }

/* =====================================================================
   Estimates, invoices, payments
   ===================================================================== */
.form-card.wide { max-width: 1100px; }
.form-section.first { margin-top: 0; padding-top: 0; border-top: 0; }
.doc-for { margin: 0 0 12px; color: var(--ink-soft); }
.stats.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) { .stats.three { grid-template-columns: 1fr 1fr; } }
.stat-sm { font-size: 20px; }
.right { float: right; font-weight: 600; }
.mt4 { margin-top: 4px; }
.dim td { opacity: .6; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; font-weight: 600; }
.danger-text { color: #8a1f1f; }
.more-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.more-actions .btn { margin-top: 0; }
.accept-form { flex-basis: 100%; }
.accept-form label { margin-top: 0; }
.total-line { text-align: right; font-size: 17px; margin: 10px 4px 0; }
.total-line.big { font-size: 22px; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.filter-tabs a { padding: 8px 12px; text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 15px; border-bottom: 3px solid transparent; }
.filter-tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
.check-row.small { font-size: 13px; margin: 4px 0; }
.num-input { text-align: right; }
.group-row th { background: #faf8f4; text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); padding: 8px 12px; }
.sub-row td { font-size: 14px; color: var(--ink-soft); }
.pct-table input { width: 100%; max-width: 110px; padding: 7px 9px; }
.pct-table th[scope=row] { text-align: left; font-weight: 600; padding: 10px 12px; }
@media (max-width: 760px) { .pct-table tr th[scope=row] { display: block; padding: 0 0 6px; } }
.deposit-box { margin: 18px 0 0; border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; }
.deposit-box summary { cursor: pointer; font-weight: 600; }
.dep-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px 12px; }
.dep-grid label { margin: 0; font-size: 13px; font-weight: 600; }
.dep-grid input { margin-top: 4px; padding: 7px 9px; }
@media (max-width: 760px) { .dep-grid { grid-template-columns: repeat(2, 1fr); } }

/* Line editor */
.lines-head, .line { display: grid; grid-template-columns: 150px minmax(160px, 1fr) 64px 64px 92px 92px 112px 172px; gap: 8px; align-items: start; }
.lines-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); padding: 0 0 6px; }
.lines-head span:nth-child(n+3):nth-child(-n+7) { text-align: right; }
.line { padding: 8px 0; border-top: 1px solid #f0ebe2; }
.line-error { background: #fff7f7; }
.lc { display: block; margin: 0; font-weight: 400; }
.lc-l { display: none; }
.lc input, .lc select { padding: 8px 9px; font-size: 15px; }
.lc-qty input, .lc-cost input, .lc-price input { text-align: right; }
.lc-total { text-align: right; padding-top: 9px; font-weight: 600; }
.lc-act { display: flex; gap: 4px; justify-content: flex-end; }
input.derived { background: #f4f2ee; color: var(--ink-soft); }
.icon-btn { background: #fff; border: 1px solid #cfc7b8; border-radius: 6px; padding: 7px 9px; cursor: pointer; font: inherit; font-size: 13px; line-height: 1; }
.icon-btn:hover { border-color: var(--ink); }
.line-more { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: flex-end; background: #faf8f4; border-radius: 6px; padding: 8px 12px; }
.line-more[hidden] { display: none !important; }
.line-more .hint { flex-basis: 100%; margin: 0; }
.line-more label { margin: 0; font-size: 13px; font-weight: 600; }
.line-more label input[type=text] { width: 110px; padding: 6px 8px; margin-top: 3px; display: block; }
.line-more .check-row { margin: 0 0 6px; }
.line-msg { grid-column: 1 / -1; }
.lines-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.lines-total { text-align: right; font-size: 18px; }
.combo { position: relative; display: block; }
.combo-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid #c9c2b5; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; }
.combo-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid #f0ebe2; padding: 9px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.combo-item:hover, .combo-item:focus { background: #f4f2ee; }
@media (max-width: 900px) {
    .lines-head { display: none; }
    .line { grid-template-columns: 1fr 1fr 1fr; padding: 12px 0; }
    .lc-l { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 2px; }
    .lc-desc { grid-column: 1 / -1; order: -1; }
    .lc-type { grid-column: 1 / -1; }
    .lc-total { padding-top: 0; text-align: left; }
    .lc-act { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Status badges: words always shown; outline style varies too */
.badge-e-draft, .badge-i-draft { background: #fff; color: #5a5245; border-style: dashed; border-color: #a99f8e; }
.badge-e-sent, .badge-i-sent { background: #e8f0fb; color: #1f4b85; border-color: #a9c3e8; }
.badge-e-client_accepted, .badge-e-converted, .badge-i-paid { background: #e6f4ea; color: #1e5631; border-color: #9fd2ad; }
.badge-e-pending_deposit, .badge-i-partial { background: #fff8e1; color: #6d4c00; border-color: #e6c35c; }
.badge-e-expired, .badge-e-rejected, .badge-i-void { background: #f1eee8; color: #6a6358; border-color: #d6cfc2; }
.badge-i-overdue { background: #fbe9e9; color: #8a1f1f; border-color: #e4a5a5; border-width: 2px; }

/* Client document pages */
.client-body { background: #f4f2ee; }
.doc { max-width: 900px; margin: 24px auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 36px; }
@media (max-width: 600px) { .doc { margin: 0; border-radius: 0; border-left: 0; border-right: 0; padding: 20px 16px; } }
.doc-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.letterhead { font-size: 14px; line-height: 1.5; }
.lh-name { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.doc-title { text-align: right; font-size: 14px; }
.doc-title h1 { font-size: 26px; margin: 0 0 4px; text-transform: uppercase; letter-spacing: .06em; }
.doc-title .btn { margin-top: 8px; }
@media (max-width: 600px) { .doc-title { text-align: left; } }
.billto { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; margin-bottom: 18px; font-size: 15px; }
@media (max-width: 600px) { .billto { grid-template-columns: 1fr; } }
.doc-h2 { font-size: 16px; margin: 24px 0 8px; }
.doc-totals { margin: 12px 0 0 auto; max-width: 320px; font-size: 16px; }
.doc-totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.doc-totals .due { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 8px; font-size: 19px; }
.notes.small { font-size: 13px; }
.accept-box { margin-top: 26px; border: 2px solid var(--ink); border-radius: var(--radius); padding: 18px 20px; }
.accept-box h2 { margin: 0 0 8px; font-size: 19px; }
.accept-box .btn { margin-top: 10px; }
/* Paying in full: the client's two choices, as large tappable rows. */
.pay-choice { border: 0; padding: 0; margin: 4px 0 14px; }
.pay-choice legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.pay-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 8px; cursor: pointer; font-weight: 400; }
.pay-option input { width: auto; margin: 3px 0 0; flex: none; transform: scale(1.2); }
.pay-option > span { display: flex; flex-direction: column; gap: 2px; }
.pay-option:has(input:checked) { border: 2px solid var(--ink); padding: 11px 13px; background: #faf8f4; }
.pay-full-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px 4px; margin: 18px 0 0; }
.pay-full-box legend { font-weight: 700; padding: 0 6px; }
.pay-full-box .check-row { margin: 6px 0; }
.full-pay-form { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #faf8f4; }
.full-pay-form h3 { margin: 0 0 6px; font-size: 16px; }
.full-pay-form .check-row { margin: 8px 0; }
.short-field input { max-width: 140px; }
.doc-foot { margin-top: 32px; font-size: 12px; color: #999; text-align: center; }
@media print {
    .client-body { background: #fff; }
    .doc { border: 0; margin: 0; padding: 0; max-width: none; }
    .no-print, .doc-foot { display: none !important; }
    .client-body .doc, .client-body .doc * { visibility: visible; }
}

/* =====================================================================
   Left menu (replaces the top navigation)
   ===================================================================== */
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.side { position: fixed; top: 0; bottom: 0; left: 0; width: 232px; background: #2e2e2e; color: #ddd; overflow-y: auto; z-index: 40; padding: 0 0 24px; }
.side a { color: #ddd; }
.side-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 6px; }
.side-brand { font-weight: 700; font-size: 20px; color: #fff !important; text-decoration: none; }
.side-co { padding: 4px 18px 14px; border-bottom: 1px solid #444; font-size: 14px; }
.side-co strong { display: block; color: #fff; font-size: 15px; }
.side-co a { font-size: 13px; color: #bbb; }
.side-sec { padding: 12px 0 2px; }
.side-h { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9a948a; padding: 0 18px 4px; }
.side-sec a { display: block; padding: 8px 18px; text-decoration: none; font-weight: 600; font-size: 15px; border-left: 4px solid transparent; }
.side-sec a:hover { background: #3a3a3a; color: #fff; }
.side-sec a.on { background: #3f3f3f; color: #fff; border-left-color: #fff; }
.side-me { margin-top: 10px; border-top: 1px solid #444; }
.menu-close { display: none; }
.shell { margin-left: 232px; min-height: 100vh; }
.topbar { display: none; }
.app-main { max-width: 1180px; margin: 0; padding: 22px 28px 48px; }
@media (max-width: 900px) {
    .topbar { display: flex; align-items: center; gap: 12px; background: #2e2e2e; color: #ddd; padding: 10px 16px; position: sticky; top: 0; z-index: 30; }
    .topbar .side-brand { font-size: 18px; }
    .topbar-co { font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .menu-btn { color: #fff; border: 1px solid #777; border-radius: 6px; padding: 6px 12px; text-decoration: none; font-weight: 600; font-size: 14px; }
    .side { display: none; width: min(300px, 86vw); box-shadow: 4px 0 18px rgba(0,0,0,.35); }
    .side:target, body.menu-open .side { display: block; }
    body.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
    .menu-close { display: inline-block; color: #ddd; font-size: 14px; }
    .shell { margin-left: 0; }
    .app-main { padding: 16px 16px 40px; }
}
@media print { .side, .topbar { display: none !important; } .shell { margin-left: 0; } }
.phone-pair { display: grid; grid-template-columns: 1fr 84px; gap: 0 10px; }
.settings-tabs { margin-top: -4px; }
.sample-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.sample-row label { margin-bottom: 6px; }
.disclaimer { font-size: 13px; background: var(--note-bg); border: 1px solid var(--note-line); color: var(--note-ink); border-radius: 6px; padding: 10px 12px; margin: 14px 0 0; }
.module-list li { display: flex; justify-content: space-between; gap: 12px; }
.badge-on { background: #e6f4ea; color: #1e5631; border-color: #9fd2ad; }
.badge-off { background: #fff; color: #6a6358; border-color: #cfc7b8; border-style: dashed; }
.nowrap { white-space: nowrap; }
.inline-role { display: flex; gap: 6px; align-items: center; }
.inline-role select { width: auto; padding: 6px 8px; }
.role-pick { border: 0; padding: 0; margin: 14px 0 0; }
.role-pick legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 4px; }
.role-pick .check-row { align-items: flex-start; margin: 8px 0; }
.role-pick .check-row input { margin-top: 4px; }
.module-switch { display: flex; gap: 8px; align-items: center; }

/* On/off switches. The word On / Off always sits beside the switch, and the
   knob moves left/right, so colour is never the only cue. */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; border: 2px solid #8f877a; border-radius: 13px;
          background: #e7e2d8; padding: 0; margin: 0; cursor: pointer; vertical-align: middle; transition: background .15s, border-color .15s; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.35);
                transition: left .15s; }
.switch.is-on { background: #2e2e2e; border-color: #2e2e2e; }
.switch.is-on .knob { left: 22px; }
.switch:focus-visible { outline: 3px solid #8aa9d6; outline-offset: 2px; }
.switch.is-locked { cursor: default; opacity: .55; }
.switch-label { font-size: 14px; font-weight: 600; min-width: 28px; }
.module-switch { display: flex; gap: 10px; align-items: center; justify-content: flex-end; min-width: 160px; }
.module-switch form { display: flex; gap: 10px; align-items: center; margin: 0; }
.modules-panel { max-width: 860px; }
.module-list { list-style: none; margin: 14px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; }
.module-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid #f0ebe2; }
.module-list li:last-child { border-bottom: 0; }
.module-list li.is-child { padding-left: 38px; }
.module-text { flex: 1; min-width: 0; }
.module-text .muted { margin-top: 2px; }
.requires { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.modules-panel.soon summary { cursor: pointer; list-style: revert; }
.modules-panel.soon summary h2 { display: inline; }
@media (max-width: 560px) { .module-list li { flex-direction: column; align-items: flex-start; } .module-switch { justify-content: flex-start; min-width: 0; } .module-list li.is-child { padding-left: 28px; } }
/* Checkbox shown as a switch: <label class="check-row"><input type="checkbox" class="switch-input"> text</label> */
input.switch-input { -webkit-appearance: none; appearance: none; position: relative; width: 46px; height: 26px; flex: none; margin: 0;
                     border: 2px solid #8f877a; border-radius: 13px; background: #e7e2d8; cursor: pointer; transition: background .15s; }
input.switch-input::before { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
                             box-shadow: 0 1px 2px rgba(0,0,0,.35); transition: left .15s; }
input.switch-input:checked { background: #2e2e2e; border-color: #2e2e2e; }
input.switch-input:checked::before { left: 22px; }
input.switch-input:focus-visible { outline: 3px solid #8aa9d6; outline-offset: 2px; }

/* =====================================================================
   Photos
   ===================================================================== */
.upload-form input[type=file] { display: block; width: 100%; padding: 10px; border: 1px dashed #b9b1a3; border-radius: 6px; background: #fbfaf7; }
.gallery-group + .gallery-group { margin-top: 18px; }
.gallery-group h3 { font-size: 16px; margin: 0 0 10px; }
.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.photo-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.photo-thumb { display: block; aspect-ratio: 4 / 3; background: #ece8e0; overflow: hidden; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.photo-pdf { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--ink); padding: 10px; text-align: center; }
.pdf-icon { font-weight: 800; font-size: 15px; letter-spacing: .06em; border: 2px solid var(--ink); border-radius: 4px; padding: 10px 8px; background: #fff; }
.pdf-name { font-size: 13px; word-break: break-word; }
.photo-meta { padding: 8px 10px 10px; font-size: 14px; }
.photo-num { display: inline-block; font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.photo-cap { color: var(--ink); }
.photo-edit summary { cursor: pointer; font-weight: 600; font-size: 13px; margin-top: 4px; }
.photo-edit label { font-size: 13px; margin-top: 8px; }
.photo-edit input, .photo-edit select { font-size: 14px; padding: 6px 8px; }
.photo-edit .btn { margin-top: 8px; }
.photo-delete { margin-top: 8px; font-size: 13px; }
.viewer { width: min(1100px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 12px 14px; border: 0; border-radius: 10px; background: #1f1f1f; color: #f4f2ee; }
.viewer::backdrop { background: rgba(0,0,0,.75); }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 14px; }
.viewer-close { background: none; border: 1px solid #777; color: #f4f2ee; border-radius: 6px; padding: 6px 12px; font: inherit; cursor: pointer; }
.viewer figure { margin: 0; text-align: center; }
.viewer img { max-width: 100%; max-height: calc(100vh - 170px); object-fit: contain; display: inline-block; }
.viewer figcaption { margin-top: 8px; min-height: 1.2em; }
.viewer-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; }
.viewer-nav .btn { margin: 0; width: auto; }
.viewer-nav a { color: #f4f2ee; }
.upload-status { margin-top: 10px; font-weight: 600; }
.upload-status ul { margin: 6px 0; padding-left: 20px; font-weight: 400; }

/* =====================================================================
   Estimate reviews
   ===================================================================== */
.form-h { font-size: 17px; margin: 24px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-card .form-h:first-of-type { border-top: 0; padding-top: 0; margin-top: 10px; }
.choice-set { border: 0; padding: 0; margin: 0; }
.choice-set legend { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.choice-set .check-row { align-items: flex-start; margin: 8px 0; }
.choice-set .check-row input { margin-top: 4px; }
.choice-set .check-row .muted { display: block; font-size: 13px; }
.pick-grid { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pick-grid label { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 6px; cursor: pointer; font-weight: 400; margin: 0; background: #fff; }
.pick-grid input { width: auto; margin: 0 0 6px; }
.pick-grid img, .pick-pdf { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: #f1eee8; }
.pick-pdf { display: grid; place-items: center; font-weight: 700; color: var(--ink-soft); }
.pick-cap { display: block; font-size: 12px; margin-top: 4px; color: var(--ink-soft); }
.pick-grid label:has(input:not(:checked)) img { opacity: .4; }

.badge-r-open { background: var(--note-bg); color: var(--note-ink); border: 1px solid var(--note-line); }
.badge-r-submitted { background: #e8eefc; color: #1d3a7a; border: 1px solid #c5d3f3; }
.badge-r-closed, .badge-r-cancelled { background: #f1eee8; color: var(--ink-soft); border: 1px solid var(--line); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line); background: #f8f6f2; text-transform: uppercase; letter-spacing: .02em; }
.tag-add { border-style: solid; }
.tag-remove { text-decoration: line-through; }
.tag-comment { font-style: italic; }
.tag-accepted { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
.tag-rejected { background: #f1eee8; color: var(--ink-soft); }
.tag-pending { background: var(--note-bg); color: var(--note-ink); border-color: var(--note-line); }

.review-list { list-style: none; padding: 0; margin: 0; }
.review-list li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.review-list li:first-child { border-top: 0; }
.card-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.card-list .panel { margin: 0; }
.card-link { display: block; margin-bottom: 6px; font-size: 17px; }
.note-from p { margin: 0; white-space: normal; }

.rv-line { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 14px; margin: 0 0 12px; background: var(--card); min-width: 0; }
.rv-line.has-suggestion { border-left: 4px solid var(--ink); }
.rv-line legend { font-weight: 700; padding: 0 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rv-shared { margin: 2px 0 8px; font-size: 13px; color: var(--ink-soft); }
.rv-grid { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.rv-field { flex: 1 1 110px; min-width: 0; }
.rv-field.rv-wide { flex: 3 1 240px; }
.rv-field.rv-num { flex: 0 1 120px; }
.rv-field label, .rv-c-label { font-size: 13px; margin: 0 0 3px; display: block; font-weight: 600; }
.rv-field input, .rv-field select { margin: 0; }
.rv-line textarea { width: 100%; }
.rv-c-label { margin-top: 8px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); z-index: 2; display: flex; gap: 10px; flex-wrap: wrap; }

.rv-item { border-top: 1px solid var(--line); padding: 14px 0; }
.rv-item:first-of-type { border-top: 0; }
.rv-item.is-decided { opacity: .75; }
.rv-item-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.rv-flag { background: var(--note-bg); color: var(--note-ink); border: 1px solid var(--note-line); border-radius: 6px; padding: 8px 10px; font-size: 14px; }
.rv-quote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid #c9c2b5; background: #f8f6f2; border-radius: 0 6px 6px 0; }
.rv-quote-who { font-weight: 700; }
.rv-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.rv-actions .btn, .head-actions .btn-small { margin-top: 0; }
.diff { border-collapse: collapse; width: 100%; max-width: 640px; font-size: 14px; }
.diff th, .diff td { text-align: left; padding: 5px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.diff thead th { font-size: 12px; text-transform: uppercase; color: var(--ink-soft); letter-spacing: .03em; }
.diff tbody th { font-weight: 600; width: 130px; }
.diff del { color: var(--ink-soft); }
.send-back { display: inline-block; }
.send-back summary { list-style: none; display: inline-block; margin-top: 0; }
.send-back summary::-webkit-details-marker { display: none; }
.send-back[open] form { margin-top: 8px; max-width: 420px; }
.hint.small, .muted.small { font-size: 13px; }
@media (max-width: 640px) { .rv-field.rv-num { flex: 1 1 40%; } .diff tbody th { width: 90px; } }

/* =====================================================================
   Scope of work
   ===================================================================== */
.sow-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.sow-preview-col { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.sow-preview-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.sow-preview-bar h2 { font-size: 16px; margin: 0; }
.sow-paper { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.sow-paper .doc-head h1 { font-size: 22px; }
.sow-tabs { display: none; }
@media (max-width: 1100px) {
    .sow-layout { grid-template-columns: 1fr; }
    .sow-preview-col { position: static; max-height: none; display: none; }
    .sow-tabs { display: flex; gap: 0; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
    .sow-tabs button { flex: 1; padding: 10px; font: inherit; font-weight: 600; background: #fff; border: 0; cursor: pointer; }
    .sow-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }
    body.sow-show-preview .sow-preview-col { display: block; }
    body.sow-show-preview .sow-edit > *:not(.sow-tabs) { display: none; }
    body.sow-show-preview .sow-layout { display: block; }
}
.sow-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 12px; margin: 0 0 12px; min-width: 0; background: #fff; }
.sow-box legend { font-weight: 700; padding: 0 6px; }
.sow-box label { font-size: 13px; font-weight: 600; display: block; margin: 8px 0 3px; }
.sow-box label input, .sow-box label textarea { margin-top: 3px; font-weight: 400; }
.sow-row { display: flex; flex-wrap: wrap; gap: 0 10px; }
.sow-f { flex: 1 1 120px; min-width: 0; }
.sow-f-wide { flex: 3 1 220px; }
.sow-box-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.sow-box-act .btn { margin-top: 0; }
.sow-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sow-add .btn { margin-top: 0; }
.sow-lib select { width: auto; min-width: 220px; margin: 0; }
.sow-assign select { margin: 0; min-width: 150px; }
.sow-phase-totals { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }

.sow-check { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
.sow-check ul { list-style: none; padding: 0; margin: 6px 0 0; }
.sow-check li { display: flex; gap: 8px; padding: 3px 0; }
.sow-check-mark { width: 18px; flex: none; font-weight: 700; text-align: center; }
.sow-check li.is-todo .sow-check-mark { color: var(--ink-soft); }

.sow-intro { margin: 0 0 12px; }
.sow-phase { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.sow-phase-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.sow-phase h3 { font-size: 17px; margin: 0; }
.sow-n { color: var(--ink-soft); }
.sow-price { font-weight: 700; white-space: nowrap; }
.sow-when { margin: 2px 0 6px; color: var(--ink-soft); font-size: 14px; }
.sow-list h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); margin: 10px 0 2px; }
.sow-list ul, .sow-bullets { margin: 0; padding-left: 20px; }
.sow-list li, .sow-bullets li { margin: 2px 0; }
.sow-not_included li::marker { content: "✕  "; }
.sow-mark { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.sow-removed del { color: var(--ink-soft); }
.sow-days { font-size: 14px; color: var(--ink-soft); margin-top: 12px; }
.sow-total { font-size: 17px; }
.sow-signed { border-top: 2px solid var(--ink); margin-top: 22px; padding-top: 10px; }
.sow-in-estimate { border-top: 2px solid var(--line); margin-top: 24px; }
.sow-client-bar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.tag-change { background: var(--note-bg); color: var(--note-ink); border-color: var(--note-line); }
.badge-sow-draft { background: #fff; color: #5a5245; border-style: dashed; border-color: #a99f8e; }
.badge-sow-sent { background: #e8eefc; color: #1d3a7a; border-color: #c5d3f3; }
.badge-sow-signed { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
.lib-items { list-style: none; padding: 0; margin: 8px 0; max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
@media print { .sow-paper { border: 0; box-shadow: none; padding: 0; } .sow-phase { break-inside: avoid; } }

/* =====================================================================
   Schedule (Gantt)
   ===================================================================== */
.g-stats { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) { .g-stats { grid-template-columns: 1fr 1fr; } }
.g-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.g-toolbar .btn { margin-top: 0; }
.g-zoom { display: inline-flex; border: 1px solid #c9c2b5; border-radius: 6px; overflow: hidden; margin-right: 6px; }
.g-zoom a { padding: 6px 12px; text-decoration: none; color: var(--ink); background: #fff; font-size: 14px; font-weight: 600; }
.g-zoom a + a { border-left: 1px solid #c9c2b5; }
.g-zoom a.on { background: var(--ink); color: #fff; }
.g-wrap { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 14px; }
.g-grid { border-right: 2px solid #c9c2b5; overflow-x: auto; max-width: min(640px, 55vw); }
.g-chart { overflow-x: auto; }
.g-chart svg { display: block; }
.g-empty { padding: 20px; }
.g-table { border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.g-table thead th { height: 48px; box-sizing: border-box; padding: 0 6px; text-align: left; font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .02em; border-bottom: 1px solid #c9c2b5; vertical-align: bottom; padding-bottom: 6px; }
.g-table td { height: 40px; box-sizing: border-box; padding: 0 3px; border-bottom: 1px solid #ece7dd; vertical-align: middle; }
.g-table input { margin: 0; padding: 4px 6px; height: 30px; font-size: 13px; }
.g-table input[type=date] { width: 122px; padding: 4px; }
.g-table .g-name input[type=text] { width: 150px; }
.g-table .g-short { width: 40px; }
.g-table .g-after { width: 52px; }
.g-table td:nth-child(8) input { width: 84px; }
.g-table input.is-auto { background: #f4f2ee; color: var(--ink-soft); }
.g-num { width: 28px; text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.g-tr.lvl-2 .g-name { padding-left: 24px; }
.g-tr.lvl-2 .g-name::before { content: "└"; color: var(--ink-soft); margin-right: 4px; }
.g-tr.is-sum .g-name input, .g-tr.is-sum .g-name { font-weight: 700; }
.g-fin { min-width: 74px; }
.g-var { display: block; font-size: 11px; font-weight: 700; color: var(--ink-soft); line-height: 1.1; }
.g-act { white-space: nowrap; }
.g-act button { border: 1px solid #d8d2c6; background: #fff; border-radius: 4px; width: 21px; height: 26px; padding: 0; cursor: pointer; font-size: 12px; margin-left: 1px; }
.g-act button:hover { border-color: var(--ink); }
.tag-crit { display: inline-block; margin-left: 4px; font-size: 9px; padding: 0 4px; line-height: 1.5; background: #fff; border: 1px solid var(--ink); vertical-align: middle; }
.g-table tbody tr { height: 40px; }
.g-grid, .g-chart { min-width: 0; position: relative; }
.g-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 8px; }
.g-add .btn { margin-top: 0; }
.g-bar.is-editable[data-drag="move"] { cursor: grab; }
.g-handle { cursor: ew-resize; }
.g-help { margin: 0 0 16px; font-size: 14px; }
.g-help summary { cursor: pointer; font-weight: 600; }
.g-help code { background: #f1eee8; padding: 1px 5px; border-radius: 3px; }
.g-dayoff { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 10px; }
.g-dayoff > div { flex: 0 1 220px; }
.g-dayoff label { margin-top: 0; }
.g-dayoff .btn { margin-top: 0; }
.g-common { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; font-size: 14px; }
.g-common label { margin: 0; font-weight: 600; }
.g-common select { width: auto; margin: 0; }
.g-common .btn { margin-top: 0; }
.g-weekdays { display: flex; flex-wrap: wrap; gap: 0 18px; }
.g-overlap { white-space: normal; min-width: 140px; font-size: 12px; }
@media (max-width: 900px) {
    .g-wrap { grid-template-columns: minmax(0, 1fr); }
    .g-grid { max-width: none; border-right: 0; border-bottom: 2px solid #c9c2b5; }
}

/* =====================================================================
   Vendors, people and crews
   ===================================================================== */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 10px; font-size: 15px; }
dl.kv dt { color: var(--ink-soft); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tag-warn { background: var(--error-bg); color: var(--error-ink); border-color: var(--error-line); }
.add-ins summary { list-style: none; display: inline-block; margin-top: 10px; }
.add-ins summary::-webkit-details-marker { display: none; }
.add-ins[open] summary { margin-bottom: 10px; }
.w9-form { max-width: 620px; }
.member-pick { list-style: none; padding: 0; margin: 6px 0 0; columns: 2 220px; }
.member-pick li { break-inside: avoid; }
.member-pick .check-row { margin: 4px 0; }
.member-pick .muted { font-size: 13px; }

/* Schedule: "update the project's dates?" dialog */
#g-dates { width: min(540px, calc(100vw - 32px)); }
#g-dates .check-row { align-items: flex-start; }
#g-dates .check-row input { margin-top: 3px; }

/* ---------- Project dashboard (Overview tab) ---------- */
.dash { margin-bottom: 8px; }
.d-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.d-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.d-tile-l { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.d-tile-n { font-size: 26px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.d-tile-n-soft { color: var(--ink-soft); }
.d-tile-s { font-size: 13px; color: var(--ink-soft); margin: 0; }
.d-health { grid-column: span 2; }
@media (max-width: 560px) { .d-health { grid-column: auto; } .d-tiles { grid-template-columns: 1fr 1fr; } .d-health { grid-column: 1 / -1; } }
.d-reasons { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-soft); }
.d-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.d-status svg { flex: none; }
.d-status-big { font-size: 22px; gap: 10px; }
.d-status-big svg { width: 26px; height: 26px; }
.d-none { color: var(--ink-soft); font-weight: 600; }
.d-row { display: grid; gap: 16px; }
.d-row > .panel { margin-bottom: 0; min-width: 0; }
.d-row { margin-bottom: 16px; }
.d-row-progress { grid-template-columns: minmax(220px, 1fr) minmax(0, 2.6fr); }
.d-row-money { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.d-row-bottom { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.d-row-bottom:empty { display: none; }
@media (max-width: 860px) { .d-row-progress { grid-template-columns: minmax(0, 1fr); } }
.d-ring-panel { text-align: center; }
.d-ring-panel .muted { text-align: left; margin: 10px 0 0; }
.d-ring { display: block; margin: 4px auto 6px; max-width: 100%; height: auto; }
.d-mini { display: grid; grid-template-columns: auto auto; justify-content: center; gap: 2px 12px; margin: 0; font-size: 14px; text-align: left; }
.d-mini dt { color: var(--ink-soft); } .d-mini dd { margin: 0; font-weight: 700; }
.d-chart { display: block; width: 100%; height: auto; }
.d-legend { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-soft); }
.d-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.d-key-fill { display: inline-block; width: 18px; height: 10px; background: var(--ink); border-radius: 2px; }
.d-key-plan { display: inline-block; width: 0; height: 14px; border-left: 2px dashed var(--ink); vertical-align: middle; margin-left: 4px; }
.d-table-view { margin-top: 8px; font-size: 14px; }
.d-table-view summary { cursor: pointer; }
.d-table-view .d-table { margin-top: 8px; max-width: 420px; }
.d-table-wrap { overflow-x: auto; }
.d-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.d-table th { text-align: left; font-size: 12px; color: var(--ink-soft); font-weight: 700; border-bottom: 1px solid var(--line); padding: 6px 8px; white-space: nowrap; }
.d-table td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: middle; }
.d-bar { position: relative; display: block; height: 12px; background: #ece7dd; border-radius: 6px; min-width: 60px; }
.d-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); border-radius: 6px; }
.d-bar-plan { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2px dashed var(--ink); margin-left: -1px; }
.d-tile .d-bar { margin-top: 6px; }
.d-ev { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.d-ev > div { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.d-ev-n { font-size: 20px; font-weight: 700; }
.d-ev-l { font-size: 13px; font-weight: 700; }
.d-ev-h { font-size: 12px; color: var(--ink-soft); }
.d-money { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; margin: 0 0 12px; }
.d-money dt { font-weight: 600; font-size: 14px; }
.d-money dd { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; font-weight: 700; font-size: 14px; }
.d-facts { margin: 0; padding-left: 18px; font-size: 14px; }
.d-facts li { margin: 4px 0; }
.d-phases { list-style: none; margin: 0; padding: 0; }
.d-phases li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(120px, 1fr) minmax(0, 1.2fr); gap: 6px 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.d-phases li:last-child { border-bottom: 0; }
.d-ph-name { display: flex; flex-direction: column; min-width: 0; }
.d-ph-nums { font-size: 13px; }
@media (max-width: 700px) { .d-phases li { grid-template-columns: minmax(0, 1fr); } }
.d-upcoming { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.d-upcoming li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.d-upcoming li:last-child { border-bottom: 0; }
.d-up-day { flex: none; width: 84px; font-weight: 700; }
.d-photos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.d-photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.d-chart-scroll { overflow-x: auto; }
@media (max-width: 700px) { .d-chart-scroll .d-chart { min-width: 560px; } }
.d-key-hatch { display: inline-block; width: 18px; height: 10px; border: 1.5px solid var(--ink); border-radius: 2px; background: repeating-linear-gradient(45deg, #fff 0 2px, var(--ink) 2px 3.5px); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form.inline { display: inline; margin-left: 10px; }
.row-actions .link-btn { margin-left: 8px; }
tr.is-off td { color: var(--ink-soft); }
.x-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.x-filters > div { display: flex; flex-direction: column; min-width: 0; }
.x-filters label { font-size: 13px; margin: 0 0 4px; }
.x-filters select, .x-filters input[type=date], .x-filters input[type=search] { margin: 0; }
.x-filters .check-row { margin: 0 0 10px; }
.x-filters [hidden] { display: none; }
.num { text-align: right; white-space: nowrap; }
.receipt-now { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 4px 0 8px; }
.cat-form { padding: 6px 0; }
.x-phase-table td.num, .x-phase-table th.num { text-align: right; }
/* Big money figures in stat tiles fit a phone */
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { min-width: 0; }
@media (max-width: 700px) { .stats, .stats.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .stat-n { font-size: 19px; white-space: nowrap; letter-spacing: -.3px; } .stat { padding: 12px 10px; min-width: 0; } }
@media (max-width: 360px) { .stat-n { font-size: 17px; } }
.d-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.d-ph-nums .muted { margin-top: 2px; }
[data-expense-form] .check-row { margin-top: 18px; }
.seg-stack { flex-direction: column; gap: 10px; margin-top: 18px; }
[data-expense-form] .seg-stack + label { margin-top: 18px; display: block; }

/* ---------- Assignments (task_assign.php), Who's where, My schedule ---------- */
.g-who { display: block; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.ta-when { margin: 0; }
.ta-card .panel-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ta-notify { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 8px; }
.ta-notify .check-row { margin: 0; }
.ta-members { list-style: none; margin: 0; padding: 0; }
.ta-members > li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.ta-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 14px; }
.ta-release summary { cursor: pointer; font-weight: 600; text-decoration: underline; }
.ta-release[open] { flex-basis: 100%; }
.ta-release form { margin-top: 8px; }
.ta-days { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-left: 26px; }
.ta-open { font-weight: 700; font-size: 13px; }
.ta-add select { max-width: 520px; }
.ww-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.ww-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ww-scroll { position: relative; overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.ww { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.ww th, .ww td { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 6px; vertical-align: top; }
.ww thead th { font-size: 12px; font-weight: 700; text-align: center; white-space: nowrap; background: #faf8f4; }
.ww td { width: 84px; min-width: 84px; max-width: 84px; }
.ww-who { position: sticky; left: 0; background: var(--card); text-align: left; min-width: 150px; font-weight: 600; z-index: 1; }
.ww-who .muted { display: block; font-weight: 400; font-size: 12px; }
.ww thead .ww-who { background: #faf8f4; }
.ww-offcol { background: #f1eee8; }
.ww-today { box-shadow: inset 0 -3px 0 var(--ink); }
.ww-off { color: var(--ink-soft); font-size: 12px; }
.ww-job { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ww-open { display: inline-block; border: 1px dashed var(--ink); border-radius: 4px; padding: 0 6px; font-weight: 700; }
.ww-clash { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.ww-jobs { display: block; font-size: 11px; line-height: 1.3; }
.ww-section th { text-align: left; background: #faf8f4; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.ms-days { list-style: none; margin: 0; padding: 0; }
.ms-days > li h2 { font-size: 16px; }
.ms-items { list-style: none; margin: 0; padding: 0; }
.ms-items > li { padding: 8px 0; border-top: 1px solid var(--line); }
.ms-items > li:first-child { border-top: 0; }
.ms-released { color: var(--ink-soft); }
.ww-job { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
/* Time */
.tm-me { margin: 6px 0 14px; font-weight: 600; }
.label-like { display: block; font-weight: 600; font-size: 14px; margin-top: 14px; }
.tm-bill { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 4px; }
.tm-bill select { width: auto; margin: 0; }
.tm-week td { text-align: right; }
[data-time-form] [hidden] { display: none; }
[data-time-form] .seg { margin-top: 16px; } [data-time-form] .grid3 + label, [data-time-form] .grid3 + .grid3 + label { margin-top: 14px; display: block; }
/* Change orders */
.badge-co-draft { background: #fff; color: #5a5245; border-style: dashed; border-color: #a99f8e; }
.badge-co-sent { background: #e8f0fb; color: #1f4b85; border-color: #a9c3e8; }
.badge-co-approved { background: #e6f4ea; color: #1e5631; border-color: #9fd2ad; }
.badge-co-declined, .badge-co-void { background: #f1eee8; color: #5a5245; border-color: #cfc7b8; }
.copy-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.copy-row input { flex: 1 1 260px; margin: 0; }
.copy-row .btn { width: auto; margin: 0; }
.co-decline { margin-top: 12px; }
.co-decline summary { cursor: pointer; font-weight: 600; text-decoration: underline; }
.co-summary { margin: 12px 0; }

/* ---------------------------------------------------------------- client portal */
.portal-body { min-height: 100vh; display: flex; flex-direction: column; }
.pt-top { background: #fff; border-bottom: 1px solid var(--line); }
.pt-top-in { max-width: 900px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pt-brand { font-size: 19px; font-weight: 700; text-decoration: none; }
.pt-nav { display: flex; align-items: center; gap: 16px; font-size: 15px; }
.pt-nav form { margin: 0; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }
.pt-main { flex: 1; width: 100%; max-width: 900px; margin: 0 auto; padding: 22px 16px 32px; box-sizing: border-box; }
.pt-foot { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 18px 16px 28px; }
.pt-foot span { font-size: 12px; }
.pt-h1 { font-size: 26px; margin: 0 0 6px; }
.pt-h3 { font-size: 15px; margin: 14px 0 8px; color: var(--ink-soft); }
.pt-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; }
.pt-card h2 { font-size: 18px; margin: 0 0 12px; }
.pt-signin { max-width: 460px; margin: 20px auto; }
.pt-signin h1 { font-size: 22px; margin: 0 0 12px; }
.pt-welcome { background: #fff; border-left: 4px solid var(--ink); padding: 12px 16px; margin: 10px 0 16px; border-radius: 4px; }
.pt-owed { background: var(--note-bg); border: 1px solid var(--note-line); color: var(--note-ink); padding: 12px 16px; border-radius: 6px; margin: 10px 0 16px; }
.pt-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
a.pt-project { text-decoration: none; color: var(--ink); margin: 0; }
a.pt-project:hover, a.pt-project:focus { border-color: var(--ink); }
.pt-project h2 { margin: 8px 0 2px; }
.pt-open { display: inline-block; margin-top: 12px; font-weight: 600; text-decoration: underline; }
.pt-stage { display: inline-block; font-size: 13px; font-weight: 600; background: #f1eee8; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.pt-stage-big { font-size: 15px; padding: 5px 14px; }
.pt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pt-bar { height: 14px; background: #ece7de; border-radius: 7px; overflow: hidden; margin-top: 12px; border: 1px solid #ddd5c7; }
.pt-bar-fill { height: 100%; background: var(--ink); }
.pt-bar-l { margin-top: 6px; font-size: 15px; }
.pt-dates { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 12px; }
.pt-dates div { display: flex; flex-direction: column; }
.pt-list { list-style: none; margin: 0; padding: 0; }
.pt-list > li { padding: 12px 0; border-bottom: 1px solid #f0ebe2; }
.pt-list > li:last-child { border-bottom: 0; }
.pt-inv { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 16px; align-items: center; }
.pt-inv-amt { text-align: right; font-size: 17px; }
.pt-inv-act form { margin: 0; }
.pt-inv-act .btn { margin: 0; }
.pt-inv-note { grid-column: 1 / -1; }
.pt-late { color: var(--error-ink); }
.pt-docs li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pt-phases { list-style: none; margin: 0; padding: 0; }
.pt-ph { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0ebe2; }
.pt-ph:last-child { border-bottom: 0; }
.pt-ph-mark { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.pt-ph-done .pt-ph-mark { background: var(--ink); color: #fff; }
.pt-ph-next { color: var(--ink-soft); }
.pt-ph-next .pt-ph-mark { border-style: dashed; border-color: #9a9286; }
.pt-ph-state { font-size: 14px; font-weight: 600; }
.pt-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.pt-photos figure { margin: 0; }
.pt-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; background: #eee; }
.pt-photos figcaption { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.pt-pdf { display: flex; align-items: center; justify-content: center; text-align: center; aspect-ratio: 4 / 3; background: #f1eee8; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; padding: 6px; }
.pt-ask { color: var(--ink-soft); }
.small { font-size: 13px; }
.doc-back { max-width: 900px; margin: 16px auto -8px; padding: 0 4px; font-size: 15px; }
.pay-box { border: 1px solid var(--line); background: #faf8f4; border-radius: 6px; padding: 14px 16px; margin: 18px 0; }
.pay-box .btn { margin-top: 0; }
.pay-box p { margin: 8px 0 0; }
@media (max-width: 600px) {
    .pt-card { padding: 16px; }
    .pt-inv { grid-template-columns: 1fr auto; }
    .pt-inv-act { grid-column: 1 / -1; }
    .pt-inv-act .btn { width: 100%; }
    .doc-back { margin: 10px 16px 6px; }
}
.photo-share { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; margin-top: 4px; }
.photo-share form { margin: 0; }
.connect-box { border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; background: #faf8f4; margin: 10px 0 14px; }
.connect-box p { margin: 6px 0; }
.made-by a { color: inherit; }
.app-foot { margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 13px; }
.auth-foot { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 16px; }
.due-list { margin: 4px 0 8px 20px; padding: 0; }
.due-list li { margin: 3px 0; }
.setup-steps { background: #faf8f4; border: 1px solid var(--line); border-radius: 6px; padding: 12px 18px; margin: 10px 0 14px; }
.setup-steps h3 { margin: 4px 0 8px; font-size: 16px; }
.setup-steps ol { margin: 0 0 8px 20px; padding: 0; }
.setup-steps li { margin: 6px 0; line-height: 1.5; }
.ai-photos { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.ai-photos img { width: 96px; height: 72px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.ai-table td .tag { margin-right: 6px; }

/* Phones (Update 23): iPhone Safari zooms into any field under 16px, so fields get 16px on small screens;
   bigger tap targets on touch screens; long things wrap instead of pushing the page sideways. */
@media (max-width: 760px) {
    input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea, .lc input, .lc select { font-size: 16px; }
    .with-button { flex-wrap: wrap; }
    .with-button input, .with-button select { flex: 1 1 100%; min-width: 0; }
    .with-button .btn, .with-button button { flex: 1 1 auto; margin-top: 0; }
}
@media (pointer: coarse) {
    .link-btn { min-height: 32px; padding: 4px 2px; }
    input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-width: 20px; flex-shrink: 0; }
    input[type=file] { min-height: 40px; padding: 6px 0; }
}

/* Safari / iPhone (Update 23) */
/* iPhone Safari draws an empty date field shorter than a filled one and centres the date; keep them the same height, left-aligned. */
input[type=date] { -webkit-appearance: none; appearance: none; min-height: 44px; }
input[type=date]::-webkit-date-and-time-value { text-align: left; }
.g-table input[type=date] { min-height: 0; }
/* On iPhone, 100vh includes the strip behind Safari's toolbar, so tall pop-ups could hide their buttons. dvh is the visible height. */
@supports (height: 100dvh) {
    .dialog { max-height: calc(100dvh - 32px); }
    .viewer { max-height: calc(100dvh - 24px); }
    .viewer img { max-height: calc(100dvh - 170px); }
    .sow-preview-col { max-height: calc(100dvh - 24px); }
}

/* Settings → Email (Update 24) */
.email-type-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.email-type-head h2 { margin-bottom: 2px; }
.email-type-head p { margin-top: 0; }
.email-frame { display: block; width: 100%; height: 900px; border: 1px solid var(--line); border-radius: var(--radius); background: #f4f2ee; }
@media (max-width: 640px) { .email-frame { height: 1100px; } }
/* Email activity (Update 24) */
.ea-list { list-style: none; margin: 0; padding: 0; }
.ea-item { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; }
.ea-sym { display: inline-block; width: 1.2em; text-align: center; font-weight: 700; }
.ea-opened .ea-state strong { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ea-meta { font-size: 13px; color: var(--ink-soft); margin-top: 3px; overflow-wrap: anywhere; }
.ea-more { margin-top: 6px; font-size: 13px; }
.ea-more ul { margin: 6px 0 0; padding-left: 18px; }
/* Reports (Update 24) */
.report-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.report-bar .filter-tabs { margin-bottom: 0; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.range-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 4px 0 14px; }
.range-form > div { width: 170px; }
.range-form label { margin-top: 0; }
.table-scroll { overflow-x: auto; }
@media (min-width: 761px) { .report-table { min-width: 860px; } .report-table td:first-child { min-width: 170px; } }
.report-table tfoot th, .report-table tfoot td { font-weight: 700; background: #faf8f4; border-top: 2px solid var(--line); padding: 10px 12px; }
.share { display: inline-block; width: 90px; height: 10px; background: #efe9df; border: 1px solid #d9d1c3; border-radius: 3px; vertical-align: middle; overflow: hidden; }
.share-bar { display: block; height: 100%; background: var(--ink); }
.print-only { display: none; }
@media print {
    .print-only { display: block; }
    .report-print { width: 100%; }
    .report-print .table-scroll { overflow: visible; }
    .report-print details { display: block; }
    .report-print a { color: inherit; text-decoration: none; }
}
/* Statement of gross earnings */
.statement-tools { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.statement-total { border: 2px solid var(--ink); border-radius: 8px; padding: 16px 18px; margin: 22px 0; text-align: center; }
.statement-amount { font-size: 34px; font-weight: 700; margin: 4px 0; }
.statement-basis { font-size: 13px; color: var(--ink-soft); margin-top: 22px; }
.statement-sign { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 24px; margin-top: 46px; font-size: 13px; color: var(--ink-soft); }
.sign-line { display: block; border-bottom: 1px solid var(--ink); height: 34px; margin-bottom: 4px; }
@media (max-width: 600px) { .statement-sign { grid-template-columns: 1fr; } .statement-amount { font-size: 28px; } }
table.doc-lines { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0 18px; }
table.doc-lines th, table.doc-lines td { padding: 7px 8px; border-bottom: 1px solid #e8e2d7; text-align: left; vertical-align: top; }
table.doc-lines thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); border-bottom: 2px solid var(--ink); }
table.doc-lines tfoot th, table.doc-lines tfoot td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 700; }
table.doc-lines .num { text-align: right; white-space: nowrap; }
/* Website inquiry form (Update 24) */
.inq-h1 { font-size: 24px; margin: 6px 0 10px; }
.inq-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.inq-form .btn-full { margin-top: 18px; }
.inq-embed { margin: 0; background: transparent; }
.inq-embed main { max-width: 640px; padding: 12px; }
.inq-made { font-size: 12px; color: var(--ink-soft); margin-top: 16px; }
.inq-list .inq-msg { white-space: pre-line; margin: 6px 0; }
.code-box { width: 100%; font-family: Consolas, monospace; font-size: 13px; }
.row-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.row-buttons form { margin: 0; }
.mt0 { margin-top: 0; }
table.list tbody th[scope=row] { text-transform: none; letter-spacing: 0; background: none; font-size: 15px; color: var(--ink); font-weight: 600; padding: 11px 12px; border-bottom: 1px solid #f0ebe2; }
@media (max-width: 760px) { .code-box { font-size: 16px; } }
@media (max-width: 480px) { table.doc-lines { font-size: 13px; } table.doc-lines th, table.doc-lines td { padding: 6px 4px; } }
/* Settings → Billing (Update 25) */
.app-banner-soft { background: #faf8f4; color: var(--ink); border-bottom-color: var(--line); }
.plan-pick { border: 0; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.plan-pick legend { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.plan-option { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-weight: 400; margin: 0; cursor: pointer; }
.plan-option input { grid-row: 1 / span 3; margin-top: 3px; }
.plan-option .plan-name { font-weight: 700; }
.plan-option:has(input:checked) { border: 2px solid var(--ink); padding: 11px 13px; }

/* Update 26: blocked senders list, Cloudflare Turnstile box */
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 6px 0; border-bottom: 1px solid #eee8dc; overflow-wrap: anywhere; }
.plain-list li:last-child { border-bottom: 0; }
.inline-form { display: inline; margin: 0; }
.cf-turnstile { margin: 14px 0 4px; min-height: 65px; }

/* Update 27: daily logs, to-dos, weather */
.day-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.day-pick { display: inline-flex; gap: 6px; align-items: center; }
.day-pick input[type=date] { width: auto; margin: 0; }
.pre { white-space: pre-line; }
input.short { max-width: 120px; }
.log-weather { border: 1px solid #e6dfd2; border-radius: var(--radius); padding: 10px 14px 4px; margin: 14px 0; }
.log-weather legend { font-weight: 600; padding: 0 6px; }
.log-list .log-row { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid #eee8dc; }
.log-list .log-row:last-child { border-bottom: 0; }
.log-list .log-when a { font-weight: 600; }
.log-list .log-sum { overflow-wrap: anywhere; }
@media (max-width: 600px) { .log-list .log-row { grid-template-columns: minmax(0, 1fr); } }
.wx-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.wx-day { border: 1px solid #e6dfd2; border-radius: var(--radius); padding: 8px 10px; background: var(--card); font-size: 14px; }
.wx-day .wx-d { font-weight: 600; display: block; }
.wx-day .wx-t { font-size: 17px; font-weight: 600; display: block; margin: 2px 0; }
.wx-day .wx-x { color: var(--ink-soft); font-size: 13px; display: block; overflow-wrap: anywhere; }
.wx-day.wx-warn { border-width: 2px; border-style: dashed; }
.wx-table td, .wx-table th { white-space: nowrap; }
.tag-wx { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 10px; border: 1px dashed currentColor; margin-left: 6px; cursor: help; }
.wx-watch li { margin: 6px 0; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list > li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #eee8dc; }
.todo-list > li:last-child { border-bottom: 0; }
.todo-list .todo-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.todo-list .todo-meta { font-size: 13px; color: var(--ink-soft); }
.todo-list .is-done .todo-title { text-decoration: line-through; color: var(--ink-soft); }
.todo-tick { margin: 2px 0 0; }
.todo-tick button { width: 26px; height: 26px; border: 2px solid var(--ink-soft); border-radius: 6px; background: #fff; cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.todo-late { font-weight: 600; }
.checklist { list-style: none; padding: 0; margin: 6px 0 0; }
.checklist li { font-size: 14px; }
.log-delete { margin: 12px 0 18px; }

/* Update 28: documents, selections */
.doc-list { list-style: none; margin: 0 0 18px; padding: 0; }
.doc-list > li { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #eee8dc; }
.doc-list > li:last-child { border-bottom: 0; }
.doc-main { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.doc-meta { display: block; font-size: 13px; color: var(--ink-soft); }
.doc-soon { font-weight: 600; }
.doc-edit { flex-basis: 100%; }
.doc-edit summary { cursor: pointer; font-size: 14px; }
.doc-edit form { margin: 8px 0; }
.sel-card { border: 1px solid #e6dfd2; border-radius: var(--radius); padding: 14px; margin: 0 0 14px; background: var(--card); }
.sel-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; justify-content: space-between; }
.sel-head h3 { margin: 0; font-size: 17px; }
.sel-facts { font-size: 14px; color: var(--ink-soft); margin: 4px 0 8px; }
.sel-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; margin: 10px 0; }
.sel-opt { border: 1px solid #e6dfd2; border-radius: var(--radius); padding: 10px; background: #fff; min-width: 0; overflow-wrap: anywhere; }
.sel-opt.is-chosen { border-width: 3px; }
.sel-opt img { width: 100%; height: 150px; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 8px; background: #f2efe9; }
.sel-opt .sel-price { font-weight: 600; display: block; margin: 2px 0; }
.sel-opt .sel-diff { font-size: 13px; color: var(--ink-soft); display: block; }
.sel-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; border: 1px solid currentColor; }
.sel-totals { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.pt-sel { border-top: 1px solid #eee8dc; padding-top: 10px; margin-top: 10px; }

/* Update 29: messaging */
.msg-list { list-style: none; margin: 0; padding: 0; }
.msg-list li { border-bottom: 1px solid #eee8dc; }
.msg-list li:last-child { border-bottom: 0; }
.msg-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; color: inherit; text-decoration: none; }
.msg-list a:hover .msg-who, .msg-list a:focus .msg-who { text-decoration: underline; }
.msg-list .msg-who { font-weight: 600; overflow-wrap: anywhere; }
.msg-list .msg-when { font-size: 13px; color: var(--ink-soft); text-align: right; }
.msg-list .msg-job, .msg-list .msg-snip { grid-column: 1 / -1; font-size: 14px; color: var(--ink-soft); overflow-wrap: anywhere; }
.msg-list .is-unread .msg-snip { color: var(--ink); }
.msg-new { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; border: 2px solid currentColor; margin-left: 4px; }
.msg-pick { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.msg-pick select { width: auto; margin: 0; max-width: 100%; }
.msg { border: 1px solid #e6dfd2; border-radius: var(--radius); padding: 10px 12px; margin: 0 0 10px; max-width: 640px; background: #fff; overflow-wrap: anywhere; }
.msg-out { margin-left: auto; border-left: 4px solid var(--ink); }
.msg-in { margin-right: auto; border-right: 4px dashed var(--ink-soft); }
.msg-meta { font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.msg-body { white-space: pre-line; }
.msg-warn { font-size: 13px; font-weight: 600; margin: 4px 0; }

/* Update 30: purchase orders, bids */
.po-lines input { margin: 0; }
.po-lines td:first-child { min-width: 220px; }
.check-cols { columns: 2 260px; column-gap: 24px; }
.check-cols .check-row { margin: 6px 0; break-inside: avoid; }
.award-form { margin-top: 8px; min-width: 220px; }
.bid-table td { vertical-align: top; }

/* Warranty Requests (Update 31) */
.w-months { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.w-months input { width: 90px; padding: 8px 10px; }
.w-months select { width: auto; margin: 0; }
.w-months label { margin: 0; }
.w-head + .details { margin-top: 14px; }
.w-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: baseline; }
.w-status { font-weight: 600; white-space: nowrap; }
.w-photo { width: 100%; height: 160px; object-fit: cover; border-radius: var(--radius); border: 1px solid #e6dfd2; display: block; }

/* Automations & Alerts (Update 31) */
.auto-rule { padding-bottom: 14px; }
.auto-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: center; }
.auto-state { font-weight: 600; font-size: 14px; }
.auto-opts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 6px 0 10px; }
.auto-opts label { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.auto-opts input { width: 80px; padding: 6px 8px; }
.auto-list { margin: 0 0 14px; padding-left: 20px; }
.auto-list li { margin: 0 0 6px; }
.inline-label { margin: 0; }

/* QuickBooks / Xero sync (Update 32) */
.acct-connect { border-top: 1px solid #e6dfd2; padding-top: 6px; margin-top: 14px; }
.acct-connect input[type=date] { width: auto; }
.acct-list { list-style: none; margin: 0; padding: 0; }
.acct-list li { padding: 10px 0; border-bottom: 1px solid #efe9de; }
.acct-list li:last-child { border-bottom: 0; }
ul.tight li { margin: 0 0 4px; }

/* The Shimly logo, as on shimlyapp.com: cedar wedge + "Shimly" in Archivo (wide, heavy). Only the logo uses this font. */
@font-face { font-family: "Archivo"; src: url("archivo.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
.logo { display: inline-flex; align-items: center; gap: .4em; line-height: 1; vertical-align: middle; }
.logo-mark { width: 1.9em; height: .83em; flex: none; }
.logo-word { font-family: "Archivo", system-ui, sans-serif; font-weight: 800; font-stretch: 125%; letter-spacing: -0.01em; color: #24272a; }
.logo-dark .logo-word { color: #fff; }
.logo-sub { font-weight: 600; font-size: .62em; letter-spacing: .04em; text-transform: uppercase; color: #6a7075; margin-left: .15em; }
.logo-dark .logo-sub { color: #c9cdd0; }
/* Install the app (Update 38) */
.install-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.install-grid .panel { margin: 0; }
.install-steps { padding-left: 22px; margin: 0 0 10px; }
.install-steps li { margin-bottom: 8px; }
/* Installed on a phone: leave room for the clock and the home bar. */
@supports (padding: env(safe-area-inset-top)) {
    @media (display-mode: standalone) {
        .topbar { padding-top: calc(10px + env(safe-area-inset-top)); }
        .app-main { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
    }
}
/* Keep me signed in (Update 39) */
.keep-hint { margin: -8px 0 6px 26px; font-size: 13px; }
.device-list { list-style: none; padding: 0; margin: 0 0 12px; }
.device-list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* Subs signed in (Update 40) */
.sub-intro { margin: -4px 0 16px; color: var(--ink-soft); }
.sub-h3 { font-size: 15px; margin: 18px 0 6px; }
.sub-work { list-style: none; padding: 0; margin: 0 0 8px; }
.sub-work li { display: grid; grid-template-columns: 170px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sub-work li:last-child { border-bottom: 0; }
.sw-dates { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.sw-main > div { margin-top: 2px; }
.sub-msgs { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 16px; align-items: start; }
.sub-msgs .panel { margin: 0; }
.thread-list { list-style: none; padding: 0; margin: 0 0 12px; }
.thread-list li a { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 6px; text-decoration: none; color: inherit; }
.thread-list li.on a, .thread-list li a:hover { background: #f4f2ee; }
.thread-list li.on a { box-shadow: inset 3px 0 0 var(--ink); }
.sub-chat { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 10px; }
.sub-chat .chat { max-width: 85%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.sub-chat .chat-them { background: #faf8f4; align-self: flex-start; }
.sub-chat .chat-me { background: #fff; align-self: flex-end; border-color: #c9c2b5; }
.chat-who { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-bottom: 4px; }
@media (max-width: 760px) {
    .sub-work li { grid-template-columns: 1fr; gap: 4px; }
    .sub-msgs { grid-template-columns: 1fr; }
    .sub-chat .chat { max-width: 100%; }
}
/* Bills from subs (Update 41) */
.bill-img { max-width: 100%; max-height: 520px; border: 1px solid var(--line); border-radius: 6px; display: block; }
/* Lien waivers (Update 42) */
.waiver-doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 30px; max-width: 760px; }
.waiver-text { font-family: Georgia, "Times New Roman", serif; font-size: 16px; line-height: 1.6; }
.waiver-sig { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--ink); }
.waiver-sig p { margin: 4px 0; }
.seg-col { border: 0; padding: 0; margin: 0 0 6px; }
.seg-col legend { font-weight: 700; margin-bottom: 4px; }
.seg-col .check-row { margin: 6px 0; }
@media print { .no-print, .page-head .head-actions, .app-foot, .crumbs { display: none !important; } .waiver-doc { border: 0; padding: 0; } }
/* Time clock (Update 43) */
.clock-card { text-align: center; max-width: 520px; }
.clock-card label, .clock-card select, .clock-card input { text-align: left; }
.clock-state { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 6px; }
.clock-card.on .clock-state { color: var(--ok-ink); }
.clock-job { font-size: 20px; margin: 0 0 4px; }
.clock-since { margin: 0 0 14px; }
.clock-btn { width: 100%; padding: 16px; font-size: 19px; margin-top: 14px; }
.geo-status { max-width: 520px; font-size: 13px; }
.clock-list li { align-items: flex-start; }
.clock-fix { width: 100%; }
.clock-fix form { margin-top: 8px; }
/* Sign any document (Update 45) */
.sig-frame { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--line); border-radius: 6px; background: #fff; margin: 8px 0 16px; }
.sig-img { max-width: 100%; border: 1px solid var(--line); border-radius: 6px; margin: 8px 0 16px; display: block; }
.sig-note { margin: 0 0 14px; padding: 10px 14px; border-left: 3px solid var(--line); background: #faf8f4; }
.sig-cert h2 { margin-top: 0; }
.kv-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.kv-table th { text-align: left; font-weight: 600; width: 34%; vertical-align: top; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); }
.kv-table td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.break { word-break: break-all; }
.doc-sig { display: block; }

/* ---------- Sales pipeline (Update 48) ---------- */
.mt { margin-top: 12px; }
.pipe-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; margin-bottom: 12px; }
@media (max-width: 1000px) { .pipe-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .pipe-board { grid-template-columns: 1fr; } }
.pipe-col { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-width: 0; }
.pipe-col h2 { font-size: 16px; margin: 0; }
.pipe-sum { margin: 2px 0 8px; font-size: 13px; }
.lead-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lead-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; font-size: 14px; overflow-wrap: anywhere; }
.lead-name { text-decoration: none; }
.lead-facts { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 4px; font-size: 13px; }
.lead-fu { margin-top: 6px; font-size: 13px; }
.lead-due { border-left: 3px solid var(--ink); padding-left: 6px; }
.lead-quiet { margin-top: 4px; font-size: 13px; font-style: italic; }
.lead-move { display: flex; gap: 6px; margin-top: 8px; }
.lead-move select { flex: 1; min-width: 0; width: auto; padding: 4px 6px; font-size: 13px; height: auto; margin: 0; }
.lead-move .btn { padding: 4px 10px; }
select.pipe-owner { width: auto; max-width: 100%; margin: 0; }

/* ---------- RFIs (Update 49) ---------- */
.rfi-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rfi-msg { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--card); overflow-wrap: anywhere; }
.rfi-them { border-left: 4px solid var(--ink); }
.rfi-who { font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.rfi-att { margin: 8px 0 0; font-size: 14px; }

/* ---------- Client surveys (Update 50) ---------- */
.survey-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .survey-stats { grid-template-columns: 1fr; } }
.survey-stats .stat:hover { border-color: var(--line); }
.survey-bar-cell { width: 60%; }
.survey-bar { display: block; height: 12px; background: var(--ink); border-radius: 3px; min-width: 2px; }
.survey-quote { margin: 10px 0; padding: 10px 14px; border-left: 4px solid var(--ink); background: var(--bg); overflow-wrap: anywhere; }
.survey-quote footer { margin-top: 6px; font-size: 14px; color: var(--ink-soft); }
.survey-reviews { display: flex; flex-wrap: wrap; gap: 10px; }
.survey-answers li > div { margin-top: 4px; }

/* ---------- Markup (Update 51) ---------- */
.markup-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 8px; background: var(--bg); padding: 6px 0; }
@media (min-width: 760px) { .markup-bar { position: sticky; top: 0; z-index: 5; } }
.markup-group { display: flex; flex-wrap: wrap; gap: 4px; }
.markup-bar [aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 700; }
.markup-color .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; border: 1px solid #555; margin-right: 5px; vertical-align: -1px; }
.markup-textrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.markup-textrow input { max-width: 360px; margin: 0; }
.markup-textrow label { margin: 0; }
.markup-status { font-size: 14px; margin: 4px 0 8px; min-height: 1.2em; }
.markup-stage { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.markup-stage canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.markup.is-loading .markup-stage { min-height: 240px; }
.markup-select { font-size: 13px; }
.photo-markup { font-size: 13px; margin-top: 4px; }
.markup-stage canvas.is-scrolling { touch-action: auto; cursor: grab; }

/* ---------- Custom fields (Update 52) ---------- */
.cf-grid .cf-wide { grid-column: 1 / -1; }
.cf-dl { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 6px 14px; margin: 0; }
.cf-dl dt { color: var(--ink-soft); }
.cf-dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .cf-dl { grid-template-columns: 1fr; } .cf-dl dd { margin-bottom: 8px; } }
.cf-filters { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0; }
.cf-filter { display: flex; flex-direction: column; min-width: 150px; }
.cf-filter label { font-size: 13px; margin: 0 0 2px; }
.cf-filter select { margin: 0; }
.toolbar .cf-filter { flex-direction: row; align-items: center; gap: 6px; min-width: 0; }
.cf-archived td { color: var(--ink-soft); }
.cf-actions form.inline { display: inline-flex; gap: 4px; flex-wrap: wrap; }

/* ---------- Lists (Update 53) ---------- */
.list-grid-wrap { overflow-x: auto; }
table.list-grid th a { color: inherit; text-decoration: none; white-space: nowrap; }
table.list-grid th[aria-sort] a { text-decoration: underline; }
table.list-grid td.lg-cell { padding: 4px 6px; min-width: 120px; }
table.list-grid td.lg-checkbox { min-width: 60px; text-align: center; }
table.list-grid td.lg-long_text { min-width: 220px; }
table.list-grid td.lg-cell input[type=text], table.list-grid td.lg-cell input[type=date], table.list-grid td.lg-cell select, table.list-grid td.lg-cell textarea {
    margin: 0; padding: 6px 8px; font-size: 14px; min-height: 0; border-color: transparent; background: transparent; }
table.list-grid td.lg-cell input:hover, table.list-grid td.lg-cell select:hover, table.list-grid td.lg-cell textarea:hover,
table.list-grid td.lg-cell input:focus, table.list-grid td.lg-cell select:focus, table.list-grid td.lg-cell textarea:focus { border-color: #c9c2b5; background: #fff; }
table.list-grid td.lg-cell [aria-invalid="true"] { border-color: #9b1c28; background: #fff; }
table.list-grid td.lg-checkbox input { width: 20px; height: 20px; }
.lg-msg { display: block; font-size: 12px; min-height: 0; }
.lg-msg.lg-bad { color: #9b1c28; font-weight: 600; }
.lg-msg.lg-ok { color: var(--ink-soft); }
.lg-open { font-size: 12px; }
.lg-del { white-space: nowrap; vertical-align: middle !important; }
.list-filters .cf-filter { flex-direction: row; align-items: center; gap: 6px; min-width: 0; }
.list-job-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list-job-pick select { width: auto; max-width: 100%; margin: 0; }
.list-job-pick label { margin: 0; }
.list-add-toggle summary { cursor: pointer; font-weight: 600; margin: 8px 0; }
@media (max-width: 760px) {
    table.list-grid td.lg-cell { padding: 3px 0; }
    table.list-grid td.lg-cell input[type=text], table.list-grid td.lg-cell input[type=date], table.list-grid td.lg-cell select, table.list-grid td.lg-cell textarea { border-color: #c9c2b5; background: #fff; }
    table.list-grid td.lg-cell:first-child::before { content: attr(data-label) ": "; color: var(--ink-soft); font-size: 13px; }
    table.list-grid td.lg-checkbox { text-align: left; }
}

/* ---------- Saved views (Update 54) ---------- */
.view-bar { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-bottom: 10px; font-size: 14px; }
.view-bar a { text-decoration: none; padding: 3px 0; border-bottom: 2px solid transparent; }
.view-bar a.on { border-bottom-color: var(--ink); font-weight: 700; }
.view-panel { margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 0 14px; }
.view-panel > summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.view-panel[open] { padding-bottom: 14px; }
.view-panel h3 { font-size: 15px; margin: 14px 0 0; }
.view-save { border-top: 1px solid var(--line); margin-top: 14px; }
.view-cols .chip { font-size: 13px; }
table.view-table th a.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
table.view-table th[aria-sort] a.sort-link { text-decoration: underline; }

/* Sign in with Google or Microsoft (Update 58) */
.or-line { display: flex; align-items: center; gap: 12px; margin: 20px 0 6px; color: var(--ink-soft); font-size: 13px; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.provider-btns { display: flex; flex-direction: column; gap: 0; }
.btn-provider { background: #fff; color: var(--ink); border: 1px solid #c9c2b5; }
.btn-provider:hover { background: #f6f3ee; }
.provider-connect { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.provider-connect input[type=password] { width: 200px; max-width: 100%; margin: 0; padding: 7px 10px; }
.provider-btns .btn { margin-top: 10px; }
.provider-connect .btn { margin-top: 0; width: auto; }

/* Texting (Update 59) */
.sub-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.sub-tabs a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink-soft); background: var(--card, #fff); }
.sub-tabs a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.texts-form { margin: 10px 0 0; }
.texts-form label[for] { display: block; margin-bottom: 4px; font-weight: 600; }
.texts-form input[type=tel] { max-width: 240px; }
.texts-agree { align-items: flex-start; margin: 12px 0 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-weight: 400; line-height: 1.45; }
.texts-agree input { margin-top: 3px; }
.texts-groups { display: grid; gap: 10px; margin: 8px 0 14px; }
.texts-groups .check-row { align-items: flex-start; }
.texts-reply { border-left: 4px solid transparent; }
.texts-reply.is-new { border-left-color: var(--ink); }
.texts-reply.is-new::before { content: "New"; display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.texts-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; }
.texts-answer { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; }
.texts-answer textarea { flex: 1 1 260px; min-height: 60px; }

/* Client details request and texts box on client forms (Update 61) */
.texts-offer { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 4px; margin: 14px 0; }
.texts-offer legend { font-weight: 600; padding: 0 4px; }
.texts-offer .texts-agree { border: 0; padding: 4px 0; margin: 4px 0; }
.texts-offer input[type=tel] { max-width: 240px; }
.details-req { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.details-req p { margin: 0 0 6px; }
.change-list { margin: 6px 0 0; padding-left: 18px; }
.change-list li { margin: 2px 0; overflow-wrap: anywhere; }
.details-form .btn-full { margin-top: 18px; }
.texts-prompt { max-width: 640px; }
/* Sunday email to subs (Update 63) */
.sub-weekly-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; }
.sub-weekly-bar span { flex: 1 1 320px; }

/* Busy buttons and waiting spinners (Update 64) */
.is-busy { cursor: progress; opacity: .85; }
.spin { display: inline-block; width: 1em; height: 1em; margin-right: .45em; vertical-align: -.15em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.5s; } }
.waiting { display: flex; align-items: center; gap: 4px; margin: 6px 0; }
.app-foot .help-link a { white-space: nowrap; }

/* Update 71: what the client sees of the lines */
.line-detail { margin: 0 0 .75rem; }
.line-detail select { width: auto; display: inline-block; margin: 0 .4rem; }

/* Update 72: documents on a review request */
.pick-list { list-style: none; padding: 0; margin: .5rem 0 1rem; }
.pick-list li { padding: .4rem 0; border-bottom: 1px solid var(--line, #e6e1d8); }
.pick-list label { display: flex; gap: .6rem; align-items: baseline; font-weight: normal; }
.doc-links { list-style: none; padding: 0; margin: 0; }
.doc-links li { padding: .45rem 0; border-bottom: 1px solid var(--line, #e6e1d8); }
