/* Stellar Glass look: dark slate office mode by default, with a high-contrast "daylight" mode for
   phones in the field. The theme is html[data-theme], set in index.html and toggled in the sidebar. */
:root {
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --bg: #0b111e; --surface: #111a2e; --card: #162238; --hover: #1c2b47; --text: #f1f5f9; --muted: #94a3b8; --dim: #64748b;
  --border: #243452; --brand: #2563eb; --accent: #38bdf8; --accent-ink: #fff; --danger: #f87171; --ok: #34d399; --warn: #fbbf24;
  --gradient: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
  --sidebar: #090e18; --sidebar-border: #1d2a42;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 4px 20px -2px rgba(0, 0, 0, .35);
  --shadow-lg: 0 10px 30px -4px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f1f5f9; --surface: #fff; --card: #fff; --hover: #f8fafc; --text: #0f172a; --muted: #475569; --dim: #64748b;
  --border: #cbd5e1; --brand: #123764; --accent: #0284c7; --accent-ink: #fff; --danger: #dc2626; --ok: #15803d; --warn: #b45309;
  --gradient: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  --shadow: 0 4px 14px -2px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, .18);
  color-scheme: light;
}
* { box-sizing: border-box; }
/* Live totals are re-rendered as you type; without this, Chrome's scroll anchoring can jump the page
   between mousedown and mouseup, so a click on Save right after editing a field never lands. */
html { overflow-anchor: none; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 .75rem; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.warn { color: var(--warn); }
.ok { color: var(--ok); }
.num { text-align: right; font-family: var(--mono); font-size: .92em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c { text-align: center; }
.loading { padding: 4rem; text-align: center; color: var(--muted); }

/* Buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); color: var(--text); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, filter .15s; }
.btn:hover { background: var(--hover); border-color: var(--accent); }
.btn[hidden] { display: none; }
.btn.primary { background: var(--gradient); border-color: transparent; color: #fff; box-shadow: 0 2px 10px rgba(56, 189, 248, .25); }
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 4px 14px rgba(56, 189, 248, .4); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.small { padding: .3rem .7rem; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; padding: .25rem .4rem; }
.icon:hover { color: var(--danger); }
label { display: flex; flex-direction: column; gap: .35rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
input, select, textarea { font: inherit; font-size: .9rem; font-weight: 400; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .55rem .7rem; width: 100%; min-width: 0; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input:disabled, input[readonly] { background: color-mix(in srgb, var(--bg) 60%, var(--card)); color: var(--muted); }
/* Text boxes grow to fit their text (js/autosize.js), so there's no corner to drag. */
textarea { resize: none; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.card { padding: 1.25rem; }

/* App layout: dark sidebar on the left, page header and content on the right */
.app { display: flex; min-height: 100vh; }
/* Keeps the sidebar color running the full height of long pages. */
@media (min-width: 901px) { .app { background: linear-gradient(to right, var(--sidebar) 260px, var(--bg) 260px); } }
.sidebar { width: 260px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 20px 16px; background: var(--sidebar); border-right: 1px solid var(--sidebar-border); color: #cbd5e1; }
.sidebar .brand, .sidebar .brand:hover { text-decoration: none; }
.sidebar .brand { display: block; padding: 4px 6px 20px; margin-bottom: 14px; border-bottom: 1px solid var(--sidebar-border); }
.sidebar .brand .logo-img { width: 100%; max-width: 200px; height: auto; display: block; }
.sidebar .brand-sub { display: block; margin-top: 8px; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #38bdf8; }
.nav-label { font-size: .68rem; font-weight: 700; letter-spacing: .08em; color: #64748b; padding: 12px 12px 6px; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a, .nav button { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid transparent; border-radius: var(--radius-sm); color: #94a3b8; font-size: .9rem; font-weight: 500; text-decoration: none; transition: background .15s, color .15s; }
.nav button { width: 100%; background: none; font-family: inherit; text-align: left; cursor: pointer; }
.nav a svg, .nav button svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav a:hover, .nav button:hover { background: rgba(255, 255, 255, .05); color: #f1f5f9; text-decoration: none; }
.nav a.active { background: rgba(56, 189, 248, .12); border-color: rgba(56, 189, 248, .3); color: #38bdf8; font-weight: 600; }
.nav-count { margin-left: auto; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #1e293b; color: #94a3b8; }
.nav-count.accent { background: rgba(56, 189, 248, .2); color: #38bdf8; }
.nav-count.amber { background: rgba(245, 158, 11, .2); color: #fbbf24; }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--sidebar-border); display: flex; flex-direction: column; gap: 10px; }
.theme-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid #243452; background: #111a2e; color: #e2e8f0; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.theme-btn:hover { border-color: #38bdf8; }
.user-pill { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); border: 1px solid #243452; background: #111a2e; min-width: 0; }
.avatar { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #334155; color: #38bdf8; font-weight: 700; font-size: .8rem; }
.user-meta { min-width: 0; flex: 1; }
.user-meta strong { display: block; font-size: .82rem; color: #fff; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { display: block; font-size: .7rem; color: #94a3b8; text-transform: capitalize; }
.signout { background: none; border: 1px solid #243452; color: #94a3b8; border-radius: 8px; padding: 4px 8px; font: inherit; font-size: .72rem; cursor: pointer; }
.signout:hover { color: #fff; border-color: #475569; }
/* Search box under the logo (job-search.js): jobs and customers as you type. The sidebar is dark in both themes. */
.side-search { margin-bottom: 4px; }
.side-search-box { position: relative; }
.side-search-box > svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: #64748b; pointer-events: none; }
.side-search input { padding: 8px 34px 8px 34px; border-color: #243452; background: #111a2e; color: #e2e8f0; font-size: .88rem; color-scheme: dark; }
.side-search input::placeholder { color: #64748b; opacity: 1; }
.side-search input:focus { border-color: #38bdf8; }
.side-search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); padding: 0 6px; border: 1px solid #243452; border-radius: 5px; font: 600 .7rem/1.5 var(--mono); color: #64748b; pointer-events: none; }
.side-search input:focus + kbd, .side-search input:not(:placeholder-shown) + kbd { display: none; }
.side-search-drop { margin-top: 6px; padding: 4px; border: 1px solid #243452; border-radius: var(--radius-sm); background: #0d1526; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.ss-head { padding: 6px 8px 2px; font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #64748b; }
.ss-item { display: block; padding: 7px 8px; border-radius: 8px; color: #e2e8f0; text-decoration: none; }
.ss-item:hover, .ss-item.active { background: rgba(56, 189, 248, .12); text-decoration: none; }
/* Two lines each at most: the name, then the status, why it matched, the customer and the address. */
.ss-item b, .ss-item small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.ss-item b { font-size: .86rem; font-weight: 600; }
.ss-item small { font-size: .74rem; color: #94a3b8; }
.ss-item mark { padding: 0 1px; border-radius: 3px; background: rgba(56, 189, 248, .28); color: #fff; }
.ss-status { margin-right: 6px; font-style: normal; font-weight: 700; text-transform: capitalize; color: #94a3b8; }
.ss-status[data-s="in-progress"] { color: #38bdf8; }
.ss-status[data-s="contracted"] { color: #60a5fa; }
.ss-status[data-s="complete"] { color: #34d399; }
.ss-note { margin: 0; padding: 6px 8px; font-size: .74rem; color: #94a3b8; }
.menu-search { display: none; }
@media (max-width: 900px) {
  .mobilebar .menu-search { display: inline-flex; align-items: center; justify-content: center; padding: .5rem; border: 0; background: none; color: #e2e8f0; cursor: pointer; }
  .mobilebar .menu-search svg { width: 22px; height: 22px; }
}
@media (pointer: coarse) {
  .side-search input { font-size: 16px; }
  .side-search kbd { display: none; }
  .ss-item { padding: 10px; }
}
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mobilebar { display: none; }
.scrim { display: none; }
main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px 4rem; }
/* The page header spans the content column and stays put while the page scrolls. */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; margin: 0 -32px 28px; padding: 20px 32px; background: var(--surface); border-bottom: 1px solid var(--border); }
.page-title p { margin: 2px 0 0; font-size: .85rem; color: var(--muted); }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack > .card, .stack > fieldset.card { margin-bottom: 0; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; align-items: end; }
.span2 { grid-column: span 2; } .span4 { grid-column: 1 / -1; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.cols > .card { margin-bottom: 0; }
.top-gap { margin-top: 1rem; }
.grow { flex: 1; min-width: 200px; }
.bare { padding: 0; }
.hint { color: var(--muted); font-size: .82rem; margin: .5rem 0; }
/* A hint that warns keeps the warning colour (.hint comes after .warn above, and would turn it grey). */
.hint.warn { color: var(--warn); }
label.inline { flex-direction: row; align-items: center; gap: .4rem; color: var(--text); font-weight: 500; }
label.inline > span { display: flex; align-items: center; gap: .4rem; }
.opt { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem; background: color-mix(in srgb, var(--accent) 5%, var(--card)); }
.opt .grid4 { margin-top: .5rem; }
.scroll { overflow-x: auto; }

/* Metric tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.tile { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; display: flex; flex-direction: column; gap: .3rem; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
a.tile:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.t-label { color: var(--dim); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding-right: 40px; }
.t-value { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tiles.small .t-value { font-size: 1.2rem; }
.t-sub { color: var(--muted); font-size: .8rem; }
.t-icon { position: absolute; top: 1.1rem; right: 1.1rem; width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.t-icon svg { width: 18px; height: 18px; }
.i-blue { background: rgba(59, 130, 246, .15); color: #60a5fa; }
.i-amber { background: rgba(245, 158, 11, .15); color: #f59e0b; }
.i-purple { background: rgba(168, 85, 247, .15); color: #a855f7; }
.i-cyan { background: rgba(6, 182, 212, .15); color: #06b6d4; }
.i-green { background: rgba(16, 185, 129, .15); color: #10b981; }

/* Estimate → contract → change order → pay app → invoice */
.flow { display: flex; align-items: center; justify-content: space-between; gap: .75rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.flow a { display: flex; align-items: center; gap: .75rem; color: var(--text); text-decoration: none; min-width: 0; }
.flow a:hover strong { color: var(--accent); }
.step-num { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--gradient); color: #fff; font-weight: 700; font-size: .8rem; }
.flow strong { display: block; font-size: .88rem; }
.flow small { display: block; font-size: .75rem; color: var(--muted); }
.flow-arrow { color: var(--dim); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
.card > table.list, .card > .scroll > table.list { margin: 0 -1.25rem; width: calc(100% + 2.5rem); }
.card > table.list:last-child, .card > .scroll:last-child > table.list { margin-bottom: -1.25rem; }
table.list th, table.list td { padding: .8rem 1.25rem; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); text-align: left; }
table.list th { background: color-mix(in srgb, var(--bg) 70%, transparent); border-bottom-color: var(--border); }
table.list th, table.lines th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 700; white-space: nowrap; }
table.list th.num, table.list td.num { text-align: right; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
table.lines { margin-bottom: .6rem; }
table.lines th { text-align: left; padding: .3rem; vertical-align: bottom; }
table.lines td { padding: .2rem; vertical-align: middle; }
table.lines input.n { width: 6.5rem; text-align: right; font-family: var(--mono); font-size: .85rem; }
table.lines input.pct { width: 4.5rem; }
table.lines tfoot td { font-weight: 700; padding: .5rem .3rem; border-top: 2px solid var(--border); }
table.g703 { min-width: 1100px; }
.actions-cell { white-space: nowrap; text-align: right; }
ul.links { list-style: none; margin: 0; padding: 0; }
ul.links li { padding: .5rem 0; border-bottom: 1px solid var(--border); display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
ul.links li .num, ul.links li .actions-cell { margin-left: auto; }
ul.links li .actions-cell select { width: auto; }
/* A payment's ✎ and ✕ stay together when a phone wraps the line. */
ul.links li .pay-tools { white-space: nowrap; }
/* The Payment link box at the top of an invoice (billing.js linkBoxHtml): it stands out from the cards around it,
   and Test the payment link is the biggest button on the page. */
.card.paylink { border-left: 4px solid var(--accent); }
.card.paylink h2 { margin-top: 0; }
.card.paylink p { margin: .4rem 0; }
.paylink .paylink-test { font-size: 1rem; padding: .7rem 1.3rem; }
@media (max-width: 600px) { .paylink .row > .btn { flex: 1 1 100%; } }

/* Status pills */
.badge { display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; background: color-mix(in srgb, var(--dim) 18%, transparent); color: var(--muted); text-transform: capitalize; white-space: nowrap; }
.s-accepted, .s-signed, .s-paid, .s-approved, .s-complete { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.s-sent, .s-submitted, .s-contracted { background: color-mix(in srgb, #3b82f6 18%, transparent); color: #60a5fa; }
.s-in-progress, .s-partly-paid { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.s-unpaid, .s-pending { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.s-declined, .s-rejected, .s-void { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
:root[data-theme="light"] .s-sent, :root[data-theme="light"] .s-submitted, :root[data-theme="light"] .s-contracted { color: #1d4ed8; }

.totals .tr, .g702 .tr, .doc-totals .tr { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.totals .tr > :last-child, .g702 .tr > :last-child { font-family: var(--mono); font-size: .92em; }
.totals .grand, .g702 .grand, .doc-totals .grand { font-weight: 700; font-size: 1.1rem; border-bottom: 0; }
.totals .grand > :last-child, .g702 .grand > :last-child { color: var(--accent); }
.g702 .sub { padding-left: 1.25rem; color: var(--muted); font-size: .9rem; }

.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }

/* Sign-in, onboarding and invites */
.auth-wrap { max-width: none; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; background: radial-gradient(1000px 500px at 15% -10%, rgba(56, 189, 248, .22), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(37, 99, 235, .25), transparent 60%), #090e18; }
.auth-card h2 { margin: .25rem 0 0; }
.auth-card { width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.auth-logo .logo-img { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto .5rem; }
.auth-foot { color: #94a3b8; text-align: center; font-size: .85rem; margin: 1rem 0 0; line-height: 1.6; }
.auth-foot a { color: #e2e8f0; }
.btn.google { width: 100%; justify-content: center; margin: .5rem 0 1rem; }
.btn.google .g { font-weight: 800; color: #4285f4; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tab { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: .6rem; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.msg { min-height: 1.2em; font-size: .9rem; margin: .75rem 0 0; }
.msg.err { color: var(--danger); } .msg.ok { color: var(--ok); }
.auth-card details > summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.auth-card details[open] > summary { margin-bottom: 1rem; }

/* Logos: the dark-background version in dark mode and on the sidebar. */
.logo-pic .logo-img.on-dark { display: none; }
:root:not([data-theme="light"]) .logo-pic .on-light, .sidebar .logo-pic .on-light, .mobilebar .logo-pic .on-light { display: none; }
:root:not([data-theme="light"]) .logo-pic .on-dark, .sidebar .logo-pic .on-dark, .mobilebar .logo-pic .on-dark { display: block; }

.toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%) translateY(150%); background: var(--card); color: var(--text); border: 1px solid var(--accent); box-shadow: var(--shadow-lg); padding: .7rem 1.1rem; border-radius: var(--radius-sm); font-size: .9rem; transition: transform .2s, opacity .2s; z-index: 50; max-width: calc(100% - 2rem); opacity: 0; visibility: hidden; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.toast.err { background: #b91c1c; border-color: #b91c1c; color: #fff; }

/* Printable documents */
.print-bar { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; margin: 1.25rem 0 1rem; }
/* Printed documents keep their own plain look in both themes. */
.doc { background: #fff; color: #111; color-scheme: light; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; max-width: 8.5in; margin: 0 auto; padding: .6in; box-shadow: var(--shadow); border-radius: 4px; font-size: 13px; }
main.print-view, #view.print-view { max-width: 11in; }
.doc .num { font-family: inherit; font-size: inherit; }
.doc .totals .tr > :last-child, .doc .g702 .tr > :last-child, .doc .g702 .grand > :last-child { font-family: inherit; font-size: inherit; color: inherit; }
.doc-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 3px solid #123764; padding-bottom: .75rem; margin-bottom: 1rem; }
.doc-logo { height: 58px; width: auto; display: block; margin: -6px 0 .3rem -8px; }
.doc-title { text-align: right; }
.doc-title h1 { font-size: 1.2rem; color: #123764; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.doc-parties.three { grid-template-columns: 1fr 1fr 1fr; }
.doc .label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #666; font-weight: 700; margin-bottom: .2rem; }
.doc-table { margin: .5rem 0 1rem; }
.doc-table th { background: #eef2f6; text-align: left; padding: .4rem; font-size: .75rem; }
.doc-table td { padding: .4rem; border-bottom: 1px solid #e3e7ec; vertical-align: top; }
.doc-table tfoot td { font-weight: 700; border-top: 2px solid #123764; }
.doc-table.small { font-size: 11px; }
.doc-totals { margin-left: auto; max-width: 300px; }
.doc .tr { border-color: #e3e7ec; }
.doc-terms { margin: 1rem 0; padding: .75rem; background: #f6f8fa; border-radius: 4px; }
.doc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2rem; font-size: 12px; }
.doc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.doc .g702 .sub { color: #555; }
.doc.wide { max-width: 11in; page: wide; }
.doc .doc-table.g703 { min-width: 0; font-size: 10.5px; }
.doc .doc-table.g703 th { white-space: normal; vertical-align: bottom; }
.doc .doc-table.g703 td:nth-child(2) { min-width: 1.6in; }
.paid-stamp { color: #1e8449; border: 2px solid; display: inline-block; padding: .1rem .5rem; font-weight: 800; margin-top: .3rem; }
.page-break { height: 2rem; }

/* Proposal (matches Stellar Glass's own proposal layout) */
.doc.proposal { page: proposal; padding: 0 0 .4in; font-size: 13.5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; overflow: hidden; }
.doc.proposal > :not(.prop-band):not(.prop-foot):not(.prop-terms) { margin-left: .6in; margin-right: .6in; }
.prop-band { display: flex; justify-content: space-between; align-items: flex-start; padding: .3in .6in .2in; background: linear-gradient(180deg, #c5d7ee 0%, #e7eef8 55%, #fff 100%); border-top: 4px solid #123764; }
.prop-logo { height: 70px; width: auto; display: block; }
.prop-title { text-align: right; color: #123764; }
.prop-title h1 { font-size: 2rem; letter-spacing: .02em; color: #123764; margin: 0; }
.prop-meta { display: flex; justify-content: space-between; gap: 1rem; margin-top: .12in; line-height: 1.45; }
.prop-date { text-align: right; white-space: nowrap; }
.doc.proposal .label { display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #4a5a6e; font-weight: 700; min-width: 4.2em; margin: 0; }
.prop-to { margin-top: .14in; line-height: 1.55; }
.prop-project { margin-top: .1in; font-weight: 600; }
.prop-intro { font-weight: 700; margin: .16in 0 .06in; }
.prop-scope { font-weight: 700; padding-left: .25in; margin: 0; }
.prop-option { margin-top: .15in; break-inside: avoid; }
.prop-opt-name { font-weight: 700; text-decoration: underline; }
.prop-price { font-weight: 800; text-decoration: underline; font-size: 1.05rem; margin-bottom: .06in; }
.prop-specs { font-weight: 700; line-height: 1.5; }
.prop-specs .indent { padding-left: .4in; }
.prop-note { margin: .16in 0 0; font-size: .92rem; }
.prop-excl { margin: .06in 0 0; }
.doc.proposal .prop-terms { margin: .15in 0 0; padding: .1in .6in; margin-left: 0; margin-right: 0; background: linear-gradient(180deg, #fff 0%, #e7eef8 60%, #c5d7ee 100%); border-bottom: 2px solid #0071bc; font-weight: 600; }
.prop-sign { display: grid; grid-template-columns: 1fr 1fr; gap: .5in; margin-top: .2in; line-height: 1.45; break-inside: avoid; }
.sig-line { border-bottom: 1px solid #222; height: .4in; margin-bottom: .06in; }
.sig-row { display: flex; gap: .5rem; align-items: flex-end; margin-top: .1in; }
.sig-row .blank { flex: 1; border-bottom: 1px solid #888; height: 1.1em; }
.prop-foot { text-align: center; font-size: .85rem; color: #4a5a6e; margin-top: .15in; break-before: avoid; letter-spacing: .03em; }

/* Work orders (workorder-doc.js): one sheet per site measure, install or delivery, for the crew to take along. */
.doc.workorder { font-size: 12px; line-height: 1.4; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc.workorder .doc-head { margin-bottom: .6rem; padding-bottom: .5rem; }
.doc.workorder .doc-title h1 { font-size: 1.5rem; }
.wo-kind { font-size: 1rem; font-weight: 700; }
.wo-job { font-size: 1.25rem; margin: 0 0 .5rem; color: #123764; }
.wo-job .wo-sub { display: block; font-size: .85rem; font-weight: 500; color: #4a5a6e; margin-top: .1rem; }
.wo-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: .6rem; margin-bottom: .6rem; }
.wo-box { border: 1px solid #cbd5e1; border-radius: 6px; padding: .5rem .65rem; }
.wo-box .label { margin-top: .45rem; }
.wo-box .label:first-child { margin-top: 0; }
.wo-address { font-size: 1.15rem; font-weight: 700; }
.wo-when { font-size: 1.05rem; font-weight: 700; }
.wo-crew { font-weight: 600; }
.wo-blank { display: inline-block; min-width: 2in; border-bottom: 1px solid #222; height: 1.1em; vertical-align: bottom; margin-left: .3rem; }
.wo-section { margin-bottom: .55rem; break-inside: avoid; }
/* A long parts list flows onto a second page, but each order's heading stays with its first rows and no row is cut in half. */
.wo-section.wo-parts { break-inside: auto; }
.wo-order { break-after: avoid; break-inside: avoid; }
.wo-table thead { break-after: avoid; }
.wo-table tr { break-inside: avoid; }
.wo-table .heading-row { break-after: avoid; }
.wo-section p { margin: .15rem 0; }
.wo-ref { font-weight: 500; text-transform: none; letter-spacing: 0; }
.wo-openings { font-weight: 700; }
.wo-specs { white-space: pre-line; }
.wo-order { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; flex-wrap: wrap; margin-top: .4rem; }
.wo-status { font-weight: 600; text-align: right; }
.wo-status.late { color: #b91c1c; }
.wo-status.warn { color: #b45309; }
.doc .wo-table { margin: .2rem 0 .3rem; font-size: 11.5px; }
.doc .wo-table th, .doc .wo-table td { padding: .25rem .35rem; }
.doc .wo-table .num { text-align: right; white-space: nowrap; }
.wo-tick { width: 2.6em; text-align: center; font-size: 1.15em; }
.doc .wo-table th.wo-tick { font-size: .7rem; }
.wo-table .heading-row td { font-weight: 700; background: #f6f8fa; }
.wo-in { white-space: nowrap; text-align: center; }
.wo-notes { white-space: pre-line; }
.wo-lines { height: 1.3in; margin-top: .25rem; background: repeating-linear-gradient(to bottom, transparent 0, transparent 21px, #cbd5e1 21px, #cbd5e1 22px); }
.wo-sign { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; margin-top: .75rem; padding-top: .5rem; border-top: 2px solid #123764; font-size: 11px; break-inside: avoid; }
.wo-sign .wo-blank { display: block; min-width: 0; margin: .3rem 0 0; height: 1.4em; }
.wo-break { height: 1.5rem; }
.wo-daypick { gap: .3rem; }
.wo-daypick .print-select { min-width: 0; }
.ag-print { order: 1; margin-left: auto; font-size: .72rem; font-weight: 600; text-transform: none; letter-spacing: 0; }
.ag-day h3:has(.ag-print) .ag-add { margin-left: 0; }
ul.links li .wo-link { font-weight: 600; }

/* Job tabs and files */
.tabs a { padding: .6rem 1rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.files.drop-on { outline: 2px dashed var(--accent); outline-offset: -6px; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.files-head { margin-bottom: .6rem; }
.files-head .actions { align-items: center; }
.add-to { flex-direction: row; align-items: center; gap: .4rem; }
.add-to select { width: auto; padding: .3rem .4rem; }
.file-tools { margin-bottom: .6rem; }
.file-tools .job-filter { width: auto; max-width: 100%; flex: 1 1 220px; }
.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .2rem; margin-bottom: .6rem; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: .3rem .75rem; font: inherit; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.chip span { color: var(--muted); margin-left: .2rem; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.on span { color: #dbeafe; }
.drive-bar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); margin-bottom: .8rem; }
.g-drive { width: 16px; height: 16px; flex: none; }
.drive-acct { display: inline-flex; align-items: center; gap: .35rem; }
.upload-row { display: flex; gap: .6rem; align-items: center; padding: .35rem 0; font-size: .88rem; border-bottom: 1px solid var(--border); }
.upload-row progress { width: 40%; max-width: 220px; }
.upload-row.err { color: var(--danger); }
.file-group { font-size: .9rem; margin: 1rem 0 .5rem; }
.file-group:first-child { margin-top: .2rem; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.file-tile { display: flex; flex-direction: column; gap: .2rem; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .4rem; font: inherit; color: var(--text); cursor: pointer; min-width: 0; }
.file-tile:hover { border-color: var(--accent); }
.file-tile .thumb { aspect-ratio: 4 / 3; border-radius: 5px; overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.file-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-tile .ext { font-weight: 800; color: var(--accent); letter-spacing: .04em; font-size: 1.05rem; }
.fname { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fmeta, .fjob { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.in-drive { color: var(--ok); font-weight: 600; }
dialog.viewer { width: min(1100px, 96vw); height: min(780px, 92vh); padding: 0; border: 0; border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
dialog.viewer::backdrop { background: rgba(8, 18, 30, .7); }
.viewer-wrap { height: 100%; }
.viewer-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; height: 100%; }
.viewer-media { background: #0d1621; display: flex; align-items: center; justify-content: center; min-height: 0; }
.viewer-media img, .viewer-media video { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.viewer-media iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.big-ext { color: #fff; font-size: 2.5rem; font-weight: 800; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.big-ext small { font-size: .9rem; font-weight: 500; color: #c9d8ea; }
.viewer-side { padding: 1rem; overflow-y: auto; border-left: 1px solid var(--border); }
.viewer-nav { margin-top: auto; }


/* Phones and small tablets: the sidebar slides in from the left behind a slim top bar. */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform .25s ease; }
  .app.nav-open .sidebar { transform: translateX(0); box-shadow: 10px 0 30px rgba(0, 0, 0, .5); }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(5, 9, 17, .6); }
  .mobilebar { display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 20; padding: .5rem 1rem; background: var(--sidebar); border-bottom: 1px solid var(--sidebar-border); }
  .mobilebar .menu { background: none; border: 0; color: #e2e8f0; font-size: 1.4rem; line-height: 1; padding: .25rem .4rem; cursor: pointer; }
  .mobilebar .brand { flex: 1; }
  .mobilebar .logo-img { height: 30px; width: auto; display: block; }
  .mobilebar .theme-btn { padding: 6px 10px; }
  .mobilebar .theme-btn .theme-label { display: none; }
  main { padding: 0 16px 4rem; }
  .page-head { position: static; margin: 0 -16px 20px; padding: 16px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; justify-content: center; }
  .flow { flex-direction: column; align-items: stretch; padding: 1rem; }
  .flow-arrow { display: none; }
}

@media (max-width: 760px) {
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: 1fr; }
  .span2 { grid-column: 1 / -1; }
  .card { padding: 1rem; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .tile { padding: 1rem; }
  .t-value { font-size: 1.15rem; }
  .t-icon { display: none; }
  .t-label { padding-right: 0; }
  .card > table.list, .card > .scroll > table.list { margin: 0 -1rem; width: calc(100% + 2rem); }
  .card > table.list:last-child, .card > .scroll:last-child > table.list { margin-bottom: -1rem; }
  table.list { font-size: .88rem; }
  table.list th, table.list td { padding: .7rem 1rem; }
  /* Lists keep their first three columns and the amounts, and any column marked keep (the Accounting page's check numbers). */
  table.list th:nth-child(n+4):not(.num):not(.keep), table.list td:nth-child(n+4):not(.num):not(.keep) { display: none; }
  .doc { padding: .3in; }
  .doc-parties, .doc-parties.three, .doc-cols, .doc-sign, .prop-sign, .wo-grid, .wo-sign { grid-template-columns: 1fr; }
  .doc.proposal > :not(.prop-band):not(.prop-foot):not(.prop-terms), .prop-band, .doc.proposal .prop-terms { padding-left: .3in; padding-right: .3in; margin-left: 0; margin-right: 0; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
  dialog.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; border-radius: 0; }
  .viewer-body { grid-template-columns: 1fr; grid-template-rows: 45% 1fr; }
  .viewer-side { border-left: 0; border-top: 1px solid var(--border); }
}

@media print {
  @page { margin: .5in; }
  @page wide { size: letter landscape; }
  @page proposal { margin: .3in .35in; }
  body { background: #fff; }
  .no-print, .toast, .sidebar, .mobilebar, .scrim { display: none !important; }
  .app { display: block; background: none; }
  main { padding: 0; max-width: none; }
  .doc { box-shadow: none; padding: 0; max-width: none; }
  .doc.proposal { padding: 0; }
  .page-break { page-break-after: always; height: 0; }
  /* A day's work orders: each sheet on its own page. */
  .wo-break { page-break-after: always; break-after: page; height: 0; }
}

/* Website quote requests */
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
a.file-tile { text-decoration: none; }
.s-new { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.s-contacted { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.s-converted { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }

/* Website page: photos on the public quote page */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.row-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.site-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.site-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; margin-top: .75rem; }
.site-slot, .site-photo { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.site-slot .thumb, .site-photo .thumb { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--bg); border: 1px solid var(--border); }
.site-slot .thumb.wide { aspect-ratio: 4 / 3; }
.site-slot img, .site-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.site-photo.starter { opacity: .75; }
.site-gallery:has(.starter) { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.upload-list { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .85rem; color: var(--muted); }

/* Phones zoom into any text box under 16px when it's tapped; keep them at 16px there. */
@media (pointer: coarse) {
  input, select, textarea, table.lines input.n { font-size: 16px; }
}

/* Suppliers and parts orders */
.span3 { grid-column: span 3; }
.late { color: var(--danger); font-weight: 600; }
.t-value.late { color: var(--danger); }
.s-draft { background: color-mix(in srgb, var(--dim) 18%, transparent); color: var(--muted); }
.s-quoted { background: color-mix(in srgb, #a855f7 18%, transparent); color: #c084fc; }
.s-ordered, .s-confirmed, .s-shipped { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.s-partial { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.s-received { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.s-cancelled { background: color-mix(in srgb, var(--dim) 14%, transparent); color: var(--dim); text-decoration: line-through; }
.s-late { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
:root[data-theme="light"] .s-quoted { color: #7e22ce; }
.page-title h1 .badge { vertical-align: middle; margin-left: .3rem; }
.parts-filter { margin-bottom: .2rem; }
.parts-filter .chips { margin-bottom: .6rem; }
.chips a.chip { text-decoration: none; }
.sup-filter { width: auto; margin-bottom: .6rem; }
.plugin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; }
.plugin { display: flex; flex-direction: column; justify-content: space-between; gap: .6rem; padding: .9rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 4%, var(--card)); }
.plugin p { margin: .25rem 0 0; }
.warn-card { border-color: var(--warn); }
.supplier-tip { font-size: .85rem; color: var(--text); background: color-mix(in srgb, var(--accent) 8%, transparent); border-left: 3px solid var(--accent); border-radius: 6px; padding: .55rem .75rem; }
.chips.common { flex-wrap: wrap; align-items: center; margin: .2rem 0 .7rem; }
.from-est { width: auto; padding: .3rem .5rem; font-size: .8rem; }
.paste-box { margin-bottom: .8rem; display: flex; flex-direction: column; gap: .5rem; }
/* A long pasted list scrolls inside, so "Add these lines" stays in reach. */
.paste-box textarea { font-family: var(--mono); font-size: .85rem; max-height: 50vh; }
table.parts-lines input { min-width: 0; }
table.parts-lines input.qty { width: 4.5rem; }
table.parts-lines input.inches { width: 6.5rem; text-align: right; }
table.parts-lines input.unit { width: 4.5rem; }
table.parts-lines input.short { width: 8rem; }
table.parts-lines td:not(.row-tools) { min-width: 4rem; }
table.parts-lines .heading-row input { font-weight: 700; background: color-mix(in srgb, var(--accent) 6%, var(--bg)); }
table.parts-lines .size-hint { display: block; font-size: .75rem; margin: .2rem 0 0 .2rem; }
.row-tools { white-space: nowrap; }
.row-tools .icon { padding: .2rem .25rem; }
.row-tools [data-up]:hover, .row-tools [data-down]:hover { color: var(--accent); }
ul.problems { margin: .4rem 0 0; padding-left: 1.1rem; color: var(--warn); font-size: .85rem; }
ul.problems:empty { display: none; }
.recips { margin: 0; }
.sub-h { font-size: .9rem; margin: .5rem 0 .4rem; }
.file-picks { display: flex; flex-direction: column; gap: .3rem; max-height: 220px; overflow-y: auto; }
.file-pick { font-weight: 400; }
.email-preview { width: 100%; height: 520px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.email-preview.short { height: 360px; }
.send-bar { position: sticky; bottom: .75rem; z-index: 4; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; box-shadow: var(--shadow-lg); }
.ask-bar { border-color: var(--accent); display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.ask-bar p { margin: 0; }
details.request-box { margin-bottom: 1.25rem; }
details.request-box > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow); }
details.request-box > summary::-webkit-details-marker { display: none; }
details.request-box > summary::before { content: '▸'; color: var(--accent); margin-right: .2rem; }
details.request-box[open] > summary { margin-bottom: 1rem; }
details.request-box[open] > summary::before { content: '▾'; }
details.request-box > summary > span:first-child { flex: 1; }
.tracker .stepper { display: flex; list-style: none; margin: .5rem 0 1rem; padding: 0; counter-reset: step; }
.stepper li { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem; min-width: 0; font-size: .82rem; color: var(--muted); }
.stepper li::before { content: ''; position: absolute; top: 9px; left: -50%; width: 100%; height: 3px; background: var(--border); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.done::before, .stepper li.part::before { background: var(--accent); }
.stepper .dot { position: relative; z-index: 1; width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--border); background: var(--surface); }
.stepper li.done .dot { background: var(--accent); border-color: var(--accent); }
.stepper li.part .dot { background: linear-gradient(90deg, var(--accent) 50%, var(--surface) 50%); border-color: var(--accent); }
.stepper li.now .lbl { color: var(--text); font-weight: 700; }
.stepper li.done .lbl { color: var(--text); }
.stepper small { font-size: .72rem; color: var(--dim); }
dl.facts { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin: 0 0 1rem; }
dl.facts div { display: flex; flex-direction: column; }
dl.facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 700; }
dl.facts dd { margin: 0; font-weight: 600; }
.track-form { border-top: 1px solid var(--border); padding-top: 1rem; }
table.receive input.n { width: 5rem; }
table.receive td { padding: .35rem .3rem; }
table.receive .heading-row td { padding-top: .7rem; }
ol.timeline { list-style: none; margin: 0; padding: 0; }
ol.timeline li { display: flex; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
ol.timeline .when { flex: none; width: 8.5rem; color: var(--muted); font-size: .82rem; }
.phone-only { display: none; }
.email-card { display: flex; flex-direction: column; gap: .65rem; }
.email-card > h2, .email-card > p { margin: 0; }

@media (max-width: 760px) {
  .span3 { grid-column: 1 / -1; }
  .stepper li { font-size: .7rem; }
  .stepper small { display: none; }
  .email-preview { height: 420px; }
  ol.timeline li { flex-direction: column; gap: .1rem; }
  .send-bar { bottom: .5rem; }
  .send-bar .btn { flex: 1 1 45%; }
  .phone-only { display: block; margin-top: .3rem; }
  /* What's come in, on a phone: what was ordered, the item and how many are in. */
  table.receive th:last-child, table.receive tr:not(.heading-row) > td:last-child { display: none; }
  table.receive input.n { width: 3.75rem; }
}

/* Schedule. Each kind of event has its color (--tc), close to the color it gets in Google Calendar. */
.t-measure { --tc: #039be5; } .t-install { --tc: #5c6bc0; } .t-meeting { --tc: #ab47bc; } .t-delivery { --tc: #f4511e; }
.t-task { --tc: #e4ac00; } .t-timeoff { --tc: #8a8f98; } .t-fabrication { --tc: #0b8043; } .t-other { --tc: #33b679; }
.i-teal { background: rgba(20, 184, 166, .15); color: #14b8a6; }
[data-sched] [hidden], [data-event] [hidden] { display: none !important; }
.sched-bar { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: .75rem; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg button { background: none; border: 0; padding: .45rem .9rem; font: inherit; font-size: .85rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--brand); color: #fff; }
.sched-nav { display: flex; gap: .4rem; align-items: center; flex: 1; min-width: 240px; }
.sched-nav strong { margin-left: .4rem; font-size: 1rem; white-space: nowrap; }
.who-filter { width: auto; min-width: 170px; }
.t-chip { border-left: 4px solid var(--tc); }
.t-chip.on { background: color-mix(in srgb, var(--tc) 22%, var(--surface)); border-color: var(--tc); color: var(--text); }
.t-chip:not(.on) { opacity: .55; text-decoration: line-through; }
.t-badge { background: color-mix(in srgb, var(--tc) 20%, transparent); color: var(--text); }
.agenda { padding: .25rem 1.25rem; }
.ag-day { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.ag-day:last-child { border-bottom: 0; }
.ag-day h3 { margin: 0 0 .45rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); display: flex; align-items: center; gap: .5rem; }
.ag-day.is-today h3 { color: var(--accent); }
.ag-day.late h3 { color: var(--warn); }
.ag-add { order: 2; margin-left: auto; font-size: 1.15rem; line-height: 1; padding: 0 .45rem; color: var(--muted); }
.ag-list, .up-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.ag-item { display: flex; gap: .7rem; align-items: center; padding: .5rem .65rem; border-left: 3px solid var(--tc, var(--border)); background: color-mix(in srgb, var(--tc, var(--border)) 8%, transparent); border-radius: 0 8px 8px 0; }
.ag-time { flex: 0 0 9.5rem; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ag-time.warn { color: var(--warn); }
/* Navigate (navigate.js): directions to the address in the phone's own maps app. */
.nav-btn { white-space: nowrap; flex: none; }
.where-row { display: flex; gap: .5rem; align-items: flex-end; }
.where-row > label { flex: 1; min-width: 0; }
/* A job, read-only (views.js jobDetails): Edit opens the form. */
.job-view .label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 700; margin-bottom: .2rem; }
.job-site { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.job-address { font-weight: 600; font-size: 1.05rem; }
.job-notes { line-height: 1.5; }
.ag-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ag-title { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.ag-meta { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-who { display: flex; gap: .2rem; flex-shrink: 0; }
input.tick, .tick-gap { width: 1.2rem; height: 1.2rem; flex-shrink: 0; margin: 0; }
.tick { cursor: pointer; }
ul.links li .ev-when { margin-left: auto; color: var(--muted); }
ul.links li .ev-when.warn { color: var(--warn); }
.is-done .ag-title, .is-done .up-title, .m-ev.is-done, .tw-ev.is-done { text-decoration: line-through; opacity: .65; }
.is-canceled { opacity: .5; }
.who-dot { display: inline-flex; align-items: center; justify-content: center; width: 1.65rem; height: 1.65rem; border-radius: 50%; background: var(--card); border: 1px solid var(--border); font-size: .64rem; font-weight: 700; color: var(--muted); }
.up-item a { display: flex; flex-direction: column; padding: .45rem .65rem; border-left: 3px solid var(--tc); border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--tc) 8%, transparent); color: var(--text); }
.up-item a:hover { text-decoration: none; background: color-mix(in srgb, var(--tc) 15%, transparent); }
.up-when, .up-meta { font-size: .76rem; color: var(--muted); }
.up-when.warn { color: var(--warn); }
.up-title { font-weight: 600; }
.month { padding: 0; overflow: hidden; }
.m-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.m-dow { padding: .45rem .5rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); border-bottom: 1px solid var(--border); }
.m-cell { position: relative; min-height: 7.2rem; padding: .3rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.m-cell:nth-child(7n) { border-right: 0; }
.m-cell.other { background: color-mix(in srgb, var(--bg) 50%, transparent); }
.m-cell.other .m-num { color: var(--dim); }
.m-head { display: flex; justify-content: space-between; align-items: center; }
.m-num { font-size: .8rem; font-weight: 700; color: var(--text); width: 1.7rem; height: 1.7rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.m-cell.is-today .m-num { background: var(--accent); color: var(--accent-ink); }
.m-add { color: var(--dim); opacity: 0; padding: 0 .35rem; font-size: 1.05rem; line-height: 1; }
.m-cell:hover .m-add, .m-add:focus { opacity: 1; }
.m-ev, .tw-ev { display: block; font-size: .74rem; line-height: 1.3; padding: .15rem .35rem; border-radius: 4px; color: var(--text); background: color-mix(in srgb, var(--tc) 22%, transparent); border-left: 3px solid var(--tc); }
.m-ev { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-ev:hover, .tw-ev:hover { text-decoration: none; background: color-mix(in srgb, var(--tc) 34%, transparent); }
.m-more { font-size: .72rem; color: var(--muted); padding-left: .35rem; }
.m-dots { display: none; gap: 3px; flex-wrap: wrap; }
.m-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--tc); }
.team-card { padding: 0; overflow: hidden; }
.team-week { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; }
.team-week th, .team-week td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: .4rem; vertical-align: top; text-align: left; }
.team-week thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); background: color-mix(in srgb, var(--bg) 70%, transparent); }
.team-week thead th:first-child { width: 9rem; }
.team-week thead th a { color: inherit; }
.team-week tbody th { font-size: .85rem; }
.team-week th small { display: block; color: var(--dim); font-weight: 500; text-transform: capitalize; }
.team-week .is-today { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.tw-ev { margin-bottom: .2rem; overflow-wrap: anywhere; }
.ev-form fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem .9rem .9rem; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: .75rem; }
.ev-form legend { font-size: .8rem; font-weight: 700; color: var(--muted); padding: 0 .35rem; }
.type-pick { display: flex; gap: .4rem; flex-wrap: wrap; }
.type-opt { position: relative; flex-direction: row; }
.type-opt input { position: absolute; opacity: 0; pointer-events: none; }
.type-opt span { border: 1px solid var(--border); border-left: 4px solid var(--tc); border-radius: 999px; padding: .35rem .85rem; font-size: .86rem; font-weight: 600; color: var(--text); cursor: pointer; background: var(--surface); }
.type-opt input:checked + span { background: color-mix(in srgb, var(--tc) 26%, var(--surface)); border-color: var(--tc); }
.type-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.type-opt input:disabled + span { cursor: default; opacity: .75; }
.when-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.who-pick, .rem-pick { display: flex; flex-wrap: wrap; gap: .4rem; }
.pick-opt { flex-direction: row; align-items: center; gap: .35rem; border: 1px solid var(--border); border-radius: 999px; padding: .3rem .75rem; font-size: .85rem; font-weight: 500; color: var(--text); background: var(--surface); cursor: pointer; }
.pick-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.status-row { gap: 1rem; }
/* Google Calendar connections */
.gcal-card h3 { font-size: .92rem; margin: 1.1rem 0 .35rem; }
.gc-state { font-weight: 600; }
.gc-state.ok { color: var(--ok); } .gc-state.warn { color: var(--warn); } .gc-state.bad { color: var(--danger); }
.gc-busy { color: var(--accent); }
.gc-picker { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem .9rem; margin: .6rem 0; background: var(--bg); display: flex; flex-direction: column; gap: .45rem; }
.pick-row { flex-direction: row; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 500; color: var(--text); }
.gc-line { font-size: .85rem; color: var(--muted); margin: 0 0 .75rem; }
.gc-line.warn { color: var(--warn); }
.gc-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--ok); margin-right: .45rem; vertical-align: .05em; }
.gc-offer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.gc-offer p { margin: .2rem 0 0; }
/* Settings > What staff can see: each person on staff, with a box for each part of the app */
.staff-access { border-top: 1px solid var(--border); padding: .85rem 0; }
.staff-access:first-child { border-top: 0; padding-top: .25rem; }
.staff-access legend { float: left; width: 100%; padding: 0; margin-bottom: .6rem; }
.access-opts { clear: both; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .65rem 1.25rem; }
.access-opt { gap: .15rem; font-size: .9rem; font-weight: 500; color: var(--text); cursor: pointer; }
.access-opt > span { display: flex; align-items: center; gap: .5rem; }
.access-opt input { width: 1.05rem; height: 1.05rem; margin: 0; flex: none; }
.access-opt small { padding-left: 1.55rem; font-size: .78rem; font-weight: 400; color: var(--muted); }
@media (max-width: 760px) {
  .sched-nav { min-width: 0; flex-basis: 100%; }
  .who-filter { flex: 1; }
  .agenda { padding: .25rem 1rem; }
  .ag-item { flex-wrap: wrap; row-gap: .15rem; }
  .ag-time { flex-basis: 100%; }
  .tick-gap { display: none; }
  .m-cell { min-height: 3.6rem; padding: .2rem; }
  .m-ev, .m-more, .m-add { display: none; }
  .m-dots { display: flex; }
  /* The whole day is the link to that day's list. */
  .m-num::after { content: ''; position: absolute; inset: 0; }
}

/* Takeoff: the sheet on the left, what was found and the openings on the right */
main.wide-view { max-width: none; }
.takeoff { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 1.25rem; align-items: start; }
.tk-view { padding: 0; overflow: hidden; margin-bottom: 0; }
.tk-bar { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; padding: .6rem .8rem; border-bottom: 1px solid var(--border); }
.tk-bar select { width: auto; max-width: 24rem; }
.tk-scroll { height: calc(100vh - 230px); min-height: 360px; overflow: auto; background: #fff; }
.tk-stage { position: relative; }
.tk-stage canvas, .tk-stage svg { position: absolute; left: 0; top: 0; }
.tk-stage svg { cursor: crosshair; overflow: visible; }
.tk-tip { margin: 0; padding: .5rem .8rem; border-top: 1px solid var(--border); }
.tk-side .card { margin-bottom: 0; }
.tk-side h2 { margin-bottom: .5rem; }
.tk-side .seg { margin-bottom: .5rem; }
.tk-hit, .tk-type, .tk-dup, .tk-mark, .tk-line, .tk-cal, .tk-rect { vector-effect: non-scaling-stroke; stroke-width: 2.5; }
.tk-hit { fill: rgba(16, 185, 129, .18); stroke: #059669; }
.tk-type { fill: rgba(37, 99, 235, .14); stroke: #2563eb; }
.tk-dup { fill: none; stroke: #64748b; stroke-dasharray: 5 4; }
.tk-mark { fill: rgba(245, 158, 11, .12); stroke: #d97706; }
.tk-line { stroke: #e11d48; }
.tk-rect { fill: rgba(225, 29, 72, .12); stroke: #e11d48; stroke-dasharray: 6 3; }
.tk-cal { stroke: #2563eb; stroke-dasharray: 6 4; }
.tk-dot { fill: #e11d48; }
.tk-label { fill: #be123c; font-weight: 800; text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; font-family: var(--font); }
.tk-cad-layers { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; padding: .45rem .8rem; border-bottom: 1px solid var(--border); background: var(--bg); max-height: 5.5rem; overflow-y: auto; }
.tk-layer-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .3rem; }
.tk-sys-bar { display: flex; flex-direction: column; gap: .45rem; margin-bottom: .65rem; padding: .55rem .65rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
table.tk-rows td { padding: .15rem; }
table.tk-rows input { padding-left: .35rem; padding-right: .35rem; }
table.tk-rows input.tk-n { width: 4.5rem; }
table.tk-rows input.tk-bays { width: 2.8rem; appearance: textfield; -moz-appearance: textfield; }
table.tk-rows input[data-f="qty"] { width: 2.9rem; appearance: textfield; -moz-appearance: textfield; }
table.tk-rows input[data-f="qty"]::-webkit-inner-spin-button, table.tk-rows input[data-f="qty"]::-webkit-outer-spin-button,
table.tk-rows input.tk-bays::-webkit-inner-spin-button, table.tk-rows input.tk-bays::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
table.tk-rows input[data-f="label"] { width: 3.1rem; }
.tk-cut-summary { margin: .55rem 0; }
.tk-cut-grid { display: flex; flex-direction: column; gap: .25rem; padding: .5rem .65rem; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); }
.tk-sel td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tk-big { font-size: 1.3rem; font-family: var(--mono); }
.tk-fam + .tk-fam { margin-top: .6rem; }
dialog.tk-3d-dlg { width: min(1040px, 96vw); max-height: 92vh; padding: 1.1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 12px 48px rgba(0, 0, 0, .45); overflow-y: auto; }
dialog.tk-3d-dlg::backdrop { background: rgba(8, 18, 30, .72); }
.tk-3d-wrap { display: flex; flex-direction: column; gap: .75rem; }
.tk-3d-head h2 { margin: 0; }
.tk-3d-head p { margin: .15rem 0 0; }
.tk-3d-controls { gap: .75rem; flex-wrap: wrap; padding: .55rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.tk-3d-controls label { display: flex; flex-direction: column; gap: .2rem; flex: 1 1 180px; }
.tk-3d-stage { position: relative; width: 100%; height: min(56vh, 520px); min-height: 320px; border-radius: var(--radius-sm); overflow: hidden; background: #0f172a; border: 1px solid var(--border); }
.tk-3d-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: .95rem; }
.tk-3d-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: .6rem; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.tk-3d-stats > div { display: flex; flex-direction: column; gap: .15rem; }
dialog.tk-video-dlg { width: min(1040px, 96vw); max-height: 92vh; padding: 1.1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 12px 48px rgba(0, 0, 0, .45); overflow-y: auto; }
dialog.tk-video-dlg::backdrop { background: rgba(8, 18, 30, .72); }
.tk-video-wrap { display: flex; flex-direction: column; gap: .7rem; }
.tk-video-head h2 { margin: 0; }
.tk-video-head p { margin: .15rem 0 0; }
.tk-video-stage { width: 100%; border-radius: var(--radius-sm); overflow: hidden; background: #0f172a; border: 1px solid var(--border); }
.tk-video-stage video { display: block; width: 100%; max-height: 62vh; background: #0f172a; }
.tk-video-chapters { display: flex; flex-wrap: wrap; gap: .4rem; }
.tk-video-note { margin: 0; }
@media (max-width: 1100px) {
  .takeoff { grid-template-columns: minmax(0, 1fr); }
  .tk-scroll { height: 62vh; }
}

/* Sending a proposal (proposal-send.js): the PDF, the email, and the ways to send them. */
dialog.send-dlg { --pad: 1.25rem; width: min(640px, 96vw); max-height: 92vh; padding: var(--pad); border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 10px 40px rgba(0, 0, 0, .35); overflow-y: auto; }
/* Send with Gmail stays in view at the bottom of the window while the email above it is read over. */
.send-main { position: sticky; bottom: calc(-1 * var(--pad)); z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; margin: 0 calc(-1 * var(--pad)); padding: .8rem var(--pad) var(--pad); border-top: 1px solid var(--border); background: var(--surface); }
.send-main .btn { min-width: 12rem; }
.send-main .hint a { white-space: nowrap; }
.send-or { margin: 0; }
.send-dlg .ask-bar.done-bar { border-color: var(--ok); }
dialog.send-dlg::backdrop { background: rgba(8, 18, 30, .7); }
.send-dlg h2 { margin: 0; }
.send-dlg .hint { margin: 0; }
.send-dlg .warn { color: var(--warn); }
/* Everyone a proposal goes to, under the To box: long addresses wrap instead of running off a phone. */
.send-to-list { overflow-wrap: anywhere; color: var(--text); }
.send-dlg textarea { max-height: 40vh; }
.send-file { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.send-from-box { display: flex; flex-direction: column; gap: .55rem; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.pdf-ico { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 6px; background: #c62828; color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .04em; display: flex; align-items: center; justify-content: center; }
.send-file-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.send-file-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send-ways { display: flex; flex-wrap: wrap; gap: .6rem; }
.send-dlg .ask-bar { padding: .75rem; border: 1px solid var(--accent); border-radius: var(--radius-sm); }
@media (max-width: 760px) {
  dialog.send-dlg { --pad: 1rem; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .send-main { align-items: stretch; }
  .send-ways .btn { flex: 1 1 calc(50% - .6rem); }
  .send-ways .btn.primary { flex-basis: 100%; }
}

/* Persistent Quick Navigation Shortcuts Bar & Quick Jump (⌘K) Modal */
.quickbar { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; padding: .5rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.q-pill { display: inline-flex; align-items: center; gap: .3rem; padding: .32rem .68rem; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: .8rem; font-weight: 600; text-decoration: none; cursor: pointer; font-family: inherit; transition: border-color .15s, background .15s; white-space: nowrap; }
.q-pill:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg)); text-decoration: none; }
.q-pill.accent { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: color-mix(in srgb, var(--accent) 14%, var(--bg)); }
.q-pill.video { border-color: #0284c7; background: color-mix(in srgb, #0284c7 15%, var(--bg)); }
.q-pill.search { margin-left: auto; border-color: var(--accent); }
dialog.quick-dlg { width: min(620px, 95vw); max-height: 85vh; padding: 1.15rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 12px 48px rgba(0, 0, 0, .45); overflow-y: auto; }
dialog.quick-dlg::backdrop { background: rgba(8, 18, 30, .72); }
.quick-list { display: flex; flex-direction: column; gap: .25rem; max-height: 58vh; overflow-y: auto; }
.q-group { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .5rem .4rem .2rem; }
.q-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem .7rem; border-radius: var(--radius-sm); border: 1px solid transparent; color: var(--text); text-decoration: none; background: var(--bg); }
.q-item:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); text-decoration: none; }
.q-item small { color: var(--muted); font-size: .78rem; text-align: right; }
@media (max-width: 760px) {
  .quickbar { padding: .45rem .75rem; overflow-x: auto; flex-wrap: nowrap; }
  .q-pill.search { margin-left: 0; }
}

/* Accessibility (WCAG 2.1 AA): screen-reader-only text, skip links, focus rings, and reduced motion */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 9999; background: var(--accent); color: #fff; padding: .55rem 1rem; border-radius: var(--radius-sm); font-weight: 700; text-decoration: none; transform: translateY(-200%); transition: transform .15s ease; }
.skip-link:focus, .skip-link:focus-visible { transform: translateY(0); outline: 3px solid #fff; outline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Accounting & Notary Hub, notary blocks, and Florida statutory lien waivers (§ 713.20) */
.print-select { width: auto; min-width: 190px; padding: .38rem .65rem; font-size: .84rem; }
.notary-cert-block { margin-top: .5rem; padding: .55rem .7rem; border: 1px solid #cbd5e1; border-radius: 6px; background: rgba(248, 250, 252, .65); color: #0f172a; }
.arch-cert-block { margin-top: .55rem; padding-top: .45rem; border-top: 1px solid #cbd5e1; }
.waiver-controls { max-width: 920px; margin: 0 auto 1rem; }
.waiver-body { display: flex; flex-direction: column; gap: 1rem; font-size: .98rem; line-height: 1.65; color: #0f172a; padding: .5rem 0; }
.waiver-lead { font-size: 1.02rem; line-height: 1.8; }
.waiver-prop-box { padding: .75rem 1rem; border: 1px solid #94a3b8; border-radius: 6px; background: #f8fafc; font-size: .96rem; line-height: 1.5; }
.waiver-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; padding: .75rem 1rem; border: 1px solid #94a3b8; border-radius: 6px; background: #f8fafc; }
.waiver-line { padding: .35rem 0; }
.waiver-dated { margin-top: .4rem; font-size: 1rem; }
.waiver-sign-block { align-self: flex-end; width: min(420px, 100%); display: flex; flex-direction: column; gap: .55rem; margin-top: .5rem; padding: .85rem 1rem; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; }
.waiver-sig-line { display: flex; align-items: flex-end; gap: .5rem; margin-top: .6rem; }
.waiver-sig-line .blank { flex: 1; border-bottom: 1.5px solid #0f172a; height: 1.4rem; }
.waiver-statutory-note { margin-top: 1.1rem; padding-top: .75rem; border-top: 1px solid #cbd5e1; font-size: .84rem; color: #334155; }
.acct-upload-bar { align-items: end; padding: .75rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg); }

/* Desktop Web App (PWA) Install Button & Modal (Windows & Mac) */
.q-pill.install { border-color: #10b981; background: color-mix(in srgb, #10b981 15%, var(--bg)); }
.pwa-auth-btn { width: 100%; margin-top: .35rem; border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
dialog.pwa-install-dlg { width: min(860px, 95vw); max-height: 90vh; padding: 1.25rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 16px 56px rgba(0, 0, 0, .55); overflow-y: auto; }
dialog.pwa-install-dlg::backdrop { background: rgba(8, 18, 30, .75); }
.pwa-install-body { display: flex; flex-direction: column; gap: 1rem; margin-top: .85rem; }
.pwa-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .85rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); }
.pwa-banner-ready { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }
.pwa-banner-ok { border-color: #10b981; background: color-mix(in srgb, #10b981 12%, var(--bg)); flex-direction: column; align-items: flex-start; gap: .25rem; }
.pwa-os-grid { align-items: stretch; }
.pwa-os-card { display: flex; flex-direction: column; gap: .65rem; border: 1px solid var(--border); }
.pwa-os-card.pwa-os-active { border: 2px solid var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.pwa-steps { margin: .25rem 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: .55rem; font-size: .9rem; line-height: 1.5; }
.pwa-tip { margin-top: auto; padding-top: .6rem; border-top: 1px solid var(--border); }
@media (display-mode: standalone), (display-mode: window-controls-overlay) {
  .q-pill.install, .pwa-auth-btn { display: none; }
}

/* High-Definition Printable QR Code, Truck/Van Magnet & Business Card Studio */
.qr-promo-card { border-left: 4px solid var(--accent); }
.qr-promo-row { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.qr-promo-thumb { flex: 0 0 132px; width: 132px; height: 132px; padding: .45rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); display: flex; align-items: center; justify-content: center; }
.qr-promo-thumb svg { width: 100%; height: 100%; display: block; border-radius: 6px; }
dialog.qr-studio-dlg { width: min(1060px, 96vw); max-height: 92vh; padding: 1.25rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 18px 60px rgba(0, 0, 0, .58); overflow-y: auto; }
dialog.qr-studio-dlg::backdrop { background: rgba(8, 18, 30, .78); }
.qr-studio-grid { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-top: .5rem; }
.qr-studio-controls, .qr-studio-preview { margin: 0; }
.qr-preview-stage { display: flex; align-items: center; justify-content: center; min-height: 310px; padding: 1rem; border-radius: var(--radius-sm); border: 1px dashed var(--border); background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--accent) 14%, var(--bg)), var(--bg)); overflow: hidden; }
.qr-preview-stage svg { width: 100%; max-width: 580px; max-height: 410px; height: auto; display: block; border-radius: 8px; box-shadow: 0 12px 34px rgba(0, 0, 0, .42); }
.qr-export-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
.qr-card-sheet { width: 8.5in; max-width: 100%; margin: 0 auto; padding: .5in .65in; background: #fff; color: #0f172a; border: 1px solid #cbd5e1; border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); display: grid; grid-template-columns: repeat(2, 3.5in); grid-auto-rows: 2in; gap: .2in .2in; justify-content: center; align-content: center; }
.qr-card-cell { width: 3.5in; height: 2in; border: 1px dashed #94a3b8; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.qr-card-cell svg { width: 100%; height: 100%; display: block; }
.qr-magnet-sheet { max-width: 920px; margin: 0 auto; padding: 1.25rem; background: #fff; color: #0f172a; border: 1px solid #cbd5e1; border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.qr-magnet-stage { display: flex; align-items: center; justify-content: center; padding: .5rem; background: #f8fafc; border: 1px dashed #94a3b8; border-radius: 8px; }
.qr-magnet-stage svg { width: 100%; max-height: 72vh; height: auto; display: block; }
.qr-magnet-spec { margin-top: .85rem; padding-top: .75rem; border-top: 1px solid #cbd5e1; display: flex; flex-direction: column; gap: .25rem; font-size: .88rem; color: #334155; }
@media (max-width: 820px) {
  .qr-studio-grid { grid-template-columns: 1fr; }
  .qr-card-sheet { width: 100%; padding: .75rem; grid-template-columns: 1fr; grid-auto-rows: auto; }
  .qr-card-cell { width: 100%; height: auto; aspect-ratio: 7 / 4; }
}
@media print {
  .qr-card-sheet { border: 0; box-shadow: none; padding: .35in .5in; width: 8.5in; grid-template-columns: repeat(2, 3.5in); grid-auto-rows: 2in; gap: .18in .2in; }
  .qr-card-cell { width: 3.5in; height: 2in; aspect-ratio: auto; page-break-inside: avoid; }
  .qr-magnet-sheet { border: 0; box-shadow: none; padding: 0; max-width: none; }
}

/* Ideas & updates: the shared Google Doc, shown in the page (ideas.js). */
.ideas-frame { display: block; width: 100%; height: calc(100vh - 280px); min-height: 480px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }

/* Settings > Connections (connections.js): one line per outside service */
.c-on { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.c-off { background: color-mix(in srgb, var(--warn, #d97706) 18%, transparent); color: var(--warn, #d97706); }
.c-unknown, .c-checking { background: color-mix(in srgb, var(--dim) 18%, transparent); color: var(--muted); }
.conn-list { border-top: 1px solid var(--border); }
.conn { display: grid; grid-template-columns: minmax(12rem, 1.2fr) 11rem 2fr; gap: .4rem 1rem; align-items: start; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.conn .badge { text-transform: none; }
@media (max-width: 720px) {
  .conn { grid-template-columns: 1fr auto; }
  .conn-note { grid-column: 1 / -1; }
}
/* Fill from GDS / WinBidPro (gds-panel.js): what the file says to check, then the costs it read, each editable. */
.gds-warn { margin: 0; padding-left: 1.1rem; color: var(--warn); font-size: .88rem; }
.gds-warn:empty { display: none; }
.gds-costs input { width: 9rem; }
.gds-dlg .totals { margin: 0; }

/* Job page Billing card (views/job-billing.js): a long next step wraps inside the card on a phone. */
#job-billing [data-jb-next] .btn { white-space: normal; max-width: 100%; text-align: left; }

/* Dashboard: Waiting on you (views/waiting.js) */
.waiting h2 { display: flex; align-items: center; gap: .5rem; }
.waiting .w-count { display: inline-flex; min-width: 1.6rem; justify-content: center; padding: .05rem .5rem; border-radius: 999px; font-size: .8rem; background: color-mix(in srgb, var(--accent, #0071bc) 16%, transparent); }
.w-list { list-style: none; margin: .5rem 0; padding: 0; }
.w-row { display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; align-items: center; padding: .7rem 0; border-top: 1px solid var(--border); }
.w-row:first-child { border-top: 0; }
.w-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; min-width: 0; }
.w-kind { flex-basis: 100%; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.w-title { font-weight: 600; }
.w-amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.w-meta { flex-basis: 100%; }
.w-actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; align-items: center; }
.w-hold { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.w-held summary { cursor: pointer; color: var(--muted); margin-top: .4rem; }
@media (max-width: 760px) {
  .w-row { grid-template-columns: 1fr; }
  .w-actions { justify-content: flex-start; }
  .w-actions .btn { flex: 1 1 auto; text-align: center; }
}

/* Follow-ups (views/follow-ups.js): sent proposals to check in on, customers' answers and the win rate */
.fu-list { list-style: none; margin: .5rem 0; padding: 0; }
.fu-row { display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; align-items: center; padding: .75rem 0; border-top: 1px solid var(--border); }
.fu-row:first-child { border-top: 0; }
.fu-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; min-width: 0; }
.fu-title { font-weight: 600; }
.fu-amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.fu-meta, .fu-answer { flex-basis: 100%; margin: 0; }
.fu-answer { padding: .45rem .6rem; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 4px; }
.fu-actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; align-items: center; }
.fu-actions select { width: auto; }
.badge.fu-amber, .badge.fu-warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge.fu-accent { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.fu-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.fu-stats > div { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); }
.fu-stats .t-value { font-size: 1.6rem; font-weight: 700; }
.inline-h { display: inline; font-size: 1.05rem; }
#fuWaiting summary, #fuPast summary, .card > details > summary { cursor: pointer; }
.fu-dlg .fu-results { display: flex; flex-direction: column; gap: .3rem; border: 0; padding: 0; margin: 0; }
.fu-dlg .hidden { display: none; }
@media (max-width: 760px) {
  .fu-row { grid-template-columns: 1fr; }
  .fu-actions { justify-content: flex-start; }
  .fu-actions .btn { flex: 1 1 auto; text-align: center; }
}

/* Accounting page (accounting.js): tabs that scroll sideways on a phone, the To do list, the waiver ticks with who
   and when under them, and an upload button that wraps instead of spilling out of its card. */
.acct-tabs { overflow-x: auto; scrollbar-width: none; }
.acct-tabs a { white-space: nowrap; }
.acct-todo li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .6rem; }
.acct-todo li .num { margin-left: auto; font-variant-numeric: tabular-nums; }
.acct-tick { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; flex-direction: row; margin: .15rem 0; }
.acct-tick .small { flex-basis: 100%; padding-left: 1.5rem; }
.acct-prints { display: flex; flex-direction: column; align-items: stretch; gap: .3rem; }
.acct-queue td:nth-child(2) { min-width: 10rem; }
.acct-upload-bar .btn { white-space: normal; width: 100%; }
.acct-exports { flex-wrap: wrap; gap: .5rem; }
.acct-notice { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; color: var(--text); }
.tile .t-sub .warn { color: var(--warn); }

/* Smart rates (views.js estimateEdit #smartRate, views/rates.js): the suggested markup beside Wes's own. */
.smart-rate { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem .75rem; border: 1px dashed var(--accent); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.smart-rate.hidden { display: none; }
.smart-rate .row { flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
/* The whole suggestion, drawn like a primary button without the .primary class: other screens' tests and habits press
   "#f button.primary" for Save proposal, and this box sits inside that form. */
.smart-rate [data-rate-approve]:first-child { background: var(--gradient); border-color: transparent; color: #fff; }
@media (max-width: 640px) { .smart-rate { flex-direction: column; align-items: stretch; } .smart-rate .row { justify-content: flex-start; } }
#rf table input[type=number] { width: 5.5rem; text-align: right; }
#rf table.list th, #rf table.list td { padding: .55rem .7rem; vertical-align: middle; }
/* Tighter cells than other lists, so the table stays inside its card: the usual bleed to the card's edge (negative
   margin) would be clipped by .scroll and cut off the first letters. */
#rf .card > .scroll > table.list { margin: 0; width: 100%; }
#rf table.list td.small { min-width: 16rem; }
