/*
 * TEG Ops screens. Builds on the design system in tegops.css (tokens, chrome, primitives); only layout and
 * module-specific pieces live here.
 */

/* ---------- Brand ---------- */
.tg-brand-sub { font-weight: 450; color: var(--tg-muted); }
.tg-login-aside .tg-brand-sub { color: #9fb0c7; }
.tg-brand-mark rect.tg-brand-path { fill: none; stroke-width: 2.2; }
.tg-brand-mark path.tg-brand-path { stroke-width: 2.2; }

/* ---------- Overview ---------- */
.ov-cols { display: grid; gap: var(--tg-space-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 72rem) {
    .ov-cols { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
    .ov-cols.is-wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
}
.ov-job { display: grid; grid-template-columns: 4.25rem minmax(0, 1fr) auto 3.5rem; align-items: center; gap: var(--tg-space-4); padding: 0.75rem var(--tg-space-5); text-decoration: none; color: inherit; border-top: 1px solid var(--tg-border-subtle); transition: background-color var(--tg-dur) var(--tg-ease); }
.ov-job:first-child { border-top: 0; }
.ov-job:hover { background: var(--tg-hover); }
.ov-job-date { display: flex; flex-direction: column; line-height: 1.2; }
.ov-job-dow { font-size: var(--tg-fs-xs); color: var(--tg-muted); }
.ov-job-day { font-size: var(--tg-fs-sm); font-weight: 600; color: var(--tg-heading); font-variant-numeric: tabular-nums; }
.ov-job-now { display: inline-flex; align-items: center; gap: 0.375rem; font-size: var(--tg-fs-sm); font-weight: 600; color: var(--tg-warning-text); }
.ov-job-main { min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.ov-job-title { font-size: var(--tg-fs-sm); font-weight: 550; color: var(--tg-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-job-meta { font-size: var(--tg-fs-xs); color: var(--tg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-job-lead { display: inline-flex; align-items: center; gap: 0.375rem; font-size: var(--tg-fs-xs); color: var(--tg-text-2); }
.ov-job-no { text-align: right; }
.ov-att { display: grid; grid-template-columns: 0.5rem minmax(0, 1fr) 1rem; align-items: center; gap: var(--tg-space-3); padding: 0.6875rem var(--tg-space-5); text-decoration: none; color: inherit; border-top: 1px solid var(--tg-border-subtle); }
.ov-att:first-child { border-top: 0; }
.ov-att:hover { background: var(--tg-hover); }
.ov-att-more { display: block; width: 100%; padding: 0.6875rem var(--tg-space-5); text-align: left; background: none; border: 0; border-top: 1px solid var(--tg-border-subtle); cursor: pointer; }
.ov-att-more:hover { background: var(--tg-hover); }
.ov-att-main { min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.ov-att-title { font-size: var(--tg-fs-sm); font-weight: 550; color: var(--tg-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-att-meta { font-size: var(--tg-fs-xs); color: var(--tg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-att-chev { width: 1rem; height: 1rem; color: var(--tg-faint); }
.ov-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--tg-space-4); margin: 0 0 var(--tg-space-5); }
.ov-facts dt { font-size: var(--tg-fs-xs); color: var(--tg-muted); }
.ov-facts dd { margin: 0.25rem 0 0; font-size: var(--tg-fs-xl); font-weight: 600; letter-spacing: -0.02em; color: var(--tg-heading); font-variant-numeric: tabular-nums; }
.ov-facts dd small { font-size: var(--tg-fs-xs); font-weight: 450; color: var(--tg-muted); letter-spacing: 0; }
.ov-pump { display: flex; flex-direction: column; gap: var(--tg-space-2); padding-top: var(--tg-space-4); border-top: 1px solid var(--tg-border-subtle); }
.ov-pump-head { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--tg-fs-sm); }
.ov-pump-row { display: flex; flex-wrap: wrap; gap: var(--tg-space-5); font-size: var(--tg-fs-sm); color: var(--tg-text-2); }
.ov-pump-row b { color: var(--tg-heading); font-weight: 600; }

/* ---------- Jobs ---------- */
.jb-cell { display: flex; flex-direction: column; gap: 0.125rem; }
.jb-layout { display: grid; gap: var(--tg-space-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 72rem) { .jb-layout { grid-template-columns: minmax(0, 1fr) 22rem; } }
/* The right column is narrow: a card's title and summary keep their width and its buttons wrap below them, and a wide
   table (the materials) scrolls inside its card instead of squeezing its columns. */
.jb-layout > aside .tg-section-header { flex-wrap: wrap; row-gap: var(--tg-space-2); }
.jb-layout > aside .tg-section-heading { flex: 1 1 12rem; min-width: 0; }
.jb-layout > aside .tg-section-actions { flex: 0 1 auto; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.jb-layout > aside .tg-section-actions .dz-actions, .jb-layout > aside .tg-fold-actions { flex-wrap: wrap; min-width: 0; }
@media (min-width: 72rem) { .jb-layout > aside .st-materials { min-width: 32rem; } }
.jb-head { padding: var(--tg-space-4) var(--tg-space-5); }
.jb-ticket td, .jb-ticket th { vertical-align: top; }
.jb-ticket tfoot td { font-weight: 650; color: var(--tg-heading); border-top: 1px solid var(--tg-border); padding-top: 0.75rem; padding-bottom: 0.75rem; }
.jb-ticket tfoot td.is-num { font-size: var(--tg-fs-lg); }
.jb-sign { display: flex; align-items: baseline; gap: var(--tg-space-3); flex-wrap: wrap; padding: var(--tg-space-3) var(--tg-space-5) var(--tg-space-4); border-top: 1px solid var(--tg-border-subtle); }
.jb-sig { font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", cursive; font-size: 1.25rem; color: var(--tg-heading); }
.jb-notes { display: grid; gap: var(--tg-space-4); }
.jb-notes p { margin: 0.25rem 0 0; font-size: var(--tg-fs-md); line-height: 1.6; color: var(--tg-text); max-width: 46rem; }
.jb-trail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.jb-trail li { position: relative; display: grid; grid-template-columns: 0.75rem minmax(0, 1fr); gap: 0.75rem; padding-bottom: var(--tg-space-4); }
.jb-trail li::before { content: ""; position: absolute; left: calc(0.375rem - 0.5px); top: 1rem; bottom: 0; width: 1px; background: var(--tg-border); }
.jb-trail li:last-child { padding-bottom: 0; }
.jb-trail li:last-child::before { display: none; }
.jb-trail li.is-done::before { background: var(--tg-accent-border); }
.jb-trail-dot { width: 0.75rem; height: 0.75rem; margin-top: 0.1875rem; border-radius: 999px; background: var(--tg-surface); box-shadow: inset 0 0 0 1.5px var(--tg-border-strong); }
.jb-trail li.is-done .jb-trail-dot { background: var(--tg-accent-solid); box-shadow: none; }
.jb-trail li.is-current .jb-trail-dot { box-shadow: inset 0 0 0 2px var(--tg-accent-solid), 0 0 0 3px var(--tg-accent-soft); }
.jb-trail-label { font-size: var(--tg-fs-sm); font-weight: 550; color: var(--tg-heading); }
.jb-trail li:not(.is-done) .jb-trail-label { color: var(--tg-muted); font-weight: 500; }
.jb-trail li.is-current .jb-trail-label { color: var(--tg-heading); }
.jb-ba td, .jb-ba th { padding-left: 0; }
.jb-val { font-variant-numeric: tabular-nums; font-weight: 550; }
.jb-val.is-danger { color: var(--tg-danger-text); }
.jb-val.is-warning { color: var(--tg-warning-text); }
.jb-val.is-success { color: var(--tg-text); }

/* ---------- DEHY units ---------- */
.un-hero { display: grid; gap: var(--tg-space-6); grid-template-columns: minmax(0, 1fr); padding: var(--tg-space-5); }
@media (min-width: 64rem) { .un-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; } }
.un-hero-health { display: flex; flex-direction: column; gap: var(--tg-space-2); }
.un-hero-status { display: flex; align-items: center; gap: 0.625rem; font-size: var(--tg-fs-2xl); font-weight: 650; letter-spacing: -0.02em; color: var(--tg-heading); }
.un-flags { list-style: none; margin: var(--tg-space-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.375rem; font-size: var(--tg-fs-sm); }
.un-flags li { display: flex; align-items: center; gap: 0.5rem; }
.un-specs { padding-top: var(--tg-space-1); }
.un-charts { display: grid; gap: var(--tg-space-5) var(--tg-space-6); grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.un-chart { min-width: 0; }
.un-chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--tg-space-2); }
.un-chart-label { font-size: var(--tg-fs-sm); font-weight: 550; color: var(--tg-heading); }
.un-chart-value { font-size: var(--tg-fs-lg); font-weight: 650; font-variant-numeric: tabular-nums; color: var(--tg-heading); }
.un-chart-value small { font-size: var(--tg-fs-xs); font-weight: 450; color: var(--tg-muted); margin-left: 0.125rem; }
.un-chart-value.is-danger { color: var(--tg-danger-text); }
.un-chart-value.is-warning { color: var(--tg-warning-text); }
.un-results td:first-child { white-space: nowrap; }

/* ---------- Invoices ---------- */
.iv-kpis { margin-bottom: var(--tg-space-5); grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.5fr); }
@media (max-width: 72rem) { .iv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.iv-sync { display: inline-flex; align-items: center; gap: 0.3125rem; white-space: nowrap; }
.iv-chip { display: inline-flex; align-items: center; height: 1.25rem; padding: 0 0.375rem; border-radius: var(--tg-radius-xs); font-size: var(--tg-fs-2xs); font-weight: 600; letter-spacing: 0.02em; color: var(--tg-faint); box-shadow: inset 0 0 0 1px var(--tg-border); }
.iv-chip.is-on { color: var(--tg-accent-text); background: var(--tg-accent-soft); box-shadow: inset 0 0 0 1px var(--tg-accent-border); }
.iv-chip.is-mail { color: var(--tg-text-2); background: var(--tg-surface-3); box-shadow: none; }
.iv-aging-bar { display: flex; height: 0.5rem; border-radius: 999px; overflow: hidden; background: var(--tg-surface-3); margin: 0.625rem 0 0.75rem; gap: 2px; }
.iv-aging-bar span, .iv-aging-legend i { display: block; }
.iv-aging-bar .is-0, .iv-aging-legend .is-0 { background: var(--tg-accent-solid); }
.iv-aging-bar .is-1, .iv-aging-legend .is-1 { background: #e0a43a; }
.iv-aging-bar .is-2, .iv-aging-legend .is-2 { background: #e2703a; }
.iv-aging-bar .is-3, .iv-aging-legend .is-3 { background: var(--tg-danger); }
.iv-aging-legend { display: flex; flex-wrap: wrap; gap: 0.375rem 0.875rem; font-size: var(--tg-fs-xs); color: var(--tg-muted); }
.iv-aging-legend span { display: inline-flex; align-items: center; gap: 0.3125rem; }
.iv-aging-legend i { width: 0.5rem; height: 0.5rem; border-radius: 2px; }
.iv-aging-legend b { font-weight: 600; color: var(--tg-text); font-variant-numeric: tabular-nums; }

/* ---------- Customers ---------- */
.cu-cell { display: flex; align-items: center; gap: 0.625rem; }

/* ---------- Pump shop ---------- */
.pr-pipe { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--tg-space-3); margin-bottom: var(--tg-space-5); }
@media (max-width: 64rem) { .pr-pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pr-stage { display: flex; flex-direction: column; gap: var(--tg-space-2); padding: var(--tg-space-3); border-radius: var(--tg-radius-lg); background: var(--tg-surface-2); box-shadow: inset 0 0 0 1px var(--tg-border); min-height: 8rem; }
.pr-stage-head { display: flex; align-items: center; gap: 0.4375rem; font-size: var(--tg-fs-xs); font-weight: 600; color: var(--tg-text-2); padding: 0 0.125rem 0.25rem; }
.pr-count { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--tg-muted); font-weight: 500; }
.pr-card { padding: 0.5625rem 0.625rem; border-radius: var(--tg-radius-md); background: var(--tg-surface); box-shadow: 0 0 0 1px var(--tg-border); display: flex; flex-direction: column; gap: 0.1875rem; font-size: var(--tg-fs-sm); }
.pr-card.is-late { box-shadow: 0 0 0 1px var(--tg-warning-border); }
.pr-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.pr-empty { font-size: var(--tg-fs-xs); color: var(--tg-faint); padding: 0.25rem 0.125rem; }
.pr-text { min-width: 12rem; max-width: 20rem; }
/* Shop findings can run long: two lines in the list, the full text on hover. */
.pr-text .fi-ta-text-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Crew ---------- */
.cr-matrix th, .cr-matrix td { white-space: nowrap; }
.cr-cell { display: inline-flex; align-items: center; gap: 0.375rem; font-variant-numeric: tabular-nums; font-size: var(--tg-fs-sm); color: var(--tg-text-2); }
.cr-cell.is-expiring, .cr-cell.is-expired { color: var(--tg-heading); font-weight: 550; }
.jb-activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.625rem; }
.jb-activity li { display: flex; flex-direction: column; gap: 0.0625rem; padding-left: 0.75rem; box-shadow: inset 1px 0 0 var(--tg-border); }
.jb-activity-more { align-self: flex-start; padding: 0; background: none; border: 0; cursor: pointer; }
.jb-activity li > button.tg-link { align-self: flex-start; padding: 0; background: none; border: 0; cursor: pointer; }
.jb-activity-text { font-size: var(--tg-fs-sm); color: var(--tg-text); }

/* ---------- Schedule ---------- */
.sc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 44rem; }
.sc-board { overflow-x: auto; }
.sc-row { display: grid; grid-template-columns: 14rem repeat(6, minmax(8.5rem, 1fr)); min-width: 66rem; border-top: 1px solid var(--tg-border-subtle); }
.sc-row:first-child { border-top: 0; }
.sc-head { background: var(--tg-surface-2); }
.sc-lead-cell { padding: 0.75rem 1rem; display: flex; align-items: center; font-size: var(--tg-fs-xs); color: var(--tg-muted); border-right: 1px solid var(--tg-border-subtle); }
.sc-day { padding: 0.625rem 0.75rem; display: flex; align-items: baseline; gap: 0.375rem; border-left: 1px solid var(--tg-border-subtle); }
.sc-dow { font-size: var(--tg-fs-xs); color: var(--tg-muted); }
.sc-date { font-size: var(--tg-fs-md); font-weight: 600; color: var(--tg-heading); font-variant-numeric: tabular-nums; }
.sc-day.is-today .sc-date { color: #fff; background: var(--tg-accent); border-radius: 999px; min-width: 1.5rem; height: 1.5rem; display: inline-grid; place-items: center; font-size: var(--tg-fs-sm); }
.sc-cell { padding: 0.5rem; display: flex; flex-direction: column; gap: 0.375rem; min-height: 5.25rem; border-left: 1px solid var(--tg-border-subtle); }
.sc-cell.is-today { background: var(--tg-accent-soft); }
.sc-open { margin: auto; font-size: var(--tg-fs-xs); color: var(--tg-faint); }
.sc-job { display: flex; flex-direction: column; gap: 0.0625rem; padding: 0.4375rem 0.5625rem; border-radius: var(--tg-radius-sm); background: var(--tg-surface); box-shadow: 0 0 0 1px var(--tg-border), inset 3px 0 0 var(--tg-neutral); text-decoration: none; transition: box-shadow var(--tg-dur) var(--tg-ease); }
.sc-job:hover { box-shadow: 0 0 0 1px var(--tg-border-strong), inset 3px 0 0 var(--tg-accent-solid), var(--tg-shadow-md); }
.sc-job.is-info { box-shadow: 0 0 0 1px var(--tg-border), inset 3px 0 0 var(--tg-info); }
.sc-job.is-warning { box-shadow: 0 0 0 1px var(--tg-border), inset 3px 0 0 var(--tg-warning); }
.sc-job.is-accent, .sc-job.is-success { box-shadow: 0 0 0 1px var(--tg-border), inset 3px 0 0 var(--tg-success); }
.sc-job.is-cont { opacity: 0.72; }
.sc-job-title { font-size: var(--tg-fs-xs); font-weight: 600; color: var(--tg-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-job-meta { font-size: var(--tg-fs-2xs); color: var(--tg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Crew app preview ---------- */
.ca-layout { display: grid; gap: var(--tg-space-8); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 90rem) { .ca-layout { grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr); } }
.ca-title { font-size: var(--tg-fs-2xl); font-weight: 650; letter-spacing: -0.022em; color: var(--tg-heading); line-height: 1.25; margin: var(--tg-space-2) 0 var(--tg-space-5); }
.ca-steps { list-style: none; margin: 0 0 var(--tg-space-5); padding: 0; display: flex; flex-direction: column; gap: var(--tg-space-4); }
.ca-steps li { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: var(--tg-space-3); }
.ca-steps li > span { width: 1.75rem; height: 1.75rem; border-radius: 999px; display: grid; place-items: center; font-size: var(--tg-fs-xs); font-weight: 650; color: var(--tg-accent-text); background: var(--tg-accent-soft); box-shadow: inset 0 0 0 1px var(--tg-accent-border); }
.ca-steps b { font-size: var(--tg-fs-md); color: var(--tg-heading); font-weight: 600; }
.ca-steps p { margin: 0.125rem 0 0; font-size: var(--tg-fs-sm); color: var(--tg-muted); line-height: 1.5; }
.ca-note { font-size: var(--tg-fs-xs); }
.ca-phones { display: flex; flex-wrap: wrap; gap: var(--tg-space-6); justify-content: center; }
.ca-phones .tg-phone { --tg-phone-w: 17.5rem; }
.ca-app-strong { font-size: 1.0625rem; font-weight: 650; color: #fff; margin-top: 0.25rem; }
.ca-app-meta { font-size: 0.75rem; color: #c3cfdf; }
.ca-grow { flex: 1; min-width: 0; }
.ca-row-title { font-size: 0.8125rem; font-weight: 600; color: #101828; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-ico { width: 2rem; height: 2rem; border-radius: 0.625rem; display: grid; place-items: center; background: #eef4fa; color: #24578b; flex: none; }
.ca-ico svg { width: 1rem; height: 1rem; }
.ca-amt { font-size: 0.8125rem; font-weight: 600; color: #101828; font-variant-numeric: tabular-nums; }
.ca-lines { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.ca-quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.ca-quick span { text-align: center; padding: 0.5rem; border-radius: 0.75rem; background: #fff; box-shadow: 0 0 0 1px #e4e7ec; font-size: 0.75rem; font-weight: 600; color: #24578b; }
.ca-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.8125rem; color: #475467; }
.ca-total b { font-size: 1.125rem; color: #0f2033; font-variant-numeric: tabular-nums; }
.ca-sign { background: #fff; border-radius: 1rem; padding: 0.75rem 1rem 1rem; box-shadow: 0 0 0 1px #e4e7ec; }
.ca-sign-ink { width: 100%; height: 4.5rem; display: block; }
.ca-sign-line { height: 1px; background: #d0d5dd; }

/* ---------- Customer portal preview ---------- */
.cp-picker { flex-wrap: wrap; }
.cp-browser { border-radius: var(--tg-radius-xl); overflow: hidden; background: var(--tg-surface); box-shadow: 0 0 0 1px var(--tg-border), var(--tg-shadow-md); }
.cp-bar { display: flex; align-items: center; gap: var(--tg-space-4); padding: 0.625rem 1rem; background: var(--tg-surface-3); border-bottom: 1px solid var(--tg-border); }
.cp-dots { display: inline-flex; gap: 0.375rem; }
.cp-dots i { width: 0.625rem; height: 0.625rem; border-radius: 999px; background: var(--tg-border-strong); display: block; }
.cp-url { flex: 1; max-width: 26rem; margin: 0 auto; text-align: center; font-size: var(--tg-fs-xs); color: var(--tg-muted); background: var(--tg-surface); border-radius: var(--tg-radius-sm); padding: 0.25rem 0.75rem; box-shadow: inset 0 0 0 1px var(--tg-border); }
.cp-body { padding: var(--tg-space-6) var(--tg-space-8) var(--tg-space-8); display: flex; flex-direction: column; gap: var(--tg-space-6); }
.cp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--tg-space-4); padding-bottom: var(--tg-space-5); border-bottom: 1px solid var(--tg-border); }
.cp-title { font-size: 1.625rem; font-weight: 650; letter-spacing: -0.025em; color: var(--tg-heading); margin: 0.25rem 0; }
.cp-cta { display: inline-flex; align-items: center; height: 2.25rem; padding: 0 1rem; border-radius: var(--tg-radius-md); background: var(--tg-accent); color: #fff; font-size: var(--tg-fs-sm); font-weight: 600; white-space: nowrap; }
.cp-h { font-size: var(--tg-fs-sm); font-weight: 600; color: var(--tg-heading); margin: 0 0 var(--tg-space-3); }
.cp-units { display: grid; gap: var(--tg-space-3); grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.cp-unit { display: flex; flex-direction: column; gap: 0.375rem; padding: 0.875rem 1rem; border-radius: var(--tg-radius-lg); box-shadow: 0 0 0 1px var(--tg-border); text-decoration: none; color: inherit; background: var(--tg-surface); transition: box-shadow var(--tg-dur) var(--tg-ease); }
.cp-unit:hover { box-shadow: 0 0 0 1px var(--tg-border-strong), var(--tg-shadow-md); }
.cp-unit-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.cp-unit-vals { display: flex; gap: var(--tg-space-4); font-size: var(--tg-fs-md); font-weight: 600; color: var(--tg-heading); font-variant-numeric: tabular-nums; margin-top: 0.25rem; }
.cp-unit-vals small { display: block; font-size: var(--tg-fs-2xs); font-weight: 500; color: var(--tg-muted); }
.cp-cols { display: grid; gap: var(--tg-space-6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 64rem) { .cp-cols { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.cp-list { display: flex; flex-direction: column; margin-bottom: var(--tg-space-5); }
.cp-row { display: flex; align-items: center; gap: var(--tg-space-3); padding: 0.625rem 0; border-top: 1px solid var(--tg-border-subtle); text-decoration: none; color: inherit; }
.cp-row:first-child { border-top: 0; }
.cp-row-title { display: block; font-size: var(--tg-fs-sm); font-weight: 550; color: var(--tg-heading); }
.cp-doc { width: 2rem; height: 2rem; border-radius: var(--tg-radius-md); display: grid; place-items: center; background: var(--tg-surface-3); color: var(--tg-text-2); flex: none; }
.cp-doc svg { width: 1rem; height: 1rem; }
.cp-date { font-size: var(--tg-fs-xs); font-weight: 600; color: var(--tg-accent-text); min-width: 3rem; }
.ov-growth { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; gap: var(--tg-space-4); align-items: center; padding: var(--tg-space-4) var(--tg-space-5); border-radius: var(--tg-radius-lg); background: var(--tg-accent-soft); box-shadow: inset 0 0 0 1px var(--tg-accent-border); }
.ov-growth-icon { width: 2.25rem; height: 2.25rem; border-radius: var(--tg-radius-md); display: grid; place-items: center; background: var(--tg-surface); color: var(--tg-accent-text); box-shadow: 0 0 0 1px var(--tg-accent-border); }
.ov-growth-icon svg { width: 1.125rem; height: 1.125rem; }
.ov-growth-title { font-size: var(--tg-fs-sm); font-weight: 600; color: var(--tg-heading); margin-bottom: 0.125rem; }
.ov-growth-link { white-space: nowrap; }
@media (max-width: 48rem) { .ov-growth { grid-template-columns: 2.25rem minmax(0, 1fr); } .ov-growth-link { grid-column: 2; } }
/* Crew app: explainer across the top, three phones in one row */
.ca-layout { grid-template-columns: minmax(0, 1fr) !important; gap: var(--tg-space-6); }
.ca-copy { display: grid; gap: var(--tg-space-4) var(--tg-space-8); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 72rem) { .ca-copy { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); align-items: start; } .ca-copy .ca-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); display: grid; } .ca-copy .ca-note { grid-column: 1 / -1; } }
.ca-copy .ca-title { margin-bottom: 0; }
.ca-phones { flex-wrap: nowrap; overflow-x: auto; justify-content: center; padding-bottom: var(--tg-space-2); }
.ca-phones .tg-phone { --tg-phone-w: 16.75rem; flex: none; }
.ca-phones .tg-app-btn { flex: none; }

/* =============================================================================================
   Roles and access: role chip, view-as banner, sign in as, team matrix, customer portal home
   ============================================================================================= */
.tg-role-chip {
    display: inline-flex; align-items: center; gap: 0.4375rem; white-space: nowrap; margin-inline-start: var(--tg-space-2);
    font-size: var(--tg-fs-xs); font-weight: 550; line-height: 1; padding: 0.375rem 0.625rem; border-radius: var(--tg-radius-pill);
    color: var(--tg-text); background: var(--tg-surface); box-shadow: inset 0 0 0 1px var(--tg-border);
}
@media (max-width: 640px) { .tg-role-chip { display: none; } }

.tg-viewas {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: center; gap: var(--tg-space-3);
    padding: 0.5rem var(--tg-space-5); font-size: var(--tg-fs-sm); color: #fff; background: #1c3d5f;
}
.tg-viewas b { font-weight: 650; }
.tg-viewas-icon { width: 1rem; height: 1rem; flex: none; opacity: 0.85; }
.tg-viewas form { margin: 0; }
.tg-viewas-back {
    font: inherit; font-weight: 600; font-size: var(--tg-fs-xs); cursor: pointer; white-space: nowrap;
    padding: 0.3125rem 0.75rem; border-radius: var(--tg-radius-pill); border: 0; color: #1c3d5f; background: #fff;
}
.tg-viewas-back:hover { background: #dce8f3; }
@media (max-width: 47.99rem) { .tg-viewas { justify-content: space-between; font-size: var(--tg-fs-xs); } }

.tg-login-roles { margin-top: var(--tg-space-6); padding-top: var(--tg-space-5); border-top: 1px solid var(--tg-border-subtle); display: flex; flex-direction: column; gap: var(--tg-space-1); }
.tg-login-roles-head { font-size: var(--tg-fs-xs); font-weight: 600; color: var(--tg-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--tg-space-2); }
.tg-login-role {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--tg-space-3);
    width: 100%; padding: 0.5625rem 0.625rem; margin: 0 -0.625rem; box-sizing: content-box; text-align: start; cursor: pointer;
    font: inherit; color: inherit; background: transparent; border: 0; border-radius: var(--tg-radius-md);
    transition: background-color var(--tg-dur) var(--tg-ease);
}
.tg-login-role:hover, .tg-login-role:focus-visible { background: var(--tg-hover); outline: none; }
.tg-login-role:focus-visible { box-shadow: 0 0 0 2px var(--tg-accent-border); }
.tg-login-role[disabled] { opacity: 0.6; cursor: progress; }
.tg-login-role-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.tg-login-role-name { font-size: var(--tg-fs-sm); font-weight: 600; color: var(--tg-heading); display: flex; align-items: center; gap: var(--tg-space-2); }
.tg-login-role-sub { font-size: var(--tg-fs-xs); color: var(--tg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-login-role-tag { font-size: var(--tg-fs-2xs); font-weight: 600; padding: 0.125rem 0.4375rem; border-radius: var(--tg-radius-pill); color: var(--tg-text-2); background: var(--tg-surface-3); }
.tg-login-role-tag.is-accent { color: var(--tg-accent-text); background: var(--tg-accent-soft); }
.tg-login-role-tag.is-info { color: var(--tg-info-text); background: var(--tg-info-soft); }
.tg-login-role-tag.is-success { color: var(--tg-success-text); background: var(--tg-success-soft); }
.tg-login-role-tag.is-warning { color: var(--tg-warning-text); background: var(--tg-warning-soft); }
.tg-login-role-go { width: 1rem; height: 1rem; color: var(--tg-faint); transition: transform var(--tg-dur) var(--tg-ease), color var(--tg-dur) var(--tg-ease); }
.tg-login-role:hover .tg-login-role-go { color: var(--tg-accent-text); transform: translateX(2px); }

.tm-matrix th { vertical-align: bottom; }
.tm-matrix th:not(:first-child), .tm-matrix td:not(:first-child) { min-width: 7.5rem; }
.tm-role { display: inline-flex; align-items: center; gap: 0.4375rem; font-weight: 600; color: var(--tg-heading); text-transform: none; letter-spacing: 0; }
.tm-count { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; margin-top: 0.125rem; }
.tm-cell { display: inline-flex; align-items: center; font-size: var(--tg-fs-xs); font-weight: 600; padding: 0.1875rem 0.5rem; border-radius: var(--tg-radius-pill); }
.tm-cell.is-manage { color: var(--tg-accent-text); background: var(--tg-accent-soft); box-shadow: inset 0 0 0 1px var(--tg-accent-border); }
.tm-cell.is-view { color: var(--tg-text-2); background: var(--tg-surface-3); }
.tm-cell.is-none { color: var(--tg-faint); padding-inline: 0.25rem; }
.tm-scope { display: block; margin-top: 0.25rem; }

.cp-frame { border-radius: var(--tg-radius-xl); background: var(--tg-surface); box-shadow: 0 0 0 1px var(--tg-border), var(--tg-shadow-sm); }
.cp-frame .cp-body { padding: var(--tg-space-6); }
a.cp-row { text-decoration: none; color: inherit; }
div.ov-job { cursor: default; }
div.ov-job:hover { background: transparent; }

/* =============================================================================================
   Job lifecycle: milestones, next step, field ticket editor, signature, invoice checks
   Mobile first: one column, large touch targets (44px), the next step and the ticket before anything else.
   ============================================================================================= */
.jb-flow { display: flex; flex-direction: column; gap: var(--tg-space-3); }

.jb-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; margin: 0; padding: var(--tg-space-4) var(--tg-space-5); list-style: none;
    background: var(--tg-surface); border-radius: var(--tg-radius-lg); box-shadow: 0 0 0 1px var(--tg-border); }
.jb-step { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: var(--tg-space-2); min-width: 0; }
.jb-step::before { content: ""; position: absolute; top: 0.8125rem; left: 1.75rem; right: 0.25rem; height: 2px; background: var(--tg-border); }
.jb-step:last-child::before { display: none; }
.jb-step.is-done::before { background: var(--tg-accent-solid); }
.jb-step-dot { position: relative; z-index: 1; width: 1.625rem; height: 1.625rem; border-radius: 999px; display: grid; place-items: center; flex: none;
    font-size: var(--tg-fs-xs); font-weight: 650; color: var(--tg-muted); background: var(--tg-surface); box-shadow: inset 0 0 0 1.5px var(--tg-border-strong); }
.jb-step-dot svg { width: 0.875rem; height: 0.875rem; }
.jb-step.is-done .jb-step-dot { color: #fff; background: var(--tg-accent-solid); box-shadow: none; }
.jb-step.is-current .jb-step-dot { color: var(--tg-accent-text); background: var(--tg-accent-soft); box-shadow: inset 0 0 0 2px var(--tg-accent-solid), 0 0 0 4px var(--tg-accent-soft); }
.jb-step.is-problem .jb-step-dot { color: var(--tg-danger-text); background: var(--tg-danger-soft); box-shadow: inset 0 0 0 2px var(--tg-danger), 0 0 0 4px var(--tg-danger-soft); }
.jb-step-text { display: flex; flex-direction: column; min-width: 0; padding-right: var(--tg-space-2); }
.jb-step-label { font-size: var(--tg-fs-sm); font-weight: 550; color: var(--tg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jb-step.is-done .jb-step-label { color: var(--tg-text); }
.jb-step.is-current .jb-step-label { color: var(--tg-heading); font-weight: 650; }
.jb-step-at { font-size: var(--tg-fs-xs); color: var(--tg-faint); min-height: 1em; }
@media (max-width: 47.99rem) {
    /* Phones: the line becomes compact dots; only the current step keeps its words. */
    .jb-steps { padding: var(--tg-space-3) var(--tg-space-4); grid-template-columns: repeat(6, auto); justify-content: space-between; }
    .jb-step { flex-direction: row; align-items: center; }
    .jb-step::before { left: 1.625rem; right: -50%; top: 50%; }
    .jb-step-text { display: none; }
    .jb-step.is-current .jb-step-text { display: flex; position: absolute; top: calc(100% + 0.375rem); left: 50%; transform: translateX(-50%); padding: 0; }
    .jb-step.is-current .jb-step-at { display: none; }
    .jb-steps { margin-bottom: var(--tg-space-5); }
    .jb-step:first-child.is-current .jb-step-text { left: 0; transform: none; }
    .jb-step:last-child.is-current .jb-step-text { left: auto; right: 0; transform: none; }
}

.jb-next { display: flex; align-items: center; justify-content: space-between; gap: var(--tg-space-4); flex-wrap: wrap;
    padding: var(--tg-space-4) var(--tg-space-5); border-radius: var(--tg-radius-lg); background: var(--tg-surface); box-shadow: 0 0 0 1px var(--tg-border); }
.jb-next.is-mine { background: var(--tg-accent-soft); box-shadow: inset 0 0 0 1px var(--tg-accent-border); }
.jb-next-text { min-width: 0; flex: 1 1 18rem; }
.jb-next-title { margin: 0; font-size: var(--tg-fs-md, 1rem); font-weight: 650; color: var(--tg-heading); letter-spacing: -0.01em; }
.jb-next-body { margin: 0.25rem 0 0; font-size: var(--tg-fs-sm); color: var(--tg-text-2); line-height: 1.5; max-width: 46rem; }
.jb-next-actions { display: flex; flex-wrap: wrap; gap: var(--tg-space-2); align-items: center; }
.jb-next-actions:empty { display: none; }
@media (max-width: 47.99rem) {
    .jb-next { padding: var(--tg-space-4); }
    .jb-next-actions { width: 100%; }
    .jb-next-actions > .fi-btn, .jb-next-actions > button { flex: 1 1 auto; justify-content: center; min-height: 2.75rem; }
}

.jb-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--tg-space-3); }
.jb-checks li { display: grid; grid-template-columns: 1.125rem minmax(0, 1fr); gap: var(--tg-space-2); align-items: start; }
.jb-checks li > svg { width: 1.125rem; height: 1.125rem; margin-top: 0.0625rem; }
.jb-checks li > span { display: flex; flex-direction: column; gap: 0.0625rem; }
.jb-checks .is-ok > svg { color: var(--tg-success); }
.jb-checks .is-bad > svg { color: var(--tg-danger); }
.jb-checks .is-warn > svg { color: var(--tg-warning); }
.jb-check-label { font-size: var(--tg-fs-sm); font-weight: 550; color: var(--tg-heading); }
.jb-sig-svg { width: 11rem; height: auto; color: var(--tg-heading); }
.jb-sig-svg path { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.tk-msa { display: inline-flex; align-items: center; margin-left: 0.375rem; padding: 0.0625rem 0.375rem; border-radius: var(--tg-radius-pill);
    font-size: var(--tg-fs-2xs); font-weight: 650; letter-spacing: 0.02em; color: var(--tg-accent-text); background: var(--tg-accent-soft); vertical-align: middle; }
.tk-msa.is-custom { color: var(--tg-warning-text); background: var(--tg-warning-soft); }

/* Field ticket editor */
.tk { padding: 0; overflow: hidden; }
.tk-head { display: flex; align-items: center; justify-content: space-between; gap: var(--tg-space-3); flex-wrap: wrap; padding: var(--tg-space-4) var(--tg-space-5); border-bottom: 1px solid var(--tg-border-subtle); }
.tk-title { margin: 0; font-size: var(--tg-fs-md, 1rem); font-weight: 650; color: var(--tg-heading); }
.tk-sync { display: inline-flex; align-items: center; gap: 0.4375rem; font-size: var(--tg-fs-xs); color: var(--tg-muted); }
.tk-sync-dot { width: 0.5rem; height: 0.5rem; border-radius: 999px; background: var(--tg-success); flex: none; }
.tk-sync.is-pending .tk-sync-dot, .tk-sync.is-saving .tk-sync-dot { background: var(--tg-accent-solid); animation: tk-pulse 1s ease-in-out infinite; }
.tk-sync.is-offline .tk-sync-dot, .tk-sync.is-conflict .tk-sync-dot { background: var(--tg-warning); }
.tk-sync.is-offline, .tk-sync.is-conflict { color: var(--tg-warning-text); }
.tk-sync.is-error .tk-sync-dot { background: var(--tg-danger); }
.tk-sync.is-error { color: var(--tg-danger-text); }
@keyframes tk-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .tk-sync-dot { animation: none !important; } }
.tk-empty { padding: var(--tg-space-6) var(--tg-space-5); font-size: var(--tg-fs-sm); color: var(--tg-muted); text-align: center; }
.tk-lines { list-style: none; margin: 0; padding: 0; }
.tk-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 6.5rem 2.25rem; gap: var(--tg-space-3); align-items: center; padding: var(--tg-space-3) var(--tg-space-5); border-bottom: 1px solid var(--tg-border-subtle); }
.tk-line-main { min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.tk-line-title { font-size: var(--tg-fs-sm); font-weight: 600; color: var(--tg-heading); }
.tk-line-meta { font-size: var(--tg-fs-xs); color: var(--tg-muted); }
.tk-note { margin-top: 0.25rem; width: 100%; max-width: 22rem; border: 0; padding: 0.125rem 0; font: inherit; font-size: var(--tg-fs-xs); color: var(--tg-text-2); background: transparent; border-bottom: 1px dashed transparent; }
.tk-note:hover, .tk-note:focus { outline: none; border-bottom-color: var(--tg-border-strong); }
.tk-note::placeholder { color: var(--tg-faint); }
.tk-qty { display: inline-flex; align-items: center; gap: 0; border-radius: var(--tg-radius-md); box-shadow: inset 0 0 0 1px var(--tg-border); background: var(--tg-surface); position: relative; }
.tk-step { width: 2.5rem; height: 2.5rem; border: 0; background: transparent; font-size: 1.125rem; line-height: 1; color: var(--tg-text-2); cursor: pointer; border-radius: var(--tg-radius-md); touch-action: manipulation; }
.tk-step:hover { background: var(--tg-hover); color: var(--tg-heading); }
.tk-qty-input { width: 3.75rem; height: 2.5rem; border: 0; text-align: center; font: inherit; font-size: var(--tg-fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--tg-heading); background: transparent; -moz-appearance: textfield; }
.tk-qty-input::-webkit-outer-spin-button, .tk-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tk-rate { display: inline-flex; align-items: baseline; gap: 0.125rem; }
.tk-rate-input { width: 5.5rem; padding: 0 0.25rem; border: 0; border-bottom: 1px dashed var(--tg-border-strong); font: inherit; font-variant-numeric: tabular-nums; color: var(--tg-heading); background: transparent; -moz-appearance: textfield; }
.tk-rate-input::-webkit-outer-spin-button, .tk-rate-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tk-rate-input:focus { outline: 2px solid var(--tg-accent-border); outline-offset: 1px; border-radius: var(--tg-radius-sm); }
.tk-qty-input:focus { outline: 2px solid var(--tg-accent-border); outline-offset: -2px; border-radius: var(--tg-radius-sm); }
.tk-uom { position: absolute; bottom: -1.0625rem; left: 0; right: 0; text-align: center; font-size: var(--tg-fs-2xs); color: var(--tg-faint); }
.tk-amount { text-align: right; font-size: var(--tg-fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--tg-heading); }
.tk-remove { width: 2.25rem; height: 2.25rem; border: 0; border-radius: var(--tg-radius-md); display: grid; place-items: center; background: transparent; color: var(--tg-faint); cursor: pointer; }
.tk-remove svg { width: 1rem; height: 1rem; }
.tk-remove:hover { color: var(--tg-danger-text); background: var(--tg-danger-soft); }
.tk-add { display: flex; flex-wrap: wrap; gap: var(--tg-space-2); padding: var(--tg-space-3) var(--tg-space-5); }
.tk-add-btn, .tk-hint { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.5rem; padding: 0 0.875rem; border-radius: var(--tg-radius-md); font: inherit; font-size: var(--tg-fs-sm); font-weight: 600; cursor: pointer; touch-action: manipulation; }
.tk-add-btn { border: 0; color: var(--tg-accent-text); background: var(--tg-accent-soft); box-shadow: inset 0 0 0 1px var(--tg-accent-border); }
.tk-add-btn:hover { background: var(--tg-surface); }
.tk-add-btn svg, .tk-hint svg { width: 1rem; height: 1rem; }
.tk-hint { border: 0; color: var(--tg-text-2); background: var(--tg-surface-2); box-shadow: inset 0 0 0 1px var(--tg-border); }
.tk-hint:hover { color: var(--tg-heading); }
.tk-picker { margin: 0 var(--tg-space-5) var(--tg-space-4); padding: var(--tg-space-3); border-radius: var(--tg-radius-lg); background: var(--tg-surface-2); box-shadow: inset 0 0 0 1px var(--tg-border); display: flex; flex-direction: column; gap: var(--tg-space-3); }
.tk-search { width: 100%; height: 2.75rem; padding: 0 0.875rem; border: 0; border-radius: var(--tg-radius-md); font: inherit; font-size: 1rem; background: var(--tg-surface); box-shadow: inset 0 0 0 1px var(--tg-border); color: var(--tg-heading); }
.tk-search:focus { outline: 2px solid var(--tg-accent-border); outline-offset: 0; }
.tk-cats { display: flex; gap: var(--tg-space-2); overflow-x: auto; padding-bottom: 0.125rem; scrollbar-width: none; }
.tk-cats::-webkit-scrollbar { display: none; }
.tk-cat { flex: none; min-height: 2.25rem; padding: 0 0.75rem; border: 0; border-radius: var(--tg-radius-pill); font: inherit; font-size: var(--tg-fs-xs); font-weight: 600; color: var(--tg-text-2); background: var(--tg-surface); box-shadow: inset 0 0 0 1px var(--tg-border); cursor: pointer; }
.tk-cat.is-on { color: #fff; background: var(--tg-accent-solid); box-shadow: none; }
.tk-options { list-style: none; margin: 0; padding: 0; max-height: 18rem; overflow-y: auto; border-radius: var(--tg-radius-md); background: var(--tg-surface); box-shadow: inset 0 0 0 1px var(--tg-border); }
.tk-option { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: var(--tg-space-3); min-height: 2.875rem; padding: 0.5rem 0.875rem; border: 0; border-bottom: 1px solid var(--tg-border-subtle); background: transparent; font: inherit; font-size: var(--tg-fs-sm); text-align: left; color: var(--tg-heading); cursor: pointer; }
.tk-options li:last-child .tk-option { border-bottom: 0; }
.tk-option:hover, .tk-option:focus-visible { background: var(--tg-hover); outline: none; }
.tk-option-rate { flex: none; font-size: var(--tg-fs-xs); color: var(--tg-muted); font-variant-numeric: tabular-nums; }
.tk-none { padding: var(--tg-space-4); font-size: var(--tg-fs-sm); color: var(--tg-muted); }
.tk-custom { display: flex; flex-direction: column; gap: var(--tg-space-2); }
.tk-custom-row { display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem 4rem 5.5rem auto; gap: var(--tg-space-2); }
.tk-custom-row input { min-width: 0; height: 2.5rem; padding: 0 0.625rem; border: 0; border-radius: var(--tg-radius-md); font: inherit; font-size: var(--tg-fs-sm); background: var(--tg-surface); box-shadow: inset 0 0 0 1px var(--tg-border); }
.tk-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--tg-space-4); padding: var(--tg-space-3) var(--tg-space-5); background: var(--tg-surface-2); border-top: 1px solid var(--tg-border-subtle); }
.tk-total { display: flex; flex-direction: column; }
.tk-total strong { font-size: 1.25rem; font-weight: 650; color: var(--tg-heading); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tk-submit { min-height: 2.75rem; padding: 0 1.125rem; border: 0; border-radius: var(--tg-radius-md); font: inherit; font-size: var(--tg-fs-sm); font-weight: 650; color: #fff; background: var(--tg-accent-solid); cursor: pointer; touch-action: manipulation; }
.tk-submit:hover { filter: brightness(1.08); }
.tk-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.tk-error { margin: 0; padding: 0 var(--tg-space-5) var(--tg-space-3); font-size: var(--tg-fs-xs); color: var(--tg-warning-text); }
[x-cloak] { display: none !important; }
@media (max-width: 47.99rem) {
    .tk-head, .tk-add, .tk-foot { padding-inline: var(--tg-space-4); }
    .tk-picker { margin-inline: var(--tg-space-4); }
    .tk-line { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main remove" "qty amount"; padding: var(--tg-space-3) var(--tg-space-4) var(--tg-space-5); row-gap: var(--tg-space-3); }
    .tk-line-main { grid-area: main; }
    .tk-remove { grid-area: remove; align-self: start; }
    .tk-qty { grid-area: qty; justify-self: start; }
    .tk-amount { grid-area: amount; align-self: center; font-size: var(--tg-fs-md, 1rem); }
    .tk-step { width: 2.875rem; height: 2.875rem; }
    .tk-qty-input { height: 2.875rem; font-size: 1rem; }
    .tk-note { max-width: none; font-size: var(--tg-fs-sm); }
    .tk-custom-row { grid-template-columns: 1fr 1fr; }
    .tk-custom-row input:first-child { grid-column: 1 / -1; }
    /* The total and Submit stay under the thumb while scrolling a long ticket. */
    .tk-foot { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -8px 16px -12px rgb(0 0 0 / 0.25); }
}

/* Signature sheet */
.sg-backdrop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgb(11 13 18 / 0.55); padding: 0; }
@media (min-width: 48rem) { .sg-backdrop { align-items: center; padding: var(--tg-space-6); } }
.sg-sheet { width: 100%; max-width: 40rem; max-height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--tg-space-3);
    padding: var(--tg-space-5); background: var(--tg-surface); border-radius: var(--tg-radius-xl) var(--tg-radius-xl) 0 0; box-shadow: var(--tg-shadow-lg); }
@media (min-width: 48rem) { .sg-sheet { border-radius: var(--tg-radius-xl); } }
.sg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--tg-space-3); }
.sg-title { margin: 0; font-size: 1.125rem; font-weight: 650; color: var(--tg-heading); }
.sg-close { width: 2.5rem; height: 2.5rem; border: 0; border-radius: var(--tg-radius-md); display: grid; place-items: center; background: var(--tg-surface-2); color: var(--tg-muted); cursor: pointer; }
.sg-close svg { width: 1.125rem; height: 1.125rem; }
.sg-label { display: flex; flex-direction: column; gap: 0.375rem; font-size: var(--tg-fs-sm); font-weight: 600; color: var(--tg-heading); }
.sg-input { height: 2.875rem; padding: 0 0.875rem; border: 0; border-radius: var(--tg-radius-md); font: inherit; font-size: 1rem; font-weight: 400; background: var(--tg-surface); box-shadow: inset 0 0 0 1px var(--tg-border-strong); }
.sg-input:focus { outline: 2px solid var(--tg-accent-border); }
.sg-pad-wrap { position: relative; border-radius: var(--tg-radius-lg); background: #fbfbfc; box-shadow: inset 0 0 0 1px var(--tg-border-strong); }
.sg-pad { display: block; width: 100%; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; }
.sg-line { position: absolute; left: 1rem; right: 1rem; bottom: 22%; border-top: 1px solid var(--tg-border-strong); padding-top: 0.25rem; font-size: var(--tg-fs-2xs); color: var(--tg-faint); pointer-events: none; }
.sg-foot { display: flex; justify-content: space-between; gap: var(--tg-space-3); }
.sg-clear { min-height: 2.75rem; padding: 0 1rem; border: 0; border-radius: var(--tg-radius-md); font: inherit; font-size: var(--tg-fs-sm); font-weight: 600; color: var(--tg-text-2); background: var(--tg-surface-2); box-shadow: inset 0 0 0 1px var(--tg-border); cursor: pointer; }
.sg-foot .tk-submit { flex: 1; max-width: 16rem; }

.tg-nowrap { white-space: nowrap; }
@media (max-width: 47.99rem) {
    .jb-ticket .jb-rate { display: none; }
    .jb-ticket th, .jb-ticket td { padding-inline: 0.625rem; }
    .jb-ticket th:first-child, .jb-ticket td:first-child { padding-left: var(--tg-space-4); }
    .jb-ticket th:last-child, .jb-ticket td:last-child { padding-right: var(--tg-space-4); }
}

.cp-approve { display: flex; flex-direction: column; gap: var(--tg-space-3); padding: var(--tg-space-4) var(--tg-space-5); border-radius: var(--tg-radius-lg);
    background: var(--tg-warning-soft); box-shadow: inset 0 0 0 1px var(--tg-warning-border); }
.cp-approve-head { display: flex; gap: var(--tg-space-3); align-items: flex-start; }
.cp-approve-icon { width: 1.5rem; height: 1.5rem; color: var(--tg-warning-text); flex: none; }
.cp-approve-title { margin: 0; font-size: var(--tg-fs-md, 1rem); font-weight: 650; color: var(--tg-heading); }
.cp-approve .cp-list { background: var(--tg-surface); border-radius: var(--tg-radius-md); box-shadow: 0 0 0 1px var(--tg-border); padding: 0 var(--tg-space-4); }
.cp-review { font-size: var(--tg-fs-xs); font-weight: 500; color: var(--tg-on-accent); background: var(--tg-accent); padding: 0.375rem 0.75rem; border-radius: var(--tg-radius-md); flex: none; }
.cp-row:hover .cp-review { background: var(--tg-accent-hover); }
.cp-approve .cp-list { margin-bottom: 0; }

@media (max-width: 47.99rem) {
    /* Phones: job rows give the words the room; the job number and lead avatar are on the job itself. */
    .ov-job { grid-template-columns: 3.75rem minmax(0, 1fr); gap: var(--tg-space-3); padding-inline: var(--tg-space-4); }
    .ov-job-no, .ov-job-lead { display: none; }
    .ov-job-title, .ov-job-meta { white-space: normal; overflow: visible; text-overflow: clip; }
}

/* ---- Daily log on the job ---------------------------------------------------------------------------------- */
.jb-day { padding: var(--tg-space-3) var(--tg-space-5) var(--tg-space-4); border-top: 1px solid var(--tg-border-subtle); }
.jb-day:first-child { border-top: 0; }
.jb-day-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--tg-space-3); flex-wrap: wrap; margin-bottom: var(--tg-space-2); font-size: var(--tg-fs-sm); }
.jb-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.jb-log-row { display: grid; grid-template-columns: 8.5rem 4.25rem minmax(0, 1fr) auto; gap: var(--tg-space-3); align-items: baseline; padding: 0.4375rem 0; font-size: var(--tg-fs-sm); border-top: 1px dashed var(--tg-border-subtle); }
.jb-log-row:first-child { border-top: 0; }
.jb-log-time { font-size: var(--tg-fs-xs); color: var(--tg-text-2); white-space: nowrap; }
.jb-log-kind { justify-self: start; font-size: var(--tg-fs-2xs, 0.6875rem); font-weight: 600; letter-spacing: 0.02em; padding: 0.0625rem 0.4375rem; border-radius: 999px; color: var(--tg-neutral-text); background: var(--tg-neutral-soft); }
.jb-log-row.is-work .jb-log-kind { color: var(--tg-accent-text); background: var(--tg-accent-soft); }
.jb-log-row.is-standby .jb-log-kind { color: var(--tg-warning-text); background: var(--tg-warning-soft); }
.jb-log-text { color: var(--tg-text); line-height: 1.5; }
.jb-delay { display: block; margin-top: 0.125rem; font-size: var(--tg-fs-xs); font-weight: 550; color: var(--tg-warning-text); }
.jb-delay-text { color: var(--tg-warning-text); font-weight: 550; }
.jb-log-del { width: 1.75rem; height: 1.75rem; display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--tg-faint); cursor: pointer; }
.jb-log-del:hover { background: var(--tg-hover); color: var(--tg-danger-text); }
.jb-log-del svg { width: 1rem; height: 1rem; }
.jb-delays { padding: var(--tg-space-3) var(--tg-space-5) var(--tg-space-4); background: var(--tg-warning-soft); border-top: 1px solid var(--tg-warning-border); }
.jb-delays ul { list-style: none; margin: var(--tg-space-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.jb-delays li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--tg-space-3); align-items: baseline; font-size: var(--tg-fs-sm); }
.jb-summary { display: flex; flex-direction: column; gap: var(--tg-space-3); }
.jb-summary-text { width: 100%; font: 500 0.8125rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--tg-text); background: var(--tg-surface-2); border: 1px solid var(--tg-border); border-radius: 8px; padding: 0.75rem 0.875rem; resize: vertical; }
@media (max-width: 47.99rem) {
    .jb-log-row { grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 0.125rem; column-gap: var(--tg-space-2); align-items: center; }
    .jb-log-time { grid-column: 1; grid-row: 1; }
    .jb-log-kind { grid-column: 2; grid-row: 1; }
    .jb-log-del { grid-column: 3; grid-row: 1; width: 1.5rem; height: 1.5rem; }
    .jb-log-text { grid-column: 1 / -1; grid-row: 2; }
    .jb-day { padding-inline: var(--tg-space-4); }
    /* Section headers with buttons: the title keeps its width, the buttons drop below. */
    .tg-section-header { flex-wrap: wrap; row-gap: var(--tg-space-2); }
    .tg-section-heading { flex: 1 1 12rem; min-width: 0; }
}

/* ---- Who owes the next move (job sidebar) ------------------------------------------------------------------- */
.jb-wait { display: flex; flex-direction: column; gap: var(--tg-space-2); padding: var(--tg-space-4) var(--tg-space-5); border-radius: var(--tg-radius-lg, 12px); background: var(--tg-surface); box-shadow: 0 0 0 1px var(--tg-border); }
/* Whose move it is reads from the eyebrow and the day count; only a stuck or held job tints the card. */
.jb-wait.is-hold, .jb-wait.is-stuck { box-shadow: 0 0 0 1px var(--tg-warning-border); background: linear-gradient(var(--tg-warning-soft), var(--tg-surface) 70%); }
.jb-wait-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--tg-space-3); }
.jb-wait-days { font-size: var(--tg-fs-lg); font-weight: 650; color: var(--tg-heading); letter-spacing: -0.02em; }
.jb-wait.is-stuck .jb-wait-days { color: var(--tg-warning-text); }
.jb-wait-what { margin: 0; font-size: var(--tg-fs-md, 1rem); font-weight: 600; color: var(--tg-heading); line-height: 1.35; }
.jb-wait-due { color: var(--tg-danger-text); font-weight: 600; }
.jb-chases { list-style: none; margin: var(--tg-space-1, 0.25rem) 0; padding: 0 0 0 var(--tg-space-3); border-left: 1px solid var(--tg-border); display: flex; flex-direction: column; gap: 0.375rem; }
.jb-chases li { display: flex; flex-direction: column; }
.jb-missing { font-size: var(--tg-fs-xs); font-weight: 600; color: var(--tg-danger-text); }
.jb-trail li.is-problem .jb-trail-dot { background: var(--tg-danger); box-shadow: 0 0 0 3px var(--tg-danger-soft); }
.jb-trail li.is-problem .jb-trail-label { color: var(--tg-danger-text); }
.tk-msa.is-quote { margin-left: 0.125rem; padding-inline: 0; color: var(--tg-muted); background: transparent; font-weight: 450; letter-spacing: 0; font-size: var(--tg-fs-xs); }

/* ---- Billing desk ------------------------------------------------------------------------------------------- */
.bd-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--tg-space-3); flex-wrap: wrap; }
.bd-filter { display: inline-flex; align-items: center; gap: var(--tg-space-2); }
.bd-select { font: inherit; font-size: var(--tg-fs-sm); color: var(--tg-text); padding: 0.375rem 2rem 0.375rem 0.625rem; border-radius: 8px; border: 1px solid var(--tg-border-strong); background-color: var(--tg-surface); }
.bd-row { display: grid; grid-template-columns: minmax(0, 1fr) 10rem 9rem 6.5rem minmax(4.5rem, auto); gap: var(--tg-space-4); align-items: center; padding: 0.75rem var(--tg-space-5); border-top: 1px solid var(--tg-border-subtle); }
.bd-row:first-child { border-top: 0; }
/* A stuck row is told by its day count in warning ink; the row itself stays clean. */
.bd-main { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; text-decoration: none; color: inherit; }
.bd-main:hover .tg-strong { color: var(--tg-accent-text); }
.bd-what { display: inline-flex; align-items: center; gap: 0.5rem; font-size: var(--tg-fs-sm); }
.bd-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 1rem; }
.bd-owner, .bd-age { display: flex; flex-direction: column; gap: 0.0625rem; min-width: 0; }
.bd-owner .tg-small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-days { font-size: var(--tg-fs-md, 1rem); font-weight: 650; color: var(--tg-heading); font-variant-numeric: tabular-nums; }
.bd-days.is-stuck { color: var(--tg-warning-text); }
.bd-due { color: var(--tg-danger-text); font-weight: 600; }
.bd-amount { text-align: right; font-size: var(--tg-fs-sm); }
.bd-actions { justify-self: end; display: flex; align-items: center; gap: var(--tg-space-2); }
.bd-actions > .fi-icon-btn { color: var(--tg-faint); }
.bd-actions > .fi-icon-btn:hover { color: var(--tg-heading); }
@media (max-width: 63.99rem) {
    .bd-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0.375rem; padding-inline: var(--tg-space-4); }
    .bd-main { grid-column: 1 / -1; }
    .bd-owner { grid-column: 1; }
    .bd-amount { grid-column: 2; grid-row: 2; }
    .bd-age { grid-column: 1; flex-direction: row; flex-wrap: wrap; gap: 0.25rem 0.625rem; align-items: baseline; }
    .bd-actions { grid-column: 2; grid-row: 3; }
    .bd-meta { white-space: normal; }
}

/* ---- Quotes and programs ------------------------------------------------------------------------------------ */
.qt-options { padding: var(--tg-space-3) var(--tg-space-5) var(--tg-space-4); border-top: 1px solid var(--tg-border-subtle); }
.qt-options ul { list-style: none; margin: var(--tg-space-2) 0; padding: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.qt-options li { display: flex; justify-content: space-between; gap: var(--tg-space-3); font-size: var(--tg-fs-sm); padding: 0.5rem 0.75rem; border-radius: 8px; background: var(--tg-surface-2); box-shadow: inset 0 0 0 1px var(--tg-border-subtle); }
.qt-options li.is-taken { background: var(--tg-success-soft); box-shadow: inset 0 0 0 1px var(--tg-success-border); }
.qt-options li.is-left { opacity: 0.6; }
.qt-scope { white-space: pre-line; }
/* A quote's and a quote template's lines: the table scrolls inside the dialog when it is wider, the item picker keeps
   room for the item's name, and the numbers keep room for a value such as 1,240.00. A scrolling table clips what
   opens below its last line, so while a picker's list is open the table makes room under it for the list. */
.qt-lines.fi-fo-table-repeater { overflow-x: auto; }
.qt-lines.fi-fo-table-repeater:has([aria-expanded="true"]) { padding-bottom: 16rem; }
.qt-lines .qt-line-item { min-width: 16rem; }
.qt-lines .fi-fo-text-input:has(input[id$=".description"]) { min-width: 12rem; }
.qt-lines .fi-fo-text-input:has(input[id$=".quantity"]) { min-width: 5.5rem; }
.qt-lines .fi-fo-text-input:has(input[id$=".rate"]), .qt-lines .fi-fo-text-input:has(input[id$=".unit_cost"]) { min-width: 8.5rem; }
.qt-lines .fi-fo-text-input:has(input[id$=".discount"]) { min-width: 6.5rem; }
.pg-bar { display: block; width: 7rem; height: 0.3125rem; margin-top: 0.3125rem; border-radius: 999px; background: var(--tg-surface-3); overflow: hidden; }
.pg-bar span { display: block; height: 100%; border-radius: inherit; background: var(--tg-success); }
.iv-chip.is-bad { color: var(--tg-danger-text); background: var(--tg-danger-soft); box-shadow: inset 0 0 0 1px var(--tg-danger-border); }
.cp-approve.is-quote { background: var(--tg-accent-soft); box-shadow: inset 0 0 0 1px var(--tg-accent-border); }
.cp-approve.is-quote .cp-approve-icon { color: var(--tg-accent-text); }
.bd-open { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; color: var(--tg-faint); }
.bd-open:hover { background: var(--tg-hover); color: var(--tg-accent-text); }
.bd-open svg { width: 1.125rem; height: 1.125rem; }
.bd-bar .tg-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.bd-bar .tg-seg::-webkit-scrollbar { display: none; }

/* ==== Field app: My jobs and the phone job screen ============================================================== */
.fj-wrap, .fj { width: 100%; max-width: 42rem; margin-inline: auto; display: flex; flex-direction: column; gap: var(--tg-space-4); }
.fj-h { margin: var(--tg-space-2) 0 var(--tg-space-2); font-size: var(--tg-fs-xs); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tg-text-2); }
.fj-lead { display: flex; align-items: center; justify-content: space-between; gap: var(--tg-space-3); }
.fj-center { text-align: center; }

/* My jobs */
.mj-card { display: flex; flex-direction: column; gap: var(--tg-space-3); padding: var(--tg-space-4); border-radius: 14px; background: var(--tg-surface); box-shadow: 0 0 0 1px var(--tg-border); margin-bottom: var(--tg-space-3); }
.mj-card.is-live { box-shadow: 0 0 0 2px var(--tg-accent-solid); }
.mj-main { display: flex; flex-direction: column; gap: 0.25rem; color: inherit; text-decoration: none; }
.mj-top { display: flex; justify-content: space-between; align-items: center; gap: var(--tg-space-2); }
.mj-title { font-size: 1.125rem; font-weight: 650; color: var(--tg-heading); letter-spacing: -0.01em; line-height: 1.3; }
.mj-meta { font-size: var(--tg-fs-sm); color: var(--tg-text-2); }
.mj-pill { display: inline-flex; align-items: center; height: 1.5rem; padding: 0 0.625rem; border-radius: 999px; font-size: var(--tg-fs-xs); font-weight: 600; white-space: nowrap; color: var(--tg-neutral-text); background: var(--tg-neutral-soft); }
.mj-pill.is-accent, .mj-pill.is-info { color: var(--tg-accent-text); background: var(--tg-accent-soft); }
.mj-pill.is-success { color: var(--tg-success-text); background: var(--tg-success-soft); }
.mj-pill.is-warning { color: var(--tg-warning-text); background: var(--tg-warning-soft); }
.mj-pill.is-danger { color: var(--tg-danger-text); background: var(--tg-danger-soft); }
.mj-actions { display: flex; gap: var(--tg-space-2); }
.mj-go { flex: 1; display: inline-flex; align-items: center; justify-content: center; height: 3rem; border-radius: 12px; background: var(--tg-accent-solid); color: #fff; font-weight: 650; font-size: 1rem; text-decoration: none; }
.mj-go:active { transform: scale(0.99); }
.mj-icon { width: 3rem; height: 3rem; display: inline-grid; place-items: center; border-radius: 12px; color: var(--tg-text); background: var(--tg-surface-2); box-shadow: inset 0 0 0 1px var(--tg-border); }
.mj-icon svg { width: 1.375rem; height: 1.375rem; }
.mj-row { display: flex; align-items: center; gap: var(--tg-space-3); padding: 0.875rem var(--tg-space-4); margin-bottom: var(--tg-space-2); border-radius: 12px; background: var(--tg-surface); box-shadow: 0 0 0 1px var(--tg-border); color: inherit; text-decoration: none; }
.mj-row.is-bad { box-shadow: 0 0 0 1px var(--tg-danger-border); }
.mj-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.mj-row-text .tg-strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mj-date { width: 2.75rem; flex: none; display: flex; flex-direction: column; align-items: center; font-size: var(--tg-fs-2xs, 0.6875rem); font-weight: 600; color: var(--tg-text-2); text-transform: uppercase; }
.mj-date b { font-size: 1.25rem; line-height: 1.1; color: var(--tg-heading); }
.mj-ok { width: 1.5rem; height: 1.5rem; color: var(--tg-success); flex: none; }

/* Job screen header */
.fj-head { display: flex; flex-direction: column; gap: var(--tg-space-2); }
.fj-back { display: inline-flex; align-items: center; gap: 0.125rem; align-self: flex-start; font-size: var(--tg-fs-sm); font-weight: 550; color: var(--tg-accent-text); text-decoration: none; margin-left: -0.25rem; }
.fj-back svg { width: 1.125rem; height: 1.125rem; }
.fj-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--tg-space-3); }
.fj-title { margin: 0; font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; color: var(--tg-heading); }
.fj-sub { margin: 0.25rem 0 0; font-size: var(--tg-fs-sm); color: var(--tg-text-2); }
.fj-quick { display: flex; flex-wrap: wrap; gap: var(--tg-space-2); }
.fj-chip { display: inline-flex; align-items: center; gap: 0.375rem; height: 2.25rem; padding: 0 0.875rem; border-radius: 999px; font-size: var(--tg-fs-sm); font-weight: 550; color: var(--tg-text); background: var(--tg-surface); box-shadow: inset 0 0 0 1px var(--tg-border-strong); text-decoration: none; }
.fj-chip svg { width: 1rem; height: 1rem; color: var(--tg-text-2); }

/* Clock */
.fj-clock { display: flex; flex-direction: column; gap: var(--tg-space-3); padding: var(--tg-space-4); border-radius: 16px; background: var(--tg-surface); box-shadow: 0 0 0 1px var(--tg-border); }
.fj-clock.is-work { background: linear-gradient(160deg, var(--tg-accent-soft), var(--tg-surface) 75%); box-shadow: 0 0 0 1px var(--tg-accent-border); }
.fj-clock.is-travel { background: linear-gradient(160deg, var(--tg-neutral-soft), var(--tg-surface) 75%); }
.fj-clock.is-standby { background: linear-gradient(160deg, var(--tg-warning-soft), var(--tg-surface) 75%); box-shadow: 0 0 0 1px var(--tg-warning-border); }
.fj-clock-state { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0.125rem var(--tg-space-3); }
.fj-clock-label { font-size: var(--tg-fs-sm); font-weight: 650; color: var(--tg-heading); }
.fj-clock-time { grid-row: span 2; font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; color: var(--tg-heading); }
.fj-clock.is-off .fj-clock-time { color: var(--tg-faint); }
.fj-clock-today { font-size: var(--tg-fs-xs); color: var(--tg-text-2); }
.fj-clock-btns { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--tg-space-2); }
.fj-clock-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem; height: 4rem; border: 0; border-radius: 12px; font: inherit; font-size: var(--tg-fs-xs); font-weight: 600; color: var(--tg-text); background: var(--tg-surface-2); box-shadow: inset 0 0 0 1px var(--tg-border); cursor: pointer; touch-action: manipulation; }
.fj-clock-btn svg { width: 1.5rem; height: 1.5rem; }
.fj-clock-btn.is-on { color: #fff; background: var(--tg-accent-solid); box-shadow: none; }
.fj-clock.is-standby .fj-clock-btn.is-on { background: var(--tg-warning); color: #fff; }
.fj-clock-btn.is-stop:not(:disabled) { color: var(--tg-danger-text); }
.fj-clock-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.fj-reasons { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--tg-space-2); padding-top: var(--tg-space-2); }
.fj-reasons > span { width: 100%; }
.fj-reason { height: 2.5rem; padding: 0 0.875rem; border: 0; border-radius: 999px; font: inherit; font-size: var(--tg-fs-sm); color: var(--tg-warning-text); background: var(--tg-warning-soft); box-shadow: inset 0 0 0 1px var(--tg-warning-border); cursor: pointer; }

/* Tabs: a bottom bar on phones, a row on bigger screens */
.fj-tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.25rem; padding: 0.25rem; border-radius: 14px; background: var(--tg-surface-2); box-shadow: inset 0 0 0 1px var(--tg-border); }
.fj-tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.1875rem; padding: 0.5rem 0.125rem; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: 0.6875rem; font-weight: 600; color: var(--tg-text-2); cursor: pointer; touch-action: manipulation; }
.fj-tab svg { width: 1.375rem; height: 1.375rem; }
.fj-tab.is-on { color: var(--tg-accent-text); background: var(--tg-surface); box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 0 0 1px var(--tg-border); }
.fj-tab em { position: absolute; top: 0.25rem; right: 0.375rem; min-width: 1.125rem; height: 1.125rem; padding: 0 0.25rem; border-radius: 999px; font-style: normal; font-size: 0.625rem; line-height: 1.125rem; text-align: center; color: var(--tg-text-2); background: var(--tg-surface-3); }
@media (max-width: 47.99rem) {
    .fj { padding-bottom: 5.5rem; }
    .fj-tabs { position: fixed; z-index: 30; left: 0.5rem; right: 0.5rem; bottom: calc(0.5rem + env(safe-area-inset-bottom)); background: var(--tg-surface); box-shadow: var(--tg-shadow-md), 0 0 0 1px var(--tg-border); }
}

/* Panels and cards */
.fj-panel { display: flex; flex-direction: column; gap: var(--tg-space-3); }
.fj-card { display: flex; flex-direction: column; gap: var(--tg-space-3); padding: var(--tg-space-4); border-radius: 14px; background: var(--tg-surface); box-shadow: 0 0 0 1px var(--tg-border); }
.fj-card-title { display: flex; align-items: center; justify-content: space-between; gap: var(--tg-space-2); margin: 0; font-size: 1rem; font-weight: 650; color: var(--tg-heading); }
.fj-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--tg-space-3); margin: 0; }
.fj-facts dt { font-size: var(--tg-fs-2xs, 0.6875rem); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--tg-text-2); }
.fj-facts dd { margin: 0.125rem 0 0; font-size: var(--tg-fs-sm); font-weight: 600; color: var(--tg-heading); }
@media (max-width: 30rem) { .fj-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fj-lab { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: var(--tg-fs-sm); color: var(--tg-text); }
.fj-note { margin: 0; padding: 0.625rem 0.75rem; border-radius: 10px; background: var(--tg-surface-2); font-size: var(--tg-fs-sm); }
.fj-field { display: flex; flex-direction: column; gap: 0.375rem; font-size: var(--tg-fs-sm); font-weight: 600; color: var(--tg-heading); }
.fj-field > span { display: flex; justify-content: space-between; align-items: baseline; gap: var(--tg-space-2); }
.fj-field textarea, .fj-field input, .fj-caption { width: 100%; font: inherit; font-weight: 400; font-size: 1rem; color: var(--tg-text); padding: 0.75rem 0.875rem; border-radius: 10px; border: 1px solid var(--tg-border-strong); background: var(--tg-surface); resize: vertical; }
.fj-field textarea:disabled, .fj-field input:disabled { background: var(--tg-surface-2); color: var(--tg-text-2); }
.fj-link { border: 0; background: none; padding: 0; font: inherit; font-size: var(--tg-fs-xs); font-weight: 600; color: var(--tg-accent-text); cursor: pointer; }
.fj-log { display: grid; grid-template-columns: 6.75rem auto 1fr; gap: var(--tg-space-2); align-items: baseline; padding: 0.375rem 0; border-top: 1px dashed var(--tg-border-subtle); }
.fj-log:first-of-type { border-top: 0; }

/* Checklists */
.fj-count { font-size: var(--tg-fs-xs); font-weight: 650; padding: 0.125rem 0.5rem; border-radius: 999px; color: var(--tg-text-2); background: var(--tg-surface-2); }
.fj-count.is-done { color: var(--tg-success-text); background: var(--tg-success-soft); }
.fj-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.fj-check { width: 100%; display: flex; align-items: center; gap: 0.875rem; min-height: 3.25rem; padding: 0.625rem 0.75rem; border: 0; border-radius: 12px; font: inherit; text-align: left; color: var(--tg-text); background: var(--tg-surface-2); cursor: pointer; touch-action: manipulation; transition: background 120ms ease; }
.fj-check:disabled { cursor: default; }
.fj-box { flex: none; width: 1.75rem; height: 1.75rem; display: grid; place-items: center; border-radius: 8px; background: var(--tg-surface); box-shadow: inset 0 0 0 2px var(--tg-border-strong); color: transparent; transition: all 120ms ease; }
.fj-box svg { width: 1.125rem; height: 1.125rem; }
.fj-check.is-on { background: var(--tg-success-soft); }
.fj-check.is-on .fj-box { background: var(--tg-success); box-shadow: none; color: #fff; }
.fj-check-text { display: flex; flex-direction: column; gap: 0.0625rem; font-size: var(--tg-fs-sm); font-weight: 550; line-height: 1.35; }
.fj-big { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 3.25rem; padding: 0 1rem; border: 0; border-radius: 12px; font: inherit; font-size: 1rem; font-weight: 650; color: #fff; background: var(--tg-accent-solid); cursor: pointer; text-decoration: none; touch-action: manipulation; }
.fj-big svg { width: 1.25rem; height: 1.25rem; }
.fj-big:disabled { opacity: 0.45; cursor: not-allowed; }
.fj-big.is-ghost { color: var(--tg-text); background: var(--tg-surface-2); box-shadow: inset 0 0 0 1px var(--tg-border-strong); }

/* Readings */
.fj-readings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--tg-space-3); }
.fj-reading { display: flex; flex-direction: column; gap: 0.25rem; font-size: var(--tg-fs-xs); font-weight: 600; color: var(--tg-heading); }
.fj-reading small { font-weight: 400; color: var(--tg-faint); font-size: 0.6875rem; }
.fj-input { display: flex; align-items: center; border-radius: 10px; border: 1px solid var(--tg-border-strong); background: var(--tg-surface); overflow: hidden; }
.fj-input input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1.125rem; font-weight: 600; padding: 0.625rem 0.75rem; color: var(--tg-heading); font-variant-numeric: tabular-nums; }
.fj-input input:focus { outline: none; }
.fj-input:focus-within { border-color: var(--tg-accent-solid); box-shadow: 0 0 0 3px var(--tg-accent-soft); }
.fj-input em { font-style: normal; font-size: var(--tg-fs-xs); color: var(--tg-text-2); padding-right: 0.75rem; }
.fj-reading-head { display: flex; align-items: center; gap: var(--tg-space-2); }
.fj-reading-head .tg-xs { flex: 1; }
.fj-values { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.fj-value { display: inline-flex; flex-direction: column; padding: 0.375rem 0.625rem; border-radius: 10px; background: var(--tg-surface-2); font-size: var(--tg-fs-sm); font-weight: 650; color: var(--tg-heading); font-variant-numeric: tabular-nums; }
.fj-value small { font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--tg-text-2); }
.fj-value em { font-style: normal; font-weight: 500; font-size: var(--tg-fs-xs); color: var(--tg-text-2); }
.fj-value.is-bad { color: var(--tg-danger-text); background: var(--tg-danger-soft); }

/* Ticket summary (read only) */
.fj-line { display: flex; justify-content: space-between; align-items: baseline; gap: var(--tg-space-3); padding: 0.5rem 0; border-top: 1px solid var(--tg-border-subtle); }
.fj-line > span:first-child { display: flex; flex-direction: column; }
.fj-line.is-total { font-weight: 700; color: var(--tg-heading); }

/* Photos */
.fj-tags { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.375rem; }
.fj-tag { height: 2.5rem; border: 0; border-radius: 10px; font: inherit; font-size: var(--tg-fs-sm); font-weight: 600; color: var(--tg-text-2); background: var(--tg-surface-2); box-shadow: inset 0 0 0 1px var(--tg-border); cursor: pointer; }
.fj-tag.is-on { color: var(--tg-accent-text); background: var(--tg-accent-soft); box-shadow: inset 0 0 0 1.5px var(--tg-accent-solid); }
.fj-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--tg-space-3); }
@media (min-width: 40rem) { .fj-photos { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fj-photo { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: var(--tg-surface); box-shadow: 0 0 0 1px var(--tg-border); }
.fj-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--tg-surface-2); }
.fj-photo figcaption { padding: 0.5rem 0.625rem; font-size: var(--tg-fs-xs); display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.fj-ptag { font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.0625rem 0.375rem; border-radius: 6px; color: var(--tg-neutral-text); background: var(--tg-neutral-soft); }
.fj-ptag.is-before { color: var(--tg-warning-text); background: var(--tg-warning-soft); }
.fj-ptag.is-after { color: var(--tg-success-text); background: var(--tg-success-soft); }
.fj-ptag.is-issue { color: var(--tg-danger-text); background: var(--tg-danger-soft); }
.fj-photo-del { position: absolute; top: 0.375rem; right: 0.375rem; width: 2rem; height: 2rem; display: grid; place-items: center; border: 0; border-radius: 999px; background: rgb(0 0 0 / 0.55); color: #fff; cursor: pointer; }
.fj-photo-del svg { width: 1rem; height: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* Finish */
.fj-todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fj-todo button { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.75rem; padding: 0.625rem 0; border: 0; border-top: 1px solid var(--tg-border-subtle); background: none; font: inherit; text-align: left; color: var(--tg-text); cursor: pointer; }
.fj-todo li:first-child button { border-top: 0; }
.fj-todo svg { width: 1.375rem; height: 1.375rem; color: var(--tg-faint); }
.fj-todo svg.is-ok { color: var(--tg-success); }
.fj-done-card { align-items: center; text-align: center; padding-block: var(--tg-space-6, 1.5rem); }
.fj-done-icon { width: 3rem; height: 3rem; color: var(--tg-success); }
.fj-done-icon.is-wait { color: var(--tg-accent-solid); }
.jb-readings th, .jb-readings td { font-size: var(--tg-fs-xs); }
.jb-val.is-danger { color: var(--tg-danger-text); font-weight: 650; }
.jb-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: var(--tg-space-2); padding: var(--tg-space-3) var(--tg-space-5) var(--tg-space-4); border-top: 1px solid var(--tg-border-subtle); }
.jb-photo { position: relative; display: block; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--tg-border); }
.jb-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.jb-photo .fj-ptag { position: absolute; left: 0.375rem; bottom: 0.375rem; }

/* Field app, round two: the phone's outbox, the lead's own clock, note phrases, readings due, next job */
.fj-sync { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.625rem 0.875rem; border-radius: 12px; font-size: var(--tg-fs-sm); font-weight: 600; }
.fj-sync svg { width: 1.125rem; height: 1.125rem; flex: none; }
.fj-sync.is-offline { color: var(--tg-warning-text); background: var(--tg-warning-soft); box-shadow: inset 0 0 0 1px var(--tg-warning-border); }
.fj-sync.is-saving { color: var(--tg-accent-text); background: var(--tg-accent-soft); }
.fj-sync.is-auth { color: var(--tg-danger-text); background: var(--tg-danger-soft); }
.fj-spin { animation: fj-spin 1s linear infinite; }
@keyframes fj-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fj-spin { animation: none; } }
.fj-clock-note { margin: 0; font-size: var(--tg-fs-sm); color: var(--tg-text-2); }
.fj-phrases { display: flex; flex-wrap: nowrap; gap: 0.375rem; margin: -0.25rem calc(-1 * var(--tg-space-4)) 0; padding: 0 var(--tg-space-4) 0.125rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.fj-phrases::-webkit-scrollbar { display: none; }
.fj-phrase { min-height: 2.25rem; padding: 0.375rem 0.75rem; border: 0; border-radius: 999px; font: inherit; font-size: var(--tg-fs-xs); font-weight: 600; color: var(--tg-text-2); background: var(--tg-surface-2); box-shadow: inset 0 0 0 1px var(--tg-border); cursor: pointer; touch-action: manipulation; text-align: left; flex: none; white-space: nowrap; }
.fj-phrase:active { background: var(--tg-accent-soft); color: var(--tg-accent-text); }
.fj-waiting { color: var(--tg-warning-text); font-weight: 600; }
.fj-due { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border-radius: 10px; font-size: var(--tg-fs-sm); font-weight: 600; color: var(--tg-warning-text); background: var(--tg-warning-soft); }
.fj-due svg { width: 1.125rem; height: 1.125rem; }
.fj-tab em.is-due { color: #fff; background: var(--tg-warning); }
.fj-input.is-bad { border-color: var(--tg-danger); box-shadow: 0 0 0 3px var(--tg-danger-soft); }
.fj-input.is-bad input { color: var(--tg-danger-text); }
.fj-reading-row.is-waiting { box-shadow: 0 0 0 1px var(--tg-warning-border); }
.fj-photo-btns { display: grid; grid-template-columns: 3fr 2fr; gap: 0.5rem; }
.fj-todo-icon { display: inline-flex; }
.fj-next { position: relative; display: flex; flex-direction: column; gap: 0.125rem; text-decoration: none; color: inherit; padding-right: 4.5rem; }
.fj-next-title { font-size: 1rem; font-weight: 650; color: var(--tg-heading); }
.fj-next-go { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 0.125rem; font-size: var(--tg-fs-sm); font-weight: 650; color: var(--tg-accent-text); }
.fj-next-go svg { width: 1rem; height: 1rem; }
.fj-next-map { align-self: flex-start; }

/* The running clock, across the app for the lead; and the day on My jobs */
.tg-run { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 var(--tg-space-4); padding: 0.625rem 0.875rem; border-radius: 12px; text-decoration: none; color: inherit; background: var(--tg-accent-soft); box-shadow: inset 0 0 0 1px var(--tg-accent-border); }
.tg-run.is-standby { background: var(--tg-warning-soft); box-shadow: inset 0 0 0 1px var(--tg-warning-border); }
.tg-run.is-travel { background: var(--tg-surface-2); box-shadow: inset 0 0 0 1px var(--tg-border-strong); }
.tg-run-dot { flex: none; width: 0.625rem; height: 0.625rem; border-radius: 999px; background: var(--tg-accent-solid); box-shadow: 0 0 0 4px var(--tg-accent-soft); animation: tg-pulse 1.6s ease-in-out infinite; }
.tg-run.is-standby .tg-run-dot { background: var(--tg-warning); }
.tg-run.is-travel .tg-run-dot { background: var(--tg-text-2); }
@keyframes tg-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .tg-run-dot { animation: none; } }
.tg-run-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tg-run-text b { font-size: var(--tg-fs-sm); color: var(--tg-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-run-time { font-size: 1.125rem; font-weight: 700; color: var(--tg-heading); font-variant-numeric: tabular-nums; }
.tg-run-go { font-size: var(--tg-fs-sm); font-weight: 650; color: var(--tg-accent-text); }
.tg-outbox { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 var(--tg-space-4); padding: 0.5rem 0.875rem; border-radius: 12px; font-size: var(--tg-fs-sm); font-weight: 600; color: var(--tg-warning-text); background: var(--tg-warning-soft); }
.tg-outbox svg { width: 1.125rem; height: 1.125rem; }
.mj-day { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.mj-day > div { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.625rem 0.75rem; border-radius: 12px; background: var(--tg-surface); box-shadow: 0 0 0 1px var(--tg-border); }
.mj-day dt { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--tg-text-2); }
.mj-day dd { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--tg-heading); font-variant-numeric: tabular-nums; }
.tk-clock { padding: var(--tg-space-3) var(--tg-space-5) 0; }
.tk-hint.is-clock { width: 100%; justify-content: flex-start; min-height: 2.75rem; color: var(--tg-accent-text); background: var(--tg-accent-soft); box-shadow: inset 0 0 0 1px var(--tg-accent-border); text-align: left; }

/* Lab: desk rows, the sample page, checks, files, comparisons, limit versions */
.lb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--tg-space-4); align-items: center; padding: 0.75rem var(--tg-space-5); border-top: 1px solid var(--tg-border-subtle); text-decoration: none; color: inherit; }
.lb-row:first-child { border-top: 0; }
.lb-row.is-action, .lb-row.is-compact { grid-template-columns: minmax(0, 1fr) auto; }
.lb-row.is-compact:has(.lb-days) { grid-template-columns: minmax(0, 1fr) auto auto; }
a.lb-row:hover .tg-strong, .lb-main:hover .tg-strong { color: var(--tg-accent-text); }
.lb-main { display: flex; flex-direction: column; gap: 0.1875rem; min-width: 0; text-decoration: none; color: inherit; }
.lb-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: var(--tg-fs-sm); }
.lb-point { font-size: 0.6875rem; font-weight: 650; letter-spacing: 0.03em; text-transform: uppercase; color: var(--tg-text-2); padding: 0.0625rem 0.375rem; border-radius: 6px; background: var(--tg-surface-3); }
.lb-detail { color: var(--tg-text); max-width: 52rem; }
.tg-more { display: flex; flex-direction: column; align-items: flex-start; gap: 0.125rem; }
.tg-more-btn { padding: 0; background: none; border: 0; cursor: pointer; }
.lb-checksum { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.375rem; }
.lb-act { display: flex; align-items: center; gap: 0.375rem; justify-content: flex-end; flex-wrap: wrap; }
.lb-bad { color: var(--tg-danger-text); font-weight: 600; }
.lb-days { font-size: var(--tg-fs-sm); font-weight: 650; font-variant-numeric: tabular-nums; color: var(--tg-text-2); }
.lb-days.is-late { color: var(--tg-danger-text); }
@media (max-width: 47.99rem) {
    .lb-row, .lb-row.is-action, .lb-row.is-compact, .lb-row.is-compact:has(.lb-days) { grid-template-columns: minmax(0, 1fr); gap: var(--tg-space-2); }
    .lb-checksum, .lb-act { justify-content: flex-start; }
}
.lb-hero { display: grid; gap: var(--tg-space-5); grid-template-columns: minmax(0, 1fr); padding: var(--tg-space-5); }
@media (min-width: 64rem) { .lb-hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.lb-hero-main { display: flex; flex-direction: column; gap: var(--tg-space-2); }
.lb-hero-top { display: flex; align-items: center; gap: var(--tg-space-3); flex-wrap: wrap; }
.lb-grade { display: inline-flex; align-items: center; gap: 0.5rem; font-size: var(--tg-fs-xl); font-weight: 650; color: var(--tg-heading); letter-spacing: -0.01em; }
.lb-grade em { font-style: normal; font-size: var(--tg-fs-xs); font-weight: 600; color: var(--tg-warning-text); background: var(--tg-warning-soft); padding: 0.0625rem 0.4375rem; border-radius: 999px; letter-spacing: 0; }
.lb-wait { margin: 0; padding: 0.625rem 0.75rem; border-radius: 10px; background: var(--tg-warning-soft); color: var(--tg-warning-text); }
.lb-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.625rem; }
.lb-steps li { position: relative; display: flex; flex-direction: column; padding-left: 1.5rem; font-size: var(--tg-fs-sm); }
.lb-steps li::before { content: ""; position: absolute; left: 0; top: 0.25rem; width: 0.75rem; height: 0.75rem; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--tg-border-strong); background: var(--tg-surface); }
.lb-steps li.is-done::before { background: var(--tg-success); box-shadow: none; }
.lb-steps li.is-bad::before { background: var(--tg-danger); box-shadow: none; }
.lb-steps li span { color: var(--tg-text-2); font-size: var(--tg-fs-xs); }
.lb-note { margin: 0; padding: 0.75rem var(--tg-space-5); border-top: 1px solid var(--tg-border-subtle); font-size: var(--tg-fs-sm); color: var(--tg-text); }
.lb-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.lb-check { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); gap: 0.125rem 0.5rem; align-items: start; font-size: var(--tg-fs-sm); }
.lb-check svg { width: 1.125rem; height: 1.125rem; margin-top: 0.0625rem; grid-row: span 2; }
.lb-check span { grid-column: 2; color: var(--tg-text-2); font-size: var(--tg-fs-xs); }
.lb-checks:not(:has(svg)) .lb-check { grid-template-columns: minmax(0, 1fr); padding-left: 0.75rem; box-shadow: inset 3px 0 0 var(--tg-border-strong); }
.lb-checks:not(:has(svg)) .lb-check span { grid-column: 1; }
.lb-check.is-pass svg { color: var(--tg-success); }
.lb-check.is-warn svg { color: var(--tg-warning); }
.lb-check.is-fail svg { color: var(--tg-danger); }
.lb-checks:not(:has(svg)) .lb-check.is-pass { box-shadow: inset 3px 0 0 var(--tg-success); }
.lb-checks:not(:has(svg)) .lb-check.is-warn { box-shadow: inset 3px 0 0 var(--tg-warning); }
.lb-checks:not(:has(svg)) .lb-check.is-fail { box-shadow: inset 3px 0 0 var(--tg-danger); }
.lb-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.lb-files li { display: flex; align-items: center; gap: 0.625rem; }
.lb-files li > svg { width: 1.375rem; height: 1.375rem; color: var(--tg-text-2); flex: none; }
.lb-file { display: flex; flex-direction: column; min-width: 0; flex: 1; text-decoration: none; color: inherit; }
.lb-file:hover .tg-strong { color: var(--tg-accent-text); }
.lb-hash { font-family: ui-monospace, monospace; }
.lb-upload { display: flex; gap: 0.5rem; align-items: center; margin-top: var(--tg-space-3); flex-wrap: wrap; }
.lb-drop { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.5rem; padding: 0 0.875rem; border-radius: var(--tg-radius-md); font-size: var(--tg-fs-sm); font-weight: 600; color: var(--tg-accent-text); background: var(--tg-accent-soft); box-shadow: inset 0 0 0 1px var(--tg-accent-border); cursor: pointer; }
.lb-drop svg { width: 1rem; height: 1rem; }
.lb-compare th .lb-th-sub { display: block; font-weight: 450; font-size: var(--tg-fs-xs); color: var(--tg-muted); }
.lb-delta { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--tg-text-2); }
.lb-delta small { font-weight: 500; }
.lb-delta.is-good { color: var(--tg-success-text); }
.lb-delta.is-bad { color: var(--tg-danger-text); }
.lb-into { margin-left: 0.375rem; color: var(--tg-success); font-weight: 700; }
.lb-version { display: flex; flex-direction: column; gap: 0.375rem; padding: 0.875rem var(--tg-space-5); border-top: 1px solid var(--tg-border-subtle); }
.lb-version:first-child { border-top: 0; }
.lb-version p { margin: 0; color: var(--tg-text); }
.lb-version-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.lb-diff { margin: 0.125rem 0 0; padding-left: 1rem; font-size: var(--tg-fs-sm); color: var(--tg-text-2); display: flex; flex-direction: column; gap: 0.25rem; }
.lb-diff b { color: var(--tg-heading); font-weight: 600; }
.lb-arrow { color: var(--tg-muted); }
.lb-struck { text-decoration: line-through; color: var(--tg-faint); }
.lb-pdf { display: inline-grid; place-items: center; color: var(--tg-text-2); }
.lb-pdf svg { width: 1.125rem; height: 1.125rem; }
.lb-pdf:hover { color: var(--tg-accent-text); }
.lb-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem; padding: 0.75rem var(--tg-space-5); }
.cp-sub { margin: -0.25rem 0 0.5rem; }
/* Recommendations sit in the page as a hairline list, not a box inside the box. */
.cp-recs { border-top: 1px solid var(--tg-border); border-bottom: 1px solid var(--tg-border); }
.cp-recs .lb-row { padding-inline: 0; }
.fj-tags.is-3 { grid-template-columns: repeat(3, 1fr); }
.fj-bottle { font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important; font-size: 1.125rem !important; font-weight: 650 !important; letter-spacing: 0.03em; }
.fj-bottles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.fj-bottles:empty { display: none; }
.fj-bottles li { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.5rem 0.625rem; border-radius: 10px; background: var(--tg-surface-2); font-size: var(--tg-fs-sm); font-family: inherit; }

/* ---------- Phone-only cell lines: tables hide secondary columns below md, the key cell carries them ---------- */
@media (min-width: 48rem) { .tg-below-md { display: none !important; } }
@media (max-width: 47.99rem) {
    /* Phones: cell text wraps so the status column stays on screen instead of scrolling sideways. */
    .fi-ta-cell .fi-ta-text, .fi-ta-cell .fi-ta-text-item, .fi-ta-cell .fi-ta-text-item-label, .fi-ta-cell .fi-ta-text-description { white-space: normal; }
    .fi-ta-cell .jb-cell > span { overflow-wrap: break-word; }
    /* The key cell takes the spare width; status stays on one line. */
    .fi-ta-table .fi-ta-cell:has(.jb-cell) { width: 100%; }
    .fi-ta-cell .tg-status { white-space: nowrap; }
}
@media (max-width: 39.99rem) {
    /* Bulk selection is a desk task; phones get the full row width back. */
    .fi-ta-table .fi-ta-selection-cell { display: none; }
    /* Row actions keep their icon and accessible name; the visible label goes. */
    .fi-ta-row .fi-ta-actions .fi-link { font-size: 0; gap: 0; min-width: 2rem; min-height: 2rem; justify-content: center; }
}

/* ---------- Row buttons in lab lists are secondary: the page header keeps the one filled button ---------- */
.lb-act .fi-btn.fi-color:not(.fi-outlined), .dark .lb-act .fi-btn.fi-color:not(.fi-outlined) {
    background: var(--tg-surface); color: var(--tg-text); box-shadow: inset 0 0 0 1px var(--tg-border-strong);
}
.lb-act .fi-btn.fi-color:not(.fi-outlined):not(.fi-disabled):not([disabled]):hover { background: var(--tg-surface-2); }
.lb-act .fi-btn.fi-color:not(.fi-outlined) .fi-icon { color: var(--tg-muted); }
.lb-act .fi-btn.fi-color-success:not(.fi-outlined) .fi-icon { color: var(--tg-success); }
.lb-act .fi-btn.fi-color-primary:not(.fi-outlined) .fi-icon { color: var(--tg-accent-solid); }

/* The invoice reference number joins the sync chips only on wide screens; the chips carry it as a tooltip. */
@media (max-width: 95.99rem) { .iv-sync-ref { display: none; } }

/* Phones: a waiting ticket or quote reads full width, with its amount and Review on the line below. */
@media (max-width: 39.99rem) {
    .cp-row { flex-wrap: wrap; row-gap: var(--tg-space-2); }
    .cp-row > .ca-grow { flex-basis: 100%; }
    .cp-row > .tg-strong { margin-left: auto; }
}

/* ---------- Schedule on a phone: one list of days instead of the sideways board ---------- */
.sc-days { display: none; }
@media (max-width: 47.99rem) {
    .sc-board { display: none; }
    .sc-days { display: block; }
}
.sc-days-day { padding: 0.75rem 1rem; border-top: 1px solid var(--tg-border-subtle); }
.sc-days-day:first-child { border-top: 0; }
.sc-days-day.is-today { background: var(--tg-accent-soft); }
.sc-days-head { display: flex; align-items: baseline; gap: 0.375rem; margin: 0 0 0.375rem; }
.sc-days-day.is-today .sc-date { color: var(--tg-accent-text); }
.sc-days-job { display: flex; align-items: center; justify-content: space-between; gap: var(--tg-space-3); padding: 0.5rem 0; border-top: 1px solid var(--tg-border-subtle); text-decoration: none; color: inherit; }
.sc-days-head + .sc-days-job { border-top: 0; }
.sc-days-lead { flex: none; text-align: right; }
.sc-days-open { margin: 0; }

/* ---------- Minimal layer, screens ---------- */
.tg-plain-btn { padding: 0; background: none; border: 0; cursor: pointer; }
.is-fold .ov-growth { background: none; box-shadow: none; padding: 0; }
.un-hero { grid-template-columns: minmax(0, 1fr) !important; padding: var(--tg-space-6); }
.un-specs.is-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--tg-space-4) var(--tg-space-6); }
.lb-picker { background: transparent; padding-inline: 0; }
.tk-row .tk-uom, .tk-uom, .lb-point { font-size: var(--tg-fs-xs); }

/* Phones: the result's colour carries the grade; the words stay for screen readers. */
@media (max-width: 39.99rem) {
    .lb-results th:last-child, .lb-results td:last-child { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .lb-results td { white-space: nowrap; }
}

/* ---------- Lab desk: four queues as tabs, the count is the tab ---------- */
.lb-desk { display: flex; flex-direction: column; gap: var(--tg-space-5); }
.lb-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--tg-space-2); }
.lb-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 0.125rem; padding: var(--tg-space-4) var(--tg-space-5); min-height: 2.75rem; border: 0; border-radius: 0.875rem; background: transparent; color: var(--tg-muted); font: inherit; text-align: left; cursor: pointer; transition: background var(--tg-dur) var(--tg-ease); }
.lb-tab:hover { background: var(--tg-surface-3); }
.lb-tab.is-on { background: var(--tg-surface); color: var(--tg-heading); }
.lb-tab-n { font-size: 1.75rem; font-weight: 550; letter-spacing: -0.025em; line-height: 2rem; font-variant-numeric: tabular-nums; color: var(--tg-heading); }
.lb-tab-n.is-late { color: var(--tg-danger-text); }
.lb-tab-label { font-size: var(--tg-fs-sm); }
.lb-panel-note { margin: 0; padding: 0.75rem var(--tg-space-5); border-top: 1px solid var(--tg-border-subtle); font-size: var(--tg-fs-xs); color: var(--tg-muted); }
@media (max-width: 39.99rem) {
    .lb-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lb-tab { padding: var(--tg-space-3) var(--tg-space-4); }
    .lb-tab-n { font-size: 1.375rem; line-height: 1.75rem; }
}

/* Round two: fewer columns of text per row. */
.ov-job { grid-template-columns: 4.25rem minmax(0, 1fr) auto; }
/* An empty ticket note waits out of sight until the line is hovered or focused; touch screens always show it. */
@media (hover: hover) {
    .tk-note:placeholder-shown { opacity: 0; height: 0.25rem; transition: opacity var(--tg-dur) var(--tg-ease); }
    .tk-line:hover .tk-note:placeholder-shown, .tk-line:focus-within .tk-note:placeholder-shown { opacity: 1; height: auto; }
}
@media (max-width: 47.99rem) { .tg-md-up { display: none; } }

/* Parts order: where it stands, three steps down the side. */
.pt-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--tg-space-3); }
.pt-steps li { position: relative; display: grid; grid-template-columns: 1rem 1fr; column-gap: var(--tg-space-3); row-gap: 0.125rem; }
.pt-steps li > .tg-small, .pt-steps li > .tg-xs { grid-column: 2; }
.pt-dot { grid-row: 1 / span 2; width: 0.625rem; height: 0.625rem; margin-top: 0.3rem; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--tg-border-strong); background: var(--tg-surface); }
.pt-steps li.is-done .pt-dot { background: var(--tg-accent); box-shadow: none; }
.pt-steps li:not(:last-child)::after { content: ""; position: absolute; left: 0.28rem; top: 1.15rem; bottom: calc(-1 * var(--tg-space-3) + 0.15rem); width: 1px; background: var(--tg-border); }
.pt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--tg-space-3); }

/* Field forms: each checklist as a small card, items listed in order. */
.ff-grid { display: grid; gap: var(--tg-space-4); grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.ff-card { display: flex; flex-direction: column; gap: 0.25rem; padding: var(--tg-space-4); border-radius: var(--tg-radius-md); box-shadow: inset 0 0 0 1px var(--tg-border); }
.ff-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--tg-space-2); }
.ff-items { margin: var(--tg-space-2) 0 0; padding-left: 1.1rem; display: grid; gap: 0.25rem; color: var(--tg-text); }
.ff-items li::marker { color: var(--tg-muted); font-size: 0.75em; }
@media (max-width: 64rem) { .ff-hint-col { display: none; } }

/* ---- Lines of work, distillation, the owner's dashboards ------------------------------------------------------- */
.jb-line { margin-left: 0.375rem; font-size: var(--tg-fs-xs); font-weight: 500; color: var(--tg-muted); }
.jb-kv-edit { margin-left: 0.375rem; }

.dz-actions { display: flex; gap: var(--tg-space-2); align-items: center; }
.dz-empty { padding: var(--tg-space-4) var(--tg-space-6) var(--tg-space-5); }
.dz-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--tg-space-4); margin: 0; padding: var(--tg-space-2) var(--tg-space-6) var(--tg-space-4); }
.dz-facts dt { font-size: var(--tg-fs-xs); color: var(--tg-muted); }
.dz-facts dd { margin: 0.125rem 0 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--tg-heading); }
.dz-facts dd small { font-size: var(--tg-fs-xs); font-weight: 500; color: var(--tg-muted); }
.dz-late { margin: 0 var(--tg-space-6) var(--tg-space-3); font-size: var(--tg-fs-sm); font-weight: 500; color: var(--tg-danger-text); }
.dz-table small { font-size: var(--tg-fs-xs); color: var(--tg-muted); }
.dz-table td { vertical-align: top; }
.dz-del { width: 2.5rem; text-align: right; }
.dz-del .tg-plain-btn { color: var(--tg-faint); }
.dz-del .tg-plain-btn:hover { color: var(--tg-danger-text); }
.dz-del svg { width: 1rem; height: 1rem; }
.dz-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--tg-space-2); padding: var(--tg-space-3) var(--tg-space-6) var(--tg-space-4); border-top: 1px solid var(--tg-border-subtle); }
.dz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: var(--tg-space-4); }
.dz-unit { display: flex; flex-direction: column; gap: 0.25rem; padding: var(--tg-space-4) var(--tg-space-5); border-radius: var(--tg-radius-lg); background: var(--tg-surface-2); color: inherit; text-decoration: none; transition: background var(--tg-dur) var(--tg-ease); }
.dz-unit:hover { background: var(--tg-surface-3); }
.dz-unit-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--tg-space-2); }
.dz-unit-name { font-size: 1.0625rem; font-weight: 700; color: var(--tg-heading); letter-spacing: -0.01em; }
.dz-unit-where { font-size: var(--tg-fs-sm); font-weight: 500; color: var(--tg-text); }
.dz-unit-rate { margin: var(--tg-space-2) 0 var(--tg-space-1); }
.dz-unit-rate b { font-size: 1.75rem; font-weight: 650; letter-spacing: -0.025em; color: var(--tg-accent); }
.dz-unit-rate small { font-size: var(--tg-fs-xs); color: var(--tg-muted); }
.dz-unit-row { display: flex; justify-content: space-between; gap: var(--tg-space-2); font-size: var(--tg-fs-sm); color: var(--tg-muted); }
.dz-unit-row b { font-weight: 600; color: var(--tg-text); }
.dz-unit-last { margin-top: var(--tg-space-2); font-size: var(--tg-fs-xs); color: var(--tg-muted); }
.dz-unit-last.is-late { color: var(--tg-danger-text); font-weight: 600; }
.dz-phone .dz-rate { margin: 0; color: var(--tg-accent-text); font-weight: 600; }
.dz-pending { margin: 0; }
@media (max-width: 47.99rem) {
    .dz-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: var(--tg-space-4); }
    .dz-empty, .dz-foot { padding-inline: var(--tg-space-4); }
}

.rv-scope { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tg-space-3); }
.rv-pick select { min-width: 9rem; }
.rv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rv-kpis.is-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 63.99rem) { .rv-kpis, .rv-kpis.is-four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rv-lines { display: flex; flex-direction: column; gap: var(--tg-space-4); }
.rv-line { display: flex; flex-direction: column; gap: 0.375rem; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.rv-line-head { display: flex; justify-content: space-between; gap: var(--tg-space-3); font-size: var(--tg-fs-md); }
.rv-line-track { height: 0.5rem; border-radius: 999px; background: var(--tg-surface-3); overflow: hidden; }
.rv-line-fill { display: block; height: 100%; border-radius: 999px; background: var(--tg-accent); }
.rv-line:hover .rv-line-head .tg-strong { color: var(--tg-accent-text); }
.rv-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--tg-space-4) var(--tg-space-5); margin: 0; }
.rv-stages dt { font-size: var(--tg-fs-xs); color: var(--tg-muted); }
.rv-stages dd { margin: 0.125rem 0 0; font-size: 1.375rem; font-weight: 600; color: var(--tg-heading); letter-spacing: -0.02em; }
.rv-matrix-wrap { padding: 0 var(--tg-space-4) var(--tg-space-4); overflow-x: auto; }
.rv-matrix { width: 100%; }
.rv-matrix td { text-align: center; padding: 0.4375rem 0.25rem; border-radius: 6px; min-width: 2.5rem; }
.rv-matrix td.tg-heat-0 { background: var(--tg-surface-2); }
.rv-due { flex: none; color: var(--tg-muted); white-space: nowrap; }
.rv-due.is-late { color: var(--tg-danger-text); font-weight: 600; }
.rv-rank { list-style: none; margin: 0; padding: 0 var(--tg-space-6) var(--tg-space-5); display: flex; flex-direction: column; gap: var(--tg-space-3); }
.rv-rank li { display: flex; flex-direction: column; gap: 0.25rem; }
.rv-rank-head { display: flex; justify-content: space-between; gap: var(--tg-space-3); font-size: var(--tg-fs-sm); }
.rv-rank-bar { display: block; height: 2px; border-radius: 2px; background: var(--tg-border-strong); }
.rv-rank li:first-child .rv-rank-bar { background: var(--tg-heading); }
/* Dashboards: rows carry a trailing figure or date instead of a chevron; panels keep their own height. */
.rv-cols { align-items: start; }
.ov-cols.rv-cols > .tg-section { display: block; }
.ov-cols.rv-cols .tg-list { display: block; }
.rv .ov-att { grid-template-columns: 0.5rem minmax(0, 1fr) auto; }

/* ---- Pumps: the shop board (Needs repair, Repair started, Ready, going out), prices by size, the pump page. ---- */
.tg-link-plain { color: inherit; text-decoration: none; }
.tg-link-plain:hover { text-decoration: underline; text-underline-offset: 2px; }
.pm-kpis, .cr-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cr-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 90rem) { .cr-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 47.99rem) { .cr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cr-tl-more { align-self: flex-start; margin-top: var(--tg-space-2); background: none; border: 0; padding: 0; cursor: pointer; }
@media (max-width: 63.99rem) { .pm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pm-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--tg-space-4); align-items: start; }
@media (max-width: 63.99rem) { .pm-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 39.99rem) { .pm-board { grid-template-columns: minmax(0, 1fr); } }
.pm-col { display: flex; flex-direction: column; gap: var(--tg-space-3); padding: var(--tg-space-4); border-radius: var(--tl-panel, 1.25rem); background: var(--tg-surface); min-height: 9rem; }
.pm-col-head { display: flex; align-items: center; gap: 0.5rem; font-size: var(--tg-fs-sm); font-weight: 650; color: var(--tg-heading); }
.pm-col-title { flex: 1; min-width: 0; }
.pm-count { min-width: 1.5rem; padding: 0 0.4375rem; border-radius: 999px; background: var(--tg-surface-2); color: var(--tg-text-2); font-size: var(--tg-fs-xs); font-weight: 600; text-align: center; line-height: 1.375rem; }
.pm-col.is-success .pm-count { background: var(--tg-success-soft); color: var(--tg-success-text); }
.pm-col.is-accent .pm-count { background: var(--tg-accent-soft); color: var(--tg-accent-text); }
.pm-col.is-danger .pm-count { background: var(--tg-danger-soft); color: var(--tg-danger-text); }
.pm-cards { display: flex; flex-direction: column; gap: var(--tg-space-2); }
.pm-card { display: flex; flex-direction: column; gap: 0.1875rem; padding: 0.625rem 0.75rem; border-radius: var(--tl-inner, 0.75rem); background: var(--tg-surface-2); color: inherit; text-decoration: none; transition: background var(--tg-dur) var(--tg-ease); }
.pm-card:hover { background: var(--tg-surface-3); }
.pm-card.is-late { box-shadow: inset 3px 0 0 var(--tg-warning); }
.pm-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; font-size: var(--tg-fs-sm); }
.pm-size { font-size: var(--tg-fs-xs); font-weight: 600; color: var(--tg-accent-text); background: var(--tg-accent-soft); border-radius: 999px; padding: 0 0.5rem; line-height: 1.25rem; white-space: nowrap; }
.pm-card-meta { font-size: var(--tg-fs-xs); color: var(--tg-muted); }
.pm-card-note { font-size: var(--tg-fs-xs); color: var(--tg-text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pm-empty { font-size: var(--tg-fs-xs); color: var(--tg-faint); padding: 0.25rem 0.125rem; }
.pm-more { padding: 0 0.25rem; }
.pm-sizes td, .pm-sizes th { white-space: nowrap; }

/* The pump exchange on a Pumps job: going out, the price, coming back. */
.px-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--tg-space-4); }
@media (max-width: 47.99rem) { .px-flow { grid-template-columns: minmax(0, 1fr); } }
.px-step { display: flex; flex-direction: column; gap: 0.1875rem; padding: var(--tg-space-3) var(--tg-space-4); border-radius: var(--tl-inner, 0.75rem); background: var(--tg-surface-2); min-width: 0; }
.px-step + .px-step { position: relative; }
.px-label { font-size: var(--tg-fs-xs); color: var(--tg-muted); }
.px-value { font-size: 1.0625rem; font-weight: 650; color: var(--tg-heading); letter-spacing: -0.01em; }
.px-step .fi-link, .px-step .fi-btn { margin-left: 0.25rem; }

/* What a distillation run bills, beside its meters. */
.dz-facts { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 71.99rem) { .dz-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dz-bill dt { display: flex; align-items: center; gap: 0.25rem; }
.dz-bill dd { color: var(--tg-accent-text); }
.dz-bill dd .tg-xs { font-size: var(--tg-fs-xs); font-weight: 500; letter-spacing: 0; color: var(--tg-muted); }
.dz-unit-row.is-bill b { color: var(--tg-accent-text); }

/* ---- Customers: the customer page (head, figures, next steps, timeline, what is open) and the activity log. ---- */
.cr-head { display: flex; align-items: center; gap: var(--tg-space-4); }
.cr-head-text { display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; }
.cr-head-text .tg-xs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.cr-code { font-size: 0.8125rem; letter-spacing: 0.02em; }
.cr-layout { display: grid; gap: var(--tg-space-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 72rem) { .cr-layout { grid-template-columns: minmax(0, 1fr) 24rem; } }
.cr-pad { padding: var(--tg-space-3) var(--tg-space-5) var(--tg-space-4); }
.cr-follow { grid-template-columns: 0.5rem minmax(0, 1fr) auto; }
.cr-follow-end { display: flex; align-items: center; gap: var(--tg-space-3); }
.cr-follow button.tg-link { background: none; border: 0; padding: 0; cursor: pointer; }
.cr-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cr-tl { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: var(--tg-space-3); padding: 0.625rem 0; position: relative; }
.cr-tl + .cr-tl::before { content: ""; position: absolute; left: 1rem; top: -0.625rem; height: 1.25rem; border-left: 1px solid var(--tg-border); }
.cr-tl-icon { width: 2rem; height: 2rem; border-radius: 999px; display: grid; place-items: center; background: var(--tg-surface-2); color: var(--tg-muted); position: relative; z-index: 1; }
.cr-tl-icon svg { width: 1rem; height: 1rem; }
.cr-tl-icon.is-accent { background: var(--tg-accent-soft); color: var(--tg-accent-text); }
.cr-tl-icon.is-info { background: var(--tg-info-soft); color: var(--tg-info-text); }
.cr-tl-icon.is-warning { background: var(--tg-warning-soft); color: var(--tg-warning-text); }
.cr-tl-body { min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; padding-top: 0.3125rem; }
.cr-tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--tg-space-3); font-size: var(--tg-fs-sm); }
.cr-touches { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--tg-space-4); }
.cr-touch { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: var(--tg-space-3); }
.cr-touch-icon { width: 1.75rem; height: 1.75rem; border-radius: 999px; display: grid; place-items: center; background: var(--tg-accent-soft); color: var(--tg-accent-text); }
.cr-touch-icon svg { width: 0.9375rem; height: 0.9375rem; }
.cr-touch-body { min-width: 0; display: flex; flex-direction: column; gap: 0.1875rem; }
.cr-touch-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem var(--tg-space-3); font-size: var(--tg-fs-sm); }
.cr-touch-text { margin: 0; font-size: var(--tg-fs-sm); color: var(--tg-text); white-space: pre-line; }
.cr-next { display: inline-flex; align-items: center; gap: 0.375rem; align-self: flex-start; margin-top: 0.125rem; padding: 0.125rem 0.625rem; border-radius: 999px; background: var(--tg-surface-2); font-size: var(--tg-fs-xs); color: var(--tg-text-2); }
.cr-next svg { width: 0.875rem; height: 0.875rem; }
.cr-next.is-due { background: var(--tg-warning-soft); color: var(--tg-warning-text); font-weight: 600; }
.cr-next.is-done { color: var(--tg-muted); text-decoration: line-through; text-decoration-color: var(--tg-faint); }
.rv-rank-bar.is-muted, .rv-rank li:first-child .rv-rank-bar.is-muted { background: var(--tg-warning); }
.cr-group { display: flex; justify-content: space-between; gap: var(--tg-space-3); padding: 0.625rem var(--tg-space-5) 0.375rem; font-size: var(--tg-fs-xs); font-weight: 600; color: var(--tg-muted); border-top: 1px solid var(--tg-border-subtle); }
.cr-group:first-child { border-top: 0; padding-top: 0.25rem; }
@media (max-width: 47.99rem) { .tg-above-md { display: none !important; } }

/* Today queue: section filter chips above the list, and the section each line belongs to. */
.ov-areas { padding: var(--tg-space-3) var(--tg-space-5); border-bottom: 1px solid var(--tg-border-subtle); }
.ov-attention .ov-att { grid-template-columns: 0.5rem minmax(0, 1fr) auto 1rem; }
.ov-areas + .ov-att { border-top: 0; }
.ov-att-area { white-space: nowrap; }
@media (max-width: 640px) { .ov-att-area { display: none; } .ov-attention .ov-att { grid-template-columns: 0.5rem minmax(0, 1fr) 1rem; } }
.ov-cols { align-items: start; }

/* Customer page (ViewCustomer): a profile card with badges and labelled facts, the KPIs, then one tab at a time. */
.cv { gap: var(--tg-space-5); }
.cv-profile { display: flex; align-items: flex-start; gap: var(--tg-space-5); padding: var(--tg-space-5) var(--tg-space-6); background: var(--tg-surface); border-radius: var(--tl-panel, var(--tg-radius-xl)); }
.cv-code { width: 3rem; height: 3rem; font-size: 0.875rem; letter-spacing: 0.03em; flex: none; border-radius: var(--tg-radius-md); }
.cv-profile-main { display: flex; flex-direction: column; gap: var(--tg-space-4); min-width: 0; flex: 1; }
.cv-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.cv-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr)); gap: var(--tg-space-4) var(--tg-space-6); margin: 0; }
.cv-facts > div { display: flex; flex-direction: column; gap: 0.1875rem; min-width: 0; }
.cv-facts dt { font-size: var(--tg-fs-2xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--tg-faint); }
.cv-facts dd { margin: 0; font-size: var(--tg-fs-sm); font-weight: 500; color: var(--tg-heading); line-height: 1.35; overflow-wrap: anywhere; }
.cv-fact-sub { display: block; margin-top: 0.125rem; font-size: var(--tg-fs-xs); font-weight: 450; color: var(--tg-muted); }
a.cv-fact-sub { color: var(--tg-accent-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-hold p { margin: 0; }
@media (max-width: 40rem) {
    .cv-profile { flex-direction: column; gap: var(--tg-space-3); padding: var(--tg-space-4); }
    .cv-code { width: 2.5rem; height: 2.5rem; }
    .cv-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--tg-space-3) var(--tg-space-4); }
    .cv-row { flex-wrap: wrap; row-gap: var(--tg-space-2); }
}

.cv-tabs-wrap { display: flex; flex-direction: column; gap: var(--tg-space-4); }
.cv-tabbar { display: flex; align-items: center; justify-content: space-between; gap: var(--tg-space-3); flex-wrap: wrap; }
.cv-tabs .tg-seg-item { padding-inline: 0.875rem; min-height: 2.125rem; font-size: var(--tg-fs-sm); }
.cv-record-link { display: inline-flex; align-items: center; gap: 0.375rem; }
.cv-record-link svg { width: 1rem; height: 1rem; }
.cv-panel { display: flex; flex-direction: column; gap: var(--tg-space-5); }
.cv-grid { display: grid; gap: var(--tg-space-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 64rem) { .cv-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .cv-grid.is-wide { grid-template-columns: minmax(0, 1.6fr) minmax(20rem, 1fr); } }

/* On the customer page a state reads as a tinted pill (the list's contract pills, Pill::html), never bare text. */
.cv .tg-badge:is(.is-accent, .is-primary, .is-success, .is-warning, .is-danger, .is-info) { padding-inline: 0.5rem; border-radius: 999px; font-weight: 500; }
.cv .tg-badge.is-success { color: var(--tg-success-text); background: var(--tg-success-soft); box-shadow: inset 0 0 0 1px var(--tg-success-border); }
.cv .tg-badge.is-warning { color: var(--tg-warning-text); background: var(--tg-warning-soft); box-shadow: inset 0 0 0 1px var(--tg-warning-border); }
.cv .tg-badge.is-danger { color: var(--tg-danger-text); background: var(--tg-danger-soft); box-shadow: inset 0 0 0 1px var(--tg-danger-border); }
.cv .tg-badge.is-info { color: var(--tg-info-text); background: var(--tg-info-soft); box-shadow: inset 0 0 0 1px var(--tg-info-border); }
.cv .tg-badge:is(.is-accent, .is-primary) { color: var(--tg-brand-text, var(--tg-accent-text)); background: var(--tg-brand-soft, var(--tg-accent-soft)); box-shadow: inset 0 0 0 1px var(--tg-brand-border, var(--tg-accent-border)); }
.cv .tg-badge:not(:is(.is-accent, .is-primary, .is-success, .is-warning, .is-danger, .is-info, .is-outline, .is-solid)) { padding-inline: 0.5rem; border-radius: 999px; }

/* Rows: the title and one quiet line, the state as a badge at the end. */
.cv-row { display: flex; align-items: center; justify-content: space-between; gap: var(--tg-space-4); padding: 0.75rem var(--tg-space-5); border-top: 1px solid var(--tg-border-subtle); }
.tg-list > .cv-row:first-child { border-top: 0; }
.cv-row-main { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.cv-row-title { font-size: var(--tg-fs-sm); font-weight: 550; color: var(--tg-heading); }
.cv-row-meta { font-size: var(--tg-fs-xs); color: var(--tg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-row-end { display: flex; align-items: center; gap: var(--tg-space-2); flex: none; }
.cv-done { display: inline-flex; align-items: center; gap: 0.25rem; height: 1.625rem; padding: 0 0.5rem; border: 0; border-radius: var(--tg-radius-sm); background: none; font: inherit; font-size: var(--tg-fs-xs); font-weight: 550; color: var(--tg-text-2); cursor: pointer; box-shadow: inset 0 0 0 1px var(--tg-border); }
.cv-done svg { width: 0.875rem; height: 0.875rem; }
.cv-done:hover { color: var(--tg-success-text); background: var(--tg-success-soft); box-shadow: inset 0 0 0 1px var(--tg-success-border); }
.ov-att.cv-item { grid-template-columns: 2rem minmax(0, 1fr) auto; padding-block: 0.75rem; }
.cv-item-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.cv-item-badge { justify-self: end; white-space: nowrap; }
@media (max-width: 30rem) { .cv-item-badge { display: none; } .ov-att.cv-item { grid-template-columns: 2rem minmax(0, 1fr); } }

/* The timeline reads lighter: regular-weight titles, the date at the end. */
.cr-tl-title { font-weight: 500; color: var(--tg-heading); }
.cv-search { display: flex; gap: var(--tg-space-2); }
.cv-search .tg-search { flex: 1; min-width: 0; }
.cv-search .tg-input { width: 100%; }
.cv-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.cv-year-lines { display: flex; flex-wrap: wrap; gap: 0 0.625rem; font-size: var(--tg-fs-xs); color: var(--tg-muted); }

/* Sites and units: each station as a header, its units as tiles beneath. */
.cu-sites { display: flex; flex-direction: column; }
.cu-site-block { padding: var(--tg-space-4) var(--tg-space-5); border-top: 1px solid var(--tg-border-subtle); }
.cu-site-block:first-child { border-top: 0; }
.cu-site { display: flex; align-items: center; justify-content: space-between; gap: var(--tg-space-3); }
.cu-site-ic { width: 2rem; height: 2rem; border-radius: var(--tg-radius-md); display: grid; place-items: center; flex: none; background: var(--tg-surface-3); color: var(--tg-text-2); }
.cu-site-ic svg { width: 1rem; height: 1rem; }
.cu-site-main { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; flex: 1; }
.cu-site-name { display: flex; align-items: center; gap: var(--tg-space-2); flex-wrap: wrap; font-size: var(--tg-fs-sm); }
.cu-site-act { display: flex; align-items: center; gap: var(--tg-space-2); flex-shrink: 0; }
.cu-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr)); gap: var(--tg-space-2); margin: var(--tg-space-3) 0 0 2.75rem; }
.cu-unit { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.625rem 0.75rem; border-radius: var(--tg-radius-md); background: var(--tg-surface-2); box-shadow: inset 0 0 0 1px var(--tg-border-subtle); text-decoration: none; color: inherit; transition: box-shadow var(--tg-dur) var(--tg-ease), background var(--tg-dur) var(--tg-ease); }
.cu-unit:hover { background: var(--tg-surface); box-shadow: inset 0 0 0 1px var(--tg-border-strong); }
.cu-unit-head { display: flex; align-items: center; justify-content: space-between; gap: var(--tg-space-2); font-size: var(--tg-fs-sm); }
.cu-units-empty { margin: var(--tg-space-2) 0 0 2.75rem; }
.cu-site-block.is-archived, .cu-unit.is-archived { opacity: 0.6; }
@media (max-width: 40rem) { .cu-units, .cu-units-empty { margin-left: 0; } }

/* Account and contacts. */
.cv-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--tg-space-4) var(--tg-space-5); margin: 0; }
.cv-kv > div { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.cv-kv > .is-full { grid-column: 1 / -1; }
.cv-kv dt { font-size: var(--tg-fs-2xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--tg-faint); }
.cv-kv dd { margin: 0; font-size: var(--tg-fs-sm); color: var(--tg-text); line-height: 1.5; }
@media (max-width: 40rem) { .cv-kv { grid-template-columns: minmax(0, 1fr); } }
.cv-checklist { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.cv-checklist-note { margin-top: 0.375rem; }
.cv-override { margin-top: var(--tg-space-2); padding: 0.5rem 0.75rem; border-radius: var(--tg-radius-md); background: var(--tg-surface-2); font-size: var(--tg-fs-xs); line-height: 1.5; }
.cv-contacts-search { padding-top: 0; }
.cv-contacts-search .tg-search { display: block; }
.cv-contacts-search .tg-input { width: 100%; }
.cv-contacts { list-style: none; margin: 0; padding: 0; }
.cv-contact { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 0.25rem var(--tg-space-3); padding: 0.75rem var(--tg-space-5); border-top: 1px solid var(--tg-border-subtle); }
.cv-contact-main { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.cv-contact-name { font-size: var(--tg-fs-sm); font-weight: 550; color: var(--tg-heading); }
.cv-contact-roles { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.cv-contact-act { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 0.125rem; }
.cv-contact-edit { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border: 0; border-radius: var(--tg-radius-sm); background: none; color: var(--tg-faint); cursor: pointer; }
.cv-contact-edit:hover { color: var(--tg-heading); background: var(--tg-hover); }
.cv-contact-edit svg { width: 1rem; height: 1rem; }
.cv-contact-links { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 0.25rem var(--tg-space-4); }
.cv-contact-link { display: inline-flex; align-items: center; gap: 0.3125rem; min-width: 0; font-size: var(--tg-fs-xs); color: var(--tg-accent-text); text-decoration: none; }
.cv-contact-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-contact-link svg { width: 0.875rem; height: 0.875rem; flex: none; color: var(--tg-faint); }
.cv-contact-link:hover { text-decoration: underline; }

/* Crew matrix: a menu beside each person, dates that open their ticket, a quiet + to add one. */
.cr-member { display: flex; align-items: center; justify-content: space-between; gap: var(--tg-space-2); }
button.cr-cell { background: none; border: 0; padding: 0.125rem 0.25rem; margin: -0.125rem -0.25rem; border-radius: var(--tg-radius-sm, 0.375rem); font: inherit; color: inherit; cursor: pointer; }
button.cr-cell:hover { background: var(--tg-hover); }
.cr-add { width: 1.5rem; height: 1.5rem; border-radius: 999px; border: 1px dashed var(--tg-border-strong); background: none; color: var(--tg-faint); cursor: pointer; line-height: 1; }
.cr-add:hover { color: var(--tg-accent-text); border-color: var(--tg-accent-border); background: var(--tg-accent-soft); }

/* Quick look slide-over: label and value side by side, then a short history. */
.qv { display: flex; flex-direction: column; gap: var(--tg-space-6); }
.qv-facts { display: flex; flex-direction: column; margin: 0; }
.qv-fact { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: var(--tg-space-3); padding: 0.5rem 0; border-top: 1px solid var(--tg-border-subtle); font-size: var(--tg-fs-sm); }
.qv-fact:first-child { border-top: 0; }
.qv-fact dt { color: var(--tg-muted); }
.qv-fact dd { margin: 0; color: var(--tg-heading); font-weight: 500; }
.qv-history ol { list-style: none; margin: var(--tg-space-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--tg-space-3); }
.qv-history li { display: flex; flex-direction: column; gap: 0.125rem; }
.qv-status { display: flex; flex-direction: column; gap: 0.25rem; padding: var(--tg-space-3) var(--tg-space-4); border-radius: var(--tg-radius-md, 0.5rem); background: var(--tg-surface-2); }
.qv-block { display: flex; flex-direction: column; gap: var(--tg-space-2); }
.qv-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.qv-lines li { display: flex; align-items: baseline; justify-content: space-between; gap: var(--tg-space-3); padding: 0.5rem 0; border-top: 1px solid var(--tg-border-subtle); }
.qv-lines li:first-child { border-top: 0; }
.qv-lines li.is-muted { opacity: 0.6; }
.qv-lines .qv-line-main { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.qv-lines .qv-total { border-top: 1px solid var(--tg-border-strong); font-weight: 600; color: var(--tg-heading); }
.qv-note { margin: 0; font-size: var(--tg-fs-sm); color: var(--tg-text); white-space: pre-line; }

/* ---------- Row buttons: quiet icons that wake on hover, so a list reads as data first ---------- */
.fi-ta-row .fi-ta-actions { flex-wrap: nowrap; }
.fi-ta-row .fi-ta-actions .fi-icon-btn { color: var(--tg-faint); }
.fi-ta-row .fi-ta-actions .fi-icon-btn:hover, .fi-ta-row .fi-ta-actions .fi-icon-btn:focus-visible { color: var(--tg-heading); background: var(--tg-hover); }
@media (hover: hover) {
    .fi-ta-row .fi-ta-actions .fi-icon-btn { opacity: 0.6; transition: opacity 120ms ease, color 120ms ease; }
    .fi-ta-row:hover .fi-ta-actions .fi-icon-btn, .fi-ta-row:focus-within .fi-ta-actions .fi-icon-btn { opacity: 1; }
}
/* A wide list scrolls sideways under its buttons: they stay pinned to the right edge, always in reach. */
.fi-ta-table > tbody > .fi-ta-row > td.fi-ta-cell:last-child:has(> .fi-ta-actions),
.fi-ta-table > thead > tr > th.fi-ta-actions-header-cell:last-child { position: sticky; right: 0; z-index: 1; background: var(--tg-surface); }
.fi-ta-table > tbody > .fi-ta-row:hover > td.fi-ta-cell:last-child:has(> .fi-ta-actions) { background: var(--tg-surface-2); }
.dark .fi-ta-table > tbody > .fi-ta-row:hover > td.fi-ta-cell:last-child:has(> .fi-ta-actions) { background: linear-gradient(rgb(255 255 255 / 0.025), rgb(255 255 255 / 0.025)), var(--tg-surface); }
.fi-ta-table > tbody > .fi-ta-row.fi-selected > td.fi-ta-cell:last-child:has(> .fi-ta-actions) { background: linear-gradient(var(--tg-accent-soft), var(--tg-accent-soft)), var(--tg-surface); }
/* An open row menu sits above the pinned buttons of the rows below it. */
.fi-ta-table > tbody > .fi-ta-row:focus-within > td.fi-ta-cell:last-child:has(> .fi-ta-actions),
.fi-ta-table > tbody > .fi-ta-row > td.fi-ta-cell:last-child:has(.fi-dropdown-panel:not([style*="none"])) { z-index: 5; }
/* A long status note (a dispute, a lost reason) keeps to one short line on desk widths; the quick look has it whole. */
@media (min-width: 48rem) {
    .fi-ta-cell .tg-status + div.tg-xs { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- A list row with a quick look beside it: the row opens the page, the eye opens the slide-over ---------- */
.ov-att-row { display: flex; align-items: center; border-top: 1px solid var(--tg-border-subtle); }
.ov-att-row:first-child { border-top: 0; }
.ov-att-row > .ov-att { flex: 1; min-width: 0; border-top: 0; }
.ov-att-row > .fi-icon-btn { margin: 0 var(--tg-space-3) 0 calc(-1 * var(--tg-space-2)); color: var(--tg-faint); flex-shrink: 0; }
.ov-att-row > .fi-icon-btn:hover, .ov-att-row > .fi-icon-btn:focus-visible { color: var(--tg-heading); background: var(--tg-hover); }
@media (hover: hover) {
    .ov-att-row > .fi-icon-btn { opacity: 0.6; transition: opacity 120ms ease; }
    .ov-att-row:hover > .fi-icon-btn, .ov-att-row:focus-within > .fi-icon-btn { opacity: 1; }
}
.ov-att-row:hover { background: var(--tg-hover); }
.ov-att-row > .ov-att:hover { background: none; }
.ov-areas + .ov-att-row { border-top: 0; }
/* With an eye beside it, the row needs no chevron: the whole row is the link. */
.ov-att-row:has(> .fi-icon-btn) .ov-att-chev { visibility: hidden; width: 0; }
.ov-att-row:has(> .fi-icon-btn) > .ov-att { grid-template-columns: 0.5rem minmax(0, 1fr) 0; }
.ov-attention .ov-att-row:has(> .fi-icon-btn) > .ov-att { grid-template-columns: 0.5rem minmax(0, 1fr) auto 0; }
@media (max-width: 640px) { .ov-attention .ov-att-row:has(> .fi-icon-btn) > .ov-att { grid-template-columns: 0.5rem minmax(0, 1fr) 0; } }
.ov-att-row > .ov-job { flex: 1; min-width: 0; border-top: 0; }
.cr-follow-end > .fi-icon-btn, .bd-actions > .fi-icon-btn { color: var(--tg-faint); }
.cr-follow-end > .fi-icon-btn:hover, .bd-actions > .fi-icon-btn:hover { color: var(--tg-heading); background: var(--tg-hover); }
.ov-att-row .ov-att > * { min-width: 0; }
.ov-att-row .ov-att .ov-att-title, .ov-att-row .ov-att .ov-att-meta { display: block; }
/* Phones keep the eye and the "…" menu on a row; the pencil and the document move into the menu. */
@media (max-width: 39.99rem) { .fi-ta-row .fi-ta-actions .tg-row-desk { display: none; } }
@media (min-width: 40rem) { .tg-row-phone { display: none !important; } }

/* The job's tickets and their signed versions (resources/views/filament/jobs/partials/ticket-history.blade.php). */
.tk-history { list-style: none; margin: 0; padding: 0; }
.tk-history-ticket { padding: 0.75rem 1rem; border-top: 1px solid var(--tg-border); }
.tk-history-ticket:first-child { border-top: 0; }
.tk-history-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.625rem; }
.tk-history-total { margin-left: auto; }
.tk-history-amending { margin: 0.375rem 0 0; color: var(--tg-warning-text); }
.tk-history-revisions { list-style: none; margin: 0.5rem 0 0; padding: 0 0 0 0.75rem; border-left: 2px solid var(--tg-border); display: grid; gap: 0.375rem; }
.tk-history-revisions li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.625rem; }
.tk-history-revisions li.is-superseded { opacity: 0.72; }
.tk-history-lines { margin-top: 0.5rem; }
.tk-history-lines summary { cursor: pointer; }

/* ==== Station page (resources/views/filament/sites): access and people, the station today, filters, tabs, the record. ==== */
.st { gap: var(--tg-space-5); }
.st-top { display: grid; gap: var(--tg-space-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 64rem) { .st-top { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.st-access { padding: var(--tg-space-4) var(--tg-space-5); border-left: 3px solid var(--tg-accent-solid, var(--tg-accent)); }
.st-access-head { display: flex; align-items: flex-start; gap: var(--tg-space-3); }
.st-access-icon { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 999px; display: grid; place-items: center; background: var(--tg-accent-soft); color: var(--tg-accent-text); }
.st-access-icon svg { width: 1.125rem; height: 1.125rem; }
.st-access-title { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; flex: 1; }
.st-access-go { flex: none; display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.75rem; border-radius: var(--tg-radius-md); background: var(--tg-accent-soft); color: var(--tg-accent-text); font-size: var(--tg-fs-sm); font-weight: 600; text-decoration: none; }
.st-access-go svg { width: 1rem; height: 1rem; }
.st-access-go:hover { box-shadow: inset 0 0 0 1px var(--tg-accent-border); }
.st-access-list { display: grid; gap: var(--tg-space-3) var(--tg-space-5); grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); margin: var(--tg-space-4) 0 0; font-size: var(--tg-fs-sm); }
.st-access-list > div { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.st-access-list > div.is-wide { grid-column: 1 / -1; }
.st-access-list dt { font-size: var(--tg-fs-xs); color: var(--tg-muted); }
.st-access-list dd { margin: 0; color: var(--tg-text); }
.st-pre { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.st-notes p { margin-bottom: 0.25rem; }
.st-person, .st-contact { display: flex; align-items: flex-start; gap: var(--tg-space-3); padding: 0.625rem var(--tg-space-5); border-top: 1px solid var(--tg-border-subtle); }
.st-person:first-child, .st-contact:first-child { border-top: 0; }
.st-person { justify-content: space-between; }
.st-person-main, .st-contact-main { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; flex: 1; }
.st-person-reach { display: flex; flex-direction: column; align-items: flex-end; gap: 0.125rem; min-width: 0; text-align: right; }
.st-contact .st-person-reach { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.25rem var(--tg-space-4); text-align: left; }
.st-person-reach a { overflow-wrap: anywhere; }
.st-ic { width: 0.875rem; height: 0.875rem; display: inline-block; vertical-align: -0.125rem; }
.st-contact-act { flex: none; }
.st-units { display: grid; gap: var(--tg-space-3); grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.st-unit { display: flex; flex-direction: column; gap: var(--tg-space-3); padding: var(--tg-space-4); text-decoration: none; color: inherit; min-width: 0; }
.st-unit:hover { box-shadow: inset 0 0 0 1px var(--tg-border-strong); }
.st-unit.is-archived { opacity: 0.6; }
.st-unit-head { display: flex; align-items: center; justify-content: space-between; gap: var(--tg-space-3); }
.st-unit-spark { color: var(--tg-muted); }
.st-unit-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--tg-space-2) var(--tg-space-3); margin: 0; font-size: var(--tg-fs-xs); }
.st-unit-facts > div { display: flex; flex-direction: column; min-width: 0; }
.st-unit-facts dt { color: var(--tg-muted); }
.st-unit-facts dd { margin: 0; color: var(--tg-text); font-weight: 500; display: flex; flex-direction: column; }
.st-unit-tag { color: inherit; text-decoration: none; }
.st-unit-tag:hover { text-decoration: underline; text-underline-offset: 3px; }
.st-unit-acts { display: flex; flex-wrap: wrap; gap: var(--tg-space-2); margin-top: auto; padding-top: var(--tg-space-3); border-top: 1px solid var(--tg-border); }
.st-unit-btn { display: inline-flex; align-items: center; gap: 0.375rem; height: 2rem; padding: 0 0.75rem; border-radius: var(--tg-radius-sm, 0.5rem); border: 1px solid var(--tg-border); background: var(--tg-surface); color: var(--tg-text); font-size: var(--tg-fs-xs); font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s; }
.st-unit-btn svg { width: 1rem; height: 1rem; color: var(--tg-muted); }
.st-unit-btn:hover { background: var(--tg-surface-2, var(--tg-bg)); border-color: var(--tg-border-strong); }
.st-unit-btn:focus-visible { outline: 2px solid var(--tg-accent); outline-offset: 2px; }
.st-unit-btn.is-primary { background: var(--tg-accent-solid); border-color: var(--tg-accent-solid); color: var(--tg-on-accent, #fff); }
.st-unit-btn.is-primary svg { color: currentColor; }
.st-unit-btn.is-primary:hover { background: var(--tg-accent-hover); border-color: var(--tg-accent-hover); }
.st-row { display: flex; align-items: flex-start; gap: var(--tg-space-3); padding: 0.625rem var(--tg-space-5); border-top: 1px solid var(--tg-border-subtle); }
.st-row:first-child { border-top: 0; }
.st-row-main { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.st-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--tg-space-2); padding: var(--tg-space-3) var(--tg-space-4) var(--tg-space-4); }
.st-record { display: flex; flex-direction: column; gap: var(--tg-space-4); min-width: 0; }
.st-filters { display: flex; flex-direction: column; gap: var(--tg-space-3); padding: var(--tg-space-3) var(--tg-space-4); }
.st-filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--tg-space-3); }
.st-field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 8.5rem; }
.st-field .tg-select { min-width: 9rem; }
.st-field-q { flex: 1; min-width: 12rem; }
.st-field-q .tg-search { min-width: 0; }
.st-reset { align-self: center; margin-top: 1.125rem; }
.st-tabs { align-self: flex-start; }
.st-panel { display: flex; flex-direction: column; gap: var(--tg-space-4); min-width: 0; transition: opacity var(--tg-dur) var(--tg-ease); }
.st-panel.is-loading { opacity: 0.55; }
.st-year + .st-year { margin-top: var(--tg-space-4); }
.st-year-head { margin: 0 0 0.25rem; font-size: var(--tg-fs-sm); font-weight: 600; color: var(--tg-heading); position: sticky; top: 0; background: var(--tg-surface); padding: 0.25rem 0; z-index: 2; }
.st-table td { vertical-align: top; }
.st-doc { display: flex; align-items: center; gap: var(--tg-space-3); padding: 0.5rem var(--tg-space-5); border-top: 1px solid var(--tg-border-subtle); cursor: pointer; }
.st-doc:first-child { border-top: 0; }
.st-doc:hover { background: var(--tg-hover); }
.st-doc-main { display: flex; flex-direction: column; gap: 0.0625rem; min-width: 0; flex: 1; }
.st-check { width: 1rem; height: 1rem; flex: none; accent-color: var(--tg-accent-solid, currentColor); }
/* Download picked, Email picked and Download all: on a phone they drop below the title and wrap, never past the edge. */
@media (max-width: 47.99rem) { .st-docs .tg-section-actions { flex: 1 1 100%; flex-wrap: wrap; } }
.st-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: var(--tg-space-3); padding: var(--tg-space-4) var(--tg-space-5); }
.st-photo { margin: 0; display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.st-photo-cap { display: block; color: var(--tg-text-2); }
.st-spec { padding: var(--tg-space-3) var(--tg-space-5) var(--tg-space-4); border-bottom: 1px solid var(--tg-border-subtle); }
.st-version { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.625rem var(--tg-space-5); border-top: 1px solid var(--tg-border-subtle); }
.st-version:first-child { border-top: 0; }
.st-version-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--tg-space-3); }
.st-version-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem; flex: none; }
.st-archive summary { cursor: pointer; width: fit-content; }
.st-archive ul { list-style: none; margin: 0.375rem 0 0; padding: 0 0 0 0.75rem; border-left: 2px solid var(--tg-border); display: grid; gap: 0.25rem; }
.st-archive li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; }
@media (max-width: 39.99rem) {
    .st-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .st-field, .st-field-q { min-width: calc(50% - var(--tg-space-3)); flex: 1; }
    .st-person { flex-direction: column; }
    .st-person-reach { align-items: flex-start; text-align: left; }
    .st-access-head { flex-wrap: wrap; }
}
/* ==== End of the station page ==== */

/* Customer list: a count with its warning pill beside it, the contract and any hold as pills side by side. */
.cu-num { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }
.cu-billing { width: 11rem; max-width: 11rem; }
.cu-billing .jb-cell > span { display: block; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cu-pills { display: inline-flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }

/* Station page (ViewSite): the same profile card and tabs as the customer page. */
.st-profile-ic { width: 3rem; height: 3rem; flex: none; border-radius: var(--tg-radius-md); display: grid; place-items: center; background: var(--tg-accent-soft); color: var(--tg-accent-text); box-shadow: inset 0 0 0 1px var(--tg-accent-border); }
.st-profile-ic svg { width: 1.375rem; height: 1.375rem; }
@media (max-width: 40rem) { .st-profile-ic { width: 2.5rem; height: 2.5rem; } }
.st-access { border-left: 0; padding: 0; }
.st-way { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--tg-space-4) var(--tg-space-5); margin: 0; }
.st-way > div { display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; padding: var(--tg-space-3) var(--tg-space-4); border-radius: var(--tg-radius-md); background: var(--tg-surface-2); }
.st-way > .is-wide { grid-column: 1 / -1; }
.st-way dt { display: flex; align-items: center; gap: 0.375rem; font-size: var(--tg-fs-2xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--tg-faint); }
.st-way dt svg { width: 0.875rem; height: 0.875rem; }
.st-way dd { margin: 0; font-size: var(--tg-fs-sm); line-height: 1.55; color: var(--tg-text); }
@media (max-width: 40rem) { .st-way { grid-template-columns: minmax(0, 1fr); } }
.st-people .st-person { justify-content: flex-start; padding-block: 0.75rem; }
.st-people .st-person-main { gap: 0.25rem; }
.st-people .st-person-reach { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.25rem var(--tg-space-4); text-align: left; }
@media (max-width: 47.99rem) { .st-people .st-person { flex-direction: row; } }
.st.cv .st-units { grid-template-columns: repeat(auto-fill, minmax(min(14rem, 100%), 1fr)); }
.st-cell-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin-top: 0.125rem; }
