:root {
  --navy: #06224a;
  --navy-deep: #06224a;
  --blue: #0067d8;
  --blue-soft: #eaf3ff;
  --orange: #ff7a00;
  --green: #187b3a;
  --green-soft: #eaf7ee;
  --amber: #a85a00;
  --amber-soft: #fff5e5;
  --red: #a53636;
  --red-soft: #fff0ef;
  --ink: #071d3d;
  --muted: #5f6675;
  --canvas: #f6faff;
  --surface: #fff;
  --line: #d8dee8;
  --shadow: 0 12px 30px rgb(6 34 74 / 10%), 0 2px 7px rgb(6 34 74 / 6%);
  --shadow-raised: 0 18px 46px rgb(6 34 74 / 14%), 0 3px 10px rgb(6 34 74 / 8%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; overflow-x: hidden; background: radial-gradient(circle at 92% 3%, rgb(0 103 216 / 8%), transparent 30rem), var(--canvas); }
button, input, textarea, select { font: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgb(8 102 215 / 24%); outline-offset: 2px; }
.loading { min-height: 100vh; display: grid; place-items: center; color: var(--navy); font-weight: 700; }

.topbar { position: relative; min-height: 76px; display: flex; align-items: center; padding: 10px 32px; background: radial-gradient(circle at 86% -50%, rgb(34 132 235 / 52%), transparent 34%), linear-gradient(112deg, #03162f, var(--navy-deep) 48%, #0a4b91); color: #fff; box-shadow: 0 6px 22px rgb(1 21 48 / 24%); }
.topbar::after { content: ""; position: absolute; inset: auto 0 0; height: 4px; background: linear-gradient(90deg, var(--orange), #ff9e45 38%, var(--orange)); box-shadow: 0 1px 8px rgb(255 122 0 / 34%); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand > div:last-child { display: grid; gap: 1px; }
.brand strong { font-size: 15px; letter-spacing: .01em; }
.brand-wordmark em { font-style: normal; }
.brand-wordmark-two { background: linear-gradient(180deg, #ffb32e 5%, #f48203 75%, #ec6900); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-wordmark-invoice { background: linear-gradient(90deg, #086ee8, #0788f5 48%, #0ab8ef); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand span { font-size: 11px; color: #fff; }
.mark { display: block; width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 5px 8px rgb(0 0 0 / 24%)); }
.account { margin-left: auto; display: flex; align-items: center; gap: 9px; max-width: 68%; font-size: 13px; color: #fff; }
.account-email { overflow: hidden; color: #fff; text-overflow: ellipsis; white-space: nowrap; }
.workspace-company { min-width: 150px; display: grid; gap: 2px; color: #fff; }
.workspace-company > span { color: rgb(255 255 255 / 72%); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.workspace-company > strong { max-width: 210px; overflow: hidden; color: #fff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-company select { min-height: 34px; margin: 0; border-color: rgb(255 255 255 / 55%); padding: 5px 28px 5px 8px; background: #fff; color: var(--navy); font-size: 11px; font-weight: 750; cursor: pointer; }
.header-sign-out { border: 1px solid rgb(255 255 255 / 72%); border-radius: 8px; background: transparent; color: #fff; padding: 7px 10px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.header-sign-out:hover, .header-sign-out:focus-visible { background: rgb(255 255 255 / 14%); outline: 2px solid #fff; outline-offset: 2px; }
.office-sync-control { display: flex; align-items: center; gap: 8px; margin-right: 5px; }
.sync-button { min-height: 34px; padding: 6px 11px; border-color: #fff; background: rgb(255 255 255 / 12%); color: #fff; font-size: 11px; white-space: nowrap; }
.sync-button:hover { border-color: #fff; background: rgb(255 255 255 / 22%); }
.sync-button:disabled { border-color: #fff; background: rgb(255 255 255 / 12%); color: #fff; }
.office-sync-status { display: flex; align-items: center; gap: 7px; color: #fff; }
.office-sync-control small { max-width: 230px; color: #fff; font-size: 10px; line-height: 1.25; }
.sync-indicator { flex: 0 0 auto; }
.sync-tone-current .sync-indicator, .sync-tone-error .sync-indicator { width: 10px; height: 10px; border-radius: 50%; }
.sync-tone-current .sync-indicator { background: #39d26f; box-shadow: 0 0 0 2px #fff; }
.sync-tone-error .sync-indicator { background: #ff4545; box-shadow: 0 0 0 2px #fff; }
.sync-tone-neutral .sync-indicator { width: 20px; height: 11px; border: 2px solid var(--navy-deep); border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px #fff; }

.shell { max-width: 1440px; margin: auto; padding: 22px 28px 36px; }
.layout { display: grid; grid-template-columns: 212px minmax(0, 1fr); gap: 24px; align-items: start; }
.nav { position: sticky; top: 22px; padding: 10px; border: 1px solid rgb(207 221 236 / 88%); border-radius: 18px; background: linear-gradient(165deg, #fff, #f9fcff); box-shadow: var(--shadow); }
.nav-heading { margin: 7px 10px 8px; color: #8a95a5; font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.nav button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; border-radius: 9px; padding: 10px 11px; background: transparent; color: #294462; font-size: 13px; font-weight: 680; text-align: left; cursor: pointer; }
.nav button:hover { background: #f4f7fb; }
.nav button.active { background: var(--blue-soft); color: var(--blue); box-shadow: inset 3px 0 var(--orange); }
.nav button em { min-width: 22px; padding: 2px 6px; border-radius: 99px; background: var(--amber-soft); color: var(--amber); font-size: 10px; font-style: normal; text-align: center; }
.nav-status { margin: 12px 4px 2px; padding: 12px 8px 3px; border-top: 1px solid #edf1f5; display: flex; gap: 9px; align-items: flex-start; }
.nav-status div { display: grid; gap: 2px; min-width: 0; }
.nav-status strong { font-size: 11px; }
.nav-status small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 3px; border-radius: 50%; }
.status-dot.good { background: #2bab55; box-shadow: 0 0 0 3px #dff5e6; }
.panel { min-width: 0; }

.page-header { min-height: 86px; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin: 3px 0 18px; }
.dashboard-header { align-items: center; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; }
.eyebrow.light { color: #79b7ff; }
h1 { margin: 4px 0 5px; font-size: clamp(28px, 3vw, 38px); line-height: 1.1; letter-spacing: -.04em; }
h2 { margin: 0; font-size: 18px; line-height: 1.3; letter-spacing: -.02em; }
h3 { margin: 0; }
.subtitle { max-width: 720px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }

.button { min-height: 36px; border: 1px solid var(--blue); border-radius: 8px; padding: 7px 12px; background: var(--blue); color: var(--action-text, #fff); font-size: 13px; font-weight: 600; box-shadow: none; cursor: pointer; transition: background .15s, border-color .15s; }
.button:hover { background: var(--blue); box-shadow: none; }
.button:disabled { border-color: #b7c2cf; background: #b7c2cf; color: #f7f9fb; box-shadow: none; cursor: not-allowed; transform: none; }
.button.secondary { background: #fff; color: var(--blue); }
.button.quiet { border-color: var(--line); background: #fff; color: var(--ink); }
.button.danger { border-color: var(--red); background: var(--red); }
.button.danger:hover { background: #8e2d2d; }
.button.danger:not(:disabled) { color: #fff; }
.button.sent-action { border-color: #d87508; background: var(--orange); color: #142b45; }
.button.sent-action:hover { background: #e27d0a; }
.button.paid-action { border-color: var(--green); background: var(--green); }
.button.paid-action:hover { background: #18733d; }
.button.wide { width: 100%; }
.primary-action { white-space: nowrap; }
.text-button, .back-button { border: 0; padding: 3px 0; background: transparent; color: var(--blue); font-weight: 750; cursor: pointer; }
.back-button { margin-bottom: 10px; font-size: 13px; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric-card { min-height: 98px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 16px 17px; border: 1px solid #e3e9f1; border-top: 3px solid var(--blue); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.metric-card.warning { border-top-color: var(--orange); }
.metric-card.positive { border-top-color: #36a15a; }
.performance-currency { margin-top: 18px; }
.performance-metrics { grid-template-columns: repeat(4,minmax(0,1fr)); }
.performance-metrics .metric-card { min-width: 0; align-items: flex-start; flex-direction: column; }
.performance-metrics .metric-card strong { overflow-wrap: anywhere; font-size: 24px; }
.performance-metrics .metric-card p { max-width: none; text-align: left; }
.performance-filters { display:flex; flex-wrap:wrap; align-items:end; gap:12px; margin-bottom:16px; }
.performance-filters label { display:grid; gap:6px; }
.performance-filters .field-note { flex-basis:100%; margin:0; }
.performance-definitions p { max-width:85ch; }
.performance-table-wrap { overflow-x:auto; }
.performance-table { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; }
.performance-table th,.performance-table td { padding:9px 12px; border-bottom:1px solid var(--border,#dce4ef); text-align:right; white-space:nowrap; }
.performance-table th:first-child { text-align:left; }
.performance-table [data-paid-invoice] th { min-width:180px; max-width:300px; white-space:normal; overflow-wrap:anywhere; }
.performance-table [data-paid-invoice] td:last-child { min-width:190px; max-width:300px; white-space:normal; overflow-wrap:anywhere; text-align:left; }
.performance-table [data-paid-invoice] dd { margin:3px 0 10px; overflow-wrap:anywhere; }
#app .performance-filters .field-note, #app .performance-currency .field-note, #app .performance-definitions p { font-size:13px; line-height:1.5; text-align:left; }
@media(max-width:1000px) { .performance-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:560px) { .performance-metrics { grid-template-columns:1fr; } .performance-filters label { width:100%; } }
.metric-card > div { display: grid; }
.metric { font-size: 28px; line-height: 1; font-weight: 880; letter-spacing: -.04em; }
.metric-label { margin-top: 7px; font-size: 12px; font-weight: 760; }
.metric-card p { max-width: 125px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; text-align: right; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 16px; align-items: start; }
.surface { padding: 18px; border: 1px solid rgb(214 225 237 / 92%); border-radius: 16px; background: linear-gradient(165deg, #fff 0%, #fff 64%, #f9fcff 100%); box-shadow: var(--shadow); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.section-heading > div:first-child { display: flex; align-items: flex-start; gap: 11px; }
.section-heading .eyebrow + h2 { margin-top: 3px; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.activity .job { padding: 13px 0; border-width: 1px 0 0; border-radius: 0; box-shadow: none; }
.activity .job:first-child { border-top: 0; }
.next-actions { padding: 18px 14px 14px; }
.next-actions .section-heading { padding: 0 4px; }
.action-link { width: 100%; display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 11px 5px; border: 0; border-top: 1px solid #edf1f5; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.action-link > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-soft); color: var(--blue); }
.action-link div { display: grid; gap: 2px; }
.action-link strong { font-size: 12px; }
.action-link small { color: var(--muted); font-size: 10px; }
.action-link i { color: var(--blue); font-style: normal; }
.sync-summary { display: flex; gap: 10px; margin-top: 11px; padding: 13px; border-radius: 10px; background: var(--green-soft); }
.sync-summary div { display: grid; gap: 3px; }
.sync-summary strong { color: var(--green); font-size: 12px; }
.sync-summary small { color: #486653; font-size: 10px; line-height: 1.4; }

.list { display: grid; gap: 10px; }
.job { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 16px 18px; border: 1px solid #e1e8f0; border-radius: 13px; background: var(--surface); box-shadow: 0 4px 14px rgb(21 50 87 / 5%); }
.job-status-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.job h3 { margin-bottom: 3px; font-size: 16px; }
.job-address { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.job-meta { display: flex; flex-wrap: wrap; gap: 5px 13px; color: #6b7788; font-size: 10px; }
.job-meta span:not(:first-child)::before { content: "•"; margin-right: 13px; color: #b1bbc7; }
.proof { margin: 9px 0 0; font-size: 11px; font-weight: 700; }
.proof.good { color: var(--green); }
.proof.needs { color: var(--amber); }
.badge { display: inline-flex; align-items: center; width: max-content; border-radius: 999px; padding: 4px 8px; background: #eef2f7; color: #566579; font-size: 9px; font-weight: 850; letter-spacing: .045em; text-transform: uppercase; }
.badge.complete, .badge.ready { background: var(--green-soft); color: var(--green); }
.badge.draft { background: var(--blue-soft); color: var(--blue); }
.badge.overdue { background: var(--red-soft); color: var(--red); }
.badge.neutral { background: #edf1f5; color: #58677b; }
.count-pill { min-width: 72px; padding: 8px 12px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 800; text-align: center; }

.empty { padding: 34px 24px; border: 1px dashed #ccd7e4; border-radius: 13px; background: #fbfcfe; text-align: center; }
.empty-icon { width: 36px; height: 36px; display: grid; place-items: center; margin: 0 auto 10px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 900; }
.empty h2 { margin-bottom: 5px; }
.empty p { max-width: 450px; margin: 0 auto 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.state { margin-bottom: 16px; padding: 14px 16px; border: 1px solid; border-radius: 11px; }
.state strong { font-size: 13px; }
.state p { margin: 3px 0 0; font-size: 12px; line-height: 1.5; }
.state-warning { border-color: #f1c77e; background: var(--amber-soft); color: #6e430d; }
.state-conflict { border-color: #efa9a9; background: var(--red-soft); color: var(--red); }
.state-neutral { border-color: #cedbeb; background: #f7faff; color: #405c7c; }
.inline-state { margin: 10px 0 0; }
.conflict-recovery { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 16px; box-shadow: 0 5px 16px rgb(116 36 36 / 8%); }
.conflict-recovery .state-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: rgb(165 54 54 / 11%); font-size: 15px; font-weight: 900; }
.conflict-recovery.state-neutral .state-icon { background: var(--green-soft); color: var(--green); }
.conflict-recovery > div:last-child > strong { display: block; font-size: 15px; }
.conflict-recovery > div:last-child > p { max-width: 720px; margin-top: 5px; }
.changed-fields { padding: 8px 10px; border-radius: 7px; background: rgb(255 255 255 / 65%); }
.state-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.state-actions .button { min-height: 38px; margin: 0; }
.discard-confirmation { margin-top: 10px; padding: 11px 12px; border: 1px solid #e6adad; border-radius: 9px; background: #fff; }
.discard-confirmation p { margin: 0 0 9px !important; }
.discard-confirmation > div { display: flex; flex-wrap: wrap; gap: 7px; }
.conflict-error { margin-top: 9px !important; color: var(--red); font-weight: 700; }
.compact-surface { max-width: 720px; }
.feature-list { display: grid; grid-template-columns: 26px 1fr; gap: 12px 10px; margin-top: 16px; }
.feature-list > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 850; }
.feature-list p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.feature-list strong { color: var(--ink); }

.detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.labor-rate-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 14px; }
.labor-rate-card { padding: 18px; }
.labor-rate-card dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid #dce5ef; font-size: 12px; }
.labor-rate-card dt { color: var(--muted); }
.labor-rate-card dd { margin: 0; font-weight: 760; font-variant-numeric: tabular-nums; }
.mapping-grid dl { margin: 16px 0 0; display: grid; grid-template-columns: minmax(120px, .7fr) 1fr; gap: 10px; font-size: 13px; }
.mapping-grid dt { color: var(--muted); }
.mapping-grid dd { margin: 0; font-weight: 720; }
.mapping-grid + .state { margin-top: 14px; }

.draft-header { align-items: flex-end; }
.draft-status { min-width: 180px; display: grid; justify-items: end; gap: 7px; padding-bottom: 3px; }
.draft-status strong { font-size: 12px; }
.draft-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(250px, .65fr); gap: 15px; align-items: start; }
.draft-main { display: grid; gap: 14px; }
.draft-sidebar { position: sticky; top: 22px; display: grid; gap: 12px; }
.form-section { padding: 18px; }
.step { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 850; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; color: #465972; font-size: 11px; font-weight: 760; }
input, textarea, select { width: 100%; min-width: 0; margin-top: 5px; border: 1px solid #cfd9e5; border-radius: 8px; padding: 9px 10px; background: #fff; color: var(--ink); }
input:hover, textarea:hover, select:hover { border-color: #aebfd2; }
textarea { min-height: 68px; resize: vertical; }
.amount-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.amount-summary { display: grid; align-content: start; gap: 5px; min-width: 0; padding: 9px 10px; border: 1px solid #dce5ef; border-radius: 8px; background: #f7f9fc; color: #465972; font-size: 11px; font-weight: 760; }
.amount-summary strong { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.amount-summary .amount-edit { display: inline-flex; align-items: center; justify-content: center; justify-self: start; min-width: 56px; min-height: 27px; padding: 4px 9px; border: 1px solid var(--office-nav); border-bottom: 2px solid var(--office-nav-accent); border-radius: 7px; background: var(--office-nav-active); color: var(--office-nav-active-text); font-size: 10px; font-weight: 800; line-height: 1; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; box-shadow: 0 3px 8px color-mix(in srgb, var(--office-nav) 18%, transparent); }
.amount-summary .amount-edit:hover { background: var(--office-nav-active); box-shadow: 0 4px 10px color-mix(in srgb, var(--office-nav) 24%, transparent); }
.amount-summary .amount-edit:focus-visible { outline: 2px solid var(--office-nav-accent); outline-offset: 2px; }
.amount-summary .amount-edit:disabled { border-color: #b7c2cf; background: #b7c2cf; color: #f7f9fb; box-shadow: none; }
.itemized-section [data-line-item] { scroll-margin-top: 28px; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 48px; }
.input-suffix span { position: absolute; right: 9px; top: 50%; transform: translateY(-35%); color: #8a96a5; font-size: 9px; font-weight: 700; }
.money-input { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: stretch; margin-top: 5px; overflow: hidden; border: 1px solid #cfd9e5; border-radius: 8px; background: #fff; }
.money-input > span { display: grid; min-width: 34px; place-items: center; background: #f7f9fc; color: #52647b; font-size: 13px; font-weight: 800; }
.money-input input { margin-top: 0; border: 0; border-radius: 0; padding-left: 0; font-variant-numeric: tabular-nums; outline: 0; }
.money-input:hover { border-color: #aebfd2; }
.money-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.tax-rule-list { display: grid; gap: 12px; margin: 16px 0; }
.tax-registration-list { display: grid; gap: 10px; margin: 12px 0 16px; }
.tax-rule { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(100px, .55fr) minmax(150px, .8fr) minmax(180px, 1fr) auto; gap: 10px; align-items: end; padding: 14px; border: 1px solid #dce5ef; border-radius: 11px; background: #fbfcfe; }
.tax-registration { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(200px, 1.2fr) auto auto; gap: 10px; align-items: end; padding: 12px 14px; border: 1px solid #dce5ef; border-radius: 11px; background: #fbfcfe; }
.tax-rule .tax-applicability { grid-column: 1 / -2; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.tax-rule [data-remove-tax] { min-height: 38px; }
.work-summary { margin-bottom: 14px; padding: 12px 13px; border-left: 3px solid var(--orange); border-radius: 7px; background: #f7f9fc; }
.work-summary p { margin: 5px 0 0; color: #40516a; font-size: 12px; line-height: 1.55; }
.field-source { align-self: center; padding: 5px 8px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.pricing-state { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 14px; align-items: center; }
.pricing-state p { grid-column: 1; }
.pricing-state .button { grid-column: 2; grid-row: 1 / span 2; }
.payment-state-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 14px; align-items: center; border-left: 4px solid #8995a5; }
.payment-state-card h2 { margin-top: 2px; }
.payment-state-card p { grid-column: 1 / -1; margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.payment-state-card .button { grid-column: 1 / -1; margin-top: 8px; }
.payment-status-dot { width: 12px; height: 12px; border-radius: 50%; background: #8995a5; box-shadow: 0 0 0 4px #edf1f5; }
.payment-state-card.paid { border-left-color: var(--green); }
.payment-state-card.paid .payment-status-dot { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.payment-state-card.pending { border-left-color: var(--orange); }
.payment-state-card.pending .payment-status-dot { background: var(--orange); box-shadow: 0 0 0 4px #fff0e3; }
.payment-state-card.failed { border-left-color: var(--red); }
.payment-state-card.failed .payment-status-dot { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.approval-check { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: #6e430d; font-size: 11px; }
.approval-check input { width: auto; margin: 0; }
.review-panel, .warning-panel { display: grid; gap: 10px; }
.review-current { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.review-current > strong { font-size: 18px; }
.review-panel p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.review-actions { display: grid; gap: 7px; }
.invoice-warning { padding: 12px; border: 1px solid #efc173; border-radius: 9px; background: var(--amber-soft); }
.invoice-warning.overridden { border-color: #a8cfb5; background: var(--green-soft); }
.invoice-warning p { margin: 4px 0 0; color: #5d4a2e; font-size: 11px; line-height: 1.45; }
.invoice-warning.overridden p { color: #356047; }
.override-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-top: 9px; }
.override-row input { margin: 0; }
.line-items { display: grid; gap: 9px; }
.line-item-row { display: grid; grid-template-columns: minmax(180px, 1.35fr) minmax(82px, .4fr) minmax(110px, .55fr) minmax(105px, .5fr); gap: 9px; align-items: end; padding: 12px; border: 1px solid #dce5ef; border-radius: 10px; background: #fbfcfe; }
.line-item-heading { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.line-item-heading strong { font-size: 11px; color: #40516a; }
.line-total { display: grid; gap: 5px; justify-items: end; padding: 0 4px 8px; font-variant-numeric: tabular-nums; }
.line-total span { color: var(--muted); font-size: 9px; font-weight: 720; text-transform: uppercase; }
.line-total strong { font-size: 14px; }
.compact-empty { padding: 18px; }
.compact-empty h3 { margin-bottom: 4px; }
.compact-empty p { margin-bottom: 0; }
section:has(> .advanced) { display: none; }
.line-item-preview { display: grid; gap: 7px; margin-bottom: 10px; }
.line-item-preview > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 11px; border-radius: 8px; background: #f6f8fb; font-size: 12px; }
.line-item-preview small { color: var(--muted); }
.visibility-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 14px; }
.visibility-option { min-height: 38px; display: flex !important; align-items: center; gap: 9px !important; margin: 0; padding: 7px 9px; border: 1px solid #dce5ef; border-radius: 9px; background: #fbfcfe; color: var(--ink); font-size: 12px; font-weight: 700; line-height: 1.25; cursor: pointer; }
.visibility-option input[type="checkbox"] { width: 17px !important; height: 17px; min-width: 17px; min-height: 17px !important; margin: 0; padding: 0; flex: 0 0 17px; accent-color: var(--blue); cursor: pointer; }
#app [data-number-inspection-form] .number-inspection-confirmation { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; grid-column: 1 / -1; }
#app [data-number-inspection-form] .number-inspection-confirmation[hidden] { display: none; }
#app [data-number-inspection-form] .number-inspection-confirmation input[type="checkbox"] { flex: 0 0 18px; margin-top: 2px; }
.visibility-option span { min-width: 0; }
.line-visibility { grid-column: 1 / -1; width: max-content; max-width: 100%; }
.advanced { padding-top: 10px; border-top: 1px solid #edf1f5; }
.advanced summary { color: var(--blue); font-size: 11px; font-weight: 750; cursor: pointer; }
.advanced p { color: var(--muted); font-size: 10px; }
.advanced textarea { min-height: 120px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.total-card .total { margin: 6px 0 13px; font-size: 34px; font-weight: 880; letter-spacing: -.05em; }
.total-card dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding-top: 11px; border-top: 1px solid #edf1f5; font-size: 11px; }
.total-card dt { color: var(--muted); }
.total-card dd { margin: 0; font-weight: 760; }
.template-card { overflow: hidden; }
.template-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.template-heading .eyebrow { font-size: 9px; }
.template-heading h2 { margin-top: 1px; }
.template-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: var(--blue-soft); color: var(--blue); font-family: Georgia, serif; font-size: 13px; font-weight: 800; }
.template-card label { margin-top: 2px; }
.select-wrap { position: relative; }
.select-wrap select { min-height: 41px; padding: 9px 38px 9px 11px; appearance: none; background: linear-gradient(#fff, #fbfcfe); color: var(--ink); font-weight: 720; cursor: pointer; }
.select-wrap > span { position: absolute; right: 12px; top: 50%; transform: translateY(-37%); color: var(--blue); font-size: 18px; font-weight: 800; pointer-events: none; }
.template-card p, .template-card small, .action-card p { color: var(--muted); font-size: 10px; line-height: 1.45; }
.template-card p { margin: 10px 0; }
.template-card small { display: block; padding-top: 9px; border-top: 1px solid #edf1f5; }
.action-card { display: grid; gap: 7px; }
.action-card p { margin: 3px 0 0; }
.action-card .pdf-action-status:empty { display: none; }
.action-card .pdf-action-status { margin: 0; padding: 7px 9px; border-radius: 7px; font-size: 11px; line-height: 1.4; }
.pdf-action-working { background: var(--blue-soft); color: var(--navy); }
.pdf-action-ready { background: #e8f6ed; color: #17623b; }
.pdf-action-warning, .pdf-action-error { background: var(--amber-soft); color: #6e430d; }
.pdf-action-spinner { display: inline-block; width: 13px; height: 13px; margin-right: 7px; border: 2px solid rgb(255 255 255 / 40%); border-top-color: #fff; border-radius: 50%; vertical-align: -2px; animation: d2i-spin .8s linear infinite; }
.archive-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: -4px 0 14px; }
.archive-filters .button { min-height: 34px; padding: 7px 13px; }
.archived-state { border-color: #b8c8da; background: #f3f6fa; color: #334d6c; }
.archived-state small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(400px, 520px) minmax(420px, 1fr); background: #fff; }
.login-page.single { grid-template-columns: minmax(0, 520px); justify-content: center; padding: 18px; background: var(--canvas); }
.login { align-self: center; width: 100%; max-width: 420px; min-width: 0; margin: 40px auto; padding: 38px; }
.login > *, .brand, .account, .layout > *, .panel > * { min-width: 0; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; color: var(--navy); }
.login-brand .mark { width: 72px; height: 72px; filter: drop-shadow(0 8px 12px rgb(6 34 74 / 22%)); }
.login-brand span { padding-left: 12px; border-left: 1px solid #cbd6e3; font-size: 14px; font-weight: 800; }
.login h1 { font-size: 34px; }
.form-stack { display: grid; margin-top: 24px; }
.form-stack input { min-height: 43px; margin-bottom: 13px; }
.company-onboarding { width: min(100%, 760px); }
.company-selector { width: min(100%, 520px); }
.company-choice-list { display: grid; gap: 10px; margin: 24px 0 14px; }
.company-choice { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #cfd9e5; border-radius: 12px; padding: 15px 16px; background: #fff; color: var(--navy); text-align: left; cursor: pointer; }
.company-choice:hover, .company-choice:focus-visible { border-color: var(--blue); background: var(--blue-soft); }
.company-choice > span:first-child { display: grid; gap: 4px; }
.company-choice strong { font-size: 14px; }
.company-choice small { color: var(--muted); font-size: 10px; }
.company-choice > span:last-child { color: var(--blue); font-size: 18px; font-weight: 850; }
/* Dashboard and entry: preserve full identities and existing company colors. */
#app .company-choice > span:first-child { min-width: 0; overflow-wrap: anywhere; }
#app .company-choice > span:last-child { flex-shrink: 0; }
#app .company-choice { min-width: 0; background: var(--surface); color: var(--ink); }
#app .company-choice small { font-size: 13px; line-height: 1.5; }
#app .login-page .login { background: var(--surface); color: var(--ink); }
#app .login .login-brand, #app .login label { color: var(--ink); }
#app .login #error, #app .company-selector .state, #app .loading { overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; }
#app .loading { max-width: 100%; padding: 24px; color: var(--page-text); font-size: 16px; }
#app .dashboard-grid > *, #app .dashboard-grid .section-heading > div:first-child { min-width: 0; }
#app .dashboard-grid .activity .list { grid-template-columns: minmax(0, 1fr); }
#app .dashboard-grid .activity .job, #app .dashboard-grid .activity .empty { min-width: 0; background: var(--surface); color: var(--ink); }
#app .dashboard-grid .activity .job-main { min-width: 0; overflow-wrap: anywhere; }
#app .dashboard-grid .activity .proof { color: var(--ink); }
#app .dashboard-grid .activity .job-meta { color: var(--muted); }
#app .dashboard-grid .activity .job .button { white-space: normal; overflow-wrap: anywhere; }
#app .dashboard-grid #all-review { flex-shrink: 0; white-space: nowrap; }
#app .dashboard-grid .activity .field-note, #app .dashboard-grid .activity .proof,
#app .dashboard-grid .next-actions small { font-size: 13px; line-height: 1.5; text-align: left; }
#app .dashboard-grid .snapshot-summary { background: var(--surface); border: 1px solid var(--line); }
#app .dashboard-grid .snapshot-summary strong { color: var(--ink); }
#app .dashboard-grid .snapshot-summary small { color: var(--muted); }
@media(max-width:760px) { #app .dashboard-header .primary-action { white-space: normal; overflow-wrap: anywhere; } }
.company-setup-card { display: grid; gap: 18px; }
.company-setup-grid { margin: 8px 0; }
.company-management-filters { display: grid; grid-template-columns: minmax(220px, 1fr) 150px 170px auto; gap: 12px; align-items: end; margin-bottom: 14px; }
.company-management-filters label { display: grid; gap: 6px; color: var(--navy); font-size: 11px; font-weight: 800; }
.company-management-filters input, .company-management-filters select { width: 100%; min-height: 42px; border: 1px solid #b9c6d6; border-radius: 10px; padding: 9px 11px; background: #fff; color: var(--ink); font: inherit; }
.company-management-list { display: grid; gap: 10px; }
.company-management-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 17px 19px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 6px 18px rgb(21 50 87 / 5%); }
.company-management-row h3 { margin: 8px 0 3px; }
.company-management-row p { margin: 0 0 5px; color: var(--ink); }
.company-management-row small { color: var(--muted); }
.customer-row h3 { margin-bottom: 5px; }
.search-field { display: grid; gap: 7px; color: var(--navy); font-weight: 760; }
.search-field input { width: 100%; min-height: 46px; border: 1px solid #b9c6d6; border-radius: 11px; padding: 10px 12px; color: var(--ink); font: inherit; }
.identity-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.identity-fields[hidden] { display: none; }
.identity-fields label { display: grid; gap: 6px; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.history-row:last-child { border-bottom: 0; }
.history-row h3 { margin: 7px 0 3px; }
.history-row p { margin: 0; color: var(--muted); }
.history-row:has([data-edit-price-book]) > div:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.history-row:has([data-edit-price-book]) > .actions { flex-shrink: 0; }
#app .form-section:has(#price-book-search) > .field-note { font-size: 13px; line-height: 1.5; text-align: left; overflow-wrap: anywhere; }
.preserve-lines { white-space: pre-wrap; }
.customer-detail-grid { align-items: start; }
.dispatch-assignment-control { display: grid; gap: 8px; min-width: 210px; }
.dispatch-assignment-control label { display: grid; gap: 5px; font-weight: 600; }
.dispatch-assignment-control select { min-height: 42px; border: 1px solid #b9c6d6; border-radius: 10px; padding: 9px 11px; background: #fff; color: var(--ink); font: inherit; }
.company-management-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 330px); gap: 16px; align-items: start; }
.company-management-sidebar { display: grid; gap: 16px; }
.company-management-sidebar dl { grid-template-columns: minmax(90px, .7fr) minmax(0, 1.3fr); }
.company-management-sidebar dd { overflow-wrap: anywhere; }
.company-audit-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.company-audit-list li { padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.company-audit-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.company-audit-list strong, .company-audit-list span { display: block; }
.company-audit-list span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.company-audit-list p { margin: 4px 0 0; color: var(--ink); font-size: 11px; }
.back-button { margin-bottom: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid label { display: grid; gap: 6px; color: var(--navy); font-weight: 700; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; border: 1px solid #b9c6d6; border-radius: 10px; padding: 11px 12px; background: #fff; color: #102a43; font: inherit; }
.form-grid textarea { min-height: 82px; resize: vertical; }
.form-grid .job-past-date-note { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.4; }
.wide-field { grid-column: 1 / -1; }
.duration-field { display: grid; gap: 6px; color: var(--navy); }
.duration-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.duration-field small { color: var(--muted); font-size: 10px; font-weight: 500; }
.duration-field small.duration-warning { color: var(--amber); font-weight: 700; }
.login .button { margin-top: 8px; }
.login-recovery { display: flex; justify-content: flex-end; }
.login-recovery-link { border: 0; background: transparent; box-shadow: none; padding: 2px 0; color: var(--blue); font-size: 13px; line-height: 1.5; text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.login-recovery-link:hover { color: var(--navy); }
.login-recovery-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
.login-recovery-link:disabled { cursor: wait; opacity: .65; }
.privacy-note, .field-note { color: var(--muted); font-size: 10px; text-align: center; }
.login-aside { display: grid; place-items: center; padding: 56px; overflow: hidden; background: radial-gradient(circle at 80% 20%, rgb(40 135 235 / 56%), transparent 32%), radial-gradient(circle at 8% 100%, rgb(255 122 0 / 20%), transparent 28%), linear-gradient(145deg, #03162f, var(--navy-deep) 48%, #0b4a91); color: #fff; }
.login-aside > div { max-width: 520px; }
.login-aside h2 { margin-top: 12px; font-size: clamp(28px, 4vw, 46px); line-height: 1.08; letter-spacing: -.04em; }
.login-aside ul { display: grid; gap: 12px; margin: 30px 0 0; padding: 0; list-style: none; color: rgb(255 255 255 / 80%); }
.login-aside li::before { content: "✓"; margin-right: 10px; color: #64df89; font-weight: 900; }

@media (max-width: 1040px) {
  .shell { padding: 18px; }
  .layout { grid-template-columns: 180px minmax(0, 1fr); gap: 17px; }
  .dashboard-grid, .draft-layout { grid-template-columns: 1fr; }
  .draft-sidebar { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-card { align-items: flex-start; flex-direction: column; }
  .metric-card p { max-width: none; text-align: left; }
  .amount-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .line-item-row { grid-template-columns: minmax(180px, 1fr) minmax(80px, .35fr) minmax(110px, .5fr); }
  .line-total { grid-column: 1 / -1; display: flex; justify-content: space-between; padding: 2px 4px; }
  .company-management-filters { grid-template-columns: minmax(200px, 1fr) 140px 160px; }
  .company-management-filters .button { grid-column: 1 / -1; }
  .company-management-detail { grid-template-columns: 1fr; }
  .company-management-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .duration-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .labor-rate-grid { grid-template-columns: 1fr; }
  .topbar { height: 62px; padding: 0 16px; }
  .brand span { display: none; }
  .account { max-width: 70%; font-size: 11px; }
  .workspace-company { min-width: 118px; }
  .workspace-company > strong, .workspace-company > span, .account-email { display: none; }
  .workspace-company select { max-width: 150px; }
  .office-sync-control small { display: none; }
  .shell { padding: 12px; }
  .layout { display: block; }
  .nav { position: sticky; top: 0; z-index: 5; display: flex; gap: 3px; margin: 0 -12px 16px; padding: 8px 12px; border-width: 0 0 1px; border-radius: 0; overflow-x: auto; box-shadow: 0 4px 12px rgb(21 50 87 / 8%); }
  .nav-heading, .nav-status { display: none; }
  .nav button { width: auto; flex: 0 0 auto; padding: 9px 11px; white-space: nowrap; }
  .nav button.active { box-shadow: inset 0 -3px var(--orange); }
  .page-header, .dashboard-header, .draft-header { min-height: 0; display: grid; gap: 12px; margin-bottom: 16px; }
  .primary-action, .count-pill, .draft-status { width: 100%; justify-items: start; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics .metric-card:first-child { grid-column: 1 / -1; }
  .metric-card { min-height: 82px; }
  .surface { padding: 15px; }
  .job { grid-template-columns: 1fr; gap: 12px; }
  .job .button { width: 100%; }
  .job-meta span:not(:first-child)::before { display: none; }
  .detail, .form-grid, .amount-grid { grid-template-columns: 1fr; }
  .line-item-row { grid-template-columns: 1fr; }
  .line-total { grid-column: auto; }
  .pricing-state { grid-template-columns: 1fr; }
  .pricing-state p, .pricing-state .button { grid-column: 1; grid-row: auto; }
  .form-grid .full { grid-column: auto; }
  .tax-rule { grid-template-columns: 1fr; }
  .tax-registration { grid-template-columns: 1fr; }
  .tax-rule .tax-applicability { grid-column: auto; }
  .draft-sidebar { grid-template-columns: 1fr; }
  .conflict-recovery { grid-template-columns: 1fr; }
  .conflict-recovery .state-icon { display: none; }
  .state-actions .button, .discard-confirmation .button { width: 100%; }
  .company-management-filters, .company-management-sidebar { grid-template-columns: 1fr; }
  .company-management-row { grid-template-columns: 1fr; }
  .company-management-row .button { width: 100%; }
  .identity-fields { grid-template-columns: 1fr; }
  .history-row { align-items: stretch; flex-direction: column; }
  .history-row .actions, .history-row .button { width: 100%; }
  .login-page { grid-template-columns: 1fr; }
  .login { padding: 26px; }
  .login-page.single { padding: 16px; }
  .login-aside { display: none; }
}

@media (max-width: 420px) {
  .metrics { grid-template-columns: 1fr; }
  .metrics .metric-card:first-child { grid-column: auto; }
  h1 { font-size: 27px; }
  .job-meta { display: grid; gap: 3px; }
}

/* Final D2I product-family finish. All application behavior stays unchanged. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: linear-gradient(rgb(6 34 74 / 2.25%) 1px, transparent 1px), linear-gradient(90deg, rgb(6 34 74 / 2.25%) 1px, transparent 1px); background-size: 30px 30px; mask-image: linear-gradient(to bottom, #000, transparent 58%); }
.loading { gap: 12px; font-size: 15px; }
.loading::before { content: ""; width: 27px; height: 27px; border: 3px solid #d9e6f5; border-top-color: var(--orange); border-radius: 50%; animation: d2i-spin .8s linear infinite; }
@keyframes d2i-spin { to { transform: rotate(360deg); } }
.topbar { min-height: 88px; padding-block: 13px; }
.mark { width: 56px; height: 56px; }
.brand strong { font-size: 17px; letter-spacing: -.01em; }
.brand span { max-width: 330px; color: rgb(255 255 255 / 76%); font-size: 12px; }
.office-sync-control { gap: 9px; }
.office-sync-status { min-width: 0; padding: 6px 9px; border: 1px solid rgb(255 255 255 / 24%); border-radius: 999px; background: rgb(255 255 255 / 8%); }
.office-sync-control small { max-width: 210px; font-size: 11px; }
.sync-button { width: 42px; min-width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 78%); border-radius: 50%; padding: 0; background: rgb(255 255 255 / 12%); color: #fff; font-size: 25px; line-height: 1; cursor: pointer; box-shadow: 0 5px 13px rgb(0 0 0 / 18%); transition: transform .16s ease, background .16s ease; }
.sync-button:hover { transform: rotate(18deg) scale(1.04); background: rgb(255 255 255 / 22%); }
.sync-button:disabled { opacity: .72; cursor: wait; transform: none; }
.sync-spinner { width: 18px; height: 18px; border: 2px solid rgb(255 255 255 / 35%); border-top-color: #fff; border-radius: 50%; animation: d2i-spin .8s linear infinite; }
.shell { max-width: 1520px; padding-top: 28px; }
.layout { grid-template-columns: 236px minmax(0, 1fr); gap: 28px; }
.nav { top: 26px; padding: 13px; border-color: #c8d8ea; background: linear-gradient(160deg, #fff 0%, #f8fbff 72%, #edf5ff 100%); box-shadow: 0 18px 44px rgb(6 34 74 / 12%), 0 3px 9px rgb(6 34 74 / 7%); }
.nav-heading { margin: 7px 9px 10px; font-size: 11px; }
.nav button { min-height: 45px; padding: 11px 13px; border: 1px solid transparent; border-radius: 11px; font-size: 14px; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.nav button:hover { transform: translateX(2px); border-color: #d2e3f6; background: #f3f8ff; }
.nav button.active { border-color: #c7dcf4; background: linear-gradient(100deg, #e5f1ff, #f3f8ff); box-shadow: inset 4px 0 var(--orange), 0 5px 14px rgb(0 103 216 / 8%); }
.page-header { margin-bottom: 22px; }
.page-header h1 { letter-spacing: -.045em; }
.subtitle { font-size: 15px; }
.surface { position: relative; overflow: hidden; padding: 21px; border-color: #cbdbea; border-radius: 18px; box-shadow: 0 14px 34px rgb(6 34 74 / 9%), 0 2px 7px rgb(6 34 74 / 5%); }
.surface::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--blue), #2f8ee8 72%, var(--orange)); }
.metric-card { min-height: 112px; padding: 19px; border-color: #d2dfec; border-radius: 16px; box-shadow: 0 12px 28px rgb(6 34 74 / 9%); }
.metric { font-size: 31px; }
.metric-label { font-size: 13px; }
.metric-card p { font-size: 12px; }
.job { padding: 19px 20px; border-color: #d2dfec; border-radius: 16px; background: linear-gradient(145deg, #fff 0%, #fff 67%, #f7fbff 100%); box-shadow: 0 8px 22px rgb(6 34 74 / 7%); transition: transform .16s ease, box-shadow .16s ease; }
.job:hover { transform: translateY(-2px); box-shadow: 0 14px 31px rgb(6 34 74 / 11%); }
.job h3 { font-size: 17px; }
.job-address { font-size: 13px; }
.job-meta { font-size: 12px; }
.button { min-height: 45px; border-radius: 13px; padding-inline: 18px; font-size: 14px; }
.button.secondary, .button.quiet { box-shadow: 0 3px 9px rgb(6 34 74 / 5%); }
.badge { padding: 5px 9px; border: 1px solid rgb(6 34 74 / 7%); font-size: 10px; }
.empty { padding: 40px 26px; border-color: #bfcfe0; border-radius: 17px; background: linear-gradient(145deg, #fff, #f6faff); }
.empty-icon { width: 42px; height: 42px; box-shadow: 0 5px 14px rgb(31 163 74 / 12%); }
.state { padding: 16px 18px; border-radius: 13px; }
.state strong { font-size: 14px; }
.state p { font-size: 13px; }
label { color: var(--navy); font-size: 13px; font-weight: 760; }
input, textarea, select { min-height: 47px; border-color: #afc1d3; background: linear-gradient(#fff, #fbfdff); font-size: 14px; transition: border-color .15s ease, box-shadow .15s ease; }
input:hover, textarea:hover, select:hover { border-color: #829bb4; }
.login { position: relative; }
.login-page.single .login { overflow: hidden; margin-block: 52px; border: 1px solid #cfdeed; border-radius: 24px; background: linear-gradient(160deg, #fff, #fff 68%, #f7fbff); box-shadow: var(--shadow-raised); }
.login-page.single .login::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--orange), var(--blue)); }
.company-choice { min-height: 74px; border-radius: 15px; box-shadow: 0 5px 15px rgb(6 34 74 / 5%); }
.company-management-row { border-color: #d0ddea; border-radius: 16px; background: linear-gradient(145deg, #fff, #f8fbff); box-shadow: 0 9px 24px rgb(6 34 74 / 7%); }
.workflow-options, .workflow-list { display: grid; gap: 10px; margin: 18px 0; }
.workflow-row { display: grid; grid-template-columns: minmax(220px, 1fr) 130px auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid #d2dfec; border-radius: 12px; background: #fff; }
.workflow-order { display: flex; gap: 6px; }
.workflow-order .button { min-width: 42px; padding-inline: 10px; }
.optional-check { font-weight: 600; }
@media (max-width: 1040px) { .layout { grid-template-columns: 200px minmax(0, 1fr); gap: 20px; } .office-sync-control small { max-width: 150px; } }
@media (max-width: 760px) { .topbar { min-height: 70px; height: auto; padding: 8px 13px; } .mark { width: 48px; height: 48px; } .brand strong { font-size: 14px; } .brand span { display: none; } .account { max-width: none; gap: 7px; } .office-sync-status { padding: 5px 7px; } .sync-button { width: 40px; min-width: 40px; height: 40px; } .layout { display: block; } .surface { padding: 18px; } .job { padding: 17px; } .workflow-row { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .workspace-company { display: none; } .account-email { display: none; } .office-sync-control small { display: none; } .office-sync-status { min-width: 30px; } .header-sign-out { padding-inline: 9px; } }

/* Approved Office Lite top-navigation and professional dispatch board. */
.topbar {
  --office-nav: #061b3a;
  --office-nav-active: #00224b;
  --office-nav-accent: #ff7a00;
  --office-nav-glow: #ff9a3d;
  --office-nav-text: #fff;
  --office-nav-active-text: #fff;
  min-height: 0;
  padding: 8px 16px 14px;
  gap: 12px;
  background: radial-gradient(circle at 84% -65%, color-mix(in srgb, var(--office-nav) 58%, #2389df) 0%, transparent 38%), linear-gradient(108deg, color-mix(in srgb, var(--office-nav) 89%, #000), var(--office-nav) 56%, color-mix(in srgb, var(--office-nav) 77%, #176cc0));
  color: var(--office-nav-text);
  box-shadow: 0 4px 16px rgb(1 21 48 / 22%);
}
.topbar::after { height: 8px; background: linear-gradient(90deg, color-mix(in srgb, var(--office-nav-accent) 84%, #6b2a00), var(--office-nav-accent) 45%, color-mix(in srgb, var(--office-nav-accent) 76%, #ffd08a)); box-shadow: 0 1px 5px color-mix(in srgb, var(--office-nav-glow) 24%, transparent); }
.topbar .mark { width: 52px; height: 52px; border-radius: 12px; box-shadow: 0 3px 8px rgb(0 0 0 / 26%); }
.topbar .brand { min-width: 0; flex: 0 0 auto; gap: 10px; }
.topbar .brand strong { font-size: 18px; line-height: 1.15; }
.topbar .brand span { display: block; margin-top: 4px; font-size: 12px; opacity: .78; }
.top-navigation { min-width: 0; align-self: stretch; display: flex; flex: 1 1 auto; align-items: stretch; justify-content: flex-start; gap: 4px; margin-left: 0; }
.top-nav-item { position: relative; min-width: 0; max-width: none; flex: 0 0 auto; display: grid; place-items: center; align-content: start; gap: 4px; border: 0; padding: 6px 10px 18px; background: transparent; color: color-mix(in srgb, var(--office-nav-text) 91%, transparent); font-size: 14px; font-weight: 760; line-height: 1.2; cursor: pointer; }
.top-nav-item:hover, .top-nav-item:focus-visible { background: rgb(255 255 255 / 8%); color: #fff; }
.top-nav-item.active { border-bottom-color: transparent; border-radius: 12px 12px 2px 2px; background: linear-gradient(180deg, color-mix(in srgb, var(--office-nav-active) 96%, #063367) 0%, color-mix(in srgb, var(--office-nav-active) 82%, #07172d) 100%); color: var(--office-nav-active-text); box-shadow: inset 0 1px 0 rgb(255 255 255 / 3%), 0 5px 15px rgb(0 14 35 / 18%); }
.top-nav-item.active::after { content: ""; position: absolute; right: 0; bottom: 4px; left: 0; width: auto; height: 6px; margin-inline: 0; border-radius: 6px; background: linear-gradient(180deg, color-mix(in srgb, var(--office-nav-accent) 68%, #ffd05a) 0%, var(--office-nav-accent) 48%, color-mix(in srgb, var(--office-nav-accent) 82%, #c84f00) 100%); box-shadow: 0 -4px 9px color-mix(in srgb, var(--office-nav-glow) 22%, transparent), 0 0 4px color-mix(in srgb, var(--office-nav-accent) 12%, transparent); }
.top-nav-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; color: currentColor; line-height: 1; }
.approved-nav-art { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 2px 2px rgb(0 0 0 / 28%)); }
.icon-workers .approved-nav-art { height: 36px; transform: none; }
.top-nav-more { position: relative; min-width: 0; max-width: none; flex: 0 0 auto; color: #fff; }
.top-nav-more summary { height: 100%; display: grid; place-items: center; align-content: start; gap: 4px; padding: 6px 10px 18px; color: var(--office-nav-text); font-size: 14px; font-weight: 760; line-height: 1.2; list-style: none; cursor: pointer; }
.top-nav-more summary::-webkit-details-marker { display: none; }
.top-nav-more[open] summary { background: rgb(0 0 0 / 16%); }
.top-nav-more > div { position: absolute; top: calc(100% - 1px); right: 0; z-index: 100; width: min(280px, calc(100vw - 16px)); max-height: min(70vh, 520px); overflow-y: auto; display: grid; padding: 7px; border: 1px solid #cad8e8; border-radius: 0 0 10px 10px; background: #fff; color: var(--navy); box-shadow: 0 12px 28px rgb(0 0 0 / 20%); }
.top-nav-overflow-item { display: flex; align-items: center; gap: 10px; border: 0; border-radius: 7px; padding: 9px 10px; background: transparent; color: var(--navy); font-size: 11px; font-weight: 720; text-align: left; cursor: pointer; }
.top-nav-overflow-item:hover, .top-nav-overflow-item.active { background: var(--blue-soft); color: var(--blue); }
.top-nav-overflow-item .top-nav-icon { width: 26px; color: currentColor; text-align: center; }
.top-nav-overflow-item .approved-nav-art { width: 23px; height: 23px; }
.header-utilities { position: relative; min-width: 0; display: flex; flex: 0 1 auto; align-items: center; gap: 5px; margin-left: auto; color: #fff; }
.topbar .workspace-company { min-width: 105px; }
.topbar .workspace-company > strong { max-width: 190px; font-size: 12px; }
.topbar .office-sync-status { padding: 5px 7px; }
.topbar .office-sync-control small { max-width: 150px; font-size: 11px; }
.sync-label-compact { display: none; }
.sync-label-phone { display: none; }
.topbar .sync-button { width: 38px; min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0; font-size: 21px; line-height: 1; }
.topbar .sync-button > span:not(.sync-spinner) { display: block; transform: translateY(-1px); line-height: 1; }
.notification-button { width: 34px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 7px; padding: 0; background: transparent; color: #fff; cursor: pointer; }
.notification-button:hover, .notification-button:focus-visible { background: rgb(255 255 255 / 10%); }
.notification-indicator { min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: 99px; background: #e52f35; color: #fff; font-size: 9px; font-weight: 850; }
.notification-indicator:empty { min-width: 8px; width: 8px; height: 8px; background: #49d06f; }
.user-avatar { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #fff; color: var(--navy); font-size: 13px; font-weight: 850; }
.account-control { position: relative; color: #fff; }
.account-control > summary { min-height: 42px; display: flex; align-items: center; gap: 6px; border-radius: 8px; padding: 3px; color: #fff; font-size: 12px; list-style: none; cursor: pointer; }
.account-control > summary::-webkit-details-marker { display: none; }
.account-control > summary:hover, .account-control > summary:focus-visible, .account-control[open] > summary { background: rgb(255 255 255 / 10%); }
.account-caret { transition: transform .15s ease; }
.account-control[open] .account-caret { transform: rotate(180deg); }
.account-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 110; width: min(290px, calc(100vw - 16px)); display: grid; gap: 9px; padding: 13px; border: 1px solid #cad8e8; border-radius: 10px; background: #fff; color: var(--navy); box-shadow: 0 12px 28px rgb(0 0 0 / 20%); }
.account-panel-label { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.account-panel-email { overflow: hidden; color: var(--navy); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-panel .workspace-company { min-width: 0; padding-block: 7px; border-block: 1px solid #e1e9f1; color: var(--navy); }
.account-panel .workspace-company > span { display: block; color: var(--muted); }
.account-panel .workspace-company > strong { display: block; max-width: none; color: var(--navy); font-size: 11px; }
.account-panel .workspace-company select { width: 100%; }
.account-sign-out { min-height: 36px; border: 1px solid #c8d7e7; border-radius: 8px; background: #f7faff; color: var(--navy); font-size: 11px; font-weight: 750; cursor: pointer; }
.account-sign-out:hover, .account-sign-out:focus-visible { border-color: #9fb7cf; background: #edf5ff; }
.shell {
  width: min(calc(100% - clamp(32px, 4vw, 160px)), 3200px);
  max-width: none;
  margin-inline: auto;
  padding: 20px 0 36px;
}
.panel { width: 100%; }
.section-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.section-tabs button { border: 0; border-bottom: 3px solid transparent; padding: 8px 12px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 760; cursor: pointer; }
.section-tabs button.active { border-bottom-color: var(--blue); color: var(--blue); }
.dispatch-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.dispatch-heading h1 { margin: 0; font-size: 25px; }
.dispatch-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.dispatch-date-controls { display: flex; align-items: center; gap: 6px; }
.dispatch-date-controls input { min-height: 36px; padding: 6px 9px; font-size: 11px; }
.button.compact { min-height: 36px; border-radius: 8px; padding: 6px 12px; font-size: 11px; }
.icon-button { width: 36px; height: 36px; border: 1px solid #cbd9e8; border-radius: 8px; background: #fff; color: var(--blue); font-size: 22px; cursor: pointer; }
.dispatch-filters { display: grid; grid-template-columns: minmax(220px,1fr) 180px 180px auto; gap: 9px; align-items: end; margin-bottom: 10px; padding: 10px; border: 1px solid #d5e0ec; border-radius: 10px; background: #fff; }
.dispatch-filters label { display: grid; gap: 4px; }
.dispatch-filters label > span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.dispatch-filters input, .dispatch-filters select { min-height: 36px; padding: 6px 9px; font-size: 11px; }
.dispatch-counters { display: flex; gap: 6px; }
.dispatch-counters span { min-width: 78px; padding: 7px 9px; border: 1px solid #dce6f0; border-radius: 8px; color: var(--muted); font-size: 9px; }
.dispatch-counters strong { display: block; color: var(--blue); font-size: 17px; }
.dispatch-workspace { display: grid; grid-template-columns: minmax(680px,1fr) minmax(280px,340px); gap: 10px; align-items: start; }
.dispatch-board { overflow-x: auto; padding: 0; border-radius: 10px; }
.dispatch-board::before, .dispatch-side::before { display: none; }
.dispatch-hours, .dispatch-worker { min-width: 860px; display: grid; grid-template-columns: 180px minmax(680px,1fr); }
.dispatch-hours { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid #dce6f0; background: #f7faff; }
.dispatch-hours > strong { padding: 11px; font-size: 10px; }
.dispatch-hours > div { display: grid; grid-template-columns: repeat(13,1fr); }
.dispatch-hours span { padding: 11px 2px; border-left: 1px solid #e3eaf2; color: #52687e; font-size: 9px; text-align: center; }
.dispatch-worker { min-height: 88px; border-bottom: 1px solid #e2eaf2; }
.dispatch-worker:last-child { border-bottom: 0; }
.dispatch-worker-label { display: flex; gap: 9px; align-items: center; padding: 11px; border-right: 1px solid #dfe8f1; }
.worker-avatar { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #eaf3ff; color: var(--blue); font-size: 10px; font-weight: 850; }
.dispatch-worker-label div { display: grid; gap: 2px; }
.dispatch-worker-label strong { font-size: 11px; }
.dispatch-worker-label small { color: var(--muted); font-size: 9px; }
.dispatch-worker-label span:last-child { color: var(--green); font-size: 9px; }
.dispatch-worker-label i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #22af52; }
.dispatch-timeline-cell { position: relative; overflow: hidden; background-image: repeating-linear-gradient(to right,transparent 0,transparent calc(8.333% - 1px),#e6edf4 calc(8.333% - 1px),#e6edf4 8.333%); }
.dispatch-job-block { position: absolute; left: var(--job-left); top: 12px; width: var(--job-width); min-width: 58px; height: 62px; overflow: hidden; display: grid; align-content: start; gap: 3px; border: 1px solid #72a8dc; border-left: 4px solid #216ab5; border-radius: 6px; padding: 7px 8px; background: #dcecff; color: #092b52; text-align: left; cursor: pointer; }
.dispatch-job-block strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.dispatch-job-block span { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.dispatch-job-block.priority-high, .dispatch-job-block.priority-urgent { border-color: #dc7d7d; border-left-color: #cb3333; background: #ffe4e4; }
.dispatch-job-block.priority-low { border-color: #77c499; border-left-color: #239453; background: #dff8e9; }
.dispatch-side { padding: 10px; border-radius: 10px; }
.dispatch-side .section-tabs { flex-wrap: nowrap; }
.dispatch-side .section-tabs button { flex: 1; padding-inline: 4px; }
.unassigned-list { display: grid; gap: 7px; }
.unassigned-card { display: grid; grid-template-columns: minmax(0,1fr) 112px; gap: 8px; padding: 10px; border: 1px solid #dce5ef; border-radius: 8px; }
.unassigned-card h3 { margin: 5px 0 2px; font-size: 11px; }
.unassigned-card p, .unassigned-card small { margin: 0; color: var(--muted); font-size: 9px; }
.unassigned-card label { display: grid; gap: 3px; font-size: 9px; }
.unassigned-card select { min-height: 34px; padding: 5px; font-size: 9px; }
.dispatch-map-placeholder { margin-top: 10px; padding: 14px; border-radius: 8px; background: #edf4f8; color: #49657c; }
.dispatch-map-placeholder strong { color: var(--navy); font-size: 11px; }
.dispatch-map-placeholder p { margin: 5px 0 0; font-size: 9px; line-height: 1.4; }
.empty.compact { padding: 18px 12px; }
.navigation-settings-heading { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 14px; }
.navigation-settings-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.navigation-settings-heading label { display: grid; gap: 4px; min-width: 210px; }
.navigation-setting-row { display: grid; grid-template-columns: 32px minmax(130px,.8fr) minmax(150px,1fr) 130px 120px 82px; gap: 9px; align-items: end; padding: 10px 0; border-top: 1px solid #e2eaf2; }
.navigation-setting-row:first-child { border-top: 0; }
.navigation-setting-row > div:nth-child(2) { align-self: center; display: grid; gap: 2px; }
.navigation-setting-row small { color: var(--muted); font-size: 9px; }
.navigation-setting-row label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; }
.navigation-setting-row input, .navigation-setting-row select { min-height: 36px; padding: 6px 8px; font-size: 11px; }
.drag-handle { align-self: center; color: #7890a8; font-size: 18px; cursor: grab; }
.navigation-order-buttons { display: flex; gap: 5px; }
.navigation-order-buttons .icon-button { width: 36px; font-size: 15px; }
.navigation-appearance { display: grid; gap: 16px; margin-bottom: 16px; }
.navigation-appearance h2, .navigation-appearance p { margin: 0; }
.navigation-appearance p { color: var(--muted); }
.theme-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-preset { display: flex; align-items: center; gap: 8px; min-height: 38px; border: 1px solid #c9d8e8; border-radius: 9px; padding: 6px 10px; background: #fff; color: var(--navy); font-weight: 750; cursor: pointer; }
.theme-preset > span { width: 35px; height: 20px; border-radius: 6px; background: linear-gradient(180deg,var(--preset-nav) 0 72%,var(--preset-active) 72% 88%,var(--preset-accent) 88%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 20%); }
.navigation-color-grid { display: grid; grid-template-columns: repeat(4,minmax(150px,1fr)); gap: 10px; }
.navigation-color-field { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 750; }
.navigation-color-field > span { display: grid; grid-template-columns: 42px 1fr; }
.navigation-color-field input[type="color"] { width: 42px; height: 38px; border: 1px solid #c9d8e8; border-right: 0; border-radius: 8px 0 0 8px; padding: 3px; background: #fff; }
.navigation-color-field input[type="text"], .navigation-color-field input:not([type]) { border-radius: 0 8px 8px 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; }
.navigation-theme-preview { display: flex; align-items: stretch; min-height: 62px; overflow: hidden; border-radius: 11px; background: var(--office-nav); color: var(--office-nav-text); box-shadow: 0 8px 20px rgb(1 21 48 / 16%); }
.navigation-theme-preview > * { min-width: 94px; display: grid; place-items: center; align-content: center; gap: 3px; padding: 7px 12px; font-size: 9px; font-weight: 750; }
.navigation-theme-preview .preview-brand { min-width: 170px; display: flex; justify-content: flex-start; gap: 9px; }
.navigation-theme-preview .preview-brand img { width: 34px; height: 34px; }
.navigation-theme-preview > span { position: relative; }
.navigation-theme-preview > span.active { background: var(--office-nav-active); color: var(--office-nav-active-text); box-shadow: 0 5px 12px color-mix(in srgb,var(--office-nav-glow) 7%,transparent); }
.navigation-theme-preview > span.active::after { content: ""; position: absolute; inset: auto 0 0; height: 3px; background: linear-gradient(90deg,color-mix(in srgb,var(--office-nav-accent) 78%,#572300),var(--office-nav-accent),color-mix(in srgb,var(--office-nav-accent) 72%,#ffd39b)); }
.navigation-theme-preview .approved-nav-art { width: 22px; height: 22px; }

@media (min-width: 1600px) {
  .topbar { padding-left: 28px; padding-right: 28px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); }
  .dispatch-workspace { grid-template-columns: minmax(860px, 1fr) minmax(300px, 380px); }
  .list:has(> .company-management-row) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr));
    gap: 14px;
  }
}

@media (max-width: 2200px) {
  .header-utilities .account-email, .sync-label-full { display: none; }
  .sync-label-compact { display: inline; }
}

@media (max-width: 1500px) {
  .topbar { padding-inline: 12px; gap: 8px; }
  .header-utilities { gap: 4px; }
  .header-utilities .account-email, .sync-label-full { display: none; }
  .sync-label-compact { display: inline; }
}

@media (max-width: 1280px) {
  .topbar { flex-wrap: wrap; row-gap: 10px; padding: 10px 10px 16px; }
  .topbar .brand { order: 1; }
  .topbar .mark { width: 48px; height: 48px; }
  .topbar .brand { min-width: 0; gap: 8px; }
  .topbar .brand strong { font-size: 16px; }
  .topbar .brand span { margin-top: 3px; font-size: 11px; }
  .header-utilities { order: 2; }
  .top-navigation { position: relative; order: 3; width: 100%; flex: 0 0 100%; margin: 0; overflow: visible; display: flex; flex-wrap: nowrap; gap: 2px; background: transparent; box-shadow: none; }
  .top-nav-item, .top-nav-more summary { gap: 4px; padding: 7px 9px 18px; font-size: 14px; }
  .top-nav-icon { width: 36px; height: 36px; }
  .top-nav-more { position: static; }
  .icon-workers .approved-nav-art { height: 34px; }
  .dispatch-filters { grid-template-columns: minmax(200px,1fr) 150px 150px; }
  .dispatch-counters { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .topbar { column-gap: 7px; padding-inline: 8px; }
  .header-utilities > .workspace-company > span, .header-utilities > .workspace-company > strong { display: block; }
  .dispatch-heading { align-items: stretch; flex-direction: column; }
  .dispatch-date-controls { flex-wrap: wrap; }
  .dispatch-filters { grid-template-columns: 1fr 1fr; }
  .dispatch-filters label:first-child, .dispatch-counters { grid-column: 1 / -1; }
  .dispatch-workspace { grid-template-columns: 1fr; }
  .navigation-setting-row { grid-template-columns: 28px minmax(120px,1fr) minmax(150px,1.2fr); }
  .navigation-setting-row label:nth-of-type(2), .navigation-setting-row label:nth-of-type(3), .navigation-order-buttons { grid-column: auto; }
  .navigation-color-grid { grid-template-columns: 1fr 1fr; }
  .navigation-theme-preview { overflow-x: auto; }
}
@media (max-width: 520px) {
  .topbar .mark { width: 42px; height: 42px; }
  .topbar .brand { min-width: 0; }
  .topbar .brand > div { display: none; }
  .header-utilities > .workspace-company { display: grid; }
  .header-utilities .office-sync-control small { display: block; font-size: 10px; }
  .header-utilities .sync-label-full, .header-utilities .sync-label-compact { display: none; }
  .header-utilities .sync-label-phone { display: inline; }
  .header-utilities .office-sync-status { gap: 5px; padding: 5px 6px; }
  .header-utilities .sync-indicator { width: 6px; height: 6px; border: 0; border-radius: 50%; box-shadow: none; }
  .header-utilities .notification-button:has(.notification-indicator:empty) { display: none; }
  .account-panel .workspace-company { display: grid; }
  .top-nav-item, .top-nav-more summary { padding-inline: 7px; }
  .top-nav-icon { width: 30px; height: 30px; }
  .icon-workers .approved-nav-art { height: 29px; }
  .dispatch-filters { grid-template-columns: 1fr; }
  .dispatch-filters label:first-child, .dispatch-counters { grid-column: auto; }
  .dispatch-counters { display: grid; grid-template-columns: repeat(3,1fr); }
  .navigation-settings-heading { align-items: stretch; flex-direction: column; }
  .navigation-setting-row { grid-template-columns: 24px 1fr; }
  .navigation-setting-row label, .navigation-order-buttons { grid-column: 2; }
  .navigation-color-grid { grid-template-columns: 1fr; }
}
.private-proof-image{display:block;max-width:100%;max-height:28rem;object-fit:contain;border:1px solid #d9e2ef;border-radius:.6rem;margin-top:.75rem}

/* Company appearance applies to the whole signed-in Office, not just its nav. */
#app { min-height: 100vh; background: var(--canvas); color: var(--page-text); }
#app .shell { color: var(--ink); }
#app .surface { background: var(--surface); color: var(--ink); border-color: var(--line); }
#app .button:not(.secondary):not(.quiet):not(.danger):not(.sync-button):not(:disabled) { background: var(--blue); border-color: var(--blue); color: var(--action-text, #fff); }
#app .button.secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
#app .button.quiet { background: var(--surface); color: var(--ink); }
#app .eyebrow { color: var(--ink); }
#app .login-aside .eyebrow { color: #ffb45c; }
#app .state { color: #071d3d; }
#app .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
#app .actions .button { display: inline-flex; align-items: center; justify-content: center; text-align: center; line-height: 1.3; }
#app .form-grid { align-items: end; }
#app input[type="checkbox"], #app input[type="radio"] { width: 18px; height: 18px; min-width: 18px; min-height: 18px; max-width: 18px; padding: 0; margin: 0; flex: 0 0 18px; accent-color: var(--blue); }
#app .approval-check, #app .choice-row { align-items: center; }
#app input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), #app textarea, #app select { background: var(--surface); color: var(--ink); border-color: var(--line); }
.company-wordmark { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-mark { object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.settings-heading { align-items: end; margin-bottom: 28px; }
.settings-heading h1 { font-size: clamp(27px, 3vw, 36px); letter-spacing: -.035em; }
.settings-save-note { flex: 0 1 260px; margin: 0; padding-left: 14px; border-left: 3px solid var(--accent); color: var(--page-text); font-size: 12px; line-height: 1.65; }
.settings-workspace { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-workspace .setup-toolbar { position: sticky; top: 20px; max-height: calc(100dvh - 40px); overflow-y: auto; margin: 0; padding: 18px 12px; border-radius: 14px; box-shadow: none; scrollbar-gutter: stable; }
.setup-toolbar .settings-search { display: grid; gap: 8px; padding: 0 6px; font-size: 12px; font-weight: 750; }
.settings-search input { min-width: 0; width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 10px; }
.settings-search-result { margin: 8px 6px 0; font-size: 12px; }
.settings-search-result:empty { display: none; }
.setup-toolbar nav { display: grid; gap: 16px; margin-top: 22px; }
.settings-nav-group h2 { margin: 0 10px 6px; font-size: 10px; line-height: 1.5; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.settings-nav-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.setup-toolbar a { display: grid; gap: 4px; min-height: 44px; padding: 10px 12px; border: 1px solid transparent; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.setup-toolbar a small { font-size: 11px; font-weight: 400; line-height: 1.45; color: var(--muted); }
.setup-toolbar a:hover { background: color-mix(in srgb, var(--ink) 5%, var(--surface)); border-color: var(--line); }
.setup-toolbar a.active { background: color-mix(in srgb, var(--blue) 8%, var(--surface)); border-color: var(--line); box-shadow: inset 3px 0 var(--accent); }
.setup-toolbar a:focus-visible, .setup-section:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.settings-mobile-picker { display: none; }
.settings-empty-search { padding: 12px 6px; font-size: 13px; line-height: 1.5; }
.settings-workspace .company-setup { min-width: 0; }
.setup-section { scroll-margin-top: 20px; margin: 0; min-width: 0; }
.setup-section > .page-header { min-height: 0; margin: 2px 0 22px; gap: 16px; flex-wrap: wrap; }
.setup-section .page-header > div { min-width: 0; flex: 1 1 250px; }
.setup-section h1, #app .setup-section .page-header h2 { font-size: 24px; letter-spacing: -.025em; line-height: 1.3; }
.setup-section .eyebrow { display: none; }
.setup-section .page-header .subtitle { margin-top: 8px; max-width: 68ch; font-size: 14px; }
.settings-workspace .surface.form-section { padding: clamp(18px, 2.2vw, 28px); margin: 0 0 20px; border-radius: 14px; box-shadow: 0 3px 12px color-mix(in srgb, var(--ink) 4%, transparent); }
.settings-workspace .form-section > h2 { margin-bottom: 8px; font-size: 18px; }
.settings-workspace .form-section > h3 { margin: 28px 0 14px; font-size: 15px; }
#app .settings-workspace .form-grid { gap: 22px 20px; align-items: start; margin-top: 18px; }
#app .settings-workspace label { min-width: 0; color: var(--ink); line-height: 1.5; }
#app .settings-workspace .form-grid label { font-size: 13px; gap: 8px; }
.settings-workspace input, .settings-workspace select, .settings-workspace textarea { max-width: 100%; min-width: 0; }
.settings-workspace input[type="color"] { width: 100%; height: 44px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; }
#app .settings-workspace .field-note, #app .settings-workspace .form-section .subtitle { color: var(--muted); font-size: 12px; line-height: 1.65; font-weight: 400; text-align: left; }
.settings-workspace .form-section .field-note { margin: 10px 0; }
.settings-workspace .form-section > .actions { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }
#app .settings-workspace .actions .button { min-height: 42px; font-size: 13px; padding: 10px 15px; box-shadow: none; overflow-wrap: anywhere; }
.settings-workspace .approval-check { gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; font-weight: 500; }
.settings-workspace .state { margin: 16px 0; padding: 16px; border-radius: 10px; line-height: 1.55; }
.settings-workspace .setup-message { scroll-margin-top: 20px; }
.settings-workspace .tax-rule, .settings-workspace .tax-registration, .settings-workspace [data-material-markup-tier] { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px; background: var(--surface); color: var(--ink); border-color: var(--line); }
.settings-workspace .tax-applicability { grid-column: 1 / -1; }
.settings-workspace .workflow-row { grid-template-columns: minmax(0, 1fr) 120px auto; background: var(--surface); color: var(--ink); border-color: var(--line); }
.settings-workspace .workflow-row[data-material-markup-tier] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.settings-workspace [data-material-markup-tier] > div { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px; }
.settings-workspace #material-markup-tiers { display: grid; gap: 12px; margin: 16px 0; }
.settings-workspace .tax-rule > button { justify-self: start; }
.settings-workspace .navigation-appearance { padding: clamp(18px, 2.2vw, 28px); }
.settings-workspace .navigation-color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 22px 0; }
.settings-workspace .navigation-color-field > span { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; }
#app .settings-workspace .navigation-color-field { font-size: 13px; gap: 8px; }
.settings-workspace .theme-color-input { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 8px; }
.settings-workspace .theme-color-input input { width: 100%; }
.settings-workspace .navigation-setting-row { grid-template-columns: 24px minmax(100px, 1fr) minmax(130px, 1fr); gap: 12px; padding: 18px 0; }
.settings-workspace .navigation-setting-row label:nth-of-type(2) { grid-column: 2; }
.settings-workspace .navigation-setting-row label:nth-of-type(3) { grid-column: 3; }
.settings-workspace .navigation-order-buttons { grid-column: 3; justify-self: end; }
.settings-workspace .navigation-setting-row label, .settings-workspace .navigation-setting-row small { font-size: 12px; }
.settings-workspace .navigation-setting-row input, .settings-workspace .navigation-setting-row select { font-size: 13px; min-height: 42px; }
.settings-workspace .app-palette-preview > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.settings-workspace .app-palette-preview span { display: inline-block; margin: 4px 4px 4px 0 !important; }
.settings-workspace .detail { grid-template-columns: minmax(0, 1fr); }
.settings-workspace .form-section > label { display: grid; gap: 8px; margin: 18px 0; }
.settings-workspace .form-section > label.choice-row, .settings-workspace .form-section > label.approval-check { display: flex; }
.settings-workspace .form-section dl { display: grid; grid-template-columns: minmax(100px, .4fr) minmax(0, 1fr); gap: 12px; padding: 16px 0; }
.settings-workspace .form-section dd { margin: 0; overflow-wrap: anywhere; }
.settings-workspace .form-section > .button { margin-top: 18px; }
.settings-workspace .navigation-settings { padding: 20px; }
.settings-workspace .navigation-settings > summary { line-height: 1.4; }
.settings-workspace .navigation-theme-preview { overflow-x: auto; }
@media(max-width:1000px) {
  .settings-workspace { grid-template-columns: 228px minmax(0, 1fr); gap: 20px; }
  .settings-workspace .workflow-row { grid-template-columns: minmax(0, 1fr); }
  #app .settings-workspace .form-grid, .settings-workspace .tax-rule, .settings-workspace [data-material-markup-tier] { grid-template-columns: minmax(0, 1fr); }
}
@media(max-width:760px) {
  .settings-heading { display: block; }
  .settings-save-note { margin-top: 16px; }
  .settings-workspace { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .settings-workspace .setup-toolbar { position: static; max-height: none; overflow: visible; padding: 16px; }
  .setup-toolbar .settings-search { padding: 0; }
  .setup-toolbar .settings-mobile-picker { display: grid; gap: 8px; margin-top: 14px; font-size: 12px; font-weight: 750; }
  .settings-mobile-picker select { width: 100%; padding: 10px; min-height: 44px; border: 1px solid var(--line); border-radius: 9px; }
  .setup-toolbar nav { display: none; }
  .setup-toolbar.is-searching nav { display: grid; }
  .settings-workspace .tax-registration { grid-template-columns: minmax(0, 1fr); }
  .settings-workspace .navigation-settings-heading label { min-width: 0; }
  .settings-workspace .navigation-color-grid, .settings-workspace .workflow-row[data-material-markup-tier] { grid-template-columns: minmax(0, 1fr); }
  .settings-workspace .navigation-setting-row { grid-template-columns: 24px minmax(0, 1fr); }
  .settings-workspace .navigation-setting-row label:nth-of-type(n), .settings-workspace .navigation-order-buttons { grid-column: 2; }
}
[hidden] { display: none !important; }
@media(max-width:520px) { .company-wordmark { max-width: 115px; font-size: 12px !important; } .brand span { font-size: 8px; } .company-mark { width: 30px; height: 30px; } .setup-toolbar { padding: 12px; } .setup-toolbar a { font-size: 12px; } #app .actions .button { flex: 1 1 140px; } }

#app .shell > .panel > .page-header { color: var(--page-text); }
#app .company-setup > .setup-section > .page-header { color: var(--page-text); }
#app .company-setup > .setup-section > .page-header .subtitle, #app .shell > .panel > .page-header .subtitle { color: var(--page-text); opacity: .8; }
#app .section-tabs button.active { color: var(--ink); }
#app .hero { background: var(--office-nav); color: var(--office-nav-text); }
#app .icon-button { background: var(--surface); color: var(--ink); border-color: var(--line); }

#app .brand span, #app .brand strong, #app .header-utilities, #app .header-utilities .workspace-company > span, #app .header-utilities .workspace-company > strong, #app .office-sync-status, #app .office-sync-control small, #app .account-control > summary, #app .account-email, #app .notification-button, #app .sync-button { color: var(--office-nav-text); }
#app .sync-button { border-color: var(--office-nav-text); }
#app .top-nav-more > div, #app .account-panel { background: var(--surface); color: var(--ink); }
#app .top-nav-overflow-item { color: var(--ink); }
#app .top-nav-overflow-item:hover, #app .top-nav-overflow-item.active { color: var(--ink); }
#app .setup-section .page-header h2 { font-size: 25px; }
.navigation-settings > summary { cursor: pointer; font-size: 18px; font-weight: 750; min-height: 44px; }
#app .button:focus-visible, #app input:focus-visible, #app textarea:focus-visible, #app select:focus-visible, #app a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
#app .button:disabled { color: #071426; }

@media(max-width:520px) { #app .topbar .brand { flex: 0 0 100%; } #app .topbar .brand > div { display: grid; } #app .topbar .company-wordmark { max-width: calc(100vw - 75px); font-size: 14px !important; } #app .topbar .brand span { font-size: 9px; margin-top: 2px; } #app .header-utilities { margin-left: 0; width: 100%; justify-content: space-between; } }

#app .account-panel .workspace-company > span, #app .account-panel .account-panel-label { color: var(--muted); }
#app .account-panel .workspace-company > strong, #app .account-panel .account-panel-email, #app .account-panel .account-email { color: var(--ink); }
#app .account-panel .account-sign-out { background: var(--surface); color: var(--ink); border-color: var(--line); }
#app .panel > .page-header .eyebrow, #app .setup-section > .page-header .eyebrow { color: var(--page-text); }
#app .section-tabs button { color: var(--page-text); }

#app .state-neutral { background: #eaf3ff; border-color: #c9d8e8; color: #071d3d; }
#app .state p, #app .state small { color: #071d3d; }

/* Shared Lite worker schedule: presentation only; scheduling authority is unchanged. */
.schedule-scroll { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); isolation: isolate; }
.schedule-scroll:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.schedule-day, .schedule-week { display: grid; min-width: 100%; width: max-content; color: var(--ink); }
.schedule-day { grid-template-columns: 150px var(--schedule-width); }
.schedule-week { grid-template-columns: 150px repeat(7,minmax(155px,1fr)); width: 100%; }
.schedule-day-corner, .schedule-week-corner, .schedule-day-worker, .schedule-date { position: sticky; top: 0; z-index: 3; margin: 0; padding: 12px 10px; background: var(--surface); border-bottom: 2px solid var(--accent); border-right: 1px solid var(--line); font-size: 14px; font-weight: 750; }
.schedule-day-corner, .schedule-week-corner { left: 0; z-index: 5; font-size: 12px; }
.schedule-worker { position: sticky; left: 0; z-index: 2; margin: 0; padding: 16px 10px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }
.schedule-time-scale { position: sticky; top: 0; z-index: 3; height: 46px; background: var(--surface); border-bottom: 2px solid var(--accent); }
.schedule-time-scale > span { position: absolute; top: 5px; padding-left: 5px; font-size: 12px; font-weight: 700; }
.schedule-time-scale small { display: block; font-size: 10px; font-weight: 400; color: var(--muted); }
.schedule-day-lane { position: relative; min-width: 0; border-bottom: 1px solid var(--line); }
.schedule-hour-line { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.schedule-week-cell { min-width: 0; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.schedule-job { position: relative; min-width: 0; margin: 0 0 8px; padding: 8px; border: 1px solid var(--job-accent); border-left: 5px solid var(--job-accent); border-radius: 8px; background: var(--job-tint); color: var(--job-ink); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; box-shadow: 0 2px 5px #071d3d0d; }
.schedule-day-lane > .schedule-job { position: absolute; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-auto-rows: max-content; align-content: start; gap: 0 4px; margin: 0; padding: 2px 5px; overflow: auto; border-left-width: 4px; font-size: 10px; }
.schedule-day-lane .schedule-job > strong, .schedule-day-lane .schedule-time, .schedule-day-lane .schedule-badges, .schedule-day-lane .schedule-job > .actions { grid-column: 1 / -1; }
.schedule-job[data-unassigned="true"] { border-style: dashed; box-shadow: none; }
.schedule-day-lane .schedule-job > strong, .schedule-day-lane .schedule-job > p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-day-lane .schedule-job > p { margin: 0; font-size: 10px; line-height: 1.1; }
.schedule-day-lane .schedule-job > .schedule-time { white-space: normal; font-size: 10px; line-height: 1.2; }
.schedule-day-lane .schedule-job > strong { font-size: 12px; line-height: 1.15; }
.schedule-occupied { position: absolute; height: 7px; background: var(--job-color); border: 1px solid var(--job-accent); border-right: 3px solid var(--job-accent); box-sizing: border-box; z-index: 1; }
.schedule-occupied::after { content: ''; position: absolute; right: -3px; top: -2px; height: 11px; border-right: 3px solid var(--job-accent); }
.schedule-category-dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--job-color); border: 1px solid var(--job-accent); flex: 0 0 7px; }
.schedule-label:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.schedule-job > strong { display: block; font-size: 13px; line-height: 1.3; }
.schedule-job p { margin: 5px 0; color: inherit; font-size: 11px; line-height: 1.35; }
.schedule-job .schedule-time { font-weight: 750; }
.schedule-job .schedule-clipped { font-weight: 750; border-bottom: 1px dashed var(--job-color); padding-bottom: 3px; }
.schedule-job .schedule-assignees { color: inherit; font-size: 10px; }
.schedule-warnings { max-height: 48px; overflow: auto; border-left: 2px solid var(--accent); padding-left: 5px; }
#app .schedule-job .actions { gap: 5px; margin-top: 8px; }
#app .schedule-job .actions .button { min-height: 30px; padding: 5px 7px; font-size: 11px; border-radius: 6px; white-space: normal; }
#app .schedule-day-lane .schedule-job .actions { margin-top: 0; }
#app .schedule-day-lane .schedule-job .actions .button { min-height: 24px; padding: 3px 6px; font-size: 10px; }
.schedule-empty { display: block; margin: 10px; color: var(--muted); font-size: 12px; }
@media(max-width:768px) { .schedule-scroll { max-height: 68vh; } .schedule-week { grid-template-columns: 125px repeat(7,minmax(170px,1fr)); } }
.schedule-worker-select { display: flex; gap: 7px; align-items: center; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.schedule-worker-select:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.schedule-avatar { display: grid; place-items: center; flex: 0 0 25px; height: 25px; border-radius: 50%; background: var(--blue); color: white; font-size: 12px; }
.schedule-header { margin-bottom: 10px; min-height: 0; }
.schedule-header h1 { font-size: 24px; }
.schedule-header p { margin: 3px 0; font-size: 12px; }
#app .schedule-header .actions { gap: 5px; }
#app .schedule-header .button, #app .schedule-controls .button { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.schedule-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.schedule-filters { display: flex; flex: 1; flex-wrap: wrap; gap: 7px; }
.schedule-filters label { flex: 1 1 115px; min-width: 100px; font-size: 11px; }
.schedule-filters input, .schedule-filters select { min-height: 32px; height: 32px; margin-top: 3px; padding: 4px 7px; font-size: 12px; }
.schedule-note { font-size: 11px; margin: 6px 0; }
.schedule-controls + [data-message]:empty { display: none; }
.schedule-badges { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin: 4px 0; }
.schedule-status, .schedule-unassigned, .schedule-priority { display: inline-block; padding: 1px 4px; border: 1px solid; border-radius: 4px; font-size: 10px; font-weight: 750; line-height: 1.2; white-space: nowrap; }
.schedule-status { color: #24364b; background: #fff; border-color: #6b7787; }
.schedule-unassigned { color: #283341; background: #e0e5ed; border-color: #5d6a7a; }
.schedule-priority.urgent { color: #663900; background: #fff0c2; border-color: #a85c00; }
.schedule-priority.emergency { color: #8c1010; background: #ffe2e2; border-color: #b82020; }
.schedule-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 8px 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 10px; line-height: 1.3; }
.schedule-legend-title { font-weight: 750; }
.schedule-legend-category { display: inline-flex; align-items: center; padding: 2px 5px; border: 1px solid var(--job-accent); border-radius: 4px; background: var(--job-tint); color: var(--job-ink); }
.schedule-legend-fallback { font-size: 9px; }
#schedule-board .schedule-filters label { color: var(--ink); font-size: 13px; }
#schedule-board .schedule-legend-category { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
#schedule-board .schedule-legend, #schedule-board .schedule-legend-fallback,
#schedule-board > .field-note, #schedule-board .schedule-note, #schedule-board > [data-message] { font-size: 13px; line-height: 1.5; text-align: left; overflow-wrap: anywhere; }
.schedule-priority small { font-size: 9px; }
.schedule-day-lane .schedule-badges { margin: 0; gap: 2px; }
.schedule-day-lane .schedule-badges > span { font-size: 9px; padding: 0 3px; }
.schedule-history-lock { align-self: center; font-size: 9px; font-weight: 700; }

/* Working availability: compact visual controls, existing company palette. */
.schedule-job[data-edit-mode="DRAG"] { cursor: pointer; touch-action: pan-y; }
.schedule-job[data-edit-mode="CONFIRM"] { cursor: pointer; }
.schedule-job[data-edit-mode="LOCKED"] { cursor: pointer; }
.schedule-drag-source { opacity: .5; outline: 2px dashed var(--job-accent); }
.schedule-proposed-slot { position: absolute; z-index: 4; pointer-events: none; min-height: 24px; border: 2px dashed var(--blue); border-radius: 5px; background: color-mix(in srgb,var(--blue) 15%,var(--surface)); color: var(--ink); padding: 4px; font-size: 10px; white-space: nowrap; }
.schedule-drop-target { box-shadow: inset 0 0 0 2px var(--blue); background: color-mix(in srgb,var(--blue) 8%,var(--surface)); }
.schedule-proposed-slot.has-conflict { border: 2px solid var(--orange); background: color-mix(in srgb,var(--orange) 20%,var(--surface)); }
#app .schedule-move-edge, #app .schedule-resize { position: absolute; z-index: 2; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; touch-action: none; }
#app .schedule-move-edge { cursor: grab; }
#app .schedule-move-edge.edge-top { left: 0; right: 0; top: 0; width: auto; height: 8px; }
#app .schedule-move-edge.edge-left { left: 0; top: 8px; bottom: 8px; width: 8px; height: auto; }
#app .schedule-move-edge.edge-right { right: 0; top: 8px; bottom: 8px; width: 8px; height: auto; }
#app .schedule-resize { left: 8px; right: 8px; bottom: 0; top: auto; width: auto; height: 8px; border-bottom: 2px solid var(--job-accent); cursor: ew-resize; }
#app .schedule-move-edge:hover, #app .schedule-resize:hover { background: color-mix(in srgb,var(--job-accent) 18%,transparent); }
.schedule-move-edge:focus-visible, .schedule-resize:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.schedule-drag-source .schedule-move-edge { cursor: grabbing; }
.schedule-drag-preview { position: fixed; z-index: 80; pointer-events: none; width: 290px; max-height: 150px; overflow: hidden; padding: 10px; border: 2px solid var(--blue); border-radius: 8px; background: var(--surface); color: var(--ink); box-shadow: 0 5px 20px #071d3d33; font-size: 12px; }
.schedule-drag-preview.invalid { border-color: var(--red); }
.schedule-drag-preview p { margin: 4px 0; font-size: 12px; }
.quick-schedule { width: min(560px,calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 18px; border: 1px solid var(--line); border-top: 4px solid var(--orange); border-radius: 12px; background: var(--surface); color: var(--ink); overflow: auto; }
.quick-schedule::backdrop { background: #071d3d70; }
.quick-schedule header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quick-schedule h2 { font-size: 19px; margin: 0; }
.quick-identification { font-size: 14px; line-height: 1.4; }
.quick-schedule .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.quick-schedule input, .quick-schedule select { min-width: 0; }
.quick-schedule label { font-size: 12px; }
.quick-helpers { padding: 8px; margin-top: 10px; border: 1px solid var(--line); }
.quick-helpers legend { font-size: 12px; }
.schedule-edit-warnings { padding: 8px 8px 8px 25px; border-left: 3px solid #a85c00; background: #fff0c2; color: #663900; font-size: 12px; }
.schedule-edit-protection { padding: 8px; border-left: 3px solid var(--orange); font-size: 12px; }
#app .quick-schedule .button, #app .schedule-undo { min-height: 32px; padding: 5px 9px; font-size: 12px; }
.quick-schedule [data-quick-message] { color: var(--red); font-size: 12px; }
.quick-schedule [data-proposed] { font-weight: 700; font-size: 13px; }
@media(max-width:540px) { .quick-schedule .form-grid { grid-template-columns: minmax(0,1fr); } }
.availability-editor { max-width: 1120px; min-width: 0; }
.office-job-groups { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
#app .office-job-groups .button { min-height: 34px; padding: 6px 9px; font-size: 12px; }
.office-job-groups .button span { font-variant-numeric: tabular-nums; margin-left: 3px; }
.office-job-filters { display: grid; grid-template-columns: repeat(3,minmax(130px,1fr)); gap: 10px; margin: 12px 0; }
.office-job-filters label { display: grid; gap: 5px; min-width: 0; font-size: 12px; font-weight: 700; }
.office-job-filters input, .office-job-filters select { width: 100%; min-width: 0; margin: 0; }
.office-job-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.office-job-row h2 { margin: 4px 0; font-size: 16px; }
.office-job-row p { margin: 3px 0; font-size: 13px; overflow-wrap: anywhere; }
.office-job-title { border: 0; padding: 0; background: none; color: var(--blue); font: inherit; text-align: left; cursor: pointer; max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.office-job-title:hover { text-decoration: underline; }
.office-job-title:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.job-attention-actions { flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#app .job-attention-highlight, #app .job-attention-highlight:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; border-radius: 5px; scroll-margin-block: 100px; }
#app .job-attention-actions .button { min-height: 34px; padding: 6px 9px; font-size: 12px; }

/* Correction editor only: separate labels, saved evidence and the readiness caveat. */
#app [data-job-correction-editor] [data-correction-form] { display: grid; gap: 16px; min-width: 0; }
#app [data-job-correction-editor] [data-correction-form] label { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; font-size: 14px; line-height: 1.5; text-align: left; color: var(--ink); overflow-wrap: anywhere; }
#app [data-job-correction-editor] .job-correction-label { font-weight: 650; }
#app [data-job-correction-editor] [data-correction-value] { display: block; margin: 0; font-size: 14px; line-height: 1.6; font-weight: 400; text-align: left; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
#app [data-job-correction-editor] [data-correction-caveat] { max-width: 80ch; margin-block: 12px 20px; font-size: 14px; line-height: 1.6; text-align: left; color: var(--muted); overflow-wrap: anywhere; }
#app [data-job-correction-editor] [data-correction-form] [data-correction-checkbox] { flex-direction: row; align-items: flex-start; gap: 10px; }
#app [data-job-correction-editor] [data-correction-checkbox] input[type="checkbox"] { order: -1; flex: 0 0 18px; width: 18px; height: 18px; margin: 2px 0 0; }
#app [data-job-correction-editor] [data-correction-form] textarea, #app [data-job-correction-editor] [data-correction-form] select { width: 100%; min-width: 0; max-width: 100%; margin: 0; }
#app [data-job-correction-editor] [data-correction-form] .actions { flex-wrap: wrap; gap: 8px; }

/* Local UI polish: keep existing navigation art and company palette. */
.office-skip { position: fixed; top: 8px; left: 12px; z-index: 1000; transform: translateY(-200%); padding: 12px 18px; border: 2px solid currentColor; border-radius: 8px; background: var(--surface); color: var(--ink); }
.office-skip:focus { transform: translateY(0); }
#office-main:focus { outline: none; }
.daily-route .route-summary { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin-block: 16px; }
.daily-route .route-summary p { margin: 0; }
.daily-route .route-generation { min-width: 0; margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.daily-route .route-generation legend { font-weight: 700; }
.daily-route .route-generation input { min-width: 0; max-width: 100%; }
.daily-route .route-preview { margin-block: 16px; overflow-wrap: anywhere; }
.daily-route .route-stops { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 12px; }
.daily-route .route-stop { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.daily-route .route-stop h2 { font-size: 18px; margin: 0 0 4px; overflow-wrap: anywhere; }
.daily-route .route-stop p { margin: 4px 0; overflow-wrap: anywhere; }
.daily-route .route-order { font-weight: 800; color: var(--ink); border-bottom: 3px solid var(--orange); padding: 0 8px 4px; align-self: start; }
#app .daily-route .route-stop .actions .button { min-height: 40px; padding: 7px 12px; white-space: normal; }
.daily-route .route-save-actions { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px; }
.daily-route .route-empty { padding: 20px; border: 1px dashed var(--line); border-radius: 12px; }
.daily-route [data-message]:empty { display: none; }
.daily-route .field-note { font-size: 13px; line-height: 1.5; text-align: left; color: var(--muted); }
@media(max-width:520px) { .daily-route .route-stop { padding: 12px; gap: 8px; } }
.office-job-context { color: var(--muted); }
.office-job-row .actions { align-content: start; align-self: center; justify-content: end; flex-wrap: wrap; max-width: 350px; }
#app .office-job-row .button { min-height: 34px; padding: 6px 9px; font-size: 12px; }
.office-job-row .job-status-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.office-list-tools { padding: 14px; display: grid; gap: 12px; margin-bottom: 12px; }
.office-list-search { display: grid; gap: 6px; font-size: 14px; font-weight: 700; min-width: 0; }
.office-list-search input { width: 100%; margin: 0; min-height: 42px; font-size: 16px; }
.office-list-filter-actions, .office-list-search-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.office-list-filter-actions label { display: grid; gap: 5px; min-width: 210px; font-size: 12px; font-weight: 700; }
.office-list-filter-actions select { margin: 0; width: 100%; min-height: 36px; }
.office-list-search-scope { display: flex; gap: 7px; align-items: center; align-self: center; font-size: 13px; }
.office-list-search-scope input { margin: 0; width: 18px; height: 18px; min-height: 18px; }
.office-list-views { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.office-list-context { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
#app .office-list-scope { font-size: 13px; line-height: 1.5; text-align: left; color: var(--muted); overflow-wrap: anywhere; }
.office-list-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; margin: 12px 0; }
.office-list-pager p { margin: 0; font-size: 13px; }
.office-list-pager .actions { margin: 0; gap: 8px; align-items: center; }
.office-list-pager span { font-size: 13px; }
#app .office-list-tools .button, #app .office-list-views .button, #app .office-list-pager .button, #app .office-customer-row .button, #app .office-list-empty .button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
#app .office-list-pager .button:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.office-customer-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.office-customer-row h2 { margin: 0 0 4px; font-size: 16px; }
.office-customer-row p { margin: 3px 0; font-size: 13px; overflow-wrap: anywhere; }
.office-customer-title { border: 0; background: none; padding: 0; color: var(--blue); font: inherit; text-align: left; font-weight: 700; cursor: pointer; overflow-wrap: anywhere; }
.office-customer-title:hover { text-decoration: underline; }
.office-customer-title:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.office-customer-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: end; }
@media(max-width:600px) { .office-customer-row { grid-template-columns: minmax(0,1fr); gap: 8px; } .office-customer-actions { justify-content: start; } .office-list-filter-actions label { min-width: 0; flex: 1 1 180px; } .office-list-pager { align-items: start; } .office-list-views > .office-list-context { flex-basis: 100%; } }
#office-job-progress > .surface, #office-job-progress .detail { margin-top: 14px; }
#office-job-progress dd, #office-job-progress p { overflow-wrap: anywhere; }
#office-job-progress dd { white-space: pre-wrap; }
@media(max-width:1050px) { .office-job-filters { grid-template-columns: repeat(2,minmax(0,1fr)); } .office-job-row { grid-template-columns: minmax(0,1fr); } .office-job-row .actions { justify-content: start; max-width: none; } }
@media(max-width:540px) { .office-job-filters { grid-template-columns: minmax(0,1fr); } }
.availability-worker { max-width: 340px; margin-bottom: 14px; }
.availability-copy { flex-wrap: wrap; margin-bottom: 14px; }
.availability-week { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.availability-day, .availability-exception { min-width: 0; padding: 12px; }
.availability-day > header, .availability-exception > header, .availability-exceptions > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.availability-day h2 { margin: 0; font-size: 15px; }
.availability-toggle { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink); }
.availability-toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.availability-windows { display: grid; gap: 8px; }
.availability-window { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto; align-items: end; gap: 6px; }
.availability-time { padding: 0; border: 0; margin: 0; min-width: 0; }
.availability-time legend { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.availability-clock { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) minmax(0,1.25fr); gap: 3px; align-items: center; }
.availability-clock select { width: 100%; min-width: 0; margin: 0; padding: 7px 2px; font-size: 12px; min-height: 34px; }
.availability-arrow { align-self: center; padding-top: 12px; color: var(--muted); }
.availability-error { grid-column: 1 / -1; color: var(--red); font-size: 12px; margin: 2px 0; }
.availability-error[hidden] { display: none; }
.availability-off { color: var(--muted); margin: 4px 0; font-size: 12px; }
.availability-exceptions { margin: 22px 0 16px; display: grid; gap: 10px; }
.availability-exceptions h2 { margin: 0; font-size: 18px; }
.availability-exceptions .field-note { margin: 4px 0; }
.availability-exception > header > label:first-child { min-width: 160px; max-width: 240px; }
.availability-exception .availability-window { max-width: 660px; }
#app .availability-editor .button { min-height: 34px; padding: 6px 9px; font-size: 12px; white-space: normal; }
.availability-windows > .button { justify-self: start; }
@media(max-width:1050px) { .availability-week { grid-template-columns: minmax(0,1fr); } }
@media(max-width:540px) {
  .availability-window { grid-template-columns: minmax(0,1fr); gap: 6px; align-items: start; }
  .availability-arrow { display: none; }
  .availability-clock { max-width: 260px; }
  .availability-clock select { padding: 8px 5px; }
  .availability-window > .button { justify-self: start; }
  .availability-exception > header { align-items: start; }
}

.internal-chat { display:grid; grid-template-columns:minmax(210px,1fr) minmax(0,3fr); gap:16px; }
.internal-chat aside, .internal-chat section { min-width:0; padding:18px; }
.internal-chat label { display:grid; gap:8px; min-width:0; }
.internal-chat textarea, .internal-chat select { width:100%; min-width:0; max-width:100%; box-sizing:border-box; }
.internal-chat [data-chat-inbox] { display:grid; gap:8px; margin-top:16px; }
#app .internal-chat [data-chat-peer] { width:100%; min-width:0; min-height:44px; padding:10px 12px; font-size:13px; line-height:1.5; white-space:normal; overflow-wrap:anywhere; text-align:left; justify-content:flex-start; }
.internal-chat h2, .chat-history strong { overflow-wrap:anywhere; }
.chat-history { list-style:none; padding:0; max-height:420px; overflow:auto; }
.chat-history li { padding:12px 0; border-bottom:1px solid var(--border,#d3deeb); }
.chat-history p { white-space:pre-wrap; overflow-wrap:anywhere; margin:6px 0; }
.chat-history time, .chat-history small { font-size:.8rem; }
@media(max-width:700px) { .internal-chat { grid-template-columns:minmax(0,1fr); } }
#app .company-management-row:has([data-worker-status], [data-worker-resend]) { background: var(--surface); color: var(--ink); }
.company-management-row:has([data-worker-status], [data-worker-resend]) > div:first-child { min-width: 0; overflow-wrap: anywhere; }
#app .form-section:has(#worker-email) label { color: var(--ink); }
#app .form-section:has(#worker-email) > .field-note, #app .page-header:has(~ .form-section #worker-email) .field-note { font-size: 13px; line-height: 1.5; text-align: left; }
/* Full customer/job identities remain readable without changing saved records. */
.page-header:has(#back-customers), #office-job-progress .page-header { flex-wrap: wrap; }
.page-header:has(#back-customers) > div:first-child, #office-job-progress .page-header > div:first-child { min-width: 0; flex: 1 1 280px; overflow-wrap: anywhere; }
.customer-detail-grid > .surface { min-width: 0; overflow-wrap: anywhere; }
.history-row:has([data-open-office-job]) > div:first-child { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.history-row:has([data-open-office-job]) > .actions { flex-shrink: 0; }
#app .form-section:has(#customer-type, #job-customer) label { min-width: 0; color: var(--ink); line-height: 1.5; }
#app .form-section:has(#customer-type, #job-customer) .field-note, #app .form-section:has(#job-customer) .job-past-date-note { font-size: 13px; line-height: 1.5; text-align: left; }
#app .panel:has(#customer-type, #job-customer) > .state { overflow-wrap: anywhere; }
#office-job-progress .field-note { font-size: 13px; line-height: 1.5; text-align: left; }
#job-planned-items { min-width: 0; overflow-wrap: anywhere; }
#job-planned-items .history-row > span { min-width: 0; flex: 1; }
#app .form-section:has(#job-customer) .duration-field { color: var(--ink); }
#app .form-section:has(#job-customer) .duration-field small { font-size: 13px; line-height: 1.5; }
#app [data-invoice-metadata-form] label { color: var(--ink); line-height: 1.5; }
/* Invoice review keeps full saved identities and company-theme contrast. */
.draft-header { flex-wrap: wrap; }
.draft-header > div:first-child { min-width: 0; flex: 1 1 280px; overflow-wrap: anywhere; }
.invoice-identifiers { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 10px 0 4px; }
.invoice-identifiers > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; min-width: 0; }
.invoice-identifiers dt { font-size: 14px; }
.invoice-identifiers dd { margin: 0; font-size: 18px; font-weight: 750; overflow-wrap: anywhere; }
.invoice-job-reference { margin: 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.invoice-job-reference code { font: inherit; }
.draft-layout > *, .draft-layout .surface, .draft-layout .history-row > div { min-width: 0; overflow-wrap: anywhere; }
.draft-layout .template-heading > div { min-width: 0; }
#app .draft-layout .form-section label { color: var(--ink); line-height: 1.5; }
.draft-layout .amount-summary, .draft-layout .line-item-row, .draft-layout .visibility-option, .draft-layout .work-summary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.draft-layout .line-item-heading strong, .draft-layout .work-summary p { color: var(--ink); }
.draft-layout .invoice-warning { color: #5d4a2e; }
.draft-layout .invoice-warning.overridden { color: #356047; }
.review-support-tools { margin: 0 0 14px; max-width: 100%; }
.review-support-tools > summary { width: fit-content; max-width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--page-text); font-size: 13px; cursor: pointer; }
.review-support-tools[open] > summary { margin-bottom: 10px; }
.review-support-tools-content { display: grid; gap: 10px; min-width: 0; }
#app .job .review-identity-note { font-size: 13px; line-height: 1.5; text-align: left; }
#app .list > .job { background: var(--surface); color: var(--ink); border-color: var(--line); }
#app .list > .job .job-meta { color: var(--muted); }
#app .list > .job .proof { color: var(--ink); }
/* Review cards keep an inset on Dashboard too; the older activity-list rule
   intentionally has zero side padding and must not flatten these cards. */
#app .job.review-job-card { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; box-shadow: none; }
#app .job.review-job-card:hover { transform: none; }
#app .review-job-card .job-main { min-width: 0; overflow-wrap: anywhere; }
#app .review-job-card .job-meta { line-height: 1.5; }
#app .review-job-card .field-note { margin: 8px 0 0; font-size: 12px; line-height: 1.5; text-align: left; color: var(--muted); }
#app .review-job-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); min-width: 0; }
#app .review-job-actions .review-job-secondary-actions { flex: 1 1 auto; margin: 0; gap: 8px; min-width: 0; }
#app .review-job-secondary-actions:empty { display: none; }
#app .review-job-actions .button { min-height: 36px; width: auto; max-width: 100%; padding: 7px 11px; font-size: 12px; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
#app .review-job-actions > .button { margin-left: auto; flex-shrink: 0; }
@media (max-width: 560px) {
  #app .job.review-job-card { padding: 16px; }
  #app .review-job-actions .review-job-secondary-actions { flex-basis: 100%; }
  #app .review-job-actions .button { min-height: 44px; }
  #app .review-job-actions > .button { margin-left: 0; width: 100%; }
}
/* Service Agreement overview/history keeps complete saved names and evidence readable. */
#service-agreements, #service-agreements > .surface { min-width: 0; }
#service-agreements > .history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
#service-agreements > .history-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
#service-agreements > .history-row > .actions { max-width: 360px; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
#service-agreements > .history-row .button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
#service-agreements > .surface h3, #service-agreements > .surface p, #service-agreements > [data-message] { overflow-wrap: anywhere; }
#app #service-agreements > .field-note { font-size: 13px; line-height: 1.5; text-align: left; }
.invoice-confirmation { width: min(460px, calc(100vw - 32px)); box-sizing: border-box; padding: 24px; border: 1px solid var(--line); border-top: 3px solid var(--office-nav-accent, var(--accent)); border-radius: 16px; background: var(--surface); color: var(--ink); }
.invoice-confirmation::backdrop { background: rgb(8 25 48 / 45%); }
.invoice-confirmation h2 { margin-top: 0; }
.invoice-confirmation p { line-height: 1.6; overflow-wrap: anywhere; }
.invoice-confirmation .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.invoice-confirmation .button { min-width: 100px; }
#invoice-internal-review:focus { outline: 2px solid var(--office-nav-accent, var(--accent)); outline-offset: 4px; }
@media (max-width: 760px) {
  #service-agreements > .history-row { grid-template-columns: minmax(0, 1fr); }
  #service-agreements > .history-row > .actions { max-width: 100%; width: 100%; justify-content: flex-start; }
  #service-agreements > .history-row > .actions .button { flex: 1 1 auto; }
  #service-agreements > .history-row > .badge { justify-self: start; }
}

/* Support consent stays a normal checkbox inside an accessible label target. */
.feedback-contact{display:flex;align-items:center;gap:10px;min-height:44px;cursor:pointer}.feedback-contact input[type=checkbox]{appearance:auto;display:inline-block;width:20px;height:20px;min-width:20px;min-height:20px;margin:0;padding:0;flex:0 0 20px;accent-color:var(--actionColor,#0067d8)}.support-shell fieldset{border:0;padding:0;margin:0;min-width:0}.support-actions{display:flex;gap:8px;flex-wrap:wrap}.support-threads{display:grid;gap:6px;margin:12px 0}.support-threads button{text-align:left;min-width:0;overflow-wrap:anywhere}.support-threads small{display:block;font-weight:400;white-space:pre-wrap}.support-history{display:grid;gap:12px;max-height:50dvh;overflow:auto;overscroll-behavior:contain}.support-history article{border-bottom:1px solid #c7d0db;padding:10px 0}.support-history p{white-space:pre-wrap;overflow-wrap:anywhere;margin:4px 0}.support-history small{font-size:.75rem}.support-conversation textarea{max-width:100%}

.support-shell input:not([type=checkbox]),.support-shell textarea{display:block;width:100%;box-sizing:border-box}.support-shell label{display:block;margin:12px 0}.support-shell label.feedback-contact{display:flex}.support-shell fieldset{min-width:0;border:0;padding:0}.support-shell button{min-height:44px}.support-shell textarea{min-height:100px}.support-shell .support-threads button{padding:10px}

/* Company Settings presentation only; all sections start open. */
.settings-collapse-controls{display:flex;justify-content:flex-end;gap:8px;margin-bottom:12px}
.settings-collapse-controls .button{min-height:32px;padding:5px 10px;font-size:.8rem}
.settings-collapse-heading{margin:0!important;font-size:1rem}
.settings-collapse-heading>button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:0;border:0;background:none;color:inherit;text-align:left;font:inherit;font-weight:700;cursor:pointer}
.settings-collapse-heading>button::after{content:"−";font-size:1.2rem;line-height:1}
.settings-collapse-heading>button[aria-expanded="false"]::after{content:"+"}
.settings-collapse-heading>button:focus-visible{outline:2px solid var(--action-color,var(--accent));outline-offset:5px;border-radius:3px}
.settings-collapse-body:not([hidden]){margin-top:16px}
.settings-collapse-body[hidden]{display:none!important}

/* Pricing-first review. Native disclosures retain the actual authorized editors. */
.invoice-detail{border:1px solid var(--border,#d9e1ea);border-radius:12px;background:var(--surface-color,#fff);min-width:0;overflow-wrap:anywhere}
.invoice-detail>summary{padding:12px 16px;font-weight:700;cursor:pointer;color:var(--text-color,#17334f)}
.invoice-detail>section{margin:0;border-width:0;box-shadow:none}
.invoice-detail[open]>summary{border-bottom:1px solid var(--border,#d9e1ea)}
.invoice-detail summary:focus-visible{outline:2px solid var(--action-color,#0067d8);outline-offset:2px}
.work-closeout{padding:18px;min-width:0}.work-closeout h2{font-size:1.15rem;line-height:1.35;margin:8px 0;overflow-wrap:anywhere}
.work-balance{display:flex;gap:12px;justify-content:space-between;flex-wrap:wrap}.work-steps{padding-left:20px;margin:16px 0 0;display:grid;gap:18px}
.work-steps li>strong,.work-steps li>span{display:block}.work-steps li>span{font-size:.85rem;line-height:1.45;margin:5px 0}.work-steps .button{min-height:36px;padding:7px 12px;font-size:.85rem;margin:6px 6px 0 0;white-space:normal}
.work-reviewed{font-weight:700;color:var(--text-color,#17334f)}.work-filters{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 12px}.work-filters .button{min-height:36px;padding:7px 12px;font-size:.85rem}
@media(max-width:760px){.draft-sidebar .work-closeout{padding:16px}.work-steps{grid-template-columns:1fr}.invoice-detail>summary{padding:12px}}

@media(max-width:760px){.draft-main .amount-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.draft-main .amount-summary{padding:9px;min-height:0}.draft-main .amount-summary .amount-edit{min-height:32px;padding:5px 10px}.draft-main .amount-grid>label{min-width:0}.draft-main .amount-grid select{width:100%}}

/* Internal inspection never borrows editable invoice form controls. */
.saved-pricing-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,22rem),1fr)); gap:1rem; }
.saved-pricing-grid dl, .saved-pricing-line dl { display:grid; grid-template-columns:minmax(7rem,1fr) minmax(0,2fr); gap:.45rem 1rem; }
.saved-pricing-grid dd, .saved-pricing-line dd, [data-saved-pricing-review] code { margin:0; overflow-wrap:anywhere; white-space:pre-wrap; }
.saved-pricing-line { border-top:1px solid var(--border,#dce3ec); padding:.75rem 0; }
.saved-pricing-conflict { display:block; color:#854d0e; font-size:.9em; }

/* Shared Office conversation presentation; transports and read receipts stay separate. */
.conversation-page-header { align-items: center; gap: 12px; margin-bottom: 10px; }
.conversation-page-header h1 { margin-bottom: 4px; }
.conversation-page-header p, .conversation-privacy, .conversation-notice { font-size: 13px; line-height: 1.5; }
.conversation-notice { min-height: 20px; overflow-wrap: anywhere; }
.conversation-notice:empty { display: none; }
.conversation-workspace { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 16px; align-items: start; }
.conversation-workspace > .surface { min-width: 0; padding: 18px; }
.conversation-sidebar h2, .conversation-thread h2 { margin: 0 0 8px; font-size: 17px; }
.conversation-sidebar label { font-size: 12px; }
.conversation-sidebar select { width: 100%; min-width: 0; margin-top: 6px; }
.conversation-list { display: grid; gap: 6px; margin: 12px 0 0; max-height: 62dvh; overflow: auto; }
.conversation-list .conversation-peer { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 11px 12px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; }
.conversation-list .conversation-peer[aria-pressed=true] { border-color: var(--blue); box-shadow: inset 3px 0 var(--blue); background: color-mix(in srgb, var(--surface) 92%, var(--blue)); }
.conversation-peer-title { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.conversation-list .conversation-peer small { display: block; margin-top: 4px; font-size: 12px; line-height: 1.4; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-unread { font-size: 11px; font-weight: 700; color: var(--blue); }
.conversation-thread-header { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.conversation-thread-header p { margin: 4px 0; font-size: 12px; line-height: 1.5; }
.conversation-thread .conversation-history { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-height: 180px; max-height: 52dvh; overflow: auto; overscroll-behavior: contain; list-style: none; padding: 16px 2px; margin: 0; }
.conversation-history .conversation-bubble { box-sizing: border-box; max-width: min(88%, 660px); padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px 12px 12px 3px; background: var(--surface); color: var(--ink); }
.conversation-history .conversation-bubble.is-outgoing { align-self: flex-end; border-radius: 12px 12px 3px 12px; border-color: var(--blue); background: color-mix(in srgb, var(--surface) 90%, var(--blue)); }
.conversation-message-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; justify-content: space-between; font-size: 12px; }
.conversation-message-meta time { font-size: 11px; }
.conversation-history .conversation-bubble p { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; }
.conversation-bubble small { font-size: 10px; }
.conversation-history .conversation-empty, .conversation-empty { padding: 14px 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.conversation-composer { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
.conversation-composer label { display: block; margin: 0 0 10px; font-size: 13px; }
.conversation-composer textarea, .conversation-composer select { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; }
.conversation-composer textarea { min-height: 84px; resize: vertical; }
.conversation-compose-footer { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.conversation-compose-footer p { margin: 0; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.conversation-workspace .button { white-space: normal; flex-shrink: 0; }
.conversation-workspace :focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
@media (max-width: 760px) {
  .conversation-workspace { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .conversation-workspace > .surface { padding: 14px; }
  .conversation-list { max-height: 160px; }
  .conversation-thread .conversation-history { max-height: 44dvh; min-height: 120px; }
  .conversation-history .conversation-bubble { max-width: 94%; }
  .conversation-page-header, .conversation-compose-footer { align-items: stretch; flex-direction: column; }
  .conversation-compose-footer .button { align-self: flex-end; }
}

/* Shared Office action hierarchy; company colors retain their computed foreground. */
#app .button { min-height: var(--button-min-height, 36px); border-radius: 8px; font-weight: 600; box-shadow: none; }
#app .button:hover { transform: none; box-shadow: none; }
@media (max-width: 760px), (pointer: coarse) { :root { --button-min-height: 44px; } .button { min-height: 44px; } }

.job-booking { max-width: 1040px; margin-inline: auto; }
.booking-progress { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-bottom: 24px; }
.booking-progress span { display: flex; align-items: center; gap: 8px; padding: 10px; border-bottom: 3px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
.booking-progress b { display: grid; place-items: center; flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); }
.booking-progress [aria-current="step"] { color: var(--ink); border-color: var(--orange); }
.booking-panels { display: block; }
.booking-step[hidden] { display: none; }
.booking-customer-search { min-width: 0; }
.booking-customer-result { width: 100%; display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 12px; text-align: left; padding: 12px; margin-top: 6px; background: var(--surface,#fff); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; }
.booking-customer-result[aria-pressed="true"] { border-color: var(--blue); box-shadow: inset 3px 0 var(--orange); }
.booking-customer-result:hover { background: var(--blue-soft); }
.booking-customer-result:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.booking-selected { padding: 16px; margin-block: 18px; background: var(--blue-soft); border: 1px solid var(--line); border-radius: 10px; }
.booking-selected h2 { margin: 6px 0 12px; }
.booking-selected dl,.booking-review dl { display: grid; grid-template-columns: minmax(130px,1fr) 3fr; gap: 8px 18px; margin: 0; }
.booking-selected dt,.booking-review dt { color: var(--muted); font-size: 12px; }
.booking-selected dd,.booking-review dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.booking-review { border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.booking-navigation { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 18px; }
@media(max-width:600px) { .booking-progress { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; }.booking-progress span { font-size: 11px; padding: 8px 2px; }.booking-customer-result { grid-template-columns: 1fr; gap: 4px; }.booking-selected dl,.booking-review dl { grid-template-columns: 1fr; gap: 5px; }.booking-selected dd,.booking-review dd { margin-bottom: 9px; } }
.lite-dashboard-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.lite-dashboard-metric { display: flex; align-items: baseline; gap: 12px; padding: 16px; }
.lite-dashboard-metric strong { font-size: 28px; color: var(--blue); }
.lite-dashboard-metric span { font-size: 12px; color: var(--muted); }
.lite-dashboard-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 18px; }
.lite-dashboard-review { grid-column: 1 / -1; }
.lite-dashboard-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--line); padding: 12px 0; }
.lite-dashboard-row>div { min-width: 0; }.lite-dashboard-row strong,.lite-dashboard-row p { overflow-wrap: anywhere; }
.lite-dashboard-row p { font-size: 13px; margin: 5px 0; }.lite-dashboard-row small { color: var(--muted); }
.lite-dashboard-row .button { flex-shrink: 0; }.lite-dashboard-freshness { margin-top: 18px; max-width: 1000px; }
.progress-overview { margin-bottom: 18px; }.progress-overview-facts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.progress-overview-facts span,.progress-overview-facts strong { display: block; }.progress-overview-facts span { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.progress-timeline { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; list-style: none; padding: 0; margin: 22px 0 10px; }
.progress-timeline li { border-top: 3px solid var(--line); padding-top: 9px; }.progress-timeline .recorded { border-color: var(--blue); }
.progress-timeline strong,.progress-timeline span { display: block; font-size: 12px; }.progress-timeline span { color: var(--muted); margin-top: 5px; }
.progress-details { border: 1px solid var(--line); border-radius: 10px; background: var(--surface,#fff); margin-bottom: 12px; overflow: hidden; }
.progress-details>summary { padding: 16px 18px; color: var(--ink); font-weight: 700; cursor: pointer; }.progress-details>summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
.progress-details>section.surface { border: 0; box-shadow: none; border-radius: 0; margin: 0; }.progress-details .progress-section-heading { display: none; }
.progress-exceptions { margin-top: 14px; }.progress-exceptions ul { padding-left: 20px; margin-bottom: 0; }
@media(max-width:700px) { .lite-dashboard-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }.lite-dashboard-metric { display: block; }.lite-dashboard-metric span { display: block; margin-top: 5px; }.lite-dashboard-grid { grid-template-columns: 1fr; }.lite-dashboard-review { grid-column: auto; }.progress-overview-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }.progress-timeline { grid-template-columns: 1fr; gap: 8px; }.progress-timeline li { border-top: 0; border-left: 3px solid var(--line); padding: 4px 0 4px 12px; }.progress-timeline .recorded { border-left-color: var(--blue); } }
/* Job Progress facts must retain long team identities without crossing adjacent columns. */
.progress-overview-facts>div,.progress-timeline>li{min-width:0}
.progress-overview-facts strong,.progress-timeline strong,.progress-timeline span{max-width:100%;white-space:normal;overflow-wrap:anywhere;word-break:normal}
@media(max-width:1100px){.progress-overview-facts{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.progress-overview-facts{grid-template-columns:minmax(0,1fr)}.progress-timeline{grid-template-columns:minmax(0,1fr)}}

/* Company artwork stays separate from the fixed D2I attribution. */
.topbar .brand .mark.company-mark {
  width: 76px;
  height: 42px;
  object-fit: contain;
  object-position: center;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  filter: none;
  flex: 0 0 auto;
}
@media (max-width: 760px) {
  .topbar .brand .mark.company-mark { width: 60px; height: 44px; }
}
@media (max-width: 520px) {
  .topbar .brand .mark.company-mark { width: 52px; height: 40px; }
}

/* Company header and its preview share the same hue-preserving treatment. */
.topbar, .navigation-theme-preview {
  background: radial-gradient(circle at 84% -65%, color-mix(in srgb, var(--office-nav) 58%, #fff) 0%, transparent 38%), linear-gradient(108deg, color-mix(in srgb, var(--office-nav) 89%, #000), var(--office-nav) 56%, color-mix(in srgb, var(--office-nav) 77%, #fff));
}
.top-nav-item.active, .navigation-theme-preview > span.active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--office-nav-active) 96%, #000) 0%, color-mix(in srgb, var(--office-nav-active) 82%, #000) 100%);
}
.surface::before {
  background: linear-gradient(90deg, var(--blue), color-mix(in srgb, var(--blue) 78%, var(--surface)) 72%, var(--orange));
}

.topbar,.navigation-theme-preview {background:var(--office-header-gradient);}
.surface::before {background:var(--office-card-gradient);}
.gradient-settings {display:grid;gap:12px;margin-block:16px;}
.gradient-settings fieldset {min-width:0;border:1px solid var(--line);border-radius:10px;padding:12px;}
.gradient-colors {display:flex;gap:16px;flex-wrap:wrap;}
.gradient-settings input[type=checkbox] {min-height:0;width:auto;}
.gradient-colors label {display:grid;gap:4px;}
.gradient-colors input {width:64px;min-height:44px;padding:3px;}

/* Preserve readable text on user gradients, including opposite light/dark stops. */
.topbar .brand > div:last-child,.topbar .header-utilities,.topbar .top-nav-item:not(.active) > span:last-child,.topbar .top-nav-more > summary > span:last-child,.navigation-theme-preview > *:not(.active) {background:var(--office-header-label-background,transparent);}
