@import url('https://fonts.googleapis.com/css2?family=Barlow+Semi+Condensed:wght@600;700;800&family=DM+Sans:wght@400;500;600;650;700;750&display=swap');

:root {
  color-scheme: light;
  --canvas: #f0eee4;
  --paper: #f9f7ee;
  --surface: #fffdf7;
  --ink: #202c20;
  --muted: #555f50;
  --line: #ddded0;
  --sidebar: #10271c;
  --sidebar-text: #d1dbca;
  --sidebar-muted: #b0c2aa;
  --forest: #315138;
  --forest-deep: #203d2b;
  --blaze: #f69751;
  --orange: #a84218;
  --orange-hover: #8d3312;
  --orange-ink: #763511;
  --orange-wash: #faeadb;
  --focus: #b44c21;
  /* Job type colours: windows green, shower doors blue, everything else neutral. */
  --cat-windows: #22643a;
  --cat-windows-bg: #dcefe1;
  --cat-windows-mark: #3f9a5d;
  --cat-windows-on-dark: #8fdaa6;
  --cat-showers: #1d5797;
  --cat-showers-bg: #dde9f8;
  --cat-showers-mark: #3a7bd0;
  --cat-showers-on-dark: #9cc4f5;
  --cat-misc: #625548;
  --cat-misc-bg: #eee8df;
  --cat-misc-mark: #9d8a74;
  --font: "DM Sans", "Segoe UI", Arial, sans-serif;
  --display: "Barlow Semi Condensed", "DM Sans", "Segoe UI", sans-serif;
  font: 16px/1.5 var(--font);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .6; }
a { color: var(--forest); text-underline-offset: .2em; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
.sprites { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; display: inline-block; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip-link:focus { position: fixed; top: 10px; left: 10px; z-index: 10; padding: 8px 12px; background: var(--surface); border-radius: 8px; }
.app-shell { display: grid; grid-template-columns: 239px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; display: flex; flex-direction: column; min-height: 100vh; max-height: 100vh;
  padding: 29px 16px 16px; overflow-y: auto; background-color: var(--sidebar); color: var(--sidebar-text);
  background-image: radial-gradient(ellipse at top right, #58744930, transparent 55%),
    repeating-linear-gradient(136deg, #cbd6ad07 0 1px, transparent 1px 6px);
}
.brand { display: flex; align-items: center; gap: 12px; margin: 0 5px 43px; text-decoration: none; color: var(--surface); }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; flex: none; color: var(--sidebar); background: var(--blaze); border: 1px solid #ffb076; border-radius: 9px; }
.brand-mark .icon { width: 24px; height: 24px; }
.brand strong { display: block; font: 800 1.28rem/1.1 var(--display); letter-spacing: -.02em; }
.brand small { display: block; margin-top: 4px; color: #f2b281; font-size: .66rem; font-weight: 700; letter-spacing: .14em; }
.sidebar-section h2 { margin: 0 11px 8px; color: var(--sidebar-muted); font-size: .715rem; font-weight: 750; letter-spacing: .14em; }
.sidebar-resources { margin-top: 34px; }
.nav-button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px 11px; border: 0; border-radius: 8px; background: transparent; color: inherit; text-align: left; font-size: .91rem; font-weight: 600; cursor: pointer; }
.nav-button + .nav-button { margin-top: 3px; }
.nav-button:hover { background: #244536; color: white; }
.nav-button.is-active { background: #2d4938; color: #f9f0df; box-shadow: inset 3px 0 var(--blaze); font-weight: 750; }
.nav-button.is-active .icon { color: var(--blaze); }
.sidebar-footer { display: flex; align-items: center; gap: 10px; margin: auto 2px 0; padding: 17px 3px 0; border-top: 1px solid #42604a; }
.workspace-monogram { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border: 1px solid #59715a; border-radius: 9px; color: #e8efde; font-size: .73rem; font-weight: 750; background: #294733; }
.sidebar-footer strong { display: block; color: #f4f4e9; font-size: .79rem; font-weight: 750; }
.sidebar-footer small { display: block; color: var(--sidebar-muted); font-size: .75rem; }

main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 63px; padding: 0 clamp(19px, 3.1vw, 46px); border-bottom: 1px solid var(--line); background: var(--paper); }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .89rem; }
.breadcrumbs .icon { width: 15px; height: 15px; color: #6a755f; }
.breadcrumbs strong { color: var(--ink); font-weight: 750; }
.workspace-action { min-height: 36px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--orange-ink); font-size: .855rem; font-weight: 750; cursor: pointer; }
.workspace-action:hover { background: var(--orange-wash); border-color: #d7a17e; }
.mobile-menu { display: none !important; }
.page-content { width: min(100%, 1550px); margin: 0 auto; padding: 27px clamp(19px, 3.1vw, 46px) 60px; }
.page-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 19px;
  padding: 18px clamp(16px, 2.4vw, 30px); border: 1px solid #2e4a35; border-radius: 11px; color: #fff9ec;
  background-color: var(--forest-deep);
  background-image: repeating-radial-gradient(ellipse at 117% 36%, transparent 0 13px, #f5ead217 14px, transparent 15px 26px),
    linear-gradient(105deg, #162d22 14%, #274530 73%, #314c32);
  box-shadow: 0 4px 12px #1e302118;
}
.page-heading > div { min-width: 0; }
.page-heading h1 { font: 800 clamp(2.2rem, 4vw, 2.95rem)/1 var(--display); letter-spacing: -.024em; overflow-wrap: anywhere; }
.page-heading p { margin-top: 7px; color: #e1e8d6; font-size: .97rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; font-size: .9rem; font-weight: 750; line-height: 1.35; text-decoration: none; border: 1px solid transparent; border-radius: 8px; white-space: nowrap; cursor: pointer; }
.button svg { width: 18px; height: 18px; flex: none; }
.button-primary { background: var(--orange); color: white; border-color: var(--orange); }
.button-primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
.button-secondary { background: var(--surface); color: var(--ink); border-color: #bfc5b0; }
.button-secondary:hover { border-color: #9aa48a; background: #f0f1e7; }
.new-job { flex: none; padding: 10px 15px; min-height: 43px; background: var(--blaze); border-color: var(--blaze); color: var(--sidebar); box-shadow: 0 2px 3px #182d192d; }
.new-job:hover { background: #ffb076; border-color: #ffb076; }
.new-job:focus-visible, .sidebar :focus-visible { outline-color: var(--blaze); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 25px; }
.metric-card { display: grid; grid-template: auto auto / 41px minmax(0, 1fr); align-items: center; gap: 3px 13px; min-height: 96px; width: 100%; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: 0 2px 3px #1d2b1809; text-align: left; cursor: pointer; }
.metric-card:hover { border-color: #8f9e7d; background: #fbfcf4; }
.metric-card.is-active, .metric-card[aria-pressed="true"] { border-color: #ba744b; background: #fff5e9; box-shadow: inset 0 3px var(--orange); }
.metric-icon { display: grid; place-items: center; grid-row: span 2; width: 41px; height: 41px; border-radius: 10px; }
.metric-blue { color: #365938; background: #e6eddf; }
.metric-amber { color: #854214; background: #f9ead4; }
.metric-red { color: #a3261b; background: #fbe3dc; }
.metric-purple { color: #5c4769; background: #eee7ee; }
.metric-green { color: #2b5838; background: #e1eddc; }
.metric-label { align-self: end; color: var(--muted); font-size: .875rem; font-weight: 650; }
.metric-card strong { align-self: start; color: var(--forest-deep); font: 800 1.96rem/1.05 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }

.job-panel { --job-columns: minmax(155px, 1.6fr) minmax(96px, .8fr) minmax(114px, .95fr) minmax(94px, .8fr) minmax(88px, .75fr) minmax(76px, .65fr) minmax(100px, 1.08fr) minmax(52px, .5fr) 15px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 3px 8px #26361f0a; }
.job-panel-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 67px; padding: 13px 19px 10px; }
.job-panel-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.job-panel-heading h2 { color: var(--forest-deep); font: 800 1.32rem/1.3 var(--display); letter-spacing: -.015em; }
#job-count { color: var(--muted); font-size: .81rem; white-space: nowrap; }
.search-field { display: flex; align-items: center; gap: 8px; width: min(100%, 302px); min-height: 39px; padding: 0 9px 0 11px; border: 1px solid #a5ae99; border-radius: 8px; color: #52634e; background: var(--surface); }
.search-field:focus-within { border-color: var(--focus); box-shadow: 0 0 0 2px #f4d3bc; }
.search-field .icon { width: 17px; height: 17px; }
.search-field input { min-width: 0; width: 100%; padding: 7px 0; border: 0; outline: none !important; background: transparent; color: var(--ink); font-size: .91rem; }
.search-field input::placeholder { color: #586650; }
kbd { border: 1px solid #dcdece; border-radius: 4px; min-width: 19px; padding: 0 4px; color: #58654e; background: #f0f0e6; text-align: center; font: 600 .76rem/1.4 var(--font); }
.status-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 19px 14px; }
.status-filters button { min-height: 32px; padding: 4px 9px; border: 1px solid #d9ddcd; border-radius: 6px; background: var(--surface); color: #52604c; font-weight: 650; font-size: .824rem; white-space: nowrap; cursor: pointer; }
.status-filters button:hover { background: #f4f6ea; border-color: #a3b294; }
.status-filters button.is-active { border-color: #e2b697; background: var(--orange-wash); color: var(--orange-ink); font-weight: 750; }
.job-table-head, .job-row { display: grid; grid-template-columns: var(--job-columns); align-items: center; gap: 12px; width: 100%; padding-inline: 19px; text-align: left; }
.job-table-head { min-height: 38px; border-top: 1px solid #e1e4d5; border-bottom: 1px solid #d6dbca; background: #eef1e5; color: #46573f; font-size: .78rem; font-weight: 750; }
.job-row { min-height: 64px; padding-block: 9px; border: 0; border-bottom: 1px solid #e8e9dd; background: var(--surface); color: var(--ink); cursor: pointer; }
.job-row:last-child { border-bottom: 0; }
.job-row:hover { background: #f6f5e9; }
.job-row:focus-visible { outline-offset: -3px; }
.job-customer { display: flex; align-items: center; min-width: 0; gap: 10px; }
.job-customer > span:last-child { min-width: 0; }
.job-customer strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .918rem; font-weight: 750; }
.job-customer small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .8rem; }
.job-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 8px; background: #e6ebdf; color: #36523c; font-size: .75rem; font-weight: 800; }
.job-category, .job-next, .job-updated { color: #4e5e4c; font-size: .875rem; }
.job-money, .job-supplier-date, .job-install-date { min-width: 0; color: var(--ink); font-size: .868rem; }
.job-money strong, .job-supplier-date strong { display: block; font-weight: 750; overflow-wrap: anywhere; }
.job-install-date time { display: block; font-weight: 750; white-space: nowrap; }
.job-install-date.is-missing { color: var(--muted); }
.job-money { font-variant-numeric: tabular-nums; }
.job-money small, .job-supplier-date small, .job-install-date small { display: block; color: var(--muted); font-size: .75rem; }
.job-money.is-missing strong, .job-supplier-date.is-missing strong { color: var(--muted); font-size: .785rem; font-weight: 600; }
.job-row .job-mobile-label { display: none; }
.job-next { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.32; }
.job-updated { white-space: nowrap; font-size: .82rem; }
.job-chevron { color: #647458; }
.job-chevron svg { display: block; width: 15px; height: 15px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 7px; border: 1px solid transparent; border-radius: 50px; color: #4c584a; background: #eeefe9; font-size: .765rem; line-height: 1.25; font-weight: 750; white-space: nowrap; }
.job-stage { min-width: 0; }
.job-stage .status-pill { gap: 4px; padding-inline: 5px; font-size: .73rem; white-space: normal; }
.status-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.status-measuring { color: #78450f; background: #f9ebd3; border-color: #ecd5af; }
.status-quoted { color: #344f69; background: #e6ecf0; border-color: #d5e1e8; }
.status-ordered { color: #465b27; background: #e7edd8; border-color: #d9e3c1; }
.status-scheduled { color: #5a456d; background: #eee8ef; border-color: #e4d7e7; }
.status-completed { color: #245438; background: #e5efdf; border-color: #d5e5ce; }
.status-installed { color: #6a4a0e; background: #fbefcf; border-color: #efdca6; }
.status-lost { color: #6b605a; background: #eeeae6; border-color: #e0dad4; }
.loading-state, .empty-state { display: grid; justify-items: center; gap: 7px; padding: 37px 15px; color: var(--muted); text-align: center; }
.empty-state h3, .empty-state strong { color: var(--ink); }
.empty-state svg { width: 26px; height: 26px; color: #456547; }
.empty-state .button { margin-top: 5px; }

.icon-button, .dialog-close { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 1px solid #d6dcc8; border-radius: 8px; background: var(--surface); color: #41573f; cursor: pointer; }
.icon-button:hover, .dialog-close:hover { background: #eff2e8; border-color: #9cae92; }
.dialog-close svg { width: 18px; height: 18px; }
.job-category { display: flex; align-items: center; gap: 6px; }
.cat-windows { color: var(--cat-windows); background-color: var(--cat-windows-bg); }
.cat-showers { color: var(--cat-showers); background-color: var(--cat-showers-bg); }
.cat-misc { color: var(--cat-misc); background-color: var(--cat-misc-bg); }
.cat-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 6px; border-radius: 50px; font-size: .78rem; font-weight: 750; white-space: nowrap; }
.cat-pill svg { flex: none; }
.job-category { min-width: 0; }
.job-category .cat-pill { max-width: 100%; }
.cat-pill > span { overflow: hidden; text-overflow: ellipsis; }
.dialog-eyebrow .cat-pill { font-size: .76rem; }
#category-nav [data-category="windows"] .icon { color: var(--cat-windows-on-dark); }
#category-nav [data-category="showers"] .icon { color: var(--cat-showers-on-dark); }
dialog { width: min(640px, calc(100% - 26px)); max-height: calc(100dvh - 44px); margin: auto; padding: 0; overflow: hidden; border: 1px solid #d6dcc8; border-radius: 15px; box-shadow: 0 20px 75px #18331f55; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: #12231880; }
dialog.details-dialog { width: min(567px, 100%); max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; border-radius: 15px 0 0 15px; }
.dialog-shell { display: flex; flex-direction: column; max-height: calc(100dvh - 46px); }
.details-dialog .dialog-shell { min-height: 100%; max-height: 100%; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 22px 23px 14px; }
.dialog-eyebrow { margin-bottom: 4px; color: var(--orange-ink); font-size: .8rem; font-weight: 750; }
.dialog-header h2 { color: var(--forest-deep); font: 800 1.72rem/1.2 var(--display); letter-spacing: -.018em; overflow-wrap: anywhere; }
.dialog-description { margin-top: 4px; color: var(--muted); font-size: .94rem; }
.dialog-body { min-height: 0; flex: 1; overflow: auto; padding: 17px 23px 23px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 13px 23px; border-top: 1px solid var(--line); background: #f4f4e9; }
.detail-summary { display: flex; align-items: center; gap: 10px; padding: 0 23px 15px; color: var(--muted); font-size: .82rem; }
.detail-summary .status-pill { font-size: .84rem; }
.detail-tabs { display: flex; flex-shrink: 0; gap: 4px; padding-inline: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.detail-tab { flex: 0 0 auto; min-height: 42px; padding: 6px 8px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: .87rem; font-weight: 650; cursor: pointer; }
.detail-tab:hover, .detail-tab.is-active { color: var(--forest-deep); }
.detail-tab.is-active { border-bottom-color: var(--orange); font-weight: 750; }
.detail-section + .detail-section, .form-section { margin-top: 21px; padding-top: 18px; border-top: 1px solid var(--line); }
.detail-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 7px 15px; margin-bottom: 10px; }
.detail-section-heading h3 { color: var(--forest-deep); font: 800 1.14rem/1.35 var(--display); letter-spacing: -.012em; }
.detail-section p { overflow-wrap: anywhere; }
.detail-stage-track { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; list-style: none; margin: 10px 0 13px; padding: 0; }
.detail-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); text-align: center; font-size: .77rem; font-weight: 650; }
.detail-stage:not(:last-child)::after { position: absolute; top: 10px; left: calc(50% + 12px); width: calc(100% - 19px); height: 1px; background: #d7dfcd; content: ""; }
.detail-stage.is-past::after { background: #aabf9b; }
.detail-stage-indicator { z-index: 1; display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid #bfcaaf; border-radius: 50%; background: var(--surface); color: #315138; }
.detail-stage.is-past .detail-stage-indicator { border-color: #aabf9b; background: #e6efdf; }
.detail-stage.is-current { font-weight: 800; color: var(--orange-ink); }
.detail-stage.is-current .detail-stage-indicator { border: 5px solid var(--orange); }
.detail-stage.is-current:last-child .detail-stage-indicator { color: white; border: 0; background: var(--orange); }
.next-step-box { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid #d6dfcd; border-radius: 8px; background: #eef3e7; }
.next-step-box > span, .selection-finish > span { color: #4e654b; font-size: .8rem; font-weight: 700; }
.next-step-box strong { font-size: .94rem; }
.next-step-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.next-step-done { justify-self: start; margin-top: 6px; }
.next-step-form { gap: 10px; background: var(--surface); }
.next-step-finished { display: flex; align-items: center; gap: 6px; margin: 0; color: #2f6b3a; font-size: .88rem; font-weight: 700; }
.next-step-actions { display: flex; justify-content: flex-end; gap: 8px; }
.due-flag { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 50px; font-size: .74rem; font-weight: 750; line-height: 1.45; white-space: nowrap; vertical-align: 1px; }
.due-overdue { color: #fff; background: #b4321f; }
.due-today { color: #6b3a0c; background: #f9d9a8; }
.due-upcoming { color: #44533f; background: #e7ebdd; }
.due-warning { color: #7a3d0c; background: #fbe6cf; }
.detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 14px; margin: 0; }
.detail-field { min-width: 0; }
.detail-field dt { color: var(--muted); font-size: .83rem; }
.detail-field dd { margin: 3px 0 0; font-size: .93rem; font-weight: 650; overflow-wrap: anywhere; }
.job-amount-dates .detail-field:first-child dd { color: var(--forest-deep); font-weight: 800; }
.source-links { display: flex; flex-wrap: wrap; gap: 4px 13px; margin-top: 7px; }
.material-cost { display: grid; gap: 8px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: #eef3e7; }
.material-cost > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.material-cost > div span { color: var(--muted); font-size: .85rem; font-weight: 700; }
.material-cost strong { color: var(--forest-deep); font-size: 1rem; font-variant-numeric: tabular-nums; }
.material-cost summary { width: fit-content; color: var(--forest); font-size: .85rem; font-weight: 750; cursor: pointer; }
.material-sources { display: grid; justify-items: start; margin-top: 3px; }
.material-sources a { white-space: normal; overflow-wrap: anywhere; }
.material-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.material-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.material-row > span { display: grid; justify-items: start; min-width: 0; overflow-wrap: anywhere; }
.material-row small { color: var(--muted); font-size: .78rem; }
.material-row strong { font-size: .92rem; }
.material-add { margin-top: 10px; }
.material-add summary { width: fit-content; color: var(--forest); font-size: .88rem; font-weight: 750; cursor: pointer; }
.material-add form { display: grid; gap: 10px; margin-top: 10px; }
.material-add form .button { justify-self: start; }
.danger-text, .danger-text:hover { color: #a3261b; }
.dialog-muted, .activity-row small { color: var(--muted); font-size: .875rem; }
.preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.text-button { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 2px 0; border: 0; background: transparent; color: var(--forest); font-size: .87rem; font-weight: 750; white-space: nowrap; cursor: pointer; text-decoration: none; }
.text-button:hover { color: var(--orange-ink); text-decoration: underline; }
.selection-card { display: grid; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; }
.selection-card + .selection-card { margin-top: 10px; }
.selection-card h4 { font: 800 1rem/1.35 var(--display); }
.selection-finish { display: grid; padding: 9px 10px; border-radius: 7px; background: #ebf1e4; }
.selection-finish strong { font: 800 1.12rem/1.35 var(--display); }
.selection-source { display: flex; align-items: flex-start; gap: 7px; padding-top: 8px; border-top: 1px solid #e5e8d9; color: var(--muted); font-size: .81rem; }
.selection-source svg { flex: none; color: #4a6b4b; }
.document-row, .activity-row { display: flex; align-items: center; gap: 8px 11px; min-height: 60px; padding: 7px 0; border-bottom: 1px solid #e9ecdf; }
.document-row:last-child, .activity-row:last-child { border-bottom: 0; }
.document-icon, .integration-icon { display: grid; place-items: center; flex: none; width: 35px; height: 35px; border-radius: 8px; background: #eaf0e3; color: #456543; }
.document-name { flex: 1; min-width: 0; }
.document-name strong, .activity-row strong { display: block; font-size: .92rem; overflow-wrap: anywhere; }
.document-name small { display: block; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.document-kind { display: inline-block; margin: 3px 0; padding: 1px 5px; border-radius: 4px; color: #365a39; background: #e6efdf; font-size: .72rem; font-weight: 750; }
.document-actions { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 2px 10px; }
.document-upload-options { margin: 0 0 6px; }
.document-upload-options summary { width: fit-content; color: var(--forest); font-size: .85rem; font-weight: 750; cursor: pointer; }
.document-upload-options .field-grid { margin: 8px 0 12px; }
.document-filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(146px, auto); gap: 8px; }
.document-count { margin: 7px 0 2px; color: var(--muted); font-size: .82rem; }
#document-preview { width: min(820px, calc(100% - 26px)); }
.preview-body { min-height: 180px; background: #eef1e5; }
.preview-body iframe { width: 100%; height: min(65vh, 670px); border: 0; }
.preview-body img { display: block; width: auto; max-width: 100%; max-height: 65vh; margin-inline: auto; }
.preview-body pre { margin: 0; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.upload-button { cursor: pointer; }
.upload-button:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.upload-button input { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.dialog-search { display: flex; align-items: center; gap: 8px; padding: 0 9px; border: 1px solid #a5ae99; border-radius: 8px; color: var(--muted); }
.dialog-search input { width: 100%; padding: 8px 0; border: 0; border-radius: 5px; background: transparent; }
.dialog-search:focus-within { outline: 2px solid var(--focus); }
.dialog-search input:focus { outline: none !important; }
.integration-card { display: flex; align-items: flex-start; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.integration-card + .integration-card { margin-top: 9px; }
.integration-card > div { flex: 1; min-width: 0; }
.integration-card h3 { font: 800 .97rem/1.35 var(--display); }
.integration-card p { color: var(--muted); font-size: .87rem; }
.integration-icon { width: 37px; height: 37px; }
.integration-quickbooks { background: #e5efe2; color: #346140; }
.integration-email { background: #f7e9df; color: #874631; }
.integration-dot { font: 800 1.13rem/1 var(--display); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 13px; }
.field { min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 4px; color: #41563e; font-size: .855rem; font-weight: 750; }
.field input, .field textarea, .field select { width: 100%; min-height: 39px; padding: 7px 9px; border: 1px solid #a5ae99; border-radius: 7px; background: var(--surface); color: var(--ink); font-size: .92rem; }
.field select { appearance: none; padding-right: 29px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='9' viewBox='0 0 13 9'%3E%3Cpath d='m2 2 4.5 4.5L11 2' fill='none' stroke='%23596551' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E"); background-position: right 8px center; background-repeat: no-repeat; }
.field textarea { display: block; min-height: 66px; resize: vertical; }
.door-fields { min-width: 0; margin: 8px 0 0; padding: 6px 11px 11px; border: 1px solid var(--line); border-radius: 8px; }
.door-fields legend, .invoice-form summary { color: #41563e; font-size: .9rem; font-weight: 750; }
.remove-door { float: right; margin-top: -4px; }
.door-fields .field-grid { clear: both; }
.invoice-form summary { cursor: pointer; }
.invoice-form .field-grid, .invoice-form .dialog-muted { margin-top: 8px; }
.invoice-advanced { margin-top: 9px; }
.invoice-advanced summary { color: var(--forest); font-size: .84rem; }
.form-field-note { margin-block: 7px 12px; }
.form-error { margin-top: 9px; padding: 8px 9px; border: 1px solid #e9c6ae; border-radius: 7px; background: #fbede5; color: #8c361d; font-size: .885rem; overflow-wrap: anywhere; }
.toast { position: fixed; right: 18px; bottom: 15px; z-index: 4; max-width: calc(100% - 36px); padding: 10px 13px; border: 1px solid #56744e; border-radius: 8px; color: var(--surface); background: #244832; box-shadow: 0 5px 15px #152a1d45; font-size: .88rem; font-weight: 650; }
.toast.is-error { background: #703523; border-color: #a65b3e; }

@media (max-width: 1260px) {
  .job-panel { --job-columns: minmax(148px, 1.6fr) minmax(92px, .8fr) minmax(114px, .95fr) minmax(90px, .8fr) minmax(83px, .75fr) minmax(73px, .65fr) minmax(94px, 1.08fr) 15px; }
  .job-updated-head, .job-updated { display: none; }
}
@media (max-width: 1150px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .job-panel { --job-columns: minmax(143px, 1.5fr) minmax(83px, .75fr) minmax(110px, .94fr) minmax(86px, .8fr) minmax(77px, .72fr) minmax(69px, .65fr) minmax(79px, .98fr) 14px; }
  .job-table-head, .job-row { gap: 9px; padding-inline: 13px; }
  .job-category svg { display: none; }
  .metric-card { padding-inline: 11px; gap: 3px 8px; }
}
@media (max-width: 1050px) {
  .job-panel { --job-columns: minmax(133px, 1.5fr) minmax(107px, .95fr) minmax(82px, .8fr) minmax(72px, .68fr) minmax(69px, .65fr) minmax(74px, .9fr) 13px; }
  .job-category-head, .job-category { display: none; }
}
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 182px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .sidebar-footer strong { font-size: .73rem; }
  .workspace-monogram { display: none; }
  .job-panel { --job-columns: minmax(112px, 1.5fr) minmax(107px, .95fr) minmax(78px, .8fr) minmax(64px, .68fr) minmax(65px, .65fr) minmax(55px, .9fr) 13px; }
  .metric-card { grid-template-columns: 32px minmax(0, 1fr); min-height: 79px; }
  .metric-icon { width: 32px; height: 32px; }
  .metric-icon .icon { width: 18px; height: 18px; }
  .metric-label { font-size: .81rem; }
}
@media (max-width: 815px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 3; left: 0; width: 230px; min-height: 100dvh; max-height: 100dvh; padding-inline: 16px; transform: translateX(-100%); visibility: hidden; }
  .sidebar.is-open { transform: translateX(0); visibility: visible; box-shadow: 0 0 0 100vmax #13291d73; }
  .sidebar-footer { gap: 9px; }
  .workspace-monogram { display: grid; }
  .mobile-menu { display: grid !important; }
  .topbar { min-height: 55px; justify-content: flex-start; }
  .workspace-action { margin-left: auto; }
  .page-content { padding-top: 23px; }
}
@media (max-width: 620px) {
  .job-panel { --job-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 12px; }
  .job-table-head, .job-category { display: none; }
  .job-row { grid-template-rows: auto auto auto; min-height: 98px; padding-inline: 10px; gap: 5px 8px; }
  .job-customer { grid-column: 1 / 3; grid-row: 1; gap: 6px; }
  .job-stage { grid-column: 3; grid-row: 1; justify-self: end; }
  .job-money { grid-column: 1; grid-row: 2; }
  .job-supplier-date { grid-column: 2; grid-row: 2; }
  .job-install-date { grid-column: 3; grid-row: 2; }
  .job-install-date.is-missing { display: none; }
  .job-row .job-mobile-label { display: block; }
  .job-next { grid-column: 1 / 4; grid-row: 3; }
  .job-chevron { grid-column: 4; grid-row: 1 / 4; }
  .job-chevron svg { width: 12px; }
  .job-avatar { width: 31px; height: 31px; }
}
@media (max-width: 520px) {
  .topbar, .page-content { padding-inline: 12px; }
  .topbar { gap: 8px; }
  .breadcrumbs { gap: 5px; font-size: .82rem; }
  .breadcrumbs .icon { width: 12px; }
  .workspace-action { padding-inline: 7px; }
  .page-heading { align-items: flex-start; gap: 10px; margin-bottom: 15px; padding: 14px 12px; }
  .page-heading p { font-size: .9rem; }
  .new-job { min-height: 38px; padding: 7px 8px; }
  .new-job .icon { width: 16px; }
      .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 17px; }
  .metric-card { min-height: 67px; }
  .job-panel-top { flex-wrap: wrap; gap: 7px; min-height: 0; padding: 10px; }
  .search-field { width: 100%; }
  kbd { display: none; }
  .status-filters { flex-wrap: nowrap; padding: 0 10px 10px; overflow-x: auto; }
  .job-customer strong { font-size: .87rem; }
  .job-customer small, .job-next { font-size: .76rem; }
  .status-pill { font-size: .73rem; }
  .dialog-header, .dialog-body, .dialog-footer { padding-inline: 15px; }
  .detail-summary { padding-inline: 15px; }
  .document-actions { max-width: 96px; gap: 0 7px; }
  .document-filter-bar { grid-template-columns: minmax(0, 1fr); }
  dialog.details-dialog { border-radius: 0; }
}
@media (prefers-reduced-motion: no-preference) { button, a { transition: background-color .15s, color .15s, border-color .15s; } }

.job-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.job-photo-actions .button { min-height: 44px; position: relative; }
.job-photo-actions .button:has(input:disabled) { opacity: .55; cursor: default; pointer-events: none; }
.job-photo-list { list-style: none; margin: 10px 0 0; padding: 0; }
.job-photo-list li { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.job-photo-list img { width: 40px; height: 40px; border-radius: 5px; object-fit: cover; flex: none; }
.job-photo-list span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.job-photo-list button { min-height: 44px; flex: none; }

/* Due date suggestions */
.suggest-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: -8px 0 17px; padding: 9px 12px; color: #674022; background: #fbecd9; border: 1px solid #ebc9a7; border-radius: 10px; font-size: .9rem; }
.suggest-banner > svg { flex: none; }
.suggest-banner > span { flex: 1; min-width: 200px; }
.suggest-banner .button { min-height: 34px; padding-block: 4px; }
dialog.due-review-dialog { width: min(760px, calc(100% - 26px)); }
.due-review-list { display: grid; margin: 0 0 12px; padding: 0; list-style: none; }
.due-review-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 10px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.due-review-row.is-skipped .due-review-text, .due-review-row.is-skipped .due-review-date { opacity: .45; }
.due-review-use { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--orange); }
.due-review-text strong { margin-right: 8px; }
.due-review-text > small { color: var(--muted); font-size: .8rem; }
.due-review-text p { margin: 3px 0 0; font-size: .9rem; line-height: 1.4; }
.due-review-text mark { padding: 0 2px; border-radius: 3px; color: inherit; background: #f9d9a8; font-weight: 700; }
.due-review-note { display: block; margin-top: 3px; color: #8a4a12 !important; }
.due-review-date { min-height: 36px; padding: 4px 8px; border: 1px solid #c9cfbc; border-radius: 7px; background: #fff; font: inherit; font-size: .9rem; }
.due-review-progress { margin-right: auto; align-self: center; color: var(--muted); font-size: .85rem; }
@media (max-width: 620px) {
  .due-review-row { grid-template-columns: auto minmax(0, 1fr); }
  .due-review-date { grid-column: 2; justify-self: start; }
}

/* Sidebar badge */
.nav-badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 50px; background: var(--blaze); color: var(--sidebar); font-size: .74rem; font-weight: 800; text-align: center; }

/* Money in the pipeline */
.pipeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin: -10px 0 22px; }
.pipeline-card { display: grid; gap: 1px; padding: 11px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
.pipeline-card:hover { border-color: #8f9e7d; background: #fbfcf4; }
.pipeline-card[aria-pressed="true"] { border-color: #ba744b; background: #fff5e9; box-shadow: inset 0 3px var(--orange); }
.pipeline-card span { color: var(--muted); font-size: .84rem; font-weight: 650; }
.pipeline-card strong { color: var(--forest-deep); font: 800 1.45rem/1.15 var(--display); font-variant-numeric: tabular-nums; }
.pipeline-card small { color: var(--muted); font-size: .78rem; }

/* Contractor filter chip on the board */
.filter-chip-row { padding: 0 19px 12px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border: 1px solid #e2b697; border-radius: 50px; background: var(--orange-wash); color: var(--orange-ink); font-size: .84rem; font-weight: 750; }
.filter-chip button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.filter-chip button:hover { background: #f3d4bd; }

/* Schedule, recent changes, contractors */
.view-panel { overflow: hidden; padding: 6px 19px 19px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 3px 8px #26361f0a; }
.view-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 8px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.segmented button { min-height: 32px; padding: 4px 10px; border: 1px solid #d9ddcd; border-radius: 6px; background: var(--surface); color: #52604c; font-weight: 650; font-size: .84rem; cursor: pointer; }
.segmented button[aria-pressed="true"] { border-color: #e2b697; background: var(--orange-wash); color: var(--orange-ink); font-weight: 750; }
.schedule-day h3, .changes-day { margin: 16px 0 4px; color: var(--forest-deep); font: 800 1.05rem/1.2 var(--display); }
.schedule-day.is-past h3 { color: #a3261b; }
.schedule-kind.cat-windows { border-left-color: var(--cat-windows-mark); }
.schedule-kind.cat-showers { border-left-color: var(--cat-showers-mark); }
.schedule-kind.cat-misc { border-left-color: var(--cat-misc-mark); }
.schedule-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #e9ecdf; }
.schedule-main { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; padding: 9px 0; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.schedule-main:hover strong { text-decoration: underline; }
.schedule-kind { flex: none; width: 104px; border-left: 3px solid; padding: 2px 8px; border-radius: 6px; font-size: .76rem; font-weight: 750; text-align: center; }
.schedule-text { display: grid; min-width: 0; }
.schedule-text strong { font-size: .93rem; }
.schedule-text small { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.schedule-links { display: flex; gap: 4px; }
.schedule-links a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; color: var(--forest); }
.schedule-links a:hover { background: #eef3e7; }

.activity-row { align-items: flex-start; }
.activity-body { flex: 1; min-width: 0; }
.activity-job { display: block; min-height: 0; padding: 0; white-space: normal; text-align: left; }
.activity-job span { color: var(--muted); font-weight: 600; }
.change-list { display: grid; gap: 1px; margin: 3px 0 2px; padding: 0; list-style: none; font-size: .84rem; }
.change-list li { overflow-wrap: anywhere; }
.change-list li > span:first-child { color: var(--muted); font-weight: 700; }
.undo-button { flex: none; min-height: 32px; padding: 4px 11px; font-size: .82rem; }
.activity-row.is-undone strong, .activity-row.is-undone .change-list { text-decoration: line-through; color: var(--muted); }
.undone-note { display: block; color: #8a4a12 !important; }
.activity-row.is-new { margin-inline: -8px; padding-inline: 8px; border-radius: 8px; background: #fff8ec; }
.new-dot { display: inline-block; margin-right: 4px; padding: 0 6px; border-radius: 50px; background: var(--orange); color: white; font-size: .7rem; vertical-align: 2px; }

.contractor-list { display: grid; margin-top: 8px; }
.contractor-card { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, .8fr)) 18px; align-items: center; gap: 12px; padding: 12px 0; border: 0; border-bottom: 1px solid #e9ecdf; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.contractor-card:hover strong { text-decoration: underline; }
.contractor-name { display: grid; }
.contractor-name small, .contractor-money small { color: var(--muted); font-size: .8rem; }
.contractor-attention { color: #a3261b; font-weight: 700; }
.contractor-money { display: grid; font-variant-numeric: tabular-nums; }
.company-review { margin: 10px 0 6px; padding: 14px; border: 1px solid #ebc9a7; border-radius: 10px; background: #fffaf2; }
.company-review h3 { margin: 0 0 4px; font: 800 1.1rem/1.2 var(--display); }
.company-input { width: min(220px, 100%); }
.view-panel .suggest-banner { margin: 10px 0 4px; }

/* Job drawer additions */
.attention-box { margin-bottom: 12px; padding: 9px 12px; border: 1px solid #efc9b8; border-radius: 8px; background: #fff4ee; }
.attention-box strong { display: block; color: #8d2d1d; font-size: .84rem; }
.attention-box ul { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0 0; padding: 0; list-style: none; }
.stage-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.stage-lost { margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; background: #eeeae6; color: #4f4741; font-size: .9rem; }
[data-stage-form] { margin: 12px 0; }
/* The drawer's fixed top must never be squeezed by the scrolling body below it. */
.dialog-header, .detail-summary, .contact-actions { flex-shrink: 0; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 23px 13px; }
.contact-action { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 5px 12px; border: 1px solid #c9d3bd; border-radius: 50px; background: #f3f6ec; color: var(--forest-deep); font-size: .86rem; font-weight: 750; text-decoration: none; }
.contact-action:hover { background: #e7eedb; }

@media (max-width: 815px) {
  .pipeline { gap: 8px; }
  .pipeline-card { padding: 8px 9px; }
  .pipeline-card span { font-size: .72rem; line-height: 1.25; }
  .pipeline-card strong { font-size: 1.12rem; }
  .pipeline-card small { font-size: .68rem; line-height: 1.3; }
  .contractor-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 18px; }
  .contractor-card .contractor-money:nth-of-type(3), .contractor-card .contractor-money:nth-of-type(4) { display: none; }
}
@media (max-width: 620px) {
  .view-panel { padding-inline: 12px; }
  .detail-stage { font-size: .68rem; }
  .schedule-kind { width: 76px; }
  .contact-actions { padding-inline: 15px; }
}

/* Schedule calendar */
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 2px 0 8px; color: var(--muted); font-size: .8rem; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.legend-swatch.cat-windows { background: var(--cat-windows-mark); }
.legend-swatch.cat-showers { background: var(--cat-showers-mark); }
.legend-swatch.cat-misc { background: var(--cat-misc-mark); }
.legend-overdue { border: 2px solid #b4321f; }
.legend-done { background: #d8dccf; opacity: .7; }
.cal-head { display: flex; align-items: center; gap: 6px; margin: 6px 0 10px; }
.cal-head h3 { min-width: 170px; margin: 0; color: var(--forest-deep); font: 800 1.3rem/1.2 var(--display); text-align: center; }
.cal-head [data-cal-move="-1"] svg { transform: rotate(180deg); }
.cal-today { min-height: 34px; margin-left: 6px; padding-block: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-weekday { padding: 6px 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f4f4e9; color: var(--muted); font-size: .76rem; font-weight: 750; }
.cal-day { min-height: 104px; padding: 4px 5px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; }
.cal-day:hover { background: #fbfcf4; }
.cal-day.is-outside { background: #f7f6ef; }
.cal-day.is-outside .cal-num { color: #a1a596; }
.cal-day.is-selected { background: #fff5e9; box-shadow: inset 0 0 0 2px #e2b697; }
.cal-num { display: grid; place-items: center; width: 26px; height: 26px; margin-bottom: 2px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-size: .82rem; font-weight: 750; cursor: pointer; }
.cal-day.is-today .cal-num { background: var(--orange); color: white; }
.cal-events { display: grid; gap: 3px; }
.cal-event { display: block; width: 100%; min-width: 0; padding: 2px 5px; border: 0; border-left: 3px solid; border-radius: 4px; font-size: .72rem; font-weight: 650; line-height: 1.3; text-align: left; cursor: pointer; }
.cal-event.cat-windows { border-left-color: var(--cat-windows-mark); }
.cal-event.cat-showers { border-left-color: var(--cat-showers-mark); }
.cal-event.cat-misc { border-left-color: var(--cat-misc-mark); }
.cal-event:hover { filter: brightness(.96); text-decoration: underline; }
.cal-event.is-overdue { box-shadow: inset 0 0 0 1.5px #b4321f; }
.cal-event.is-done { opacity: .5; }
.cal-text { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* Wide screens show three events as text and count the rest; phones show every event as a dot. */
.cal-event.is-extra { display: none; }
.cal-more { color: var(--muted); font-size: .72rem; font-weight: 700; }
.cal-day-panel { margin-top: 16px; }
.cal-day-panel h3 { margin: 0 0 4px; color: var(--forest-deep); font: 800 1.05rem/1.2 var(--display); }
.schedule-row.is-done { opacity: .6; }
@media (max-width: 700px) {
  .cal-head h3 { min-width: 0; flex: 1; font-size: 1.02rem; white-space: nowrap; }
  .cal-weekday { padding: 4px 2px; text-align: center; font-size: .68rem; }
  .cal-day { min-height: 56px; padding: 2px; }
  .cal-num { width: 24px; height: 24px; margin: 0 auto 2px; font-size: .78rem; }
  /* Events become coloured dots; tapping the day lists them below. */
  .cal-events { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .cal-event { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; pointer-events: none; }
  .cal-event.cat-windows { background: var(--cat-windows-mark); }
  .cal-event.cat-showers { background: var(--cat-showers-mark); }
  .cal-event.cat-misc { background: var(--cat-misc-mark); }
  .cal-event.is-overdue { box-shadow: 0 0 0 1.5px #b4321f; }
  .cal-text { display: none; }
  .cal-event.is-extra { display: block; }
  .cal-more { display: none; }
}
.workspace-action { white-space: nowrap; }

/* Integrations screen */
.connection-list { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.connection-row { display: flex; align-items: flex-start; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfbf5; }
.connection-row > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.connection-row strong { display: block; font-size: .9rem; }
.connection-row small { display: block; color: var(--muted); font-size: .8rem; }
.connection-dot { flex: none; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: #3f9a5d; }
.connection-dot.is-error { background: #b4321f; }
.connection-error { display: block; color: #a3261b !important; }
.connect-button { margin-top: 10px; }
.setup-note { margin-top: 8px; padding: 7px 10px; border-radius: 7px; background: #f4f1e8; color: #5b5245; font-size: .84rem; }
.sandbox-tag { padding: 1px 7px; border-radius: 50px; background: #f9ead4; color: #854214; font: 700 .7rem/1.6 var(--font); vertical-align: 2px; }
.toggle-row { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: .9rem; font-weight: 650; }
.toggle-row input { width: 18px; height: 18px; accent-color: var(--orange); }
.integration-settings { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.integration-settings summary { color: var(--forest); font-weight: 750; cursor: pointer; }
.integration-settings form { display: grid; gap: 10px; margin-top: 10px; }
.integration-settings form .button { justify-self: start; }
.sync-line { display: grid; gap: 3px; margin-top: 12px; color: var(--muted); font-size: .85rem; }

/* Job emails */
.email-row { display: grid; gap: 5px; padding: 11px 0; border-bottom: 1px solid #e9ecdf; }
.email-row:last-child { border-bottom: 0; }
.email-head strong { display: block; font-size: .93rem; overflow-wrap: anywhere; }
.email-head small { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.email-snippet { margin: 0; color: #3f4b3d; font-size: .86rem; }
.email-files { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding: 0; list-style: none; font-size: .8rem; color: var(--muted); }
.email-files li { display: inline-flex; align-items: center; gap: 4px; }
.email-filed { padding: 0 6px; border-radius: 50px; background: var(--cat-windows-bg); color: var(--cat-windows); font-weight: 700; }
.email-ai { display: flex; align-items: flex-start; gap: 6px; margin: 0; padding: 6px 9px; border-radius: 7px; background: #f3f6ec; font-size: .84rem; }
.email-ai svg { flex: none; margin-top: 2px; color: var(--forest); }
.email-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.email-match { color: var(--muted); font-size: .78rem; }
.email-actions [data-email-hide] { margin-left: auto; }
.email-text pre { max-height: 360px; overflow: auto; margin: 4px 0 0; padding: 10px; border-radius: 8px; background: #f6f6ef; font: .84rem/1.45 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; }

/* QuickBooks invoice search on a job */
.qb-search { display: flex; gap: 8px; margin-bottom: 8px; }
.qb-search input { flex: 1; min-width: 0; min-height: 40px; padding: 6px 10px; border: 1px solid #c9cfbc; border-radius: 8px; font: inherit; }
.qb-results { display: grid; margin: 0; padding: 0; list-style: none; }
.qb-results li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #e9ecdf; }
.qb-results li > span { display: grid; flex: 1; min-width: 0; }
.qb-results small { color: var(--muted); font-size: .8rem; }
.integration-card { min-width: 0; }
.connection-row { flex-wrap: wrap; }
.connection-row > div { flex: 1 1 200px; }
@media (max-width: 620px) {
  .integration-card .integration-icon { display: none; }
  .integration-card { padding: 11px; }
}
.connect-button { max-width: 100%; white-space: normal; text-align: left; }
.detail-stage { font-size: .72rem; overflow-wrap: anywhere; }

/* Sign-in and account */
dialog.sign-in-dialog { width: min(400px, calc(100% - 26px)); }
dialog.sign-in-dialog::backdrop { background: var(--sidebar); }
.sign-in-body { display: grid; gap: 12px; padding: 26px; }
.sign-in-mark { width: 46px; height: 46px; }
.sign-in-body h2 { margin: 0; color: var(--forest-deep); font: 800 1.6rem/1.1 var(--display); }
.sign-in-body .button { width: 100%; }
.sidebar-account { flex: 1; min-width: 0; }
.sidebar-account small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-button { flex: none; padding: 4px 9px; border: 1px solid #42604a; border-radius: 6px; background: transparent; color: var(--sidebar-text); font-size: .76rem; font-weight: 700; cursor: pointer; }
.account-button:hover { background: #244536; color: white; }
.account-password { display: grid; gap: 10px; }
.account-password h3 { margin: 0; font: 800 1.05rem/1.2 var(--display); }
.account-password .button { justify-self: start; }

/* People */
dialog.people-dialog { width: min(720px, calc(100% - 26px)); }
.people-list { display: grid; margin: 0 0 12px; padding: 0; list-style: none; }
.person-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 11px 0; border-bottom: 1px solid #e9ecdf; }
.person-main { flex: 1 1 260px; min-width: 0; }
.person-main strong { font-size: .95rem; }
.person-main small { display: block; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.person-tag { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 50px; background: #eeefe9; color: #4c584a; font-size: .72rem; font-weight: 750; vertical-align: 1px; }
.person-tag.is-admin { background: var(--orange-wash); color: var(--orange-ink); }
.person-tag.is-off { background: #f1e1dd; color: #8d2d1d; }
.person-actions { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.person-self-note { font-size: .8rem; }
.people-add { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.people-add summary { display: inline-flex; align-items: center; gap: 6px; color: var(--forest); font-weight: 750; cursor: pointer; }
.people-add form { display: grid; gap: 10px; margin-top: 10px; }
.people-add form .button { justify-self: start; }
.temporary-password { display: grid; gap: 6px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #e2b697; border-radius: 10px; background: #fff5e9; }
.temporary-password p { margin: 0; font-size: .87rem; }
.temporary-value { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.temporary-value code { padding: 6px 10px; border-radius: 7px; background: #fff; font: 700 1.05rem/1.3 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .04em; user-select: all; }
.temporary-value code { white-space: nowrap; }
@media (max-width: 620px) { .temporary-value code { font-size: .92rem; letter-spacing: 0; } }
